Re: MIDI conjunction device
- From: "Michael R. Kesti" <mrkesti@xxxxxxxxxx>
- Date: Thu, 16 Mar 2006 23:29:27 -0800
Paul Keinanen wrote:
On Wed, 15 Mar 2006 23:17:07 -0800, "Michael R. Kesti"
<mrkesti@xxxxxxxxxx> wrote:
I had, earlier in this thread, said that a merger will, by its nature,
introduce a delay of the message duration plus the time it takes to
process the message. This is true only when non-overlapping messages
are being received.
I would agree on a one byte delay with UARTs, assuming the processing
delay is insignificant, with bit banging it would be even less. When
the serial stream enters the input UART shift register, typically an
interrupt is generated when the _last_ bit has been entered into the
shift register. The interrupt service moves the byte to the output
UART, which immediately starts to send the _first_ bit from the Tx
shift register. Thus, the message is delayed by a _single_ shift
register length (and additional time for the interrupt service
routine, which was assumed insignificant).
With bit banging, the delay would be only one bit time.
The delays must be related to message time rather than character time
because we must receive, queue, and deque complete messages rather than
those messges' individual characters.
Ignoring bit-banged receivers and transmitter, you are suggesting this
timing.
IN0-|stat0|dat0A|dat0B|----------------------------------------------
IN1------------------------------------------------------------------
OUT--------|stat0|dat0A|dat0B|---------------------------------------
Consider, though, what happens when overlapping messages are received
at the inputs.
IN0-|stat0|dat0A|dat0B|----------------------------------------------
IN1----|stat1|dat1A|dat1B|-------------------------------------------
If we queue each character for transmission as thery are received, then
the output timing would lokk like this.
OUT--------|stat0|stat1|dat0A|dat1A|dat0B|dat1B|---------------------
The output has been garbled and is invalid. What must happen, instead,
is this.
IN0-|stat0|data0|data1|----------------------------------------------
IN1-----|stat1|data0|data1|------------------------------------------
OUT---------------------|stat0|data0|data1|--|stat1|data0|data1|-----
When overlapping messages are being received,
an additional delay of as musch as one message duration, depending on
how much the messages overlap, will be introduced. This is still
musically negligible.
I suppose the merger could be coded to output characters as they are
received unless there is a message "in-progress" on another input, but
this would needlessly complicate the code as well as making other features
difficult to implement. I have for example, implemented message filters
and transformations in my merger that are implemented between reading the
receiver queues and writing to the output queue. I also generate running
status on the transmitter which would be made very difficult.
As long as there are no overlap, the delay through the device is
constant and predictable. When an other message arrives, when the
previous is being processed, it must be stored, until the previous
message has been received and forwarded adding an extra delay, which
depends on the size of the message.
The situation gets messy, if a new messages on both channels arrive
immediately after the initial one, since the following messages would
be delayed more and more. Some priority system would be required to
discard redundant or unimportant messages or some other means would be
required to keep the (short time) average duty cycle on both input
channels below 50 % for a 2:1 merge situation (or below 33 % for three
inputs).
There are no redundant or unimportant messages that may be discarded.
Fortunately, typical MIDI streams rarely utilize more than a few percent
of their throughput capacity for more than a few messages at a time.
This allows one to use queues that can store enough messages to get
through the "busy" times. My two-input merger, for example, uses input
queues that can hold 5 messages and an output queue that can hold 10
messages. I can make these queues overflow with artificially dense data,
but have never experienced an overflow using actual musical data.
--
========================================================================
Michael Kesti | "And like, one and one don't make
| two, one and one make one."
mrkesti at comcast dot net | - The Who, Bargain
.
- Follow-Ups:
- Re: MIDI conjunction device
- From: Paul Keinanen
- Re: MIDI conjunction device
- References:
- Re: MIDI conjunction device
- From: ahmed.sharifi@xxxxxxxxx
- Re: MIDI conjunction device
- From: Michael R. Kesti
- Re: MIDI conjunction device
- From: ahmed.sharifi@xxxxxxxxx
- Re: MIDI conjunction device
- From: Michael R. Kesti
- Re: MIDI conjunction device
- From: Paul Keinanen
- Re: MIDI conjunction device
- Prev by Date: Re: Core module
- Next by Date: GCC compiler specific question
- Previous by thread: Re: MIDI conjunction device
- Next by thread: Re: MIDI conjunction device
- Index(es):
Relevant Pages
|