Simple USB MIDI Clock to DIN Sync Converter

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Joe., lisa, luketeaford, Kent

Post Reply
User avatar
burdij
Veteran Wiggler
Posts: 667
Joined: Mon Dec 28, 2009 4:38 pm
Location: Wisconsin US

Simple USB MIDI Clock to DIN Sync Converter

Post by burdij » Tue Jun 07, 2016 3:06 pm

I needed an interface to connect a USB MIDI clock output from Ableton Live 9 to sync a Beatstep Pro for a demo. I found this project on the net and adapted it to my needs: USB MIDI Clock interface

It is built using one of the Teensy 3.x processors (including the LC which is the one that I used). The updated program included below can be programmed into the processor using the Arduino IDE with Teensyduino add-on or loaded using the Teensy Loader from the included hex file if you don't want to go through the trouble of setting up the Arduino IDE.

This is a photo of the interface circuit built up on a breadboard:

Image

The circuit is self-powered through the USB cable. This is the schematic. The LED monitors the RUN/STOP line. When on, the external device should be running. The on-board LED on pin 13 monitors the clock pulses sent to the external device. It will flash rapidly during normal operation. The output clock occurs at a rate of 24 pulses per quarter note.

Image

Through this link, you can download a zip file containing the Arduino project and a pre-compiled hex file that can be loaded directly into the Teensy using the Teensy Loader.

Project program files

Once the unit is assembled and programmed, when it is connected to a computer running a DAW program such as Ableton, a USB device called "Teensy MIDI" should be detected. In Ableton, to send clock sync information to this device, click the ON button in the Sync column in Preferences/MIDI Sync as shown here:

Image

Connect the DIN output connector to the external device using a cable that will pass the DIN sync signals. I spent some time troubleshooting the circuit until I realized I was using a MIDI-only cable.

If everything goes to plan, when you put Ableton into play, the external device should also start and maintain sync with the computer. Here is a picture of a Beatstep Pro connected to the circuit through the external clock input connector. Note that the CLK has been selected next to the SYNC button. When the program is not running, the Beatstep Pro can still be run using the last detected rate as shown on the tempo display.

Image

This picture of the Ableton tempo display shows that the correct tempo has been detected:

Image

The circuit uses logic levels of 0 and 3.3V which work fine with the Beatstep Pro. If you intend to use this with another device that requires 5V or higher logic, you may need to construct level converters. I will post a schematic of a circuit that will provide the necessary interface. Also, if the logic level is higher than 5 Volts, you will need to provide an external power supply.

I hope this quick project will be of use to someone that needs a fast and cheap external clock interface. The Teensy LC currently costs $11.35 and the rest of the parts can be purchased for <$5.
Knobcon 7 - 2018 Photo Album
While website and store updates are in progress, access the Grove Audio Synth Store
Tesla Science Center http://www.teslasciencecenter.org

User avatar
mckenic
pew!pew!pew!kthnxbye!
Posts: 6347
Joined: Fri Aug 06, 2010 8:05 pm
Location: Limerick, Ireland

Post by mckenic » Tue Jun 07, 2016 3:50 pm

Ive been thinking of a way to get my 606 synced up to loops played in Live for awhile.

Looked at the BSP, the OP Lab and saw this project on Little Scale... have yet to try it but thank you for posting that you got it working! Very encouraging!

Quick question - there is an led and a few resistors in your breadboard pic (I cant read schematics for peanuts), are they needed please? I latched on to the Little Scale sketch because nothing else was needed.

Now to find one of the 3 bloody Teensy boards that are in the room here somewhere!

:tu:

User avatar
mikecameron
Thread Killer
Posts: 976
Joined: Sat Nov 20, 2010 2:13 am
Location: Peoria, IL
Contact:

Post by mikecameron » Tue Jun 07, 2016 5:10 pm

doesn't the BSP sync to MIDI clock as well?

In my system, I use an STG time buffer to sync my Graphic and trigger sequencers which run off Dinsync. To convert one to the other, I built a converter using a midi/sync IC from Blacet. ($16) It's pretty simple to work up on a piece of perfboard. http://www.blacet.com/store2.html


**EDIT - nevermind... I re-read the OP and see this was USB midi to DIN, not just MIDI to DIN. carry on.

User avatar
burdij
Veteran Wiggler
Posts: 667
Joined: Mon Dec 28, 2009 4:38 pm
Location: Wisconsin US

Post by burdij » Tue Jun 07, 2016 5:24 pm

mckenic wrote: Quick question - there is an led and a few resistors in your breadboard pic (I cant read schematics for peanuts), are they needed please? I latched on to the Little Scale sketch because nothing else was needed.
No, they aren't needed. The 47K resistor is a pullup on the clock just to assure as high a logic level as possible. I wasn't sure what the input levels for the BSP are. The off-board LED and the pin 13 LED are for monitoring mainly. Its nice to have to verify that the DAW sync settings are correct and that a signal is actually being sent.

One thing I noticed about the Little Scale implementation that is a bit odd is that one of the teensy output pins is being used as the ground reference after being configured as a low output. This is probably not a good idea. If there should be any difference in the ground reference potentials between the computer and the devices being controlled, all that voltage and/or current will appear across an output transistor in the micro with possible damage occurring. It is better to use an actual ground pin on the chip such as pin 1.
Knobcon 7 - 2018 Photo Album
While website and store updates are in progress, access the Grove Audio Synth Store
Tesla Science Center http://www.teslasciencecenter.org

User avatar
mckenic
pew!pew!pew!kthnxbye!
Posts: 6347
Joined: Fri Aug 06, 2010 8:05 pm
Location: Limerick, Ireland

Post by mckenic » Tue Jun 07, 2016 5:55 pm

Thank you burdij! I think I would like to try do the same, thanks!

As for the low pin being ground reference (not that I understand it a whole lot) would it be better to comment that out of the Little scale code before uploading?

Thanks again for your patience and help!
Dave

User avatar
Troubleshooter
Wiggling with Experience
Posts: 347
Joined: Thu Oct 01, 2015 8:21 am
Location: Belgium

Post by Troubleshooter » Wed Jun 08, 2016 3:37 am

If you prefer sample acurate DIN-sync like me considder skipping those sloppy MIDI interfaces.

Just use a pair of AC coupled schmidt triggers to generate the start an clock signals from 2 outputs of your soundcard. (at least if have some spare outputs on your card)

A few milliseconds of "midi jitter" here and there makes your music noticably less dancable.

Using software like expert sleepers silent ways or the free RV0's plugin makes it possible to set your required offset, swing etc...

User avatar
mckenic
pew!pew!pew!kthnxbye!
Posts: 6347
Joined: Fri Aug 06, 2010 8:05 pm
Location: Limerick, Ireland

Post by mckenic » Wed Jun 08, 2016 6:52 am

Sometimes you need something 'Just good enough.'
I have to trim my live recordings in Ableton by 2ms every time for them to line up with warped loops anyway. No mater what settings, its always 2ms and if my playing is sloppy the Warp markers are called into action.

That and the hassle of dinging out my ES stuff (even though I have the Din cable for my ES-3 and expanders anyway), powering it and making room... puts me off the thought of Jamming... for serious stuff sure but to jam, well I haven't bothered so far so that tells me something :hihi:

luche
Learning to Wiggle
Posts: 5
Joined: Tue Jul 01, 2014 3:56 pm
Location: Milwaukee, WI

Post by luche » Thu Aug 24, 2017 1:21 am

Just wanted to say thanks. I've been digging through the older teensy 1.0/2.0 [midi --> din sync] examples, and none of them made sense... wrapping my brain around ground to pin 12 was just frustrating. Pins in blurry photos or 40 second wobbly youtube clips were frustrating. No schematic, very little info... frustrating. Free code is great, and i really appreciate people sharing their work, but it took a lot of trial/error to get this little guy to work.

Finally Google magic landed me here. I followed your schematic to a T with my teensy 3.1 (and tonight ordered an LC so i can keep my TR-606 in sync while still working on future teensy builds). I didn't have to alter anything in your code, and in fact the comments left about another build saying
teensy output pins is being used as the ground reference after being configured as a low output
... this confirmed that i was in the right place. Finally someone gets it.

It's late, so my photos are dark and the build is sloppy, but maybe these photos will help people that prefer a breadboard shot over schematic (i always like to reference both).

To be clear, the (white then purple) wires in front/underneath the DIN port connect Teensy 11 to the LED (anode/long leg) and blue wire to DIN 1 (start/stop aka run) behind the jack, and the short leg (cathode) of the LED runs to the 330 ohm resistor, then to ground (i'm making use of both "blue/negative" ground rails on this breadboard via the brown to grey wire down the center).

Lastly, it never hurts to confirm with a VOM that your 5 pin cable is indeed 5 pins, and not just 3 like some cheap/modern midi cables.

Image
Image
Image

Thanks again, I'm fairly new to arduino/teensy builds... but this absolutely made my night.

JewlsRewls
1-Post Wiggler
Posts: 1
Joined: Sat Mar 21, 2020 8:34 pm

Re: Simple USB MIDI Clock to DIN Sync Converter

Post by JewlsRewls » Sat Mar 21, 2020 8:47 pm

Hey There,
New user but old time lurker. My first reply! Thanks in advance if anyone sees this, Hope it's okay to reply to something this old.
I thought i'd flash the teensy to see if Live (10.1) would show it as a midi device before i start soldering. It didn't. Is the circuit required?
Or maybe this project got pushed out function with updates since it's pretty old?
The device shows up in device manager (win 10) as a "USB Input Device" under "Human Interface Devices".
In 'Properties', The box at the bottom of the "Events" tab reads as follows;

Device USB\VID_03F0&PID_134A\5&31b15b11&1&1 was not migrated due to partial or ambiguous match.

Last Device Instance Id: USB\VID_17CC&PID_1600&MI_04\8&1f0489c9&1&0004
Class Guid: {745a17a0-74d3-11d0-b6fe-00a0c90f57da}
Location Path:
Migration Rank: 0xF000FFFFE000F120
Present: false
Status: 0xC0000719

Thanks again!
She/her Pronouns.

:goo: :eurorack: :goo:

Post Reply

Return to “Music Tech DIY”