[sdiy] MIDI Clock sync advice

brianw brianw at audiobanshee.com
Sun Mar 10 22:21:17 CET 2024


High Speed Devices must also support Full Speed (1ms) before switching into 125us timing, and the Class definitions that support High Speed show the (Full Speed) Descriptors necessary for a Host to determine that the Device also supports High Speed. If there's a Full Speed Hub along the path, then the Device will never enter High Speed timing.

USB-MIDI is Full Speed. The Class specification for USB-MIDI was not updated when USB added the 125us microframes. All USB-MIDI packets are scheduled on 1ms intervals, and there's not even a strict guarantee that the Host must do so promptly.

The important fact is that no commercial USB-MIDI Device runs any faster than Full Speed. Also important is that no operating system has support for High Speed USB-MIDI. Microsoft Windows still does not support all of the original USB-MIDI spec, although Apple macOS does. These limitations have stopped commercial USB-MIDI designers from implementing anything that deviates from the tiny part of the spec that Microsoft supports for USB-MIDI.


As for the technology of sequencing, there have always been poor implementations and great implementations. I seem to recall that Linn products had firmware that handled MIDI clocks with tight timing, whereas other products simply could not keep up.

Part of the reason I replied with the details about how firmware can peel off MIDI Timing Clock messages inside the interrupt handler, is that we all benefit if modern products have the best MIDI implementation. It's easy to ignore the details, especially when Arduino provides a "workable" MIDI class. This stuff isn't rocket science, but that doesn't guarantee everyone gets it right.

Brian


On Mar 10, 2024, at 6:29 AM, Benjamin Tremblay wrote:
> This is exactly what I was hoping to read, a detailed discussion explaining why 5 pin midi still solves problems. 
> Not holding my breath for improvement in USB. 
> Of course it would still be nice to have a better standard based on midi. 
> Back in the 80s I knew sequencing drum parts on a drum machine sounded much tighter than using any MIDI sequencer to trigger sounds on a synth, a TR-909, or an HR-16. 
> Syncing a drum machine was s as always better. But expensive.
> 
> On Mar 10, 2024, at 9:17 AM, Mike Bryant <mbryant at futurehorizons.com> wrote:
>> High speed USB is 125uS, but in general the cheaper MCUs used in most musical instruments still work on lower speed.  But in any case it's still prone to an element of jitter which may or may not be a problem.  I'd love to find a real drummer accurate to 1mS :-)
>> 
>> MIDI-2 sends an actual timestamp, as does OSC of course, so you can keep the timers in all your equipment perfectly synced up.
>> 
>> From: Richie Burnett
>> Sent: 10 March 2024 11:09
>>  
>> I thought the frame rate for high speed USB was 125us now, instead of 1ms?
>> 
>> Even if I got that wrong and MIDI clocks are quantised to 1ms, that isn't so
>> bad...  Most old analogue drum machines quantised the tempo clock and voice
>> triggers to a 1ms or 2ms "interrupt clock" anyway.
>> 
>> The issue I think that is most troublesome when "clock doubling" or "clock
>> quadrupling" is when a whole load of MIDI clock messages arrive bunched up.
>> That really messes up any instantaneous "clock-to-clock period measurement!"
>> I've heard that putting MIDI clock on it's own dedicated USB MIDI output
>> port helps minimise the jitter because there's no other data to queue for
>> that particular jack but I don't know how successful it is in practice.
>> 
>> -Richie,
>> 
>> -----Original Message-----
>> From: Tom Wiltshire
>> Sent: Saturday, March 9, 2024 11:16 PM
>> To: brianw
>> Cc: Synth-diy at synth-diy.org
>> Subject: Re: [sdiy] MIDI Clock sync advice
>> 
>> The framing delay is why I won't touch USB-MIDI with a 6ft bargepole. The
>> idea that some super-fast modern protocol has a jitter that is the same as
>> the latency of an entire MIDI message is just hopeless. That cannot remotely
>> be seen as progress! USB wasn't designed for this job and it shows
>> massively.
>> 
>> A decent UART 5-pin MIDI implementation can still provide better timing,
>> even at 31.25KHz. That's *shocking*, given that 40 years have passed.
>> 
>> 
>> > On 9 Mar 2024, at 22:31, brianw <brianw at audiobanshee.com> wrote:
>> >
>> > On Mar 9, 2024, at 8:47 AM, Benjamin Tremblay wrote:
>> >> Let’s pass usb midi through TOSLINK and call it a day.
>> >
>> > Don't say that! ;-)
>> >
>> > USB-MIDI is not MIDI. *
>> >
>> > Better to say, "Let's pass Classic MIDI through TOSLINK and call it a
>> > day."
>> >
>> > Ideally, "Let's pass MIDI over ethernet and call it RTP-MIDI." ... and
>> > wha'd'ya know, we already have that! Ethernet is generally ground
>> > isolated, although it's best to design for even better isolation than is
>> > typical.
>> >
>> > FireWire is another existing standard for MIDI transport, although
>> > FireWire is now dead.
>> >
>> > If you think about all of the other standards that have come and gone,
>> > it's incredibly impressive that MIDI has lasted 40 years, and modern gear
>> > can still connect to original gear. There aren't many standards where
>> > electronic devices from 40 years ago will work with modern equipment
>> > without some adapter.
>> >
>> > Brian
>> >
>> > (*) USB-MIDI converts MIDI messages that are 1 to 3 bytes long into 4-byte
>> > packets, where the added 4th non-MIDI byte includes redundant type
>> > information that can unfortunately be inconsistent with the same type
>> > information in the Classic MIDI message. Yes, I've seen actual USB-MIDI
>> > implementations where the two types conflict with each other, and there's
>> > no way to know which type is correct and which is in error. USB-MIDI also
>> > delays MIDI information by up to 1 ms in the best cases (0.5 ms average),
>> > even more when the USB Host has scheduling issues, and transmits the
>> > information without any time stamp that might indicate the timing of the
>> > original MIDI message before the USB framing delay. Because of all of the
>> > changes that USB-MIDI introduces, it would be best not to duplicate those
>> > for non-USB transports like a hypothetical TOSLINK transport. Instead, it
>> > would be better to follow the precedents set by other alternative MIDI
>> > transports that the MMA has specified.
>> >
>> >
>> >> On Mar 9, 2024, at 11:05 AM, Mike Bryant wrote:
>> >>> Nothing is stopping equipment having USB ground isolation - it's just
>> >>> never specified.
>> >>>
>> >>> From: John Speth
>> >>> Sent: 09 March 2024 15:14
>> >>>
>> >>> On 3/9/2024 7:00 AM, Benjamin Tremblay via Synth-diy wrote:
>> >>>> USB is just not ideal for music devices because of the star networking
>> >>>> pattern. If we could evolve to a point where every usb cable is usb C
>> >>>> and all connections are peer-to-peer, we could finally sunset five pin
>> >>>> midi.
>> >>>
>> >>> Except that 5 pin MIDI has the most excellent ground isolation. We don't
>> >>> get that with USB MIDI.
>> >
>> >
>> > ________________________________________________________
>> > This is the Synth-diy mailing list
>> > Submit email to: Synth-diy at synth-diy.org
>> > View archive at: https://synth-diy.org/pipermail/synth-diy/
>> > Check your settings at: https://synth-diy.org/mailman/listinfo/synth-diy
>> > Selling or trading? Use marketplace at synth-diy.org
>> 
>> 
>> ________________________________________________________
>> This is the Synth-diy mailing list
>> Submit email to: Synth-diy at synth-diy.org
>> View archive at: https://synth-diy.org/pipermail/synth-diy/
>> Check your settings at: https://synth-diy.org/mailman/listinfo/synth-diy
>> Selling or trading? Use marketplace at synth-diy.org
>> 
>> 
>> --
>> This email has been checked for viruses by AVG antivirus software.
>> www.avg.com
>> ________________________________________________________
>> This is the Synth-diy mailing list
>> Submit email to: Synth-diy at synth-diy.org
>> View archive at: https://synth-diy.org/pipermail/synth-diy/
>> Check your settings at: https://synth-diy.org/mailman/listinfo/synth-diy
>> Selling or trading? Use marketplace at synth-diy.org
>> 
>> From: Synth-diy <synth-diy-bounces at synth-diy.org> on behalf of Richie Burnett <rburnett at richieburnett.co.uk>
>> Sent: 10 March 2024 11:09
>> To: Tom Wiltshire <tom at electricdruid.net>
>> Cc: Synth-diy at synth-diy.org <Synth-diy at synth-diy.org>
>> Subject: Re: [sdiy] MIDI Clock sync advice
>>  
>> I thought the frame rate for high speed USB was 125us now, instead of 1ms?
>> 
>> Even if I got that wrong and MIDI clocks are quantised to 1ms, that isn't so
>> bad...  Most old analogue drum machines quantised the tempo clock and voice
>> triggers to a 1ms or 2ms "interrupt clock" anyway.
>> 
>> The issue I think that is most troublesome when "clock doubling" or "clock
>> quadrupling" is when a whole load of MIDI clock messages arrive bunched up.
>> That really messes up any instantaneous "clock-to-clock period measurement!"
>> I've heard that putting MIDI clock on it's own dedicated USB MIDI output
>> port helps minimise the jitter because there's no other data to queue for
>> that particular jack but I don't know how successful it is in practice.
>> 
>> -Richie,
>> 
>> 
>> -----Original Message-----
>> From: Tom Wiltshire
>> Sent: Saturday, March 9, 2024 11:16 PM
>> To: brianw
>> Cc: Synth-diy at synth-diy.org
>> Subject: Re: [sdiy] MIDI Clock sync advice
>> 
>> The framing delay is why I won't touch USB-MIDI with a 6ft bargepole. The
>> idea that some super-fast modern protocol has a jitter that is the same as
>> the latency of an entire MIDI message is just hopeless. That cannot remotely
>> be seen as progress! USB wasn't designed for this job and it shows
>> massively.
>> 
>> A decent UART 5-pin MIDI implementation can still provide better timing,
>> even at 31.25KHz. That's *shocking*, given that 40 years have passed.
>> 
>> 
>> > On 9 Mar 2024, at 22:31, brianw <brianw at audiobanshee.com> wrote:
>> >
>> > On Mar 9, 2024, at 8:47 AM, Benjamin Tremblay wrote:
>> >> Let’s pass usb midi through TOSLINK and call it a day.
>> >
>> > Don't say that! ;-)
>> >
>> > USB-MIDI is not MIDI. *
>> >
>> > Better to say, "Let's pass Classic MIDI through TOSLINK and call it a
>> > day."
>> >
>> > Ideally, "Let's pass MIDI over ethernet and call it RTP-MIDI." ... and
>> > wha'd'ya know, we already have that! Ethernet is generally ground
>> > isolated, although it's best to design for even better isolation than is
>> > typical.
>> >
>> > FireWire is another existing standard for MIDI transport, although
>> > FireWire is now dead.
>> >
>> > If you think about all of the other standards that have come and gone,
>> > it's incredibly impressive that MIDI has lasted 40 years, and modern gear
>> > can still connect to original gear. There aren't many standards where
>> > electronic devices from 40 years ago will work with modern equipment
>> > without some adapter.
>> >
>> > Brian
>> >
>> > (*) USB-MIDI converts MIDI messages that are 1 to 3 bytes long into 4-byte
>> > packets, where the added 4th non-MIDI byte includes redundant type
>> > information that can unfortunately be inconsistent with the same type
>> > information in the Classic MIDI message. Yes, I've seen actual USB-MIDI
>> > implementations where the two types conflict with each other, and there's
>> > no way to know which type is correct and which is in error. USB-MIDI also
>> > delays MIDI information by up to 1 ms in the best cases (0.5 ms average),
>> > even more when the USB Host has scheduling issues, and transmits the
>> > information without any time stamp that might indicate the timing of the
>> > original MIDI message before the USB framing delay. Because of all of the
>> > changes that USB-MIDI introduces, it would be best not to duplicate those
>> > for non-USB transports like a hypothetical TOSLINK transport. Instead, it
>> > would be better to follow the precedents set by other alternative MIDI
>> > transports that the MMA has specified.
>> >
>> >
>> >> On Mar 9, 2024, at 11:05 AM, Mike Bryant wrote:
>> >>> Nothing is stopping equipment having USB ground isolation - it's just
>> >>> never specified.
>> >>>
>> >>> From: John Speth
>> >>> Sent: 09 March 2024 15:14
>> >>>
>> >>> On 3/9/2024 7:00 AM, Benjamin Tremblay via Synth-diy wrote:
>> >>>> USB is just not ideal for music devices because of the star networking
>> >>>> pattern. If we could evolve to a point where every usb cable is usb C
>> >>>> and all connections are peer-to-peer, we could finally sunset five pin
>> >>>> midi.
>> >>>
>> >>> Except that 5 pin MIDI has the most excellent ground isolation. We don't
>> >>> get that with USB MIDI.
>> >



More information about the Synth-diy mailing list