Part of this discussion has already been written in the diode matrix discussion, but maybe this is a better place for my and your ideas. Or wiki, but I doesn’t seem to work right now.
Here is my idea to midi conversion to pipe organ.
About: Organ pipes controlled with midfied console.
When I came to this website and read about the MIDIO128 I also thought it can be used to control pipes and make a unit organ. This means one rank of pipes use different stops, with different transpose (1 octave, 2 octave, - 1 0ctave, 2 1/2 octave etc.)
My idea is this:
We have input:
1,2 or 3 manuals + pedal realtime midi input from different channels: note on type.
Stops pulled input: This contains: division (what manual)
What Rank (Prestant, Trompet, Flute)
What Height 16’, 8’ , 4’ etc (8’ = 0 transpoze, 16’ = 1 octave down, 4’ is one octave up. ’ stand for feet. The longest pipe on ‘piano pitch’ C is 8 feet. 16’ = twice as long = twice as low = one octave down.)
For this we can use different midiboxes or the one with a huge matrix input in development right now.
We have output:
Up to 16 ranks. With 128 or less pipes. These pipes can be controlled by midimesseges, note onoff, on the right channel. This means noteon messages received on channel 1 will be used to open or close pipes on rank 1 (Prestant for example), messages on channel 2 will control rank 2 (Flute). etc. For this we can use a MIDIO128 for each Rank/Channel, which controls the ranks.
Next step: processing.
I don’t know C and just have little experience with Java, but here is some quick code.
We an use a midiprocessor for this purpose. We get a lot of cores in this way, but I think that works fastest and is easiest to explain for now. Later we can bring it all to less midiboxes.
in the midi processor we need some matrixes: SP1, SP2, SP3, SPP (stopspulled1, stopspulled2, stopspulled3, stopspulledPedal.
The best thing is to put thes in to a main matrix SP= {SP1,SP2,SP3,SPP}
In this matrix we save what stops are pulled.
SP* look like these:
Rank / Channel
Transpoze 0 1 2 3 4 etc. 15
Height 16’ -12 0 1 0 0 0 0 0
8’ 0 0 0 1 0 0 0 0
4’ +12 1 0 1 0 0 0 0
2 2/3’ +19 0 0 0 0 0 0 0
2’ +24 1 0 0 0 0 0 0
1 3/5’ +28 0 0 0 0 0 0 0
1 1/3’ +31 0 0 0 0 0 0 0
1’ +36 0 1 0 0 0 0 0
(looks not to good, but I don’t know how to get it better)
This is a 8*17 matrix. This makes SP a 4*8*17 matrix. But different sizes can be made according to the pipes and ranks that are available. A normal church organ would only use the 8’ height.
Stops pulled are: 4’ and 2’ at channel 0, 16’ at channel 1, 8’ and 4’ at channel 2.
First consider a noteon event:
9n xx vv n = channel xx=pitch
First we check the channel.
channel=n;
Originalpitch=xx; (Save original pitch because messages will contain transposed pitch)
volume=vv; (either 0 or normal noteon value)
For r=1;SP[channel,length] ; for all rows. We first process one row and send the pitch
;belonging to that channel to all ranks(channels) for which the
;stop is pulled.
pitch = originalpitch + SP[channel,r,0] ;Change pitch.
For k=1;SP[channel,r,length] ; for all kolomns.
if SP[1,r,k]=1 ; check if stop is pulled/ if note has to be sent on this channel.
send 9k pitch volume ;send corresponding noteon message with right pitch to right channel
End ;for k=…
End ;for r=…
How to fill SP.
When a message is received that a stop is pulled/unpulled, the corresponding matrixentry has to be set/unset.
The best thing to do is, i think contain this all in the stop message:
Stop message
Yn pp vv
Y= A,B,C whatever is not used. We may need to, for on/off.
n= channel corresponding to pedal, manual I etc.
pp = pitch, /determines height
vv= volume. /determines rank
If … Stop on message is received.
Division=n;
Height=pp;
Rank=vv;
SP[Division,Height,Rank]=1.
If … Stop off message is received.
Division=n;
Height=pp;
Rank=vv;
SP[Division,Height,Rank]=0.
Coupling:
Maybe this can de done in the midibox, the manuals are coupled to: send midibyte on two channels.
Problems to be solved:
Noteoff.
This could be a problem when using say 8’ and 4’ on one channel. Say you press c1 and c2 together, but release c2 first. Then you get a noteof message for c2 on your rank, but it should be one, because the 4’ at c1 adresses c2 also. I will think about this. Any suggestions?
For a normal organ only working with 8’ it’s no problem, except if the manuals are coupled.
Stopoff.
If you put a stop off, you cannot turn the pipes off anymore, because apropriate midi messages will not be send. This means we need a noteoff on that channel, or for everynote pressed on that channel and height. This is another difficulty that will have to be overcome, or an imperfecty we have to live with.
What we need, except for the pipes I can’t afford yet :-(, is a program in C to process the input and manage the output. The SP matrix can be different for everybody using this, but it will be no problem to adjusting this in the main code. I am willing to write this program in the future, for the midiprocessor, although I don’t now C yet. Is there anyone who need this program in the near future? To check I luckily don’t need all the pipes ![]()
Yours
Rednas