Adding MIDI control to intelligent relay bypass switching - how?

Started by Grubb, July 12, 2021, 03:03:19 AM

Previous topic - Next topic

Grubb

Hi folks,

I'm planning a build that involves 3 separate preamp circuits in a 1590DD enclosure with intelligent relay bypass switching from PedalPCB. https://www.pedalpcb.com/product/relaybypass/ I only want to hear 1 preamp at a time, and the switching module in channel mode will let me switch between them or turn the entire pedal off. So far so good.

To integrate fully into my rig, what I really need is MIDI capability. I would like the switching system to work the same way, but also respond to MIDI commands. What do I need to do to add MIDI control to a setup like this?

potul

The best would be to build your own pcb for relay control and forget about the pedalPCB one. This way you could have everything into a single PCB, with a single microcontroller, managing the relays and the midi part.
But, if you still want to use the pedalpcb bypass, you could add another microcontroller (attiny or similar), to manage the midi connectivity and send a pulse to each channel to control them. You could keep the momentary switches.
The only tricky point is you probably need to leave the outputs of the midi uC in a high impedance state when not triggering the channels instead of leaving them high.

Ben N

Here's an article that goes through the basics of setting up a MIDI input for Arduino. https://www.notesandvolts.com/2012/01/fun-with-arduino-midi-input-basics.html. It's nine years old, and, as noted by potul, there may b e better choices of microcontroller for such a task, but the basics are the same AFAIK.
  • SUPPORTER

ElectricDruid

Like the others have said, if you want MIDI control of three relays, you'd be better using a single processor (so a little Arduino, for example) rather than three PedalPCB boards. You can use the rest of their schematic, but instead of having one input and one output, your circuit will have three footswitches connected to the processor and three relay outputs.

MIDI Input is pretty easy on Arduino since the libraries save you getting your hands dirty. You'll need to think about footswitch debouncing too, but there's stuff available for that too. Really, you'd only have to think much about the actual switching logic you want.

Vivek

I have been working on :

ONE) Arduino control for 6 foot stomps,

4 work this way for 4 amp channels : pressing any one immediately jumps to that mode and cancels other modes
2 for chorus and delay, one press on, next press off


TWO) Logic IC based switching
Pressing same stomp button multiple times cycles through available modes


I opted for CD405X Analog switches for my first attempt, since they have the potential to be better than mechanical relays


I need to read up on how to get the Arduino to accept Midi input, or even create Midi event upon user pressing any switch. However, setting and storing potentiometer settings makes the whole project so much more expensive/complicated


Lets share notes on how we are getting along




Vivek

Quote from: Ben N on July 12, 2021, 03:42:43 AM
Here's an article that goes through the basics of setting up a MIDI input for Arduino. https://www.notesandvolts.com/2012/01/fun-with-arduino-midi-input-basics.html. It's nine years old, and, as noted by potul, there may b e better choices of microcontroller for such a task, but the basics are the same AFAIK.

Very interesting !!!

Thanks for posting !!!

FiveseveN

Quote from: R.G. on July 31, 2018, 10:34:30 PMDoes the circuit sound better when oriented to magnetic north under a pyramid?

Grubb

Quote from: Vivek on July 12, 2021, 05:04:39 AM
4 work this way for 4 amp channels : pressing any one immediately jumps to that mode and cancels other modes

That sounds pretty much like what I want to do. I want to step on any of the 3 switches to activate that channel, but then I also want to step on it again to bypass the pedal.

Which Arduino did you choose?

I've already got the relay boards and some of the components, but I'm starting to agree that I probably need to design my own board and controller setup.

Ripthorn

I released a project a couple years ago that is a 5 loop relay switcher with MIDI control. You could basically just use that and not hook up the last two loops. Full info here: https://scientificguitarist.wixsite.com/home/mls-5. Uses an Arduino, works pretty well, though if I were doing it again, I would probably rework the debouncing of the switches, but that would just involve some hardware debouncing and reducing the software debounce delay.
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home

Grubb

Thanks Brian for sharing your excellent work on this switcher. I've copied the schematic as best I can tell into DipTrace, with the intention of eventually making some slight modifications for my own sake, including latching relays and LEDs coming straight from spare Arduino pins. At the moment, the schematic should be the same as yours.

I'll post where I've got to so far - being unfamiliar with relays, I hope I have connected this one correctly. I was hoping to get confirmation of the relay portion of the circuit before copying it for Loop 2 and 3. Thanks for the help so far.





EDIT: As I'm looking at this, I'm thinking that the input to Pin 4 on the relay has to be audio input, and the output from Pin 13 must be the output signal from the pedal (in my application), is that right?

EDIT 2: Ha I'm just getting myself more and more confused. How does audio enter and leave this circuit?

Ripthorn

Loop 1 in should be the audio in. Send goes to the pedal, return comes from the pedal, and loop 1 out is the output of the audio to the next loop. You have two sets of loop 1 and loop 2, the connection to the SPST switch is directly to an Arduino pin for sensing button press, the connection to BJT is an output from Arduino that will actually toggle the relay. If you use a latching relay, you will need two arduino pins, one for set and one for reset. The Arduino code will just pulse the pin instead of hold it like it does in my code.
Exact science is not an exact science - Nikola Tesla in The Prestige
https://scientificguitarist.wixsite.com/home