Midi Merge Technique?
Byron G. Jacquot
thescum at surfree.com
Thu Jan 20 04:43:00 CET 2000
>I'm exploring a possible CPU based MIDI knob box project and I would like to
>"pass thru and merge" midi data. The box would have a MIDI IN and MIDI OUT.
>The incoming midi data from a sequencer or keyboard will pass through and
>Midi knob Data from my CPU box will be merged. What is a good technique for
>doing this?
The first step might be for some bandwidth reduction of the knob data: Keep
all of the present knob values in RAM, and only send them when they have
changed. This means that most of the time, the box is just passing the MIDI
from input to output.
>1. MIDI IN data is monitored by CPU and CPU waits for a pause before sending
>knob data. (when sending, it kills any incoming data from the MIDI in Port)
>This method is easy to do but things like midi clk at the midi in will be a
>problem when trying to find a pause or when cutting)
Assuming that you're doing the abovementioned data thinning, you might want
to parse the incoming MIDI data. When you detect the space between messages
(say, between a note on's velocity byte and whatever follows), you could
shoot out some controller data...maybe run round-robin- send an incoming
message, send some knob data(if there is any), repeat. IE: you create your
own pauses when you need them.
And if you're running a multiplexed ADC on those knobs, you may have some
time between valid samples from the converter to prepare more MIDI. You
could even time things so you could send 3 bytes (from the incoming stream)
between knobs...
You might also change running-status streams into discrete messages to make
more room between messages...as well as possibly giving priority to midi
clock messages.
Unless the incoming stream is incredibly dense, there should be lots of room
between bytes.
>2. MIDI IN Data is monitored by CPU and buffered in memory (FIFO like) The
>CPU generated data is then interleaved and transmitted with the fifo buffer.
This actually begins to look fairly similar to #1, if you're a little slack
in your definitions for "A pause in the input stream" and "Interleaved." :>
Byron Jacquot
More information about the Synth-diy
mailing list