You are here

Guitar To MIDI Explored

Jam Origin MIDI Guitar 2 main screen.Jam Origin MIDI Guitar 2 main screen.

So, how do you get a guitar to generate MIDI?

MIDI is an extremely well-conceived protocol for sending and receiving musical data and it can easily be controlled by a bank of switches such as the ones found under the keys of your controller keyboard. Each switch is associated with a particular key on the keyboard so there’s no ambiguity as to which key you have pressed, and when you release the key, it’s also clear to the receiving piece of circuitry that you stopped holding down that key. Adding a couple more contacts to the switch allows the time it takes to depress the key to be calculated, which in turn translates into note velocity or how hard you hit the key. Put a pressure sensor under the key and you can also generate aftertouch data. That’s all very well but how do you get a guitar to generate MIDI?

Using the frets and strings as switch contacts has been tried but it tends to be very unreliable because of fret buzz and the oxidisation of the metal frets and strings. Some manufacturers have even replaced the guitar fingerboard with button switches to create a sort of guitar-friendly keyboard instrument, but the focus of this article is to explain how the various means of getting polyphonic MIDI data from a ‘real’ guitar have evolved over the past four decades. If progress seems to have been slow, that’s because combining the world of vibrating wire strings with a protocol designed for simple switches is far from trivial. 

It is probably fair to credit Roland for the most dogged pursuit of the guitar-to-MIDI goal though other companies have also played significant roles. While their first guitar synths employed analogue circuitry to track string pitch using a divided pickup to separate the sounds from the individual strings, as soon as MIDI became mainstream, they adapted their hex pickup system to work with that too. A hex pickup is essentially six pickups in one so that each strings gets its own pickup segment. The outputs from these six segments can then be processed separately. While most MIDI guitar synths include a separate MIDI Out for driving other sound modules or recording into a DAW, there are also stand-alone guitar-to-MIDI converters such as Roland’s GI-20 for those who don’t need on-board sounds. Guitar players levelled a lot of criticism at earlier MIDI guitar systems and indeed many are still suspicious. Let’s look at the problems that have to be overcome to make this work at all and then perhaps you’ll have more sympathy for the designers.

When we play guitar, we hear a series of notes, but when a piece of circuitry looks at the signal from the pickup, it sees a complex and shifting harmonic structure, occasional string buzz and sometimes false harmonics and overtones because of the way the string has been picked. Trying to separate the notes within a chord is technically very challenging and has only recently become a practical option so Roland have stuck with their divided hex pickup approach to keep the notes physically separate. To make this work effectively the pickup has to be mounted very close to the guitar bridge and very close to the strings. Roland’s GK pickup systems are the most common way of adding hex pickup capability to a standard guitar and can be fitted to most acoustic and electric guitars other than those that have physical obstructions near the bridge that prevents mounting. The most obvious example of a problem guitar is the traditional Telecaster as its ‘ash tray’ bridge has raised sides. Of course you could buy a spare bridge plate and file away the sides where the pickup needs to go.

Roland GK-3 hex pickup.Roland GK-3 hex pickup.

By digitising and then filtering the signal from each pickup segment, it is possible to extract something closer to a clean waveform, but then its frequency has to be calculated, which in the early days meant simply measuring the time between ‘zero crossings’ in the waveform. Even if this system worked perfectly, it would take at least half a cycle of the waveform to figure out the pitch, but in practice it takes longer as the start of any guitar note is rather noisy and chaotic due to the way the pick or fingers interact with the strings. You can easily confirm this by looking at the waveform produced by a guitar once you’ve recorded it into your DAW. The time it takes to process the string waveform to extract a reliable pitch is clearly going to be longer at lower pitches, and even after a pitch has been extracted, it then has to be converted to MIDI data so there is always going to be a slight delay before an accurate pitch can be established. On early MIDI guitars, this delay was clearly ‘not slight enough’ as many players complained about the tracking delay.

And so life went on with small improvements due to increases in CPU power until Neural Net technology came along. This was the first step in machine learning, the idea being that you could ‘train’ an algorithm to recognise note pitches using less than one half cycle of the input waveform. This technology underpinned Axon’s guitar/MIDI products, which is how they were able to achieve faster tracking than earlier approaches. If you’re interested you’ll see plenty of papers on the subject if you do a Google search, but in essence the software is fed multiple examples of picked noted so that it can learn to recognise them from their attack and adapt its own algorithms accordingly. One practical outcome is that note recognition becomes faster. Similar technology is used to train self-driving car algorithms so we can expect to see a lot of progress in this area over the next few years. Roland play their technological cards very close to their corporate chest so it isn’t clear whether such techniques are employed in their latest generation of guitar-to-MIDI endeavours.

The level of the incoming note can also be tracked to provide velocity information but even that is not straight forward as the picking transient of a guitar note can vary in level enormously, even though the body of the note following it is reasonably consistent in level with other played notes.

Alongside developments by Roland and other companies in the field of MIDI guitar development, we also saw a few simpler guitar-to-MIDI pedals coming to market that work with a conventional guitar with the rigid proviso that you play only single note melody lines. Allow two or more notes to sound at once and the resulting pitch could be almost anything.

MIDI Setup

Figure 1: An analogue guitar synthesizer.Figure 1: An analogue guitar synthesizer.Let’s assume that we have a working MIDI guitar system based on a split pickup. How can we best use that MIDI data to control an external synthesizer?

If you use a Mod/Bend wheel or lever set up on a keyboard, all the notes bend together but with a guitar, it is possible for the player to bend one note while leaving others unchanged. For this to translate over MIDI, each string needs to feed its own mono voice, usually by setting up six parts of a multitimbral instrument on six consecutive MIDI channels with MIDI Mode Four selected (Omni Off, Mono). This way, whenever a new note is picked on a string, the previously sounding note on that string will be replaced by the new one, just as it would on a standard guitar. The pitch bend range of the guitar-to-MIDI unit needs to be set the same as on the receiving instrument, otherwise bending a string on the guitar will produce a different amount of bend on the synth. Many players leave the bend range set to two or three semitones, but if you’re into more excessive string bending, you can set whatever works best for you. Just make sure it is the same on both the sending and receiving devices.

Another advantage of using MIDI Mode 4 is that you can assign different sounds to different strings where using the bottom one or two strings for bass sounds is not uncommon.

If you’re more into pad sounds, you can simply leave the receiving device set to MIDI Mode 3 (Omni Off, Poly On). Now you only need one part of a synth set to a single MIDI channel. Note bending will still work if you are playing single note lines but bending individual notes within a chord or partial chord won’t work. Note that guitar notes are not rock steady in the way that keyboard notes are, so if you want to emulate a keyboard part such as piano or organ, it is best to set the guitar-to-MIDI device to Chromatic mode, which means every note sent is quantised to the nearest semitone. Of course if you try to bend notes in this mode you’ll simply get semitone trills, but when playing straightforward pad parts it is your best bet.

Soft Options: Jam Origin MIDI Guitar

For me though, one of the more exciting new directions in bringing guitars and MIDI closer together is the vastly unappreciated MIDI Guitar software from Jam Origin. Their approach is unique in that spectral processing, combined with deep machine learning, is used to separate the pitches from a standard guitar without the need to attach a special divided pickup.

No doubt it would work even better if a version were to become available for hex pickups but even as it is, MIDI Guitar delivers surprisingly low latency, follows note bending unless set to its Chromatic mode and it supports both AU and VST plug-in formats on Mac OS/Windows. I’ve been using this piece of software in the studio for the past couple of years and I like its immediacy — if you get an idea, you don’t have to find a guitar with a hex pickup and a converter box, you just plug the guitar straight into your audio interface. In Logic and Garage Band you can either use it outside the DAW (it then routes MIDI to the current active track) or you can use it as a plug-in to record MIDI in real time or to convert an existing clean guitar track to MIDI. It can also be used stand-alone as it includes a few basic MIDI instruments. 

Importantly, the guitar input needs to be clean so MIDI Guitar should be the first plug-in in the chain and don’t expect it to track correctly if you are using delay, reverb or distortion pedals with your guitar. It is also important that the guitar is tuned to concert pitch — the plug-in includes a guitar tuner to help you achieve this. There’s a gate/threshold control that needs to be set appropriately for your playing style; any string noises that fall below the threshold are ignored.

Impressive though all these improvements are in both the hardware and software worlds, the output from a guitar is still far more ambiguous than from a keyboard full of switches. That means the results are to some extent at the mercy of playing technique, so you may have to tidy up the recorded data, especially if you are not the cleanest of guitar players — and I’m not talking about personal hygiene here. It is all too easy to trigger new notes, albeit at low velocity levels, when lifting your fingers off the strings or when fretting a note before picking it. If you look at the musical notes in your DAW’s piano roll editor, you’ll probably be able to spot rogue notes right away as they are usually quite short and of low velocity. You might even be able to set up a filter to remove short, low velocity notes automatically, though doing the job manually doesn’t take long.

The Lone Arranger

Guitar players are used to hearing a note as soon as it is picked — a guitar note has a fast attack followed by a fairly consistent decay in level. I have heard players complaining that when they select a string ensemble or brass sound for example, the guitar synth ‘can’t keep up’, but what they are experiencing is not a fault — it’s simply that the instrument sound they have chosen doesn’t behave in the same way as a guitar. Some instruments have a naturally slow attack time so trying to play super-fast shred licks using a tuba sample isn’t going to give the instrument time to ‘speak’.

The secret to using a MIDI guitar is to try to think as you would if you were actually playing the instrument you’re emulating.

The secret to using a MIDI guitar is to try to think as you would if you were actually playing the instrument you’re emulating. String ensemble parts tend to be fairly slow and usually have only two or three parts, so a six string campfire chord isn’t going to sound authentic. Solo flutes are monophonic, so set the receiving synth to single voice mode to prevent give-away note overlaps. 

Focus On The Positives

Playing MIDI instruments from guitar has its challenges but it also has advantages; guitar players tend to voice chords differently from keyboard players so the end result can sound less obviously ‘keyboardy’. You can also create some unique sounds by layering the processed guitar part with the MIDI part — and don’t forget that a guitarist’s vibrato is far more controllable and expressive than a keyboard’s LFO/wheel generated vibrato. There are also musical benefits in that being able to play the sounds of other instruments will help develop your arranging skills without you having to learn to play a keyboard.

If you focus on what guitar-to-MIDI technology can do for you rather than concentrating on its limitations, you’ll find that it has a lot to offer.