Wouldn’t it be nice if you could just plug one end of a cable into your Roland drum machine and the other end into a USB on your DAW, and have them play in sync?
Now you can and you can build the cable yourself.
The cable uses an ATtiny85 programmed with V-USB to act like a MIDI interface to your DAW, receiveing real-time messages and converting those into DIN Sync24 pulses.
The ATtiny is programmed with the Micronucleus bootloader and is firmware upgradeable in circuit.
The interface is plug&play and does not require any drivers for Windows, iOS or Android and shows up as a standard MIDI interface.
Roland Sync24
The Roland DIN sync interface is a TTL interface that sends 24PPQN Clock pulses on pin 3 and a high/low state signal on pin 1 for start/stop.
The microcontroller turns the MIDI realtime messages into these signal.
Clock (decimal 248, hex 0xF8)
Start (decimal 250, hex 0xFA)
Stop (decimal 252, hex 0xFC)
Physics
The interface is built on a custom PCB that fits inside the DIN plug.
One end of the PCB is soldered to the DIN plug and the USB cable is soldered to the other end.
BOM
IC1 ATtiny85 Sync24 MCU
R1 47ohm resistor
R2 1.5Kohm resistor
R3 66ohm resistor
R4/R5 Not used
R6 66ohm resistor
Z1 3.6v Zener diode
CLB1 1 meter USB cable
CN1 5-pin DIN plug
PCB1 Sync24 DIN PCB
You need the DigiMIDI library found here:
https://github.com/heartscrytech/DigisparkMIDI
To be able to receive MIDI from the host, the file DigiMIDI.h requires some modification.
Add this to the function usbFunctionWriteOut:
void usbFunctionWriteOut(uchar * data, uchar len) {
if (data[1] == 0xF8) { //If Clock
CLKcnt=500; //Reset clock counter to 2mS
digitalWrite(5,HIGH); //Set clock output
}
if (data[1] == 0xFA) { //If Start
digitalWrite(2, HIGH); //Set Start/Stop HIGH
}
if (data[1] == 0xFC) { //If Stop
digitalWrite(2, LOW); //Set Start/Stop LOW
}
}
And this is the SYNC24.INO sketch:
// (*) All in the spirit of open-source and open-hardware
// Janost 2019 Sweden
// DIY USB MIDI to Sync
// http://blog.dspsynth.eu/diy-usb2din-sync/
// Copyright 2019 DSP Synthesizers Sweden.
//
// Author: Jan Ostman
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
#include <DigiMIDI.h>;
DigiMIDIDevice midi;
void setup() {
pinMode(2,OUTPUT); // Run/Stop is output
pinMode(5, OUTPUT); //Clock is output
digitalWrite(5,LOW); //Set initial Clock to LOW;
digitalWrite(2,LOW); //Set initial Run/Stop to LOW;
}
void loop() {
midi.update(); //Check if any MIDI data is received
if (CLKcnt) { //Ongoing clock pulse?
CLKcnt--;
if (!CLKcnt) digitalWrite(5,LOW); //Reset clock output
}
}
If you want to build this all by your self the sketch runs fine on the Digispark board.
This is the setup with Reaper to send sync for a Roland drum machine:
If you have no clue about programming and soldering skills only you can buy a preprogrammed Digispark board.
The DIY preprogrammed USB2Sync Digispark is available here
Comments
Please log in or sign up to comment.