MIDI controlled relay bypass

bhcarpenter

Well-known member
For the past year or so I can’t get out of my head how great it would be to have MIDI on/off switching built directly into stomp boxes. Instead of a typical MIDI switcher that requires the pedal to be always turned on and toggled via a midi controller, integrating MIDI control into the pedal itself would retain the usefulness of the on indicator and footswitch built into the pedal itself. Here’s what I’m thinking:
- The pedal listens to program change messages and remembers the last program change received
- holding the footswitch down for a bit would save the current on/off state to the most recent program number
- receiving that program number later would recall the saved setting

Originally I had planned to do a whole I/O PCB designed around this concept, but honestly the PPCB Intelligent Relay Bypass board is most of the way there already! You just have to ignore the MIDI “requirement” that MIDI inputs need an opto-isolator (Chase Bliss and Meris seem to ignore this requirement too).

The only bad thing- doing this with an Attiny85 is probably not viable. I’ve seen some projects online that do software MIDI on a GPIO port with the Attiny85, but that seems finicky and power hungry. Luckily the some of the newer tinyAVR MCUs have hardware serial communication support! Check out this demo of me saving on/off state and the recalling it using a MIDI controller. It’s not much, but I’m pretty excited about it! https://www.dropbox.com/scl/fi/f40l1mc9urjn49kz3y3sn/Video-Feb-07-2025-9-07-02-PM.mov

I’m using a ATTiny412 and it seems to be a good fit for the job. Next step: work up a little adapter board so that I can plug this directly into the PPCB relay bypass module. I’ll keep this thread updated if my progress!
 
There is this project for inspiration. Based on PIC.

I also wanted to do it about 4 years ago. I designed a PCB and wrote a state machine to parse MIDI but never had a chance to fabricate PCBs and try to finish/debug the software (not enough money and time). I was never sure how critical the timing of the MIDI bus is. It is probably safer to use external XTAL for MCU.

I am not sure how much you can fit in ATTiny412. I remember I have used some 16F series PIC.
 
Hey @Robert if you don’t mind me asking- how are you driving the relay for the Intelligent Bypass module? Is it as simple as pulsing one pin or the other to 5v for >10ms? When not actively switching are the pins pulled to ground or tri-stated?
 
I laid out a 5 switcher, last month, based on the Raspberry Pi Pico 2. Probably overkill. I need to review it,.one more time and tweak it a bit. It's super simple. You can't change ordering but it does have midi. I'm still not sure if each effects switch rtn/send should have it's own ground plane. That is the last tweak I'm considering.
 
Hey @Robert if you don’t mind me asking- how are you driving the relay for the Intelligent Bypass module?

Basically yes.

Pull one pin high, the other low, hold for a duration, then set both pins low. No Hi-Z output, the pins need to be able to supply and sink current.


I just posted this elsewhere, but you can do the same thing using a single microcontroller pin and a capacitor. Pull high (and stay high) to engage, Pull low (and stay low) to disengage, no pulsing or timing required.

Regardless of how you control the relay, don't forget to do a Latch/Unlatch cycle at power-on to ensure that the relay is in the Unlatched state.

1739031412530.png
 
For the past year or so I can’t get out of my head how great it would be to have MIDI on/off switching built directly into stomp boxes. Instead of a typical MIDI switcher that requires the pedal to be always turned on and toggled via a midi controller, integrating MIDI control into the pedal itself would retain the usefulness of the on indicator and footswitch built into the pedal itself. Here’s what I’m thinking:
- The pedal listens to program change messages and remembers the last program change received
- holding the footswitch down for a bit would save the current on/off state to the most recent program number
- receiving that program number later would recall the saved setting

Originally I had planned to do a whole I/O PCB designed around this concept, but honestly the PPCB Intelligent Relay Bypass board is most of the way there already! You just have to ignore the MIDI “requirement” that MIDI inputs need an opto-isolator (Chase Bliss and Meris seem to ignore this requirement too).

The only bad thing- doing this with an Attiny85 is probably not viable. I’ve seen some projects online that do software MIDI on a GPIO port with the Attiny85, but that seems finicky and power hungry. Luckily the some of the newer tinyAVR MCUs have hardware serial communication support! Check out this demo of me saving on/off state and the recalling it using a MIDI controller. It’s not much, but I’m pretty excited about it! https://www.dropbox.com/scl/fi/f40l1mc9urjn49kz3y3sn/Video-Feb-07-2025-9-07-02-PM.mov

I’m using a ATTiny412 and it seems to be a good fit for the job. Next step: work up a little adapter board so that I can plug this directly into the PPCB relay bypass module. I’ll keep this thread updated if my progress!
So, like an Oscillator Devices Imp?
 
It works!

I ordered a little adapter board to convert the Attiny412 to DIP-8 for the board (and move some of the pins around). Somehow I missed connecting the GND pad of the MCU to the ground plane, so I connected it via a clipped resistor leg.

IMG_5367.jpeg


It fit right in the relay bypass board I installed into a Son of Ben:
IMG_5371.jpeg

I really like how those bypass boards can be mounted directly to the audio PCB with right angle headers.

MIDI comes in the top via an isolated 1/8” headphone jack:
IMG_5372.jpeg

Overall much simpler than I was expecting. I did originally have the relay pins backwards so that the LED was on when the pedal was bypassed and off when it was enabled, but that was easily remedied.

I’ll post the Arduino sketch later for those who are curious. Next up is probably to work up my own bypass board that supports two circuits. I’d love to have one of these control both sides of a Paragon Mini.
 
This is amazing. I’ve been wondering what it would take to add MIDI on/off control to a relay bypass. I already use a DMC micro for easy control of patches in my Metaverse delay. It would be very easy to add CC messages for other pedals to create “scenes” that you can switch between with one tap. Are you able to program a MIDI address to the ATTINY so you could individually control multiple devices?
 
This is amazing. I’ve been wondering what it would take to add MIDI on/off control to a relay bypass. I already use a DMC micro for easy control of patches in my Metaverse delay. It would be very easy to add CC messages for other pedals to create “scenes” that you can switch between with one tap. Are you able to program a MIDI address to the ATTINY so you could individually control multiple devices?
Kinda relates to my question.
@bhcarpenter
How would one use more than one without needing to program each one individually? Or have you implimented a learn function?
 
The way I have it set up is that the pedals respond to program change messages. So I send one PC from my midi controller and each pedal remembers whether or not it should be turned on for that PC.

There are two ways to save a setting. Either press and hold the footswitch to save the current on/off state for the last PC number, or save the current setting to a specified slot in response to a CC message. The second way is so that you can have a save button on your midi controller that saves all your pedals at once.

When I get back to my computer tonight I’ll try to remember to post the Arduino sketch
 
Here's what I think I'm using currently. I'd like to eventually use the RTC for timing to save even more power when blinking the LED or detecting a long press on the switch. I'm also not very happy with the way the EEPROM read/write code is structured, but that's a project for another day. Feel free to use any part of it for your own projects.

 
I would love to understand and implement this into my pedals... I'm already using midi on my board for my strymon,hxstomp and tonex and controlling with morningstar mc6pro..... If I could get my drives to be in my programs would be awesome.
 
I would love to understand and implement this into my pedals...
Same. I bought a few imps and goblins, but they are not cheap when you have several pedals where you want to bypass via MIDI.

I’ll get off this thread if I’m hijacking it- I’m an arduino n00b. Anyone who wants to chime in and correct me is more than welcome.

I’m thinking of getting a soic-8 to dip-8 like this so I can prepare the attiny412 on my breadboard. I have an old UNO r3 and a MEGA 2560 r3 laying around.

On the dip-8 adapter, it looks like pin 8 on the attiny412 needs to go to pin 4, and pin 1 on the attiny412 goes to pin 8.
 
Last edited:
Back
Top