Syncing an Old Drum Machine's Accent Trigger with DIN Sync Synths (Help Needed)

Hello! Another newbie here! :blush:

I’m experimenting with Arduino and an old drum machine, and I’d like to sync its Accent Trigger output with synths that use DIN Sync for synchronization. Here's the situation:

  • The drum machine does not have MIDI or DIN Sync outputs and is clocked at 12PPQN.
  • It has an Accent Trigger output that sends 6V 12ms pulses.
  • The pulse frequency varies from 0.75Hz to 5Hz (45BPM to 300BPM) depending on the Tempo knob, but the pulse duration is always 12ms.

My Goal :

  1. 5V Start/Stop signal for DIN Sync so the receiving synth knows when to start and stop. I’m guessing a simple digitalWrite that sets HIGH when a trigger is detected (and LOW otherwise) could work here.
  2. A way to convert the 12PPQN clock of my drum machine to the 24PPQN clock required by DIN Sync, for this part, I'm totally clueless, so that brings me to the following challenge:

DIN Sync runs at 24PPQN (24 pulses per quarter note), while my drum machine outputs at 12PPQN. Connecting the Accent Trigger directly to the Clock pin of a DIN Sync synth makes the synth’s tempo run much slower than the drum machine’s.

So far what I have done is :

Built a voltage divider to reduce the trigger voltage from 6V to 3V, which feeds into A02 on my Arduino Nano.

I wrote simple code that uses the trigger voltage on A02 to set HIGH or LOW states on pin A03, which in practice creates a digital trigger of 5V that is directly synced to the Trigger coming from the drum machine (Din Sync clock is 5V).

Here’s the code I’ve written so far:

// Pin Definitions
const int inputPin = A2;   // Pin to read the input signal
const int outputPin = A3;  // Pin to output the signal

// Threshold for detecting HIGH (in analogRead units)
const int threshold = 512; // 1.5V corresponds to 512 for a 10-bit ADC

void setup() {
  pinMode(inputPin, INPUT);    // Set input pin
  pinMode(outputPin, OUTPUT);  // Set output pin
}

void loop() {
  // Read the analog input value
  int inputValue = analogRead(inputPin);

  // Check if the input signal is HIGH or LOW
  if (inputValue > threshold) {
    digitalWrite(outputPin, HIGH); // Output 5V if the input is HIGH
  } else {
    digitalWrite(outputPin, LOW);  // Output 0V if the input is LOW
  }
}

My Questions

  1. How can I convert the 12PPQN clock from the drum machine to a 24PPQN clock for DIN Sync?
  2. What functions or techniques should I use in Arduino to achieve this?
  3. Is this even feasible?

Any insights, guidance, or example code or even links to other projects if this has already been done, would be greatly appreciated! I’m still learning, so sorry for not being very clear :sweat_smile:

Thanks in advance! :pray:

Not a MIDI expert here, but if you are receiving a signal at a given frequency and you want to output a signal at twice the frequency, you are going to have to measure the incoming pulse frequency and then output a pulse twice as often. From a quick search:

There are 24 clocks per quarter note. One beat is a quarter note, so the BPM value specifies quarter notes per minute. One minute has 60,000,000 microseconds.

So the number of microseconds between two MIDI clocks is 60,000,000 / (24 × BPM).

If you use micros() to measure time, you can work out the timing

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.