Y A P P I

Yet Another Pipe Playing Interface

02-January-2016


"A Grand Experiment in the control of organ pipes." -C. Williams

Designer's Notes:

Here is another example of a MIDI pipe organ driver board resulting from several years of experimentation with MIDI, pipe organs, and the PIC microprocessor. I have had breadboarded versions of the circuit and software running for some time, but this is the first time I have committed the design to a PC board. (I may be committed myself, one of these days.) The design of this board results from several thoughts about MIDI and pipe organs:

If you don't know much about MIDI, here is an excellent set of links to the MIDI standard and several tutorials about it:
Jeff Glatt's MIDI Tutorial Page



Point 1: I don't play the pipe organ.

In fact, I can just barely manage to play the radio. This means that any pipe organ playing from my basement is going to have to be done by a computer from MIDI files. This will also explain why I am not in a great hurry to design a keyboard scanner. I have collected quite a few MIDI files (about 26,000 of them) and several hundred were written and/or coded for pipe organ. I am not a strict pipe organ enthusiast, so a combination of pipe organ and sound-card seems appropriate to me.

Top



Point 2: The MIDI system doesn't really fit the way a pipe organ is constructed.

MIDI was invented to control synthesizers. Each MIDI channel can play only one instrument at a time on a soundcard or synthesizer. Sending a MIDI "Program Change" event turns on an instrument. Sending a different Program Change ceases that instrument and starts a new one. If you think of a MIDI channel as equivalent to an organ manual or division, such a scheme would allow only one stop to be drawn at a time. I decided early on that I would allow multiple voices to play on each MIDI channel. I have also decided to use the MIDI control sequences control-80 through control-83 to turn stops on and off. (See this page if you are not familiar with this stop selection scheme).Sending control-81,15 might turn on 8' Diapason. Sending control-81,16 might add a 4' Principal, etc.

If multiple voices are allowed, then you must also have a "Cancel". I use control-81,0 or control-80,0 to cancel all stops. But how to turn off only one stop?

My answer was to use a second set of Control Codes to turn off individual stops. Each Control Code has a value associated with it of 0-127. If cntrl-81,1 turns on 16' Bourdon, I make cntrl-80,1 turn off 16' Bourdon. Using cntrl-80,81 lets us control 128 stops.

If you need to control more than 128 stops (Theater organs often use many stops), there are more pairs of control codes available. The YAPPI board also recognized contrl-83,82 to turn on and off stops numbered 128-254.



Point 3: Each rank of pipes can play as a separate instrument.

MIDI files usually play like a band or orchestra. Each MIDI channel has the notes for one instrument, and up to 15 instruments may play different melodic lines. (Remember channel 10 is normally reserved on sound cards for percussion). Since I am basically lazy, I would like to use my 26,000 MIDI files without having to re-arrange them extensively to fit my pipe organ. This means that I would like to treat each rank of pipes as a separate instrument.

To do this, I plant my pipes on "unit" chests, where each rank has its own control board. Each control board has a pair of "Address Switches"

which set the first MIDI Control Code value to which it will respond. Each board also has an "Option Switch" to set how it acts:


An Option Switch setting of zero means the board will respond as a Unison rank. (A Table showing the currently used Option Switch settings appears at the bottom of this page)

If a board is connected to an 8' Diapason rank, and the address switches are set to 7, then sending cntrl-81, 7 on MIDI channel 3 (for example) will cause the 8' Diapason to play the notes subsequently received on channel 3. Here is a diagram showing a MIDI source (a keyboard) and a YAPPI control board wired to a 73 note chest playing its pipes in Unison with the keyboard. Pressing low C on the keyboard will cause the pipe wired to Output 1 to sound. If the keyboard can only generate 61 MIDI note values, then only 61 pipes will sound.

The tricky part is what happens if now you also send cntrl-81, 7 from MIDI channel 5. Notes on channel 5 will also play on the 8' Diapason. Sending cntrl-81, 7 "couples" the 8' Diapason to any channel from which cntrl-81, 7 was sent. Likewise, sending cntrl-80, 7 will cancel the 8' Diapason on the channel from which it was sent. The interface board is also able to keep track of which notes are playing on which channels. If the same note is played from 4 different channels at the same time, it will continue to sound until all 4 channels cease holding it.

Remember that not only may one rank be played from more than one channel, but that many ranks may be played from each channel. In a MIDI file, channel 1 might be a Melody line and turn on 8' Diapason (with cntrl-81, 7), 4' Bourdon (cntrl-81, 4), and 2' Piccolo (cntrl-81, 6). Channel 2 might be a Bass line and turn on 16' Bourdon (cntrl-81, 1) and 8' Diapason (cntrl-81, 7). The 8' Diapason rank will respond to notes from channels 1 and 2 and each channel can play an ensemble of ranks.

Top


Point 4: A rank of pipes can play as more than one instrument.

A YAPPI board may turn a rank of pipes into more than one instrument.

Suppose this is 73 pipes of a 4' Transverse flute and that the Address Switches are set to 14. Since the Option Switch is set to 1, the 4' Transverse flute will play when cntrl-81, 14 is sent and the 2' octave of the Transverse flute will play when cntrl-81, 15 is sent. Playing low C on the keyboard after sending cntrl-81, 14 and cntrl-81, 15 will cause the pipes wired to outputs 1 and 13 to sound.

The next diagram shows Option 2 selected:

A 73 note rank of 8' Salicionals can be controlled from three MIDI Control Code values. If the Address Switches are set to 11, cntrl-81, 11 would play as a 16' (TC) Salicional, 12 would play as an 8' Salicional, and 13 would play as a 4' Salicet.

Top


Point 5: How to handle more than 73 outputs.

An early question was how many outputs to have on one board. A "normal" organ rank today is 61 pipes. Many (older) organs regularly had 73 notes per rank so that the octave coupler would not run out of pipes. (I believe the AGO had a standard in the 1920's stating that all ranks should have 73 notes). I decided on 73 notes as a compromise.

My board has 3, 26 pin output connectors on it. Each handles 2 octaves, plus the lowest note on the next connector. Thus connector 1 has outputs 1-25, connector 2 has 25-49, and connector 3 has 49-73. But not all ranks are 73 notes. The best example is the "unit flute", often of 97 notes, spanning the pitches 16'-8'-4'-2'. Commercial providers of pipe driver boards supply them in different sizes, which I simply cannot afford to do. Instead of this, I handle the 'wide' ranks in software. In the case of the "unit flute", I simply use two controller boards. Two of my built-in options are set up for this special case. Option 6 is for the board driving the 24 notes of the 16' and 8' octaves (24 pipes) and option 7 is for the board driving the 4' and 2' registers (73 pipes).

Since this arrangement would "waste" 48 outputs of one board, option 6 also defines the "leftover" outputs to drive unison and octave of 44 notes, which could be used for a pedal 16'+8'. This "unit flute" control actually defines 8 voices including 16', 10 2/3', 8', 4', 2 2/3', and 2' plus the extra Unison+octave 44 notes.

Other options allow for cases of 85 notes where 73 notes are controlled from one card and the octave below is controlled from the upper 12 outputs of another board. At the end of this article is a Table showing all of the control Options I have defined (so far). A little thought and juggling of Option and Address switch settings should allow you to accommodate most situations. Later, I will give examples of how to design a complete installation using these boards.

I won't enter into the ancient argument about "straight" versus "unit" organs. Most hobbyists can afford a limited number of ranks and wish to get out the most music possible. Deriving too many voices from a small number of ranks is not musical, but almost nobody objects to a limited number of "borrowed" voices.

Top


Point 6: An "improved" MIDI wiring scheme.

The MIDI communications standard uses an optically isolated current loop to communicate between modules. This means that each MIDI device connects to one other by means of a cable with 5-pin connectors on each end and that all devices must be connected in series ("daisy-chained"). I have departed slightly from this by using RS-422 drivers and receivers (as used in your Ethernet card). The advantage is that simple 3-wire cable may be used to connect my controllers and they need not be strictly connected in series. RS-422 is highly noise-immune and is supposed to be reliable to a distance of 1000 meters (in case someone wants to have an Echo organ in the next county). I have a small translator card with a MIDI 5-pin connector on it to translate the MIDI signal to RS-422.

Top


Point 7: All of this is a Grand Experiment

I want to be able to try different things. These controller boards are programmable in several different ways: the address switches choose different Control Code value responses and the Option Switch select different output mode. So far I have created 8 setup options to handle most of the wiring possibilities one might run into. All of these functions for the controller are programmed into the PIC16C66 microprocessor found on each board.

I chose this computer because it is a popular industrial part and easily available. It is built by Microchip, Right now I use the version where the program can be erased and changed. Another version may be programmed only once, but is less than half the price of the eraseable version. I always have a socket on the control board to be able to change the part.

Top


Point 8: What about "straight" chests?

A straight chest has multiple ranks played from one set of note inputs with stops selected separately. The software now handles this. One output board is used as the "stop selector". This board responds only to Control Code values. cntrl-81, 1 turns on output 1, cntrl-81, 2 turns on output 2,etc. cntrl-80, 1 turns off output 1, etc. This board controls all straight chest stop inputs for the entire organ. One additional board would be used at each straight chest to turn notes on and off.

Top


Point 9: Ribbon cable wiring

The interface board uses 2, 26-pin headers which receive ribbon cable connectors. I use ribbon cable to wire from these connectors to the chest magnets. Ribbon cable is normally available in 28 AWG in either grey or color-coded. Terminating 28 AWG wire is a little difficult unless you have a wire stripper which melts the insulation instead of cutting it. What is not generally known is that 3M makes 26 AWG, color-coded ribbon cable. Here is a datasheet for it (a 168K .pdf file). The price is about double that of 28 AWG, but it is much easier to terminate.

Ribbon cable terminations allow you great flexibility in making connections. A common situation is where the lowest octave of an 8' (or 16') stop is on an offset chest with the upper 61 notes (or 49 notes) on the main chest. I split the ribbon cable for the connector for notes 1-24 and crimp on a 15-pin DB connector to the 1-12 side. The mating 15-pin DB connector is crimped to a 12-wire ribbon cable going to the offset chest.

Now the YAPPI board mounted on the main chest controls all the notes for this rank, yet the offset chest is easily detached. I use DB style connectors in this case because they are cheap and easily available in male and female varieties.

Top


The author and designer, Craig Williams, may be contacted at: cwilliams 'at' surfnetc.com (translate 'at' before emailing)
YAPPI Setup Options
Options 
Option Switch
Program
Beginning MIDI note
Beginning Output
Number of Notes
Unison
0
0
36
1
73
 
 
 
 
 
 
Unison
1
0
36
1
73
Octave
1
1
36
13
61
 
 
 
 
 
 
Sub-oct.
2
0
48
1
61
Unison
2
1
36
1
73
Octave
2
2
36
13
61
 
 
 
 
 
 
Sub-octave
3
0
48
0
61
Unison
3
1
36
1
73
Nazard
3
2
36
8
66
Octave
3
3
36
13
61
 
 
 
 
 
 
Unison
4
0
36
1
61
Extra octave
4
1
36
62
12
 
 
 
 
 
 
Unison
5
0
36
1
61
Octave
5
1
36
13
37
Extra octave
5
2
49
62
12
 
 
 
 
 
 
Unison2
6
0
36
1
44
Octave2
6
1
36
13
32
16'
6
2
36
49
24
8'
6
3
36
61
12
 
 
 
 
 
 
16'
7
0
60
1
49
8'
7
1
48
1
61
4'
7
2
36
1
73
2 2/3'
7
3
36
8
61
2'
7
4
36
12
61