jimhenry Posted April 13, 2006 Report Share Posted April 13, 2006 Does anyone have a sense of how big an effort it would be to extend MIDIIO128 to operate as a MIDI driven synthesizer with support for Program Change and Channels? What I mean is that I would like to identify a range of outputs as belonging to a MIDI insteument (0-127). I would then like to be able to send a Program Change on a MIDI Channel selecting a MIDI Instrument. Thereafter the MIDIbox would take the MIDI messages and direct them to the appropriate output pins based on the MIDI channel. Quote Link to comment Share on other sites More sharing options...
stryd_one Posted April 13, 2006 Report Share Posted April 13, 2006 Heya Jim :)Sounds like maybe you could use some of the code from the new router app? Quote Link to comment Share on other sites More sharing options...
jimhenry Posted April 14, 2006 Author Report Share Posted April 14, 2006 To answer my own question, I think it is not so hard although I haven't looked at the code yet. Consider what the MIDIIO128 does with MIDI Input. It looks for an entry with the same MIDI command and the same MIDI channel number and sets an output pin on or off. It may consider what a parameter value is to decide on or off.The channel number part of the table is 4 bits for 16 channels, not enough to support the 128 MIDI instruments, which would require 7 bits. So you add a 16 byte channel table in the synth, one byte per MIDI channel. Each byte holds a 7 bit instrument number. When you receive a MIDI message you use the MIDI channel as an index into the channel table to look up your instrument number. The MIDIIO output table has to be made bigger with a 7 bit instrument number replacing the 4 bit channel. Now you look for an entry with the same instrument number as you obtained by look up rather than the same channel number.The only other change is that MIDIIO128 has to process program change as a message directed to the synth engine and not for generating an output. Program change simply writes the instrument number into the appropriate byte of the channel table. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.