Jump to content

Recommended Posts

Posted

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.

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...