Please excuse the dreadful joke!


Something I have been trying to build for the last N years, where N is >0x30, is to build an electronic organ. Every time I start building something, technology moves on. The first attempt uses a top octave generator IC followed by loads of divider IC, and keying was done by a shed-load of SN74L00N quad NAND gates. Sadly they leaked  some audio when supposed to be off.


I see someone has built an organ tuner for his Trio electronic theatre organ ( an excellent project!). That uses two free-phase oscillators per note, so you can get beat notes when things are very slightly out of tune, and this is often considered a good thing. Organ music can sound a bit dull if everything is spot on; those beat notes give an added dimension.


I also have an organ console, but this is much smaller. It is a Riha Allegro, and probably made around 1970; sadly there is very little information available. Each key has about 6 contacts, one per octave, and that is its main problem: the contacts are now very unreliable.


This project will use an Arduino Vidor 4000  and some digital-to-analogue converters, type and quantity so far undecided.


The master plan is to take in MIDI serial data commands. Many people convert their organ console over to MIDI and that in itself would make a nice FPGA project using the cheap Cyclone II boards available with 0.1-inch pins such that all 65 notes could be fed into the FPGA ( one per manual ) and the output would of course be MIDI data. This technique of DC keying avoids one diode per key when multiplexing and all that EMC noise generation of high rise time signals emitted from the long cables.


My last organ attempt used a dsPIC30F6014 if I remember correctly. It used the DSP section to generate sine waves. These could be added together in variable proportions to give a note its tonal quality. That was reasonably successful as it could generate 60 sine waves simultaneously. But that is not really enough. 60 sine waves allows 10 keys to be pressed and each key could have a fundamental tone plus 5 harmonics. But pipe organs are far more complicated. In order to change volume, either a selection of pipes would be enclosed in a box with shutters that could open and close, or more pipes could be used by pulling out more stops. Then there are stops which are octave couplers, which play an octave above, and mixtures, which can play 4 or 5 extra pipes for each note pressed by the organist. Net result is probably 1,000 sine waves would be a good place to start, to properly emulate a large pipe organ.


I think an FPGA would not have any trouble achieving this number of simultaneous sine waves.


Each sine wave  has its own frequency value and would be generated as a numerically-controlled oscillator using the FPGA's multipliers/accumulators. An FPGA has many of these so the workload can be shared out. The frequency table therefore allows all notes to be just a tad off their ideal frequency, and also the ability to change tuning scale from equal temperament to anything else is very easily done. In fact it would be simple to generate both sine and square waves so our friend with the Trio could feed those signals into the analogue filter circuitry and get the same audio output but with zero tuning hassle!


Generating all the sine waves and adding up harmonically-related ones to generate the correct tone only achieves a steady-state correlation with a real organ pipe. What is missing are the interesting bits when air is first fed into the pipe and the sound coming out varies dynamically. This can probably be simulated by generating white noise in a shift register and then filtering that with digital filters ( FIR or IIR) whose parameters could vary as a function of time.


Real pipe organs have each rank of pipes carefully ordered such that two pipes of similar frequency are not physically placed together, because they can act like couple tuned circuits. So this FPGA organ will need multiple loud-speakers and hence multiple analogue output channels, to achieve the same effect of sound coming from different directions for each note. How many loud-speakers? Answer: as many as possible!