Midi to contact (amp channel switching via midi)

Hi all. First post here…

So, I’m trying to figure out how to convert midi signal to contact meaning, I got this amp head and the channel switching is done by a contact (TS in the back, open / close) and I would like to control it via my FX processor which has midi out.

At the beginning I thought to do it with an Arduino chip but than a friend recommended I can get along with optocoupler also.

To be honest both are new for me, I know these exist but have zero experience / understanding how it works.

Ideas? Schematics? What is better (in terms of ease of building it and complexity) for me, Arduino or this optocoupler?



Sounds like you actually need both… the optocoupler to get MIDI commands from the FX unit’s MIDI OUT into a Arduino for translation/processing of the MIDI COMMANDs the FX unit is transmitting.

Then the Arduino can activate a relay to loop your TS close or open.

This is all assumption of what you have though…

Thanks for the fast replay.

I had the impression I will need either:
Arduino (midi signal receive and process) + relay pack (final contact, what will be connected to the amp channel switch input).
Arduino (midi signal receive and process) + This optocoupler (instead of the relay pack).

Your MIDI OUT device is designed to send a 5v switching signal out to another MIDI device with a optoisolator.
The optoisolator has a tiny LED inside of it. That is the MAX LOAD you want your MIDI OUT device to drive. Try to source too much current for anything else and you could damage your MIDI OUT port.
The main reason for the optoisolator was to eliminate switching noise… you don’t spend $5k on a keyboard in 1980 for a SC Prophet V and get to listen to a buzzing sound.

Granted your arduino isnt a source of sound output… and you could possibly try something different to get the MIDI signal to the arduino w/out a optoisolator…, but why risk sourcing too much current out of your MIDI OUT device, thus possibly frying it?

So what you want is:
your MIDI OUT device–> optoisolator --> arduino --> relay
is the chain you are seeking.

The relay could possibly be a transistor or mosfet or 4066 bilat IC… hard telling w/out seeing how the amp TS is wired up.
Relay is the most direct method.

But the hardest part for beginners is coming up with code to write to the arduino so it will listen to the MIDI commands, filter out what it doesnt want, recognize what it does and activate the switching device.

1 Like


I’m starting to have a clearer picture in my head about what I need.
Actually, I’m less concerned about the code as there are many examples like this over the web, I guess I will start with something and continue from there trial and error….
Any suggestions for part numbers and type, where to buy and the most important, circuit, how do I connect the parts?
I’m a practical electricity engineer so I can read circuits and understand them more or less.
Thanks again, very nice of you all to help and answer so fast.

I use a 6N137 optoisolator. TONS of examples used with Arduino can be found in a search.
Can be bought all over the net… I bought several from DigiKey since the Co. I work for buys parts all the time (I piggyback on their shipping…)

Arduino in it’s many forms… I’d probably check into a Nano since they are cheap.

Relays… There are many “module” boards on ebay that are ready to be used with arduino for cheap from China or pay extra from USA or your local country.

Schematic is usually simple… the 6N137 only needs two resistors and a diode (see examples)
Connect the 6N137 to the arduino and have a 5v Pin OUT from arduino to your 5v input of your relay…
Hook your amp’s TS to the relay.

Thank you very much.
You wrote “see examples”, any specific you referd to?

Regarding the parts, any recomands from these?

6N137: https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20200413234335&origin=y&SearchText=6N137+optoisolator

Nano: https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20200413234531&origin=y&SearchText=Arduino+nano

Thanks in advance.

And the relays: https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20200414000700&origin=y&SearchText=Relay+module+board

What is the limitation for relays? I thought of heaving 3 or 4 but if it’s only a matter of the relay board itself, I might go with 8 as if I’m already doing this, I will build something that can switch many devices like the tuner “Mute” on the pedal board for example (it has also a TS input) and others.

Any specific module preferred for the link?

While serching the web i found this: https://www.robot-electronics.co.uk/htm/midi-rly8.htm
I dont see here an Arduino chip, only the midi portion and the relays, any idea what is the signal flow here?


A quick Google search for “6N137 Arduino” gave this as one of the first results:

It shows a Uno, but you just connect to the Nano’s RX pin instead.

Those links to AliExpress should be fine.

Relay board choice is up to you. I would probably buy the single and the 4-relay boards to start with.

That robot board has a chip on it, it is small… near the USB port.
It’s a custom setup and you would have to research that more to understand it.
You would be limited to features they coded it to do.

Have you ever worked/coded with Arduino before?
Ever do a basic “blink” sketch(code)?

If not, you really should get into beginner tutorials for Arduino and coding before tackling a project like this.


No. this is my first ever with Arduino, never tried / touched it.
I have a very good tech approach and I can read and understand schemes so…how hard can that be…… right? :slight_smile:
I will order the 3 parts and return with questions once I receive everything and try something with it.
Thanks for now.

Until I will get everything…
Is there a simulator where I can practice my code writing?
Beside Arduino IDE, what else should I download and install?

I never used a Arduino simulator before. So I’d suggest searching on that topic.

I would go ahead and seek out the MIDI library for arduino.
This one seems to be popular: