Pipe Organ

Hi all, I've been thinking of starting a project of building an automated pipe organ, similar to a street or fairground organ. I've determined ways to produce the pipes and bellows through 3D printing, however I've come to Arduino to automate the valves. I've seen that it is possible to convert midi files to arduino compatible code to control buzzers. The buzzers are obviously connected to one pin as their pitch can be changed.

With my idea of a pipe organ, ideally each pin would be connected to one solenoid air valve (which would operate the pipe/flute). This is where the problem is - I haven't yet found a way of converting midi files so that an individual pin can be powered by a note (for example where pin #11 = A, pin #12 = B flat etc.
) instead of the same pin for every note.

I don't know if this is feasible or not, but you never know if you don't ask.

Any help/insight will be greatly appreciated.
Thanks

Of course its possible, just a simple matter of coding.

You may need quite a few solenoids and Arduino pins to drive them, but an Arduino pin cannot drive a solenoid directly, because too much voltage/current will be required. I suggest you use tpic6b595 chips. Each chip can drive 8 small solenoids directly, and the chips can be cascaded so that only 3 Arduino pins are needed (best to use MOSI, SCK and SS pins).

Small air valve:
s-l300 (31).jpg

Forum member CrossRoads may have a suitable board with multiple tpic chips and built-in Arduino.

s-l300 (31).jpg

I would create a timing file, place that on an SD card, and read it with the Arduino line by line, something like this:

// time, note, duration
0, A, 300
0, C, 500
300, B, 200

At time 0 A and C play, A for 300 ms after which it's replaced by a B for another 200 ms. The C plays for 500 ms. After that it's a matter of keeping track of where you are in the file and what the solenoids are doing, and when they have to be switched off and so. Using the millis() timer such a sequence will be quite easy to implement.

No idea how to create this from a Midi file, not familiar with Midi at all.

MIDI is very simple at its core: it tells you exactly when to turn on each note and when to turn it off. This is the easiest thing to drive individual solenoids.

someone has done a similar thing.

google : arduino pipe organ

dave-in-nj:
someone has done a similar thing.

Not to mention the floppy organ!