The First Swedish Programmer (1790s)?

The history show (and podcast) of Sverige Radio, Vetenskapsradion Historia, is one of the shows that I subscribe to and listen to regularly. In their look back at 2020, they reminded me of an episode from back in the summer that indirectly introduces what I believe to be the first programmer in Sweden.  

The story goes back to around the year 1800, when self-playing organs (or “flute clocks”, or music clocks, or organ clocks) were produced by Pehr Strand in Stockholm. These machines provided what is probably the first instance of recorded music being made available for people to buy for their own use. The tune being played was not fixed – you could change the music being played by changing the wooden cylinders that drove the mechanism, and apparently each machine came with a chest of cylinders with a selection of music. The technology goes back to the 1600s at the very least, maybe earlier, but Strand’s work appears to have been the first time the machinery was produced in Sweden. The concepts and mechanisms behind his machines seem to have been imported from Germany. In Berlin in the second half of the 1700s, Fredrik the Great had a clockmaker called Christian Ernst Kleemeyer, who produced machines similar to those later built by Strand. The Swedish word for the organs, “flöjtur”, is a direct translation from the German Flötenuhr, literally “flute clock”.

At the core of these machines are spiked cylinders that determine which notes to play. Basically, a program stored in read-only memory, at a level of expression rather far from the musical notation used to describe the original piece of music. According to the radio program, the creation process involved several people. First, the piece of music had to be adapted to the playing range available in the clock and its capacity to play multiple notes simultaneously. Then, it was laid out on a grid with time on one axis and the instruments on the other and the music converted to actions.  Finally, the grid was encoded into onto the cylinder by inserting metal spikes. It should be noted that the cylinder is moved sideways during the replay process, and thus the program wrapped around the cylinder several times in a helical pattern. It seems musical pieces a few minutes in length could be played.

The process of going from a piece of music to the grid definitely counts as programming for me. It is a rather complicated transformation from a specification to an implementation in something that is probably best seen as an analogy to microcode or very long instruction word-style processors. The creators had to work within the limitations of the hardware and still produce something enjoyable. The process required precision and skill, keeping track of time and adjusting to the speed of the mechanism.

The expression of the music as action points on a timed grid is also quite similar to how music software works today – it is essentially based on the same concept, as noted in several of the sources (for example, this Youtube video shows the mechanisms in action).

Some of the surviving cylinders have a grid with annotations carved into the wood itself, while others appear to have been produced by wrapping a paper around the cylinder, banging in the spikes, and then removing the paper. Possibly, the same paper could be used to create multiple cylinders leading to something resembling mass production. In any case, the Strand factory produced many copies of the same piece of music, and their sales information kind of create some early record charts… their best seller was the overture to Christoph Willibald Gluck’s opera Iphigénie en Aulide (source).

The radio episode talked specifically about the flute clock found at Årsta Castle in Sweden, which was made by Strand in 1794. It appears to have been purchased by the owner of the estate in the early 1800s, and the inventory following his death in 1830 listed the clock plus 15 cylinders. I.e., the machine had 15 different tunes available for playing. Quite a miracle around 1800, but rather limited compared to what we are used to today… it still points at a much more modern way of consuming music as something you listen to in your home without having to produce it yourself, which until then was the only way to have music around.

On the note of programming history, Jacquard looms were invented in 1804, roughly at the same time that Strand was producing his flute clocks in Stockholm. The Jacquard looms are far more significant, introducing punched cards and leading more directly into the history of actual computers.

Links to more reading:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.