terminalVoltage
Posts: 1
Joined: Mon Jul 01, 2019 10:36 pm

Raspberry PIpe Organ

Mon Jul 01, 2019 10:51 pm

I need to preface this by very briefly discribing how an organ works
Organs usually have at least 2 keyboards (manuals) 61 keys each and a 32 note pedal board a total of 154 keys and then however many stops to control different ranks of pipes for the pedals and manuals.
61 pipes per rank so an 8' principal would have 12 8' 4' 2' 1' and 13 1/2' pipes adding to 61

Would it be possible to get all of this information into a single Pi and then get it sent to a second pi in the pipe loft connected to relays to turn on and off the pipes? I assume that the manuals and pedals could be done through a matrix. Traditionally organs use a diode matrix system with a 64 pair cable to the chest matrix board but recent much more expensive iterations use digital controllers with a single cat5 linking console encoder to chest decode. I want to build the latter of the two options as the real systems are incredibly expensive.
The new systems being Peterson ICS-4000 or the Matters organ control system.

IanS
Posts: 234
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Raspberry PIpe Organ

Thu Jul 04, 2019 11:19 am

I have a similar project you might be able to borrow bits from. I am building an organ console (two manuals and stops up and running so far, pedalboard still under construction) where the note press/release and stop statuses are monitored by a Pi, and then the status changes communicated to a sound producer - the relay controller in your case, or synth software in my case. In order to spread the synthesizer CPU load I am using one Pi per manual, which would not be an issue for you, but you might still want to spread across multiple Pis just because of the high number of inputs (notes and stops) or outputs (relays). I use mqtt to link the status changes from the hardware monitors to the sound production side. This seemed the easiest way to allow coupling between manuals.
The problem with organs is that fingers times stops can reach quite a high number. e.g. An eight note chord played with 10 stops out means triggering 80 relays, preferably within a few milliseconds of each other. Your relay power supply will need to be handle high surges in the load.

It is still a work in progress on the woodworking side, but I think the code is more or less complete. You can find a build description and code at https://github.com/Squeack/rpi_organ. Once the pedals are complete and the whole thing tidied up into a self supporting console instead of sitting on a table I will tidy up the documentation and republish.

Eirikur
Posts: 10
Joined: Sun Sep 09, 2018 9:43 pm

Re: Raspberry PIpe Organ

Wed Jul 10, 2019 8:49 pm

I did a lot of work for my own music keyboard. I will share what worked for me and eliminated a lot of the tricky stuff.

I wound up using LinuxSamper, which I had to patch (tiny patch) and build for the Pi. It is NOT too big for a Pi, even a Pi 3B+.

Once you have LinuxSampler working, all you need is a MIDI keyboard and a MIDI to USB adapter or just a modern MIDI over USB controller keyboard.

LinuxSampler supports Soundfont2, the modern SFZ format, and legacy Gigastudio .gig format. It sounds great. I have some pipe organs for it.

This is not the solution for you if you want arbitrary registrations and blending, because it's sample based. You could, however, easily play and blend several layers of samples on a Pi 4.

I can share my Python code for managing LinuxSampler and configuring MIDI and audio devices.

Eirikur

User avatar
omegaman477
Posts: 148
Joined: Tue Feb 28, 2017 1:13 pm
Location: Sydney, Australia

Re: Raspberry PIpe Organ

Fri Jul 12, 2019 12:15 pm

My only advice is to base your design on a MIDI interface between the console controller and the loft controller (and maybe a controller in the air pump/bellow room). There are countless MIDI over fibre/cat5 extenders, splitters etc. You may need multiple loft controllers for ease of design or performance, using MIDI will allow you to scale the design effortlessly.

Using MIDI allows you to drive the organ with a standard MIDI keyboard or PC MIDI application to test the organ controller, and also use a MIDI analyser app on a PC to test the console. trying to debug both ends at the same time is hard.

I always recommend to base any design on available industry standards. MIDI is a purpose built comms standard for keyboard instruments. Dont re-invent the wheel. There are solid pre-tested libraries for the RPI.

Using MIDI you could drive the organ from a PC MIDI sequencer, how cool would that be.
..the only thing worse than a stupid question is a question not asked.

IanS
Posts: 234
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Raspberry PIpe Organ

Fri Jul 12, 2019 2:06 pm

MIDI is good for most instruments, but can struggle with 'real' organs. The problem is that it does not send 'keyboard note down', 'keyboard note up' messages, but sends 'note on', 'note off'. Since having multiple stops out means that each press of a keyboard note generates multiple sounds, the MIDI protocol can get overloaded, especially when using real MIDI serial cables which run at quite a low bandwidth. Watch out that the MIDI controller generates the correct messages when a note is held but stops or couplers are changed.
See http://www.pykett.org.uk/midi_for_organists.htm for more details.

User avatar
rin67630
Posts: 535
Joined: Fri Mar 04, 2016 10:15 am

Re: Raspberry PIpe Organ

Tue Jul 23, 2019 9:11 pm

MIDI isn't a limitation.
A friend of mine has built an absolutely crazy Hauptwerk Organ (IMHO the biggest in the world, with a 64GB main memory and 10 core CPU -> 12 channel audio) operated through MIDI.
https://www.youtube.com/watch?v=5BI1eIcT-ws
I suppose the Raspi would be a bit weak to replace that...
;-)

omenie
Posts: 94
Joined: Fri Dec 09, 2011 5:09 pm
Contact: Website

Re: Raspberry PIpe Organ

Wed Jul 31, 2019 11:30 am

Just saw this thread, after I posted one of my own a couple of days back. If you are interested in a port of my St Just in Roseland Organ app (iPhone, iPad, iPod Touch, uses wavetables not samples, should run great on a Pi 2 or up, a breeze on 3 or 4) let me know on raspberrypisynthesizer at gmail dot com. If there is enough interest I will get it done.

Videos of the app being used with one manual here, software is designed for 2 manuals plus pedalboard plus swell pedal.

https://vimeo.com/299933180
https://vimeo.com/291454775
https://vimeo.com/291454681

omenie
Posts: 94
Joined: Fri Dec 09, 2011 5:09 pm
Contact: Website

Re: Raspberry PIpe Organ

Wed Jul 31, 2019 11:34 am

IanS wrote:
Fri Jul 12, 2019 2:06 pm
MIDI is good for most instruments, but can struggle with 'real' organs. The problem is that it does not send 'keyboard note down', 'keyboard note up' messages, but sends 'note on', 'note off'. Since having multiple stops out means that each press of a keyboard note generates multiple sounds, the MIDI protocol can get overloaded, especially when using real MIDI serial cables which run at quite a low bandwidth. Watch out that the MIDI controller generates the correct messages when a note is held but stops or couplers are changed.
See http://www.pykett.org.uk/midi_for_organists.htm for more details.
You’re barking up the wrong tree here. There is absolutely no issue having a single noteOn or noteOff command control dozens of stops, and similarly no issue when pulling out or pushing in a stop or a coupler when a chord is held.

IanS
Posts: 234
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Raspberry PIpe Organ

Fri Aug 02, 2019 5:23 pm

There is no problem ... if the midi controller is implemented properly.
Some low quality organ midi systems will not start a new sound if an additional stop is activated while a chord is held, or stop that sound if the stop is deactivated while the chord continues. They only generate note on/off when the pressed note changes.
Hauptwerk, from what I have seen, sends note changes and stop changes independently to the synthesizer computer, which is normally rather powerful. That is then responsible for working out how the total sound changes for each of these events. When implementing a mechanical system you have to track the overall status of the organ at one end or the other (console or pipe loft) and control the pipe valves accordingly.
If you consider an array of valves, 61 columns wide (assuming 5 octaves) with a row per stop, then a change in note on/off will impact up to an entire column, depending on the active stops; and a stop change will impact up to a row, depending on the played notes. Couplers are another complication.
My organ works the same way as Hauptwerk, with a small number of state change messages being generated at the console and the overall state being maintained by the sound synthesizer. If you maintain state at the console end and send messages to individual valve controllers then you end up sending a lot more messages. Using an IP network to send these messages is pretty quick, but using 'real' MIDI, at the roughly 37KHz bandwidth it uses can introduce a noticeable delay.

omenie
Posts: 94
Joined: Fri Dec 09, 2011 5:09 pm
Contact: Website

Re: Raspberry PIpe Organ

Tue Aug 20, 2019 7:57 pm

It’s pretty brainless to get this right to be honest, and is actually way harder to get wrong than to get right. Since the synthesis engine has to maintain the current set of depressed notes in order to synthesise at all, doing the right thing - in terms of the engine internally commanding ‘pipes’ to start or stop speaking when the registration changes - is trivial.

omenie
Posts: 94
Joined: Fri Dec 09, 2011 5:09 pm
Contact: Website

Re: Raspberry PIpe Organ

Tue Aug 20, 2019 8:02 pm

... I should say, this response is equally applicable to physical pipe organs as it is to virtual ones, even though it’s phrased in terms of virtual. The ‘synthesis engine’ on a real pipe organ just being the embedded computer that manages the big bitmap of what pipes are speaking or not at any given time.

Return to “Other projects”