Tag Archives: midi

Midi Controller with Tap Tempo for the tc electronic D-Two

I recently discovered, that my beloved guitar amp sounds so much better without too many FX pedals in the input signal chain. Still, I don’t want to live without a nice chorus or delay. So, additionally to micing the amp’s speaker, I got myself a Palmer PSI 03 JB in order to feed my old tc d-two with a speaker simulated signal and have two additional wet channels.

In order to switch programs on the d-two I’d need to buy myself a midi foot controller, and with that I’d not be able to tap the delay time, as tc states, that there’s no way to do that using MIDI (see here). While doing a bit more research, I found the MIDI specification for my device. I noticed, that you’re able to change the delay time by using either MIDI CC48 or a SysEx command.

So, I had the idea to get myself a nice pedal case, switches, etc. and some Arduino. I read up on how to use it to send MIDI data and founds this wonderful article. So without doing much circuit design or creating a BOM, I went to my local electronics supplier and got the stuff needed, which isn’t much after all:

  • aluminium case
  • 3 momentary foot switches
  • 3 220 Ohm resistors
  • 1 DIN/MIDI plug, female
  • mounting screws
  • Connectors for the arduino
  • Green LED
  • Arduino UNO

I had some vero board still lying around and decided to use it for the rather small circuit needed to do this. I really hate these boards! All that cutting and scraping. But well, sufficient for now. 😉 I first programmed the tapping using a bread board and the LED and quickly went on with putting the actual case together. It didn’t turn out as nice as I intended it to look, partly owed to my vero board aversion, partly to the fact, that I’m too stupid to create a nice cable routing. 😉 But anyway…


Next up: Trying to understand MIDI data. It took a while until I realized, what 7 and 14 bit packed into bytes is about. Obviously, the most significant bit usually is 1 for status bytes (I’d rather call them command bytes) and 0 for data bytes and the rest of the byte is being used for commands or data. While reading the mentioned MIDI specification for the d-two, I first thought CC48 would do what I wanted. But, how would you encode let’s say 1000ms to a data byte, that on top of that only uses 7 bits for data? The specs don’t tell. 🙁 So I put all my hope in using the “Parameter Data” sysex command:

But how the hell do you encode – let’s say – a value of 5000ms to 14 bit divided into an MSB and LSB? Well, I took some paper and started to wrap my brain around bit shifting and masking. I also asked Robin Gareus to verify my method and he kindly pointed out, that I had forgotten handling negative values properly (“Oh, right it’s SIGNED 14 bit!”) and that I had MSB and LSB in the wrong order. So I ended up doing this:

(d is an unsigned int containing the delay time in ms)

Thank you so much, Robin. 🙂

After a few meander regarding the SysEx param IDs, I eventually succeeded:

Well, and here’s the complete code of the sketch. Feel free to use and adapt it. 🙂 It’s probably a bit quick and dirty. Feel free to send me a comment if you have suggestions.