Electronic – MIDI source selector switch

midirelayswitching

So I am looking for a way to switch three signal lines between 1 source and another, the idea being I want to switch a MIDI Port on my device between thru and out modes, but also can't have any delay in the line when in one mode or the other. I have been looking at using some low voltage relays (My device is Arduino Based) as no part of the design is higher than 5v, however I am now looking to see if there is a better solution, specifically, less space consuming (For a pocket device) and that can stand many switches over a long period of time without a potential failure. Any ideas?

EDIT

Hi again, sorry for the confusion. Hopefully this edit will explain it all a bit better.

End Goal

The end goal is for my device to sit in a theatrical show control system and show me the status of the show control system, which will be running MIDI Show Control, basically a specification build on top of MIDI to tell lights, pyro and automation what to do, or what the time into the show is (MIDI Timecode), and the device (Lighting Controller for example) decides what to do. When I press a button, it stops the control system from passing messages to my device so that I can do things separate to the show as a whole.

Control Lines Info

So, when I say three signal lines I mean that in MIDI there are three lines:

  • Positive (The actual signal, +5v or 0v)
  • Negative
  • Shield

When in 'Mode 1', my device will pass all of these lines thru the device onto devices further down the chain. When in 'Mode 2', my device will be the terminating device for those lines and will instead pass a second set of those lines from its self. The idea being that when in 'Mode 2', my device stops signals and can send its own. I have attached a schematic below to show this idea.

Orange arrows are control signals from the original device (Device 1). In Mode 1, these must pass through the device with no delay (I will explain that in a moment), my device will see them but that is all. In Mode 2, these signals stop at my device and I will make new signals to continue onto device 2 (Blue arrows).

schematic

simulate this circuit – Schematic created using CircuitLab

No Delay

What I mean by no delay is that there can be no real world delay introduced by my device. As this device is part of a show control system, timings are very important. The system may for example trigger two cues, 0.1s apart, so while I understand that electronics add some delay, it needs to be minimal. This is also because the device may be removed (For example, once I have finished programming the show).

Hope this makes a bit more sense than the first post that was a bit rushed.

Best Answer

Your device already needs MIDI receiver and transmitter circuits when in mode 2. So the simplest way to pass through MIDI signals is to use these existing circuits to implement a MIDI Thru port (as shown in the MIDI specification); the delay of the optocoupler is not noticeable in practice.

To select between the original signal and the processed data from your microprocessor, you can use any SPDT switch, either a digital multiplexer (e.g., the (SN)74LVC1G97), or an analog multiplexer (e.g., the SN74LVC2G53):

MIDI optional Thru with demultiplexer