Jump to content

MIDIIO128 based Synthesizer


jimhenry
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...