Searching For The Perfect Sync

I’ve been taking a long hard look at my favorite way to synchronize devices: Din Sync:
Also known as Sync 24, but it also comes in other flavors (sync 48, sync 96, etc) din sync was introduced by Roland in 1980 at the same time as DCB (which is another story), but it’s essentially a series of pulses which are delivered 24 pulses per quarter note (96 pulses per bar) and the rate is adjustable to control tempo. It’s connected to a 5 pin din cable (looks like a MIDI cable, but it’s not) and the pins are wired to control START/STOP, CLOCK, GROUND, and then there are a few other things (TAP, CONTINUE, RESET, FILL-IN) which don’t always make sense, seem like they might be really cool, but don’t really seem to do anything.

If you’re curious about what din sync really is technically and accurately, there are some terrific resources:
E-RM Technical Report
Doepfer General Overview
CHD Elektroservis Article about Din Sync

There are a lot of complaints, articles, and diagrams in the wild here describing hassles, ideas, connections, pin diagrams, and other disambiguations of din sync, but so far I have never seen the official Roland Standard documentation. I’m not sure that it exists.

So what’s the big deal? Who cares about this old crap?
Great question. I do, and it’s possible that you should too. It’s been my experience that MIDI timing isn’t good enough. It’s sluggish, temperamental, and not everything can do it (properly or at all). For example let’s look at two of our all time favorite drum machines:

1. The TR-808
The iconic legend. No midi at all. It offers din sync in and out (via a switch) and it’s timing, when synchronized correctly is indeed legendary. The feel of the TR-808 is amazing (have you seen my love letter to the TR-808? It’s here I think you’ll dig it.)

2. The TR-909
The 909 has a MIDI in and out, and sometimes it’s fine, sometimes it isn’t. Firmware version 1 skips the first midi beat clock and it makes midi sync really unstable. Firmware version 4 crashes a lot, and makes din sync terrible. This is not always true either, some units are fine with v1, others are fine with v4. So far we haven’t figured out why these inconsistencies plaque us, but thanks to the RE-909 project there are a lot of smart, and talented people working in these things and we may one day see firmware v5 in a pixie cpu or an eprom bin we can flash and install and enjoy. But for now, firmware v1 and sync via din sync is the most rock solid way to get a TR-909 going properly.
I also wrote a love letter to the TR-909, have you seen it? It’s here. I think you’ll dig this one too.

Yes, we could just bail on our timeless classics and pick up a TR-8S or any other drum machine which doesn’t even deal with old school technology like din sync, but the truth is that they don’t sound the same, they don’t work the same, they don’t feel the same, and so while for many aspiring musicians, or prudent penny pinchers these are adequate substitutes (even I don’t bring much of my analog gear out live, and I use a Roland TR-8 in all of my live performances) I would rather be using a TR-909, TR-808, TR-606 because the digital surrogates are not the same.

Midi is fine for most people. But I much prefer the solid, stable, and very simple relationship of pulses to clock my 25 + pieces of equipment in a performance. It “feels” better to me. Din sync has a feel, and it is alive, and I really like it much more than the way MIDI feels. We could get into why, measure the ms between pulses, the timing of clocks, and CPU’s but I don’t want to do that right now. I’m not really “attacking MIDI”, I use it all the time, but I am supporting, and disambiguating sync 24 as something which I feel, personally, works and feels much better than MIDI clock.

This brings us to the issue of how to connect vintage gear together with modern gear in order to create reliable connection, and perform live in a way which is as durable, and reliable as din sync itself.

The Hassle
Recently I’ve been working with Squarp (as a volunteer) to help perfect the din sync output of their sequencers.

The Pyramid sends din sync out of midi port B, and it can also route it to its 3.5mm envelope output. The clock can be adjusted to send Sync 1 to Sync 96 and it works well.

The Hapax is more adept, and it has 4 Gate outputs which can be assigned for sync, and it also allows us to convert MIDI output C into a dedicated din sync port.

Here’s the beginning of the hassle:
When connecting a TR-606 or TB-303 to either the Pyramid or the Hapax they sync beautifully. No problems at all.

When connecting a TR-808 it sort of works. Start and stop are sluggish, and it sometimes doesn’t “reset” back to the start of a pattern between stop and start.

When connecting a TR-909 it’s a mess. No reset at all. We have to manually press STOP on the sequencer, and then START on the 909, and then START on the sequencer in order for it to reset. This sucks.

When connecting a TR-707/727 it’s even worse. No restart again, but this time there’s no work around to get it to reset manually. It’s just a mess.

Talking with the engineers at Squarp, we went over the problem. I took a close look at these drum machines and their schematics and compared their din sync ports, and wiring.

What all these connections have in common is Pin 1 (Run/Stop), Pin 2 (Ground), and Pin 3 (Tempo/Clock).
Then there are some differences:

The TR-808 uses pin 4 for something called “reset” which sounds promising, and Pin 5 for something called “fill-in” which is also kind of exciting… I imagined that access to this pin might trigger the intro/fill function of the TR-808 and I got very excited. More about this below.

The TR-606 and TB-303 use Pin 4 for something called “TAP” and Pin 5 is not connected at all.

The TR-909 doesn’t use Pin 4 at all, and Pin 5 is for something called “Continue”.

The TR-707 and TR-727 are wired exactly the same way as the TR-909.

So using our generally accepted assumptions, and the common libraries available to us for programming and adding Din Sync to modern devices, this should mean that the din sync protocol uses pin 1, 2 and 3 only. Other features like tap, and fill-in should be irrelevant.

But that’s not true.

Here is an excerpt of Jeff Lee’s beautiful code for the System 80 880 and it’s din sync programming:

if (sequencer.START) {
if (sequencer.sync_mode == MIDI_MASTER) {
midi_send_clock(&midi_device);
//send MIDI clock

} else { //send DIN Sync clock pulse

//this set up counter-intuitively puts DIN clock out of phase with master timer.
Not sure why this is the case, but it works. Really need to dig into this.
Not sure what other horrors this will reveal

//Need to have a good long think about this and figure out what the problem is

TCCR2A &= ~(1 << COM2B0);

TCCR2B |= (1 << FOC2B);

// force output compare to CLEAR OCR2B (PD3) – normal PORTD functions are overridden,
so need to use timer events to set or clear PD3

//now set up Timer2 to automatically clear PD3 on compare match:

TCCR2A |= (1 << COM2B1) | (1 << COM2B0);
//set up OCR2B to set on compare match
TCNT2 = 0;
//reset timer

if (flag.din_start) {

if (++clock.din_ppqn_pulses == 3) {

//send 2 DIN clock pulses before bringing RUN/STOP line high:
http://www.e-rm.de/data/ERM_DinSync_Report_10_14.pdf

flag.din_start = 0;
PORTD |= (1 << DIN_RUN_STOP);

//set DIN RUN/STOP pin

clock.ppqn_counter = 0;
flag.next_step = 1;
TCNT1 = 0;
//reset master timer, doesn’t seem necessary

flag.half_step = 0;
//delayed start requires clearing half_step flag because after start
delay it is set, which causes first step LED and first step
triggered instrument LEDs to get prematurely cleared

This code is the property of Jeff Lee, System 80 and I respect its copyright, the entire code, and it’s comments are the property of the author, and subject to their stated terms

Searching
Confused about why these modern sequencers were having trouble with sync (no reset, wildly erratic sync) I tried an experiment:

I took a TR-808 and send sync from it to all of my devices which use din sync.
From the MC-202 to the TR-909 I got marvelous results. Everything resets, and everything syncs perfectly.

I tried this again using an MSQ-100 (the notoriously quixotic door stop sequencer accessory for the Juno-106) and stepped a 1 bar pattern of nothing into it and used it as a clock source.
Worked like a charm. Solid, stable sync, and excellent reset for everything connected.

I tried this again with the CSQ-600, and the SBX-10. Same results.

So despite these different peripheral pins (4 and 5) using any din sync clock source, all of these devices, despite their differences, worked perfectly. No problems at all.

Why? I mean, is there some magic in the CompuPhonic CPU that Roland never told anyone? I doubt that. They want their devices to set the standard, and for everything in 1980 – 1984 to have the din sync standard in it, and for it all to work beautifully together. So what’s wrong? Why doesn’t modern gear successfully deploy din sync in a functional way? Is it that no one has a 909 or an 808? Have people just tested with a 606 and been happy with that? What gives?

Solution Seeking
The engineers at Squarp concluded after my experiments here that this was a hardware issue with the Pyramid, and thus the Hapax too. Something in the way these ports are wired prevents them from sending the appropriate pulses to the correct pins, and so it can’t be fixed with software. It’s a shame, but if I wanted to test this, I could build a cable which connects each of the pins of a din sync cable to it own unique 3.5mm mono connector and try some things.

I did want to do this, and so I did.

I learned that by connecting the 5 pin din end of the cable into the Sync Input of the TR-909, and then connecting the 4 3.5mm ends into the Hapax’s 4 individual gate outs and making the following assignments:

Gate 1 – Gate Clock
Gate 2 – Gate Run
Gate 3 – Gate Reset
Gate 4 – Left manually free
Gate division – 1/96

This successfully clocked and reset the TR-909. Solid and strong, reset perfectly, no problems at all.

The assumption made here is that somehow the “reset” function was what was making this work correctly. So Squarp assumed their previous conclusion was correct, and it is a hardware issue (Pyramid and Hapax can not communicate with pin 5 of the MIDI C output. But I didn’t think so…

Hypothesis
I’ve been talking with my friend Ahmad about this, and we suspect that the idea of pins 4 and 5 to make sync work on various devices is not correct.

Rather, looking into the schematics of these sources, it’s unclear what pins 4 and 5 are even doing in there. And yet, sync is killer when using din sync sources to clock everything, and anything.

So we believe that what we’re talking about is a missing stop, or the confusion of “continue” instead of stop, and then there’s Jeff’s observation in his code about phase. The clock seems to be out of phase, and this shouldn’t work correctly, but as you can see… it does.

I’ve written to Squarp, and shard all of this with them. They have responded with both a new beta version of the OS, but before I try this, I am going to try my cable again.

The thought is that if we can keep the gate low on start/stop that the “continue” command will not have any agency, and this, theoretically, should reset whatever din sync device is connected.

Setting start to low seems to be what actually resets the sequence. This is what’s supposed to happen when you decide to either “Play” OR “Continue” and not when you hit “Stop”.

The clock inversion noted by Jeff Lee may very well be what makes this actually work.

But this is all just speculation. There is no source code or documentation, no official Roland Din Sync Protocol Handbook (but you know that I wish with all my heart that there was one, and I had a copy) but we feel like the answer is here. Somewhere in the low gate, and the phase of the clock. I don’t think this is all in the magic of mysterious pins, but rather, totally in the programming of the brain.

I’ll perform this morning’s tests and update this post, but in the meantime, if you know about this sort of thing, and have solved these problems yourself (other than buying a midi to din sync converter) please either chime in in the comments below, or send me a message. I’d love to solve this problem for us, for Squarp, and for anyone using Atmega, or any other library to drive din sync, because as it stands right now, that library is wrong and needs revision.

UPDATE 1

KEEP THE GATE LOW & THE CLOCK OUT OF PHASE
// Here’s some progress already…
Using my hand made disambiguated din sync cable and the Squarp Hapax I am connecting 1/96 (sync 24) as a clock pulse and a start/stop message ONLY to the 5 pin din sync input of the TR-909 and would ya look at that… works like a champ!

This means that as Ahmad and I suspected, pins 4 and 5 (whatever they’re called in whichever device) are essentially irrelevant for sync. What we want to do is keep that gate low. When the gate is low, the clock resets and the start begins from the beginning.

If the gate is high, then it does not reset and we have a continue (exactly what we don’t want, ever, unless you do and then that’s weird and another problem for someone else).

I have every hope that this strange turn of events is the actual solution, and it means that perhaps the Hapax can be coded to behave this way – this delivering superb din sync for all. And what’s even better is that this could also be a little update for the Pyramid so it can do the same.

And in the bigger picture, hopefully correct the current Atmega and other such code library objects to work properly for more than just a TR-606.

The next test is the 707/727. It’s been most fragile and the least robust when it comes to sync. So if this works, we are golden.

/ END UPDATE 1

UPDATE 2

DISAMBIGUATED SYNC STUDY WITH THE PYRAMID
// This is kind of a further exploration of my disambiguated cable/din sync de bug and it’s also just a simple “what would happen if…” question.

Fig.1 CABLES & CONNECTIONS
This is how the cable is connected on the Pyramid. Clock is connected to the ENV output, and it’s then assigned to send out 1/96 Sync 24. Gate output is connected to Start/Stop.

Fig.2 +5v TO PIN 1
Using the @squarpinstruments Pyramid I connected 1/96 (sync 24) clock to pin 3, and a +5v gate (high) to pin 1 (start/stop) and connected the 5 pin connector to the din sync input of the TR-909.

Fig.3 GATE BEHAVIOR
I placed a single gate in step 1 and pressed play.
To my surprise only the first beat played. With every cycle the pattern simply played the first beat every time.

So I extended the gate to span the entire 16 steps of the pattern. And as I expected, the 909 plays along in sync for the length of the gate.

This is how +5v works with start stop. It is jittery and unreliable. It depends totally on the timing of the gate.

Fig.4 0v TO PIN 1
Unhappy with this, I changed the voltage of the gate to 0v (low).
I believe that this means that a 1/16 length gate simply tell the 909 to “go” and it follows the clock. I don’t think that din sync works like an S-Trigger where 0v is on, and +5v is off. It couldn’t be – the first example would t work if that were the case.

Fig.5 1/16 NOTE GATE TO START AND RESTART
This is just a tiny 0v gate at 1.1.0 and the TR-909 plays in perfect sync, without any reset problems, no continues, no jitters.
It stops when the clock stops, and begins at 1.1.0 when the gate says go and the clock starts.

This is exactly as it should be.

Now to test exactly this with everything else.
If we can code the din sync out of Hapax and Pyramid to behave this way then this problem is completely solved.

Let’s see!

/ END UPDATE 2

UPDATE 3

This (above, Update 2 0v/short gate method) works perfectly with the TR-909, TR-808, TR-606, TB-303, MC-202, TR-707 and TR-727. No issues. Perfect sync and transport functions.

/ END UPDATE 3

UPDATE 4

Sadly, after all this searching, measuring, logic analysis, scope watching, and schematic reading it seems that this is a bust. Unless you would like to build a cable as I have done for this study, the Pyramid and Hapax sequencers (and likely any and all modern sequencers which use a MIDI din for MIDI and Sync) this can’t work because of hardware. The MIDI port requires +5v to operate, and this means there’s no way to switch it off. Not without building a cable which totally disconnects it. So that means a typical 5 wire midi cable (all pins wired) with pins 4 and 5 physically removed on one end would work in much the same way as my elaborate cable works. So it’s not impossible, but requires a special cable. But according to Squarp, there’s no way to resolve this issue of reset and din sync in software. And that’s that.

/ END UPDATE 4

I know posts like this are hard to read, and not everyone cares about this sort of thing. Even those who do found it from a google search and are looking for something to download, and not really reading or getting involved in the conversation. That’s the world right now. Maybe that’s part of the problem itself? Dunno, but I hope my searching has at the very least given you some courage to continue.

LOVE

Post a Comment

Your email is never published nor shared. Required fields are marked with an *

*
*