MIDI Clock Generator w/ Tap Tempo

Status
Not open for further replies.

ForestCat

Member
Hi,
I acquired a TC Flashback X4, which is a nice looper/delay in that you can utilize the looper and delay simultaneously, i.e. loop a "delayed" signal, change the delay time/feedback, overdub that signal, etc. All good. Except for one detail: The delay Tap Tempo button becomes inoperative (re-purposed) when the looper is active. Bad. The saving factor may be that the device can respond to MIDI clock from its DIN MIDI input.

I'd like to construct a dedicated DIN MIDI clock generator stomp-box, with a momentary contact Tap Tempo button, and, ideally, a 3 digit tempo display and a pot to direct-dial a tempo (with Tap override). I've built a few Teensy MIDI devices, switch/button to MIDI Note/CC, and MIDI CC to LED, but nothing "clocked" per se. Is this idea too ambitious re: the stability of the clock, having to deal w/ interrupts, etc? I've searched a fair bit trying to find any similar code to learn from, but no joy. Anyone have any thoughts on this?
Thanks so much.
 
For the switch reads, you could get away with using elapsedmillis.

Since you want to pump the clocks out at an accurate 24 pulses per quarter note no matter what, you could use the IntervalTimer library for the greatest precision. Link with links: http://www.pjrc.com/teensy/td_timing_IntervalTimer.html

EDIT: Though the Metro library is less complicated and I thought "good enough" if not juggling too many things...doing the math comparing 120 and 122 bpm, you are going to need sub-millisecond timing precision, so the Metro library is actually not good enough. You will need an accurate interval in microseconds, so use IntervalTimer or Timer1/Timer3 as discussed in the above link.

Consider using an I2C LED display or display support chips so you aren't doing 3 X 7 segment display multiplexing, switch reads, AND pot reads/compares. Like this (other sizes/colors available): http://www.adafruit.com/products/878

Lastly: an ancient Arduino forum discussion with both tap-tempo and MIDI master clock code but not joined together or particularly nice: http://forum.arduino.cc/index.php?topic=16213.0
 
Last edited:
I'd like to construct a dedicated DIN MIDI clock generator stomp-box, with a momentary contact Tap Tempo button, and, ideally, a 3 digit tempo display and a pot to direct-dial a tempo (with Tap override). I've built a few Teensy MIDI devices, switch/button to MIDI Note/CC, and MIDI CC to LED, but nothing "clocked" per se. Is this idea too ambitious re: the stability of the clock, having to deal w/ interrupts, etc?

Its not too ambitious, no; the Teensy can produce tight clocks which are only limited by the slow bandwidth and latency of the transport (31,250 bits per second serial, for MIDI over DIN). Normally I would advise to use MIDI over USB for tighter timing, but here you are limited by the available inputs of the looper/delay unit.
 
Dr. John, thanks for the info on the IntervalTimer library. I'll look into it. I found the threads you mentioned before I posted here, as well as quite a few similar ones, and lots of info on going the other way, i.e. MIDI beat clock to various timing signals. But nothing functional, or tying the tap function to MIDI clock generation. Tacking on the knob/display is probably not too difficult if I could get the core functionality working. Guess I've got to dig in. This is such a common requirement, I'd think, I'm really surprised that there's not more code floating around... Lot's of requests, though.

Nantonos, yeah, the DIN is my only option here.
 
Status
Not open for further replies.
Back
Top