Wittgenstein

“What is the use of studying philosophy if all that it does for you is to enable you to talk with some plausibility about some abstruse questions of logic, etc., & if it does not improve your thinking about the important questions of everyday life. . . “

— Wittgenstein, in a letter to Norman Malcolm, November 1944

Better mousetrap or planned obsolescence?

The variety of kitchen faucet sprayer hose “quick connectors” are the moral equivalent to either building a better mousetrap or planned obsolescence. I can’t decide which, though. Possibly both.

Same goes for electric weed whacker batteries.

And most household appliances in general, now that I think of it.

Retrograde Inverted Fragmentation

I’ve been spending my spare time learning more about music composition to go along with my work in Logic Pro X. I came across this fantastic quote in a book I picked up for cheap:

When given a theme or a motive, there are really only two possibilities: repetition [and] change. Repetition is self-explanatory. Change can be as simple as a sequence or can become quite abstract (retrograde inverted fragmentation, for instance). Instead of tying yourself up in knots, try applying basic operations to what you already have. Not only will this likely bust through your block, but it will also enhance organic coherence of your work (constant change is disorienting to the listener–this is undesirable unless its an affect you’re aiming at).

Brandon Nelson, Composition Toolbox: Practical Ideas to Inspire

Two quick thoughts about this quote.

  1. It sounds like good generalized advice along the lines of “when in doubt, go back to the basics.”
  2. I have no idea what “retrograde inverted fragmentation” is, but it sure sounds like fun.

Real Freedom

Worship power, you will end up feeling weak and afraid, and you will need ever more power over others to numb you to your own fear. Worship your intellect, being seen as smart, you will end up feeling stupid, a fraud, always on the verge of being found out. But the insidious thing about these forms of worship is not that they’re evil or sinful, it’s that they’re unconscious. They are default settings.

They’re the kind of worship you just gradually slip into, day after day, getting more and more selective about what you see and how you measure value without ever being fully aware that that’s what you’re doing.

And the so-called real world will not discourage you from operating on your default settings, because the so-called real world of men and money and power hums merrily along in a pool of fear and anger and frustration and craving and worship of self. Our own present culture has harnessed these forces in ways that have yielded extraordinary wealth and comfort and personal freedom. The freedom all to be lords of our tiny skull-sized kingdoms, alone at the center of all creation. This kind of freedom has much to recommend it. But of course there are all different kinds of freedom, and the kind that is most precious you will not hear much talk about much in the great outside world of wanting and achieving and [unintelligible — sounds like “displayal”]. The really important kind of freedom involves attention and awareness and discipline, and being able truly to care about other people and to sacrifice for them over and over in myriad petty, unsexy ways every day.

That is real freedom. That is being educated, and understanding how to think. The alternative is unconsciousness, the default setting, the rat race, the constant gnawing sense of having had, and lost, some infinite thing.

David Foster Wallace, Kenyon College commencement speech, 2005.

Logic Pro X Scripter Editor and Controls

Update: I have made this a top-level documentation page on my site. Go there for any updates on this content.

I have been noodling around with the Scripter plug-in in Apple’s Logic Pro X. It is very powerful but also very wonky. Apple has good documentation for it, but inconsistent between the ePub versus the website, though the website looks more complete. Much more can be gleaned from the example scripts, but even then there are behaviors that are not documented anywhere, and the code can be challenging to read if you have little to no experience with Javascript. This post aims to clarify how the Scripter Editor works, and what is expected by both the compiler and the user to build controls for a script.

The Editor

I’ll leave to Apple’s documentation an overview of the Scripter Editor and just dive into the undocumented and undesirable behaviors.

The editor itself, as a Javascript editor is barebones and has none of the features a developer would expect. There is no autocomplete, and formatting is wonky where indentation is inconsistently applied between tabs as 2 and 4 character widths.

Also (and probably worst of all), there are times when the editor will stop compiling to the UI. I was able to jumpstart the editor with a major code change, completely shutting off and reloading of the Scripter plug-in and desired script, and even having to escalate restarting Logic Pro X. The escalation seemed to be necessary more often when I doing a lot of Run Script actions to parse the code, but this wasn’t consistent enough to be hard fact.

There are a few keyboard shortcuts that are specific to the editor. The usual Cut, Copy, and Paste are all supported, but you must be careful you have the correct focus or else you will mistakenly make changes in your project. Beyond that, all other keyboard shortcuts are reserved for the Project window, and the Editor has only these left specific to it:

  • Increase text size: Shift+Option+”+”
  • Decrease text size: Control+Option+”-“

To save a script update, you must go back to the Scripter plug-in menu for that script and select “Save” in the main pulldown menu. Pressing Cmd+S will only save the Project, and that save will not include the Script.

I have to rant a little bit here and state that in spite of the power provided by the Scripter plug-in, the editor is by far the single worst editing tool I have ever used, and very surprising to come across something this poor of quality from Apple. I understand Scripter is deep in the recesses of an already niche and complex app (it’s not even listed on their marketing pages as a feature), but I have to imagine if Apple wants more widespread use of Scripter, then they have a lot of work to do with the editor to get more developers to engage with it.

Controls

Controls aren’t necessary to use Scripter, but they make life a whole lot easier than trying to tweak events in code. This section is a detailed examination of their requirements and behaviors. For each control the following information is provided for each property where relevant:

  • Property name.
  • Property Datatype.
  • Is the Property required by Scripter? For the type property, the actual string expected by Scripter is given, as opposed to just a description.
  • Notes detailing expected values, quirks, and limitations.
  • The return value as captured in the ParameterChanged function.

For the purposes of this post, assume in all of the example controls are being pushed to the API’s PluginParameters array upon initialization.

var PluginParameters = [];
PluginParameters.push({name:"Excelsior!", type:"text"});

Also, assume that all controls must have the following properties specified upon initialization:

Property Datatype Required Notes
name String Yes The String used for a given control must be unique for the entire script. Having two controls with the same name will have unexpected behaviors.
type String Yes Partially determines the type of control. Values possible are “lin”, “log”, “menu”, “checkbox”, and “text”. This list is not exhaustive to the types of controls possible. If a particular string is expected by the Scripter compiler, it will be noted in the “required” field.

Different types of controls have different requirements, but all must have those two (which will be called out in each of the listings anyway).

Linear Slider

The Linear Slider is the most obvious use case for affecting MIDI events, and is straightforward to use within the typical number ranges of MIDI: 0–12 chromatic notes, 0%–100%, 0–127 pitches, etc. However, some experimentation is required when working with higher ranges like 0–1000 milliseconds or ranges requiring very fine precision.

Property Datatype Required Notes
name String Yes The String used for a given control must be unique for the entire script. Having two controls with the same name will have unexpected behaviors.
type String “lin”
minValue Integer or Float No The minimum value for the slider. The script will not crash if no value is given, but two things will happen. Scripter will assign a value of 0.00 to the property, and an error will be thrown saying a value is missing. The integer or float can be signed.
maxValue Integer or Float No The maximum value for the slider. The script will not crash if no value is given, but two things will happen. Scripter will assign a value of 1.00 to the property, and an error will be thrown saying a value is missing. The integer or float can be signed.
defaultValue Integer or Float No The maximum value for the slider. The script will not crash if no value is given, but two things will happen. Scripter will assign a value of 0.00 to the property, and an error will be thrown saying a value is missing. The integer or float can be signed.
numberOfSteps Integer No The number of increments between minValue and maxValue. The script will not crash if no value is given, but two things will happen. Scripter will assign a value of 100 to the property, and an error will be thrown saying a value is missing.
unit String No A label shown next to the number in the control to give a unit description if desired. The script will not crash if no value is given, no default will be assigned, and no error will be thrown. Nothing in the provided string will affect the slider’s calculations or settings.
Return value Integer or Float

In general, the linear slider is fairly forgiving when it comes to missing values, but the actual values derived can be unexpected. While the UI will show an appropriate level of precision—tenths, hundredths, thousandths at most—the console reveals far finer precision that may not be useful.

Notes on numberOfSteps

No minValue and maxValue

When no values are given for the minValue, maxValue, and defaultValue properties, Scripter will assign values of 0.00, 1.00, and 0.00 respectively, with the slider incrementing between 0.00–1.00 by the hundredths. So, 0.42 can be a setting for the slider.

numberOfSteps exceeds the difference between minValue and maxValue

If the numberOfSteps value exceeds the difference between minValue and maxValue, then Scripter will divide maxValue by numberOfSteps and use the result for the incremental values, rounding up at certain times. How the control divides the steps is not entirely predictable.

For example, if a slider is set to use 0.00 for minValue, 1.00 for maxValue, and 300 for numberOfSteps, then only values divisible by 0.003 are selectable. Starting at 0.00 and incrementing up the selectable values are 0.000, 0.003, 0.006, 0.010, 0.013, 0.016, 0.020, and so on.

Another example, if a slider is set to use 0 for minValue, 100 for maxValue, and 1000 for numberOfSteps, then only values with a tenths precision are selectable. Starting at 0.000 and incrementing up with the up arrow, the selectable values are 0.000, 0.100, 0.200, 0.300, 0.400, 0.500, 0.600, and so on. However, when the actual slider control is moved to the right, then sometimes values jump to 0.399, 0.599, and so on.

In both cases, the console will output values that are typical floating point values:

2
1.899999976158142
1.8200000524520874
1.7400000095367432
1.6600000858306885
1.5800000429153442
1.5199999809265137
1.440000057220459
1.3799999952316284
1.3200000524520874
1.2600001096725464
1.2000000476837158
1.1400001049041748
1.100000023841858
1.040000081062317
1

Notes on minValue and maxValue

maxValue is less than minValue

If the maxValue is less than the minValue, then the control will behave as expected, moving from the left to right decreasing in value. For example, if a slider is set to use 1.00 for minValue, 0.00 for maxValue, then the slider goes down by the expected increment.

Examples

To create a percent slider set to 50%:

{name:"Linear Slider", type:"lin", unit:"%", minValue:0, maxValue:100, numberOfSteps:100, defaultValue:50}

To create a slider that selects between a range of -12–12, set to 0:

{name:"Linear Slider", type:"lin", minValue:-12, maxValue:12, numberOfSteps:24, defaultValue:00}

Logarithmic Slider

The Linear Slider is another use case for affecting MIDI events, but requires special considerations for its uses when working with number ranges involving very fine precision or negative numbers.

Property Datatype Required Notes
name String Yes The String used for a given control must be unique for the entire script. Having two controls with the same name will have unexpected behaviors.
type String “log”
minValue Unsigned Integer or Float No The minimum value for the slider. This must be a number greater than or equal to 1. If the value is less than 1, then Scripter automatically assigns it to a value of 1.0. The script will not crash if no value is given, but two things will happen. Scripter will assign a value of 1.00 to the property, and an error will be thrown saying a value is missing.
maxValue Unsigned Integer or Float No The maximum value for the slider. This must be a number greater than or equal to 1. If the value is less than 1, then Scripter automatically assigns it to a value of 1.0. The script will not crash if no value is given, but two things will happen. Scripter will assign a value of 1.00 to the property, and an error will be thrown saying a value is missing. The integer or float can be signed.
defaultValue Unsigned Integer or Float No The maximum value for the slider. The script will not crash if no value is given, but two things will happen. Scripter will assign the value as 1.0, and an error will be thrown saying a value is missing. The integer or float cannot be signed.
numberOfSteps Integer No The number of increments between minValue and maxValue. The script will not crash if no value is given, but two things will happen. Scripter will assign a value of 100 to the property, and an error will be thrown saying a value is missing.
unit String No A label shown next to the number in the control to give a unit description if desired. The script will not crash if no value is given, no default will be assigned, and no error will be thrown.
Return value Integer or Float

In general, the logarithmic slider is less forgiving than the linear slider.

Notes on numberOfSteps

No minValue and maxValue

When no values are given for the minValue, maxValue, and defaultValue properties, Scripter will assign values of 1.00, 1.00, and 1.00 respectively, with a value of 1.0 being given regardless of the slider’s position.

numberOfSteps exceeds the difference between minValue and maxValue

If the numberOfSteps value exceeds the difference between minValue and maxValue, then Scripter will maintain only a precision of hundredths in the UI, but the console will show far more precise values (typical floating point values). How the control divides the steps is not entirely predictable.

In all cases, the console will output values that are typical floating point values:

2
1.899999976158142
1.8200000524520874
1.7400000095367432
1.6600000858306885
1.5800000429153442
1.5199999809265137
1.440000057220459
1.3799999952316284
1.3200000524520874
1.2600001096725464
1.2000000476837158
1.1400001049041748
1.100000023841858
1.040000081062317
1

Pulldown Menu

Property Datatype Required Notes
name String Yes The String used for a given control must be unique for the entire script. Having two controls with the same name will have unexpected behaviors.
type String “menu”
valueStrings Array of Strings Yes An array of strings for the user to select in the pulldown menu. There does not appear to be an unreasonable limit to the number of strings. (I was able to add 1024 strings without any issue.)
defaultValue Unsigned Integer No A 0-based index value referencing one of the strings in the valueStrings array. If no number is given, or the value is out of the array bounds, then the first menu item (item 0) is selected.
Return value Integer that is the 0-based index of the item selected.

Examples

A pulldown menu with 3 items, and the last item set as the default

{name:"Pulldown Menu", type:"menu", valueStrings:["Item 0", "Item 1", "Item 2"], defaultValue:2}

Radio Buttons

Radio Buttons are a type of menu, with only two strings in the valueStrings array. If more than two items are added to the valueStrings array, then the menu automatically converts into a pulldown menu. Because of the two-item limit, radio buttons are really just a variation of the Checkbox control.

Property Datatype Required Notes
name String Yes The String used for a given control must be unique for the entire script. Having two controls with the same name will have unexpected behaviors.
type String “menu”
valueStrings Array of Strings Yes An array of two (2) strings for the user to select in the pulldown menu.
defaultValue Unsigned Integer No A 0-based index value referencing one of the strings in the valueStrings array, so 0 or 1. If no number is given, or the value is out of the array bounds, then the first menu item (item 0) is selected.
Return value Integer that is the 0-based index of the item selected.

Examples

A pair of radio button with “On” and “Off” labels.

{name:"Radio Buttons", type:"menu", valueStrings:["On", "Off"]}

Checkbox

Property Datatype Required Notes
name String Yes The String used for a given control must be unique for the entire script. Having two controls with the same name will have unexpected behaviors.
type String “checkbox”
defaultValue Unsigned Integer No Use 0 for unchecked or 1 for checked. If no number is given, or the value is out of the array bounds, then the checkbox is left unchecked.
Return value 0 for unchecked or 1 for checked.

Examples

A checkbox with the box set to be checked.

{name:"Checkbox", type:"checkbox", defaultValue:1}

Text Control

The text control is a simple label that is used to help organize controls in the interface. But the length of the label is very limited, so if you need to include a “Readme” or instructions, best to add those as comments or a separate text file to travel with the script.

Property Datatype Required Notes
name String Yes The String used for a given control must be unique for the entire script. Having two controls with the same name will have unexpected behaviors. The String has a visible limit of approximately 45 characters. This limit not set by the compiler, but instead by the physical layout of the control.
type String “text”
Return value None.

Examples


{name:"My Text Label Control", type:"text"}

My Open/Closed-Door Policy

At a recent leadership conference sponsored by my company, I received the following anonymous feedback:

“Philip has done an excellent job creating a safe, supportive, and creative environment for his team. This has happened, in no small part, because of Philip’s ‘open door’ policy, which is a philosophy Philip truly stands by. He is always accommodating when it comes to questions, concerns, problems, or just to lend an ear. His willingness to stop what he’s working on, and put his direct reports first, has helped build trust among the team, makes them feel valued, and sets a good example for his direct reports. This is something that all managers can aspire to.”

I was really happy to see this because this confirms pretty much all the things I have been hoping to achieve in terms of leadership: feeling trusted and valued by a manager. So, the question then becomes how to create that atmosphere of trust and value. I do my best to meet with individual team members weekly, and I have a few simple rules that guides my meetings with my team.

  • Meeting time is their time. I have a general framework for an agenda to give the meeting some focus—roadblocks, questions, development, goals review, and administrative topics—but the contents of each section are entirely up to them. There are usually one or two things I have to update on during the meeting, but their weekly update meeting is their meeting to run. This means the meeting can run as short or as long as needed. If they only need 20 minutes and need to get back to a critical project, fine. If they need 2 hours to dive deep into a topic, fine. We can break up the meeting if need be, and they don’t have to wait until the following week’s meeting to pair up again. They can reschedule if they need.
  • Everyone is allowed to make mistakes. This is not a new concept, but I do my best to view a mistake as a learning moment.  One caveat to this is I prefer to hear about the mistake from the team member themselves as opposed to someone from outside the team. When discussing projects, I’m okay with hedging bets. Let me know where you think you need some wiggle room, so there are no surprises. This is because if the team member admits to a mistake up front, or highlighted an area where something could go wrong, and did, then they are being both attentive and learning. This also means I own up to my own mistakes, and team members can call me out on them. I don’t take it personally because everyone makes mistakes. Correct me when I say something incorrect, even in meetings (especially in meetings; I am rarely the smartest person in the room).
  • If you don’t understand something, ask. I’m happy to explain. I love to whiteboard. Just be prepared to return the favor when asked.
  • Decisions are mutually justifiable wherever possible. I like consensus. I like open conversations where everyone understands all the facts revealed to them, and we all kick around what things mean until we all meet somewhere in the middle. I have found when we have worked through not just how things work but also why things work the way they do consensus is far easier and the solution understandable. There are times when my hand is forced by some external influence, or things just go off the rails, and I have to make a top-down decision. But that’s rare when I do I do my best to explain why I am making the decision I am. By that point, there shouldn’t be any surprises in how I think.
  • All meetings are confidential by default. I feel this is the most crucial element to my meetings, and is what makes my Open-Door Policy actually a Closed-Door Policy. There are obviously things we need to discuss with others to move projects along. But the dirty work of working through problems, answering questions in excruciating detail, all stays behind my closed door. It’s that simple.

Pro Tip

1 package of Brown Sugar & Cinnamon Pop Tarts is the caloric equivalent to 4 cans of Miller Lite.

That is all.

Newton

I believe that the clue to his mind is to be found in his unusual powers of continuous concentrated introspection. A case can be made out, as it also can with Descartes, for regarding him as an accomplished experimentalist. Nothing can be more charming than the tales of his mechanical contrivances when he was a boy. There are his telescopes and his optical experiments, These were essential accomplishments, part of his unequalled all-round technique, but not, I am sure, his peculiar gift, especially amongst his contemporaries. His peculiar gift was the power of holding continuously in his mind a purely mental problem until he had seen straight through it. I fancy his pre-eminence is due to his muscles of intuition being the strongest and most enduring with which a man has ever been gifted. Anyone who has ever attempted pure scientific or philosophical thought knows how one can hold a problem momentarily in one’s mind and apply all one’s powers of concentration to piercing through it, and how it will dissolve and escape and you find that what you are surveying is a blank. I believe that Newton could hold a problem in his mind for hours and days and weeks until it surrendered to him its secret. Then being a supreme mathematical technician he could dress it up, how you will, for purposes of exposition, but it was his intuition which was pre-eminently extraordinary – ‘so happy in his conjectures’, said De Morgan, ‘as to seem to know more than he could possibly have any means of proving’. The proofs, for what they are worth, were, as I have said, dressed up afterwards – they were not the instrument of discovery.

― John Maynard Keynes

This reminds me of this quote from Douglas Adams:

He attacked everything in life with a mix of extraordinary genius and naive incompetence, and it was often difficult to tell which was which.

I aspire to be both, though I think I’m more in the latter rather than the former.

The Paradox of Tolerance

Less well known is the paradox of tolerance: Unlimited tolerance must lead to the disappearance of tolerance. If we extend unlimited tolerance even to those who are intolerant, if we are not prepared to defend a tolerant society against the onslaught of the intolerant, then the tolerant will be destroyed, and tolerance with them. — In this formulation, I do not imply, for instance, that we should always suppress the utterance of intolerant philosophies; as long as we can counter them by rational argument and keep them in check by public opinion, suppression would certainly be unwise. But we should claim the right to suppress them if necessary even by force; for it may easily turn out that they are not prepared to meet us on the level of rational argument, but begin by denouncing all argument; they may forbid their followers to listen to rational argument, because it is deceptive, and teach them to answer arguments by the use of their fists or pistols. We should therefore claim, in the name of tolerance, the right not to tolerate the intolerant.

The Open Society and Its Enemies, Karl Popper, 1945

“A Charmingly Preposterous Icon of American Masculinity”

A great article from the Hollywood Reporter article, Critic’s Notebook: Burt Reynolds Was a Charmingly Preposterous Icon of American Masculinity:

Reynolds probably made more terrible movies than almost any other star of comparable stature, full of juvenile humor and casual locker-room sexism. But even in his preposterously bewigged and bushy-mustached prime, he always seemed to embody an uncomplicated, undiluted, effortlessly likable strain of American masculinity that was driven much more by sunny mischief than angsty machismo. Not for him the tortured histrionics of Brando or Pacino. To his credit, Reynolds never seemed to take anything too seriously. Certainly not his career choices, and especially not himself. . . “I don’t take myself seriously, and I think the ones that do, there’s some sickness with people like that.”

I always like Burt Reynolds for this very reason. He knew exactly who he was, a similar quality I see in other male actors like William Shatner. I’ve seen all of Burt Reynolds’ movies, and there aren’t very many actors I follow like that.

Then, there is this quote which caught me by surprise:

“The audience will always forgive you for being wrong and exciting,” he once said, “but never for being right and dull.”

This is applicable in so many other situations, even at work. Speaking from experience here.