User avatar
perfo
Posts: 95
Joined: Mon Jan 30, 2012 2:42 am

Recorder Based Pipe Organ

Fri Nov 08, 2019 2:25 am

Hello my learned friends.
I've seen this on you tube https://www.youtube.com/watch?v=c7SNmeGiLHs
And simple put , I've got to have one. :shock:

Problem is I know nothing of music, notes, pipe organs and very little on MIDI.
But I'm OK with the RPI , Python and electronics so how hard can it be :-)

My thoughts are :-
Play a MIDI file from the SD on a RPI (how the file gets there or will be streamed from a phone etc will be a later add on)
Decode the MIDI file to drive GPIO.
Connect up some darlingtons or relay boards to drive Pull solenoids (not sure relay boards will be fast enough but is easiest as I have some)
Set up air source to feed a wind chest and the solenoids to interrupt the flow to the recorder mouth...(as per video)
Stick stickers on the record to make it play a certain note when it gets the wind up (again as per video)

So I'm happy enough with the mechanical bits and the drivers etc but can't seem to find out how to get from the MIDI to GPIO control?
A fair bit of stuff out there about using the RPI to play the notes as per a synth but nothing on controlling GPIO from MIDI.
Would any of you fine people have any pointers or know where I can read up on such things ? It would have been handy if the fellow that did the video had a build site , but alas not..(well not that I could find)
Thanks for reading...

User avatar
thagrol
Posts: 1889
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Recorder Based Pipe Organ

Fri Nov 08, 2019 1:29 pm

Don't take this as gospel as my knowledge of MIDI is more than a bit thin but I think in essence it's a series of note on and note off commands. Along with a bunch of other stuff you can probably ignore.

Map each note to a GPIO pin then set the pin state according to the last MIDI command received.

You might run out of gpio though...

Incidentally, any of the Pi models that can run as USB gadgets (zero, zeroW, A, A+, and 4B via its USB C port) can act as a USB midi device.
Attempts to contact me outside of thes forums will be ignored unless signed in triplicate, sent in, sent back, queried, lost, found, subjected to public enquiry, lost again, and finally buried in soft peat for three months and recycled as firelighters

User avatar
perfo
Posts: 95
Joined: Mon Jan 30, 2012 2:42 am

Re: Recorder Based Pipe Organ

Fri Nov 08, 2019 10:06 pm

Thanks for the input.
You are totally correct in your assessement.
After posting I stumbled accross a python module called MIDO this decodes MIDI files (and does a lot of other things). Now I've seen inside the file I think it may be easier than I orignially thought. As you said the file contains a lot of stuff I can strip out and I can also just select the Piano channel (or whatever) . The file then contains a line for each note with a start time, end time velocity (which strangley seems to relate to volumn??) . So with a bit of pre processing swap the note for the GPIO number , swap the velocity for a 1 or 0 , swap the timing number for a sequncial series and I may be there.

pfletch101
Posts: 527
Joined: Sat Feb 24, 2018 4:09 am
Location: Illinois, USA

Re: Recorder Based Pipe Organ

Tue Nov 12, 2019 2:01 am

perfo wrote:
Fri Nov 08, 2019 10:06 pm
Thanks for the input.
You are totally correct in your assessement.
After posting I stumbled accross a python module called MIDO this decodes MIDI files (and does a lot of other things). Now I've seen inside the file I think it may be easier than I orignially thought. As you said the file contains a lot of stuff I can strip out and I can also just select the Piano channel (or whatever) . The file then contains a line for each note with a start time, end time velocity (which strangley seems to relate to volumn??) . So with a bit of pre processing swap the note for the GPIO number , swap the velocity for a 1 or 0 , swap the timing number for a sequncial series and I may be there.
FWIW, I believe that the reason why MIDI calls what most lay people would call volume (or loudness) 'velocity'. Is because the velocity with which a piano key is struck and/or moves determines the loudness of the sound it produces, and the concept was carried over.

User avatar
perfo
Posts: 95
Joined: Mon Jan 30, 2012 2:42 am

Re: Recorder Based Pipe Organ

Thu Nov 14, 2019 8:38 am

Makes sense I guess. Thanks for the info...

Return to “Graphics, sound and multimedia”