MIDI is a venerable protocol (dating back to 1983) that is used to communicate between synthesizers, controllers, sequencers, sample players, computers, mobile devices, drum machines, and other electronic music making devices.

Electronic Music Gear

Electronic music gear is often made up of multiple discreet components that each have their specialized task to perform. They can communicate with each other through data messages, control voltages, gate and trigger signals, and/or audio signals in order to come together as a whole, united system capable of being performed, recorded, played back, and ultimately, producing audible music!

MIDI Messages

A simple and very common use case is to have a controller, such as a piano-style keyboard, send Note On and Note Off data to a music synthesizer (including software synths on your computer or mobile device).

Press a key and a message is sent telling the synth to play a specific musical note. Release the key and a message is sent to the synthesizer telling it to stop playing that note.

Getting a bit fancier than simple on/off messages, MIDI can also be used to send "continuous controller" CC messages, typically the result of turning a knob or pushing a slider on the keyboard controller. These can be used to sweep through the cuttoff frequency of a low pass filter, or modulate a tremolo, and many, many other parameters.

A similar scheme is also used to send pitch bend info -- often represented by a pitch bend wheel on the left side of a MIDI keyboard.

NeoTrellis M4 MIDI

We can use the NeoTrellis M4 to send any kind of MIDI message we like. In a previous project, we showed how to send MIDI over USB to control software synthesizers. Here we'll send MIDI the classic way, as a serial data stream over a DIN-5 connector that can control any traditional synth.

In this project, we've mapped the 32 buttons to play the "keys" on your synth, from a low C (MIDI Note 32) up to a high G (MIDI note 64). You can hold many buttons at once to create chords if you're using polyphonic synth software.

But that's not all! We can also play very expressive pitch bend and modulation with the NeoTrellis M4. This is all thanks to the Analog Device ADXL343 accelerometer built right onto the board! Tilt left and right to pitch bend down and up, and tilt forward and backward to gradually adjust the filter or tremolo or whatever you like on MIDI CC 1.

Adapting MIDI to the 3.5mm TRS Plug

In an effort to provide classic MIDI on small devices, where the large DIN-5 connector is impractical, many manufacturers have started to us a three-conductor 3.5mm plug and jack with an adapter. The 3.5mm TRS (tip, ring, sleeve) connectors and wires are what we're familiar with from most stereo headphone cables. Since we only use three of the five conductors in a DIN-5 cable, this works out well. This site has a great chart of compatibility for various manufacturers equipment and the different pinouts of TRS to DIN-5 connectors.

Here, you can see how the female 3.5mm TRS jack on one device can be plugged into a DIN-5 female MIDI jack on another.

In our scenario, we'll connect the Trellis M4's UART connection to this adapter so that we can send MIDI messages out to a synthesizer with a MIDI-IN DIN-5 female jack. Here are the connections for a Type A cable:

On a Type B adapter the tip and ring connections are reversed, so we'll wire the Trellis M4 to the adapter like this:

The outputs of the M4 are current limited, and we're using only 3.3V logic, so the wiring works fine without adding resistors. BUT if you want to be in full compliance with the MIDI electrical specification, add a 47 Ohm resistor in series to the 3V and SDA lines.

TRS Adapter

Use a small screwdriver to loosen the three screw terminals in the 3.5mm female TRS adapter. Then, insert the JST PH cable wires as shown:

  • Black to GND
  • White to R
  • Red to L

The green wire will not be connected to anything.

STEMMA Connector

Next, plug the JST PH cable into the STEMMA connector on the NeoTrellis M4. This will allow the 3V, SDA (serial data), and GND connections to be made with the TRS adapter.

MIDI Adapter

Now, plug the MIDI adapter into the TRS breakout jack. You can also plug a standard MIDI DIN-5 cable into the adapter.

Next, we'll upload the MIDI player or MIDI arpeggiator firmwares onto the NeoTrellis M4 and play the synth!

Optional Fanciness if You're Feeling Extra

Want to neaten up your cabling job a bit so you can look the part when you play live at the club? You can get some woven cable sheathing and heat shrink tubing to take it up a notch!

Cut a length of woven sheathing, bend back the unused green wire, and slip the sheathing over the wires.





Use a few pieces of heat shrink tubing to secure each end.





Plug it in and you're ready to go!

This guide was first published on Nov 20, 2018. It was last updated on Nov 20, 2018.

This page (MIDI Connections) was last updated on Nov 18, 2018.

Text editor powered by tinymce.