Jacob Vosmaer's blog

Hacking the Nava drum machine to work with d-mux

2025-03-08

Not long ago I got the proprietary d-mux protocol working with the Yocto DIY drum machine. I now also got d-mux working on the Yocto's sibling, the Nava.

The e-licktronic Nava

In 2013, e-licktronic started selling DIY kits for the Yocto, a clone of the Roland TR-808 drum machine. In 2016 they followed this up with the Nava, a clone of the TR-909.

I discovered the world of synthesizer DIY building in 2016 through these two projects. These were my first electronics DIY builds and the machines are dear to me because of that. They were also my gateway into embedded programming. E-licktronic shared the firmware for these machines which was written as an Arduino project. I quickly got frustrated with Arduino and discovered that you can bypass it because the microcontrollers can be programmed directly with the GNU AVR toolchain. I ended up writing my own firmware for both the Yocto and the Nava.

The d-mux protocol

D-mux is a proprietary musical instrument communication protocol developed by Sequentix. I have discussed it previously here. D-mux serves a similar purpose as MIDI except it's designed for a narrower use case: electronic drum triggers. The reasons to use it are:

  1. To interface with percussion sound modules that require analog trigger signals (as opposed to MIDI),
  2. To obtain better timing accuracy because multiple drum sounds can be triggered at exactly the same time.

The improved timing is due to the use of batch messages.

Electrically, d-mux is a hybrid interface. It uses digital logic to send the trigger events, and it combines this with an analog voltage called "accent" that indicates how hard each drum should be struck. It looks a bit like 3-wire SPI with an extra wire for the analog accent voltage. At each clock tick, the digital data line signals whether the drum should be triggered or not, and the analog data line signals the accent control voltage.

There is more to the protocol than this. For example, with the official hardware the sender can remotely program the receiver to set how each trigger is interpreted. But I don't know how that part of the protocol works and I don't need it for the Nava anyway.

Why is this different from d-mux on the Yocto

The TR-808 and the Yocto clone only supported two drum hit strengths: normal and accented. When I added d-mux support to the Yocto I chose to treat the accent as a meta drum hit. By triggering the accent "instrument" at the same time as one or more real instruments, those real instruments all get hit with the accented strength. If you look at the circuit diagrams of the TR-808 then you see that there is a single accent voltage for the entire instrument that gets bussed into each individual drum voice. On page 7 of the service manual this is called the "common trigger".

The shared 'common trigger' line of the TR-808' The "common trigger" line in the 808 is shared by all instruments. In this image taken from page 7 of the service manual you see it going into the snare drum and hand clap instruments.

The TR-909 on the other hand has individual accent voltages for most of drum voices. If you look at page 11 of its service manual you see 8 6-bit resistor ladder DAC's (IC2-IC9). The first five drive the accent voltage for the snare drum, bass drum, and the low, mid and high toms. The remaining three accent DACs are shared by two instruments each: IC7 for the rimshot and handclap, IC8 for the closed and open hihat, and IC9 for the crash and ride cymbals.

TR-909 accent DAC's Some of the accent DAC's of the TR-909 as seen on page 11 of the service manual. If you trace the line marked "ACC" you see that it is shared by the rimshot and the handclap circuits.

The Nava takes this one step further. Instead of having 8 6-bit DACs made out of latches and resistor ladders, the Nava uses a single integrated 12-bit DAC that drives a set of multiplexers and sample and hold circuits. This means that all 11 accent levels are truly independent in the Nava.

Diagram of the Nava accent DAC circuit In the Nava, the DAC IC118 outputs 0-4.096V. This is scaled to 0-5V by IC110A; the builder has to adjust trimmer TM2 to get this scaling factor right. The output of IC110A connects to inputs of two multiplexers IC111 and IC114. The full sample & hold circuit is missing from this diagram but it looks more or less like what you see with buffers IC110B, IC110C and IC110D and the capacitors on their inputs.

Considering that the Nava is designed for individual accents and that the d-mux protocol carries accent voltages for each drum hit, I felt like I ought to implement support for d-mux accents in my Nava d-mux project.

Attempt 1: analog to digital and back

I run custom firmware on my Nava (because it was fun to write it) and my first idea was to make the d-mux support work alongside the other two control mechanisms: MIDI and the front panel buttons. To do this I would have to read the d-mux accent voltages into the MCU and then send them out the DAC the same way as I handled MIDI.

The MCU has a built-in ADC so I ran a wire from the DIN port I was using for d-mux to an ADC pin on the MCU. I sort of got this working but it was not reliable and I was starting to feel overwhelmed by my knowledge and confidence gaps in this project.

It was too much guesswork for me to try to find out why my code was unreliable. I decided to solve a different problem instead.

Attempt 2: analog signals bypassing the MCU

It seemed inefficient to me that I was reading analog voltages into the digital domain and sending them back out again as analog voltages. There was a good reason for it, because this would allow me to merge different kinds of inputs (MIDI, front panel, d-mux) but because I was mainly curious about getting d-mux working at all I thought, what if I change the project to implementing d-mux support only.

On the hardware side this meant pulling out the DAC IC and routing the d-mux accent voltage to the pin where the DAC output used to go (pin 8 of IC118 above).

The DAC has been replaced with an adapter that connects to the d-mux DIN port The square with two white wires attached is an adapter that fits into the IC socket of the DAC. The white wires go straight to the d-mux DIN port. The upper left wire is the accent line which is now connect to where pin 8 of the DAC used to go. The other white wire is the d-mux trigger line. This now connects via the DAC IC socket to pin D5 of the MCU.

On the software side I deleted all code that did MIDI and key scanning. Every time a d-mux clock comes in, I update the signal routing of the Nava DAC multiplexer to connect the accent line to the right sample&hold.


/* The dmux/dmuxold condition detects a rising edge of the clock line.
   The dmuxn variable is the index for how far into the current frame we
   are, i.e. it is the index of the voice we're receiving trigger and accent
   for. */
if ((dmux & DMUX_CLOCK) && !(dmuxold & DMUX_CLOCK) &&
               dmuxn < ARRAY_SIZE(voicetab)) {
    /* The dmux trigger line is connected to pin D5. Is it high? */
    uint16_t trig = (PIND & (1 << 5)) > 0;

    /* If the trigger line is high, use the analog switches to route the
       accent line to the sample&hold cell of the current voice. */
    dac_mux_select(trig ? dmuxn : VOICE_T1);

    /* Outside the MCU, the sample&hold cell now gets charged to the current
       accent voltage. */

    /* VOICE_T1 is a dummy voice that disconnects the analog switches. This
       latches the accent voltage into the current cell. */
    dac_mux_select(VOICE_T1);

    /* Record the state of the trigger line for later so that we can send
       all triggers at once when the frame ends. */
    dmuxtriggers.buf[dmuxnext] |= (trig << (uint16_t)dmuxn);
}

You can see the rest of the code here.

D-mux uses a different voltage range for accents (0-3.3V) than what was coming out of the Nava DAC (0-4.096V). Luckily the trimmer for the scaling opamp IC110A has enough range for me to be able to boost the d-mux voltage to 0-5V as required by the 909 voice circuits.

Nava hooked up to oscilloscope The Nava hooked up to the oscilloscope on my workbench. The probes are connected to the frame line (yellow trace) and the accent line (blue trace). On the scope you can see how the accent jumps around because different drum hits in the frame are being triggered at different strengths.

Does it work now?

Yes, but I am not entirely sure this is the best way to implement d-mux for the Nava after all.

Near the end of the project I discovered that the different 909 instruments don't respond uniformly to the same accent voltages. The have different control laws. This is most noticeable for the sample playback voices (hihats and cymbals).

The audio data stored in the sample ROMs is compressed so that it has a constant loudness. This helps improve the signal to noise ratio of the sample playback engine. The loudness contour of the sample voices is created by a volume envelope. Funny enough this volume envelope is a linear ramp derived from the sample address counter. A linear loudness decay would not sound good so the 909 uses exponential VCA's for the sampled voices. The accent lines go into these exponential VCA's. The result is that starting from 0V, most of the 0-5V accent range is nearly inaudible and the volume goes up quickly in the last few tenths of a volt. In contrast the other voices seem to have a more linear accent voltage response.

I can deal with this because d-mux lets you change the accent control law per voice but it means that I need to fine-tune the d-mux configuration on the Cirklon just for the Nava. This peculiarity of the 909 would be a good reason to implement my original approach after all (analog to digital to analog) because then I could use a linear control law on the input and convert it to exponential where needed in the MCU. I've never used a real 909 but I wonder if its firmware does this too when you control it with MIDI.

Conclusion

This project was harder than I expected. I got stuck in the middle and that is actually when I implemented Yocto on the d-mux. That was a good move because it allowed me to learn about some of my knowledge gaps (interrupts, the d-mux protocol) without worrying about all the challenges in the Nava d-mux project at once.

It was a good exercise in looking for the edge of my abilities, and feeling out how far beyond that edge I can go and still make progress.

Tags: music dmux

IndexContact