A challenge for programmers

by Donald Daniel, Jan 2024

A computer programmer looking for a challenge might consider writing a program that would read a standard MIDI musical score, and write an audio file representing the sound of a pipe organ.

But first, some justification for the project. Most music heard today is played on other instruments.

It is much harder to write a program to synthesize the sound of a symphony orchestra than the sound of a pipe organ.

Is there any good music for a pipe organ? Not in the last two centuries. But primitive pipe organs go all the way back to ancient Rome. The violin family of instruments is much newer.

When the organ was king of instruments it probably influenced the way music was written. But a good pipe organ in today's money might cost millions of dollars. And before electricity young men used leather bellows to pump air into a sealed air chamber. A pressure regulator let the air out of the chamber into the organ. The pressure into the organ was very low, enough to push water three inches high in a vertical tube.

Since a pipe organ was expensive to build and expensive to use, only a few people could use them. In the early days of violins a frustrated composer who could not get access to an organ would compose for the violin family of instruments. But what he composed would be strongly influenced by what he had grown up hearing on the pipe organ.

For instance, Giulio Taglietti (1660-1718) wrote "concerto VII a cinque op.8 in B-flat major" for string instruments. Johann Gottfried Walther (1684-1748) liked it so much he transcribed it for organ. On Columbia LP M31205 "E. Power Biggs Johann Gottfried Walther" you can hear the organ version. It expresses the melody very much better than the available string recording on CD: "Concerti Veneziani", Erato 8573-80237-2. The melody is very good, even sounds modern in part of the first movement.

With that motivation, now I turn to a technical description of a pipe organ so the programer will understand the problem.

Typically a pipe organ has three manual keyboards of 61 keys each and one pedal keyboard of 32 keys. The manual keyboards are played with the fingers and the pedal keyboard with the shoes on the feet.

The nominal, or unison pitch of the lowest key on each manual keyboard is 64 Hz. For the pedal keyboard it is 32 Hz.

An octave is a doubling of frequency. Since the days of Bach, even tempered keyboards have been used. That means that each key on the keyboard is separated by 1/12 of an octave from the adjacent keys. This 1/12 octave is a multiplicative term not an additive term.

All of the pipes of a certain type that are activated by a given keyboard are called a rank of pipes. A given keyboard may have several ranks of pipes associated with it. All of the pipes associated with a given keyboard are referred to as a division of the organ.

For a pipe to play a key must be depressed and a stop knob must be pulled. A stop knob enables a whole rank. A key enables only one pipe within each rank. As many of the stop knobs of each division can be pulled at the same time as desired. Keys are depressed and released continually as a melody is played. Stop knobs are changed much less often only to change the mood for different sections of the melody.

The different ranks of a division can differ by musical pitch or by tonal quality, or both. A single rank may be pitched at the sub-octave pitch, or at one of the octave pitches of 2, 4, 8, or 16 times the unison pitch. Mutation ranks are pitched at 3, 5, 6, 7, 10, or 12 times the unison pitch. If a unison pitched stop is pulled, higher pitches also pulled do not prevent the note played from sounding like it is at the unison pitch. It just changes the tonal quality.

Different organs are made with different selections of stops.

A good description of pipe organs is given in Columbia LP "E. Power Biggs the organ in sight and sound" KS7203.

A computer program to simulate an organ could either play a recording of the sound of a stop, or add up sinewaves corresponding to the spectrum of a stop.

There is already a commercially available program that plays recordings of pipe sounds. It is called Hauptwerk. What I propose here is the kind of program that adds sinewaves.

The amplitudes of the sinewaves are called the spectrum of the stop. The spectra of 27 different single rank unison pitch stops are given in the 1957 book "organ registration in theory and practice" by E. Harold Geer. A harmonic is an integer multiple of the fundamental frequency. One stop had as many as 25 measured harmonics. Other stops had as few as 3 or 4. In colorful 19th century terminology the fundamental frequency was sometimes referred to as "the gravest mode".

If you wish to know the spectrum of a single rank stop, it is easy to do if you have a recording of a single pipe. Apply a fast fourier transform (FFT) algorithm to the recording. If you plot the output of the FFT you can see the spectrum.

Most stops consist of a single rank of pipes, one pipe corresponding to each key. Some stops are more than one rank.

The spectrum of a rank of pipes is not exactly the same from bottom to top of the keyboard. Higher harmonics are a little bit weaker as you go up the keyboard. This small difference is called scaling.

Real physical pipes are never exactly in tune the way computer generated pipes could be. The tiny tuning tolerance of real pipes produces an effect called warmth when multiple pipes are played together. This could avoid an electronic sound.

The attack and decay of a single pipe typically take about 30 cycles. On real pipes a spectral change during the attack is called "chiff", and is desirable. This might be too difficult to bother with in a computer program.

Next, we should address which organs are worth simulating. There is general agreement that existing organs made from 1550 to 1800 are superior to those made after 1800. Presumably this is because symphony orchestras had come to dominate the musical scene. Organ builders changed the sound of their organs to compete and made worse organs. But several very recent organs are made in the old style.

From prestomusic.com you can buy a CD set "Edward Power Biggs plays Historic Organs of Europe". This will illustrate the point. Some of my favorite recordings were on LP, as follows.

Angel S-1-36914 (29050A) LCCCN 73-750312 "sounds of XVI century spain" has Paul Bernard playing music by Joan De Segovia on the organ of San Jaime, Calatayud. Tracks 1, 2, 5, 6, and 7 are very good music from the 1500's. They are very short. The longest is only two minutes and 25 seconds.

Columbia MS7109 "historic organs of spain/ E. Power Biggs" This one is in the CD collection. I especially like the three anonymous fabordones played on the emperor's organ at Toledo cathedral and Rafael Angles aria in D minor played on the organ at Segovia.

The LP of Walther transcriptions of mentioned in an early paragraph in this article. First, Albinoni's concerto in F major, the allegro. Then Taglietti's concerto in B-flat major, the adagio. Played on the Silbermann organ in the cathedral of Freiberg Germany.

Columbia M2S 697, a set including MS 6555 and MS 6556. "the golden age of the organ". Bach choral prelude liebster jesu wir sind hier. Played on the Schnitger organ at grote kirk, St. Laurens. Vivaldi concerto in D-minor L'Estro armonico. I like the largo. Played on the Schnitger organ at Grote Kerk in Zwolle. Bach prelude and fugue in B-flat major No.8. played on the Schnitger organ in Ganderkesse. I like the fugue.

.

.

.

.

.

.

.

.

.

.

.

.