Haupz Blog

... still a totally disordered mix

Musical Languages Galore

2024-06-21 — Michael Haupt

Quite a while back, I had written about musical languages. Somewhat more recently, I came across this repository of programming languages for music. I’m impressed by the sheer amount of different languages, and by the different aspects of music they support.

Some of the languages are for notation. Heck, I’ve used Lilypond myself already. Some others are for sound synthesis, some for composition, some for MIDI programming, ...

It’s a treasure trove.

Tags: music, the-nerdy-bit

Array Programming on the Command Line

2024-06-15 — Michael Haupt

Having spent most of my adult computing life in Unix-derived operating systems, I’m quite fond of having a good command line interface (vulgo shell) available at all times. The Unix command line tools are small but powerful commands that are very well tailored to do one kind of thing. It is a definitive upside that they all work on one common shared representation of data that is passed (or “piped”) between them: text.

Text typically comes in lines, and processing line-based content with tools like grep, less, head, sort, uniq, and so forth is great. Editing data streams on the fly is possible using tools like sed, with just a bit of regular expression knowledge.

When data becomes slightly more two-dimensional in nature - lines are broken down in fields, e.g., in CSV files -, awk quickly steps in. Its programming model is a bit awkward (dad-joke level pun intended), but it provides great support for handling those columns.

Two-dimensional data like that can sometimes come in the form of matrices that may have to be pushed around and transformed a bit. Omit a column here, transpose the entire matrix there, flip the two columns yonder, oh, and sum the values in this column please. While this is possible using awk, its programming model is a bit low level for those jobs.

Enter rs and datamash.

The rs tool, according to its manual page, exists to “reshape a data array”. As mentioned, those Unix command line tools do one thing, and do it very well - so here it is. It’s a wonderful little subset of APL for two-dimensional arrays.

Sometimes reshaping isn’t enough, and computations are needed. Like rs, datamash is a nice little subset of APL, only this time not focused on reshaping, but on computing. To be fair, the capabilities of datamash also cover those of rs, but while the latter is often part of a standard installation, the former requires an installation step. (This may change in the future.) With datamash, numerous kinds of column- and line-oriented operations are possible.

These tools are two less reasons to fire up R or Excel and import that CSV file ...

Tags: hacking

Why why why why why?

2024-06-15 — Michael Haupt

The “Five Whys” technique for problem solving has a problem. Why? Because “why” is not the right question. Why? Because it has too little nuance. Why? Because there are multiple ways to ask “why” that yield more precise, more insightful responses. Why? Let’s see …

Consider the German translation of “why”. Or rather, the multiple possible translations: warum, weshalb, wozu, weswegen, wieso, wofür - all of these can be translated as “why”, and most have more nuance. The first, “warum”, is a literal translation of “why”, and has equally little nuance. We’ll leave it aside.

“Weswegen” and “wieso” are rather synonymous. One nuanced translation would be “for what reason”. You may shrug and say “but that’s what I mean when I ask ‘why’, so what?” - stay tuned.

You can translate these two in other nuanced ways as well, adding “for what cause” and “why this way” (note the recursion here). Note the subtle but important difference between “reason” and “cause”: the reason is more like a deep underlying principle, while the cause is more immediate, as in “cause and effect”.

Finally, “wozu”, “weshalb”, “wofür” all can be translated as “to what end”, pointing to a purpose.

I’m using the German language as a vehicle here to point to the possibilities. Other languages may have similar nuances. What counts is that there’s more to “why” than meets the eye - there are a reason, cause, and end to something. Each of these can be important when asking “why”: there is more contingency in what may be behind a decision or circumstance.

The Five Whys approach thus suffers from the same lack of nuance as any approach that suggests to Start With Why (sorry, Simon Sinek). The fix is easy: instead of asking “why”, ask for the reason, cause, and end of what’s observed at each of the stages. It will likely make for richer discussions and deeper insights.

Tags: work

In Touch With Old Languages

2024-05-24 — Michael Haupt

This list of the ten most(ly dead) influential programming languages is a fun trip to olden times. Even though I’m not old enough to have used COBOL “back in the day”, no less than four of these languages play quite important roles in my life.

My first programming language was indeed BASIC, and the one I learned most with during my early programmer days was PASCAL. While I don’t have any emotional attachment whatsoever to the former, I fondly recall learning about structured programming in the latter. The BASIC dialects I had used solely relied on line numbers, and consequently calling subroutines had to happen using GOSUB plus line number. Parameter passing and returning results was awkward. PASCAL with its named procedures and functions made such a tremendous difference - it was a true relief. (Remember: this was the late Eighties / early Nineties of the past century.)

Java happened in 1995, and I was an early adopter at university. I came across true object orientation only in 2003 or so, when I first looked into Smalltalk as part of my doctoral research. That was really eye opening. If I had to pick one programming language to spend the remainder of my programming work in, it would be Smalltalk. There simply is no other language that molds programming environment, application, and runtime environment like that.

Finally, APL became important in around 2014, when I was looking into optimised implementations of array programming languages as part of my work on an implementation of the R programming language. The loop-free way of programming with large vectors and (sometimes multi-dimensional) matrices was another eye opener. Also, the quirky syntax and terseness made APL appealing to this programming languages nerd.

The list features six more. I’ve heard / read about them all for sure. If I had to pick one to look into next, it would be COBOL, simply because it’s still around and running a lot of production systems around the world.

Tags: the-nerdy-bit, hacking

Potter Music

2024-05-24 — Michael Haupt

Some time back, the family and I went to a concert in Nikolaisaal Potsdam, where an orchestra and choir performed a selection of music from the Harry Potter movies. (This is the kind of concert all four of us can agree on finding interesting.)

Hearing the music in chronological order of the movies in a short time frame for the first time revealed a major shift in quality after part III. Notably, the scores for parts I-III were written by John Williams. Three other composers took care of parts IV-VII, reusing Williams' motives. Frankly, the music for the latter parts is mostly bland, and obviously exists to decorate the images, and to place some acoustic effects. The music for the former parts tells a story on its own, is much more tightly woven, and makes better use of the orchestra. I wouldn’t go so far as to say the scores for parts IV-VII are bad, but they really are mere sound tracks. (Interestingly, I remember a ton of the motives Williams introduced, but have a hard time remembering any of those introduced in the later movies.) It seems John Williams is a representative of a generation that cared about film scores in a different way.

Having gone to the concert also compelled us to watch the entirety of the film series together, which made for some entertaining movie nights. We also watched them for the first time in English (with subtitles). Achievement unlocked.

Tags: music

Squeaking Cellular Automata

2024-03-24 — Michael Haupt

My favourite programming language is Smalltalk, and I used to do a lot of work in the implementation of the language named Squeak, back in my post-doc days. Over the years, I’ve gone back to Squeak on and off, to do some little fun projects. Some time ago, I dabbled a bit with its low-level graphic operations to implement some machinery for playing with cellular automata (more precisely, elementary cellular automata).

Building this was a nice and refreshing experience applying TDD, die-hard object-orientation, some extension of the standard library (heck yeah!), and live debugging. Especially the latter is not easily possible in languages other than Smalltalk, where the IDE and runtime environment are essentially the same.

Eventually, I was able to generate some images for the rule 30 cellular automaton, which exhibits a nice dichotomy of order and chaos. Here are two examples, one for the standard initial generation with just one pixel set, and one for a random initialisation. It’s interesting to see how order seems to prevail on the left-hand side, while the right-hand side looks more chaotic (there are patterns there though, if you look closely).

The source code is here, in case you’re interested.

Tags: hacking, the-nerdy-bit

Getting to Measurable Outcome

2024-03-19 — Michael Haupt

Recently, I had written about the difference between outcome and output, and how “To what end am I doing this?” is the kind of question to ask to move from describing output to describing outcome - which is the right frame for describing goals.

In the true spirit of SMART goals, outcome should also be measured. There are two kinds of questions to get from output to measurements.

From the output perspective, what does it mean to implement the todo list? Asking “What change do I intend to achieve by generating this output?” implies that there is an observation that I’m currently making, and I want it to be different. Expressing that difference points to a possible measurement.

From the outcome perspective, I can ask “How would I notice the intended outcome is achieved?” to get to a similar response about the difference it makes.

The former question will likely yield measurements of a more internal nature, closer to the output. Conversely, the latter will more naturally lead to measurements closer to the customers the outcome is impacting. Both of these have a lot of value.

The necessary connection between both can be used to apply reality checks, too: if the internal measurement indicates success, but the external measurement doesn’t, I must’ve missed something. Such an insight is invaluable, too, because it helps to develop a deeper understanding of work on customers.

Tags: work

Solo Concertos

2024-03-16 — Michael Haupt

A piano concerto normally involves, of course, a piano (duh), and then, an orchestra. As nothing is impossible in art, some composers got ideas and wrote concertos for piano solo. The challenge with these is that the pianist has to play the solo part, which is usually complicated enough in concertos, while also emulating the orchestra. That makes for some pretty interesting music.

Meet Charles-Valentin Alkan, French late romantic pianist and composer. His Concerto for Solo Piano is a 50-minute monument of virtuosity. The incomparable John Ogdon here delivers it.

Tags: music