back to hardware index
MIDI controlled switches
In 1997 I developed this MIDI-to-switch device. Low cost and CPU-less again. It can drive up to 128 individual relais, solenoids, motors, fireworks, pyrophones, etc. With a MIDI note-on message you may switch on one of the 128 LEDs (or relais). Outputs may be switched off by sending a note-off message, or by a note-on with zero velocity. The device understands running status messages. It does not react to an all-notes-off message, but, with some additional logic gates, it won't be very hard to implement that yourself.

The device only responds to the MIDI-channel selected by the 4 switches (when no switches are closed, channel 0 is selected). I did not incorporate an omni- switch, but it won't be hard to add that yourself.
photograph of prototype.
circuit diagram.

The quartz crystal and the 74393 provide the heart of the device: the 31.25 kHz MIDI-bitrate-signal. The 4017 and 4015 form a serial-to-parallel-convertor, which places incoming MIDI-bytes on the bus (b0..b7). If it receives a note-on- or note-off-statusbyte on the selected channel, the bottom flip-flop (of leftmost 4013) is SET while the upper flip-flop of that same (leftmost) 4013 remembers whether it was an ON- or an OFF-message. The bottom part of the rightmost 4013 just counts the number of databytes received: 0, 1, 0, 1, 0, etc. (thus supporting running-status-protocol). Finally, the upper flip-flop (of the rightmost 4013) accumulates all velocity bits to support switch-off with null-velocity. The rest is just trivial latching, multiplexing and some logic-gates.

Note that quartz crystals with higher resonance frequencies are often easier to obtain (and cheaper) than low frequency crystals. In the circuit above, one may use crystals up to 8 MHz. As the market pushes us to higher and higher frequencies, it may even be possible in the future to cut costs by building, let's say, a 32 Mhz oscillator and adding a binary counter to obtain the 31.25 kHz MIDI-clock-frequency. For the opto-coupler, CNY17-1, 6N138, or 6N139 may also be used but watch the pin-layout!

timing diagram.

There might be errors in the diagrams above. I built 2 such devices (prototypes) which operate properly, but I made these drawings afterwards and I cannot really guarantee they are 100% correct. So if you don't understand basic building-blocks like shift-registers, latches, multiplexers, gates, etc., you'd better not start with it. I hope the timing diagram is of some help though.
Anyway, if you encounter any mistakes in these drawings, please e-mail me. But please do not ask me whether I can build this hardware for you, or whether I can sell it to you (for I am a designer, not a Plumbum-sniffer:-).  Well, happy soldering then!!


Pieter, may 18, 2001