[sdiy] Bunching of MIDI clock messages

rsdio at sounds.wa.com rsdio at sounds.wa.com
Fri Sep 13 01:21:58 CEST 2013

On Sep 12, 2013, at 14:19, Richie Burnett wrote:
> Hi Brian,
>> ...For example, I hope that you're not  triggering all drum  
>> samples at the beginning of the 1 ms audio  buffer. You'll get  
>> better timing if you use a constant 1 ms latency  and schedule  
>> drum samples to trigger at precise points in time, with  different  
>> sample offsets for the start of the trigger within each  buffer.  
>> Similarly, just as you wouldn't move all drum sample triggers  to  
>> the beginning of the 1 ms buffer...
> Well, that's exactly what machines like Roland's TB-303, TR-606,  
> TR-808 and TR-909 actually do.  Their tempo clock is a free-running  
> analogue oscillator that is polled every 2 milliseconds by the CPU,  
> and the instrument trigger pulses are then all generated  
> simultaneously for the appropriate instruments.  Also many of the  
> old analogue synths like the JX and Juno series also scan the  
> keyboard and update everything at a control rate of 500Hz or 1kHz.   
> So their note onsets and ends are snapped to the nearest  
> millisecond too.  It might not be the best that is achieveable with  
> current technology but it was common practice back then, and I'll  
> bet many DSP synths using block based processing follow the same  
> path now.  (I agree that variables like LFOs and envelopes should  
> be interpolated during 1 millisecond processing frames though.   
> That is essentially what happened in the old analogue synths with  
> all those CV demultiplexers, followed by RC filters to smooth each  
> CV over consecutive control updates.)

Interesting points, not without merit, but it's not the whole story.  
I highly doubt that these Roland machine are sample-accurate with the  
sounds they generate, even if the triggers are aligned perfectly.  
Thus, aligning samples in each 1 ms audio buffer will sound different  
than the vintage analog version.

I was just about to write a description of how these vintage analog  
rhythm machines have several subsystems operating almost  
independently. Some subsystems are pure analog, some are pure  
digital, and some can be considered hybrid digital/analog. When it  
comes to the 2 ms polled loop, only the CPU is operating with this  
jitter. The analog and digital/analog hybrid subsystems do not have  
the same jitter. In other words, you want to make sure that your  
implementation does not impose jitter on the subsystems that are  
operating independently of the jitter.

Taking the TR-909 as a specific example, there are three digital  
sampled sounds (hi-hat, crash, ride) and the rest are analog (bass,  
snare, 3 toms, rim, clap). Ignoring the fact that the analog  
waveforms will never line up precisely like digital samples, I don't  
see how the digital samples would line up, either. Each of the  
digital sounds has its own hybrid digital/analog clock, along with a  
16-bit address counter, ROM, and 6-bit resistor ladder DAC. Even  
though these independent clocks are all reset at the same time by the  
CPU, their tuning and other analog components like the oscillator's  
capacitor will result in the samples coming out of each sound without  
alignment to the samples from the other sounds. Another factor is  
that each trigger has an analog high-pass filter on the signal, and  
those will each have a group delay that is not precisely identical to  
the others. If these triggers are brought out to individual input  
jacks by modifying the TR-909, then all bets are off about any  
alignment to 2 ms boundaries.

If you're going to the trouble of specifically crippling a modern  
design in the hopes of emulating certain limitations of vintage gear,  
then I suggest that you must consider all the limitations of the  
vintage system together. Otherwise, you risk making your emulation  
move further away from the vintage sound because you've only  
reproduced one limitation and not others. Of course, the biggest  
factor is changing from analog to digital, unless you have lots of  
DSP power. With a digital audio buffer based system, you also add  
latency that is not present in the original design.

Why not just have a 2 ms quantize feature in the sequencer that can  
be turned off?

In contrast, if you actually built all of those independent digital  
sample players and analog sound synths in your circuit and hooked  
them to a modern CPU, I'd totally agree with the inclination to make  
the main CPU loop repeat on 2 ms intervals like the original, even  
though a modern CPU could feasibly scan an order of magnitude faster.

As for keyboards like the JX and Juno, the entire keyboard is not  
read at once. Notes are not all triggered at the same time based on  
500 Hz or 1 kHz, at least not the same way as the rhythm boxes. What  
happens is that 8 keys on the keyboard are read at a time, and any  
changes are updated at that moment. Different groups of 8 keys are  
updated at different times. So, if you're playing only a few keys in  
part of an octave, then your voice updates are probably happening at  
specific 1 ms or 2 ms intervals. However, the other octaves are not  
being updated at the same time. Their 2 ms updates are skewed in  
time. However, if you run from an internal arpeggiator, then you  
might see notes in different octaves triggered at exactly the same  
quantized times.

Brian Willoughby
Sound Consulting

More information about the Synth-diy mailing list