Guitar-to-MIDI (or, adventures in pitch tracking with free software)

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Post Reply
Basslint
Established Member
Posts: 1511
Joined: Sun Jan 27, 2019 2:25 pm
Location: Italy
Has thanked: 382 times
Been thanked: 298 times

Guitar-to-MIDI (or, adventures in pitch tracking with free software)

Post by Basslint »

I've been playing with guitar-to-MIDI conversion for a while. I will share my humble hobbyist research here.

The most reliable and widely available implementation for pitch tracking right now is inside Aubio, which includes a number of algorithms (monophonic only - no chords!). (Rakarrack also does it, for the record.)

Right now aubio can automatically convert guitar signals to MIDI Note On messages via

Code: Select all

aubionotes -j
(it even creates all the needed JACK ports!).

This can be optimized both in terms of latency and precision (a bit of a trade-off, isn't it :lol:) by filtering the input signal and picking the right tracking algorithm.

But notes generated by aubionotes are discrete. The guitar is not a discrete instrument, you can bend notes. So, it would be better to use something different than other than aubionotes.

Thankfully, aubio provides aubiopitch, a proper pitch tracker which outputs the frequency in Hz. The problem I've found with this one is that it doesn't send any data on the MIDI out channel (I connected it to QMidiRoute to verify), when it would be enough to send this frequency as a SysEx message and let some other program do the conversion to a Note On (nearest pitch) + Pitch bend event (MIDI also has a way to do microtonality, which would be a better solution, but many synths don't support it, while pitch bend is pretty much universal. And OSC would make it even easier, but not many synth support it, sadly).

Another useful thing to do would be map the amplitude of guitar signals to MIDI velocities, to have more dynamics.

Someone wants to come in and share their experiences, or give some suggestions as to how to make this straightforward? I've thought about using Pure Data to make a program which does all but the pd-aubio packages sadly segfaults on my system.
The community of believers was of one heart and mind, and no one claimed that any of his possessions was his own, but they had everything in common. [Acts 4:32]

Please donate time (even bug reports) or money to libre software 🎁

Jam on openSUSE + GeekosDAW!
joe-b
Established Member
Posts: 19
Joined: Sun Jun 02, 2019 7:25 pm

Re: Guitar-to-MIDI (or, adventures in pitch tracking with free software)

Post by joe-b »

I've used Rakarrack for guitar-to-MIDI before. I gave it up. The latency seemed really inconsistent, so with the time I spent fixing all the notes, it was just easier to manually input them.

Pitch bend and velocity detection would be great though.
User avatar
Babarosa
Established Member
Posts: 52
Joined: Sun Feb 23, 2014 10:16 pm
Has thanked: 3 times
Been thanked: 18 times

Re: Guitar-to-MIDI (or, adventures in pitch tracking with free software)

Post by Babarosa »

The software "waon - a wave-to-notes transcriber" works fine for my needs. Get information at "http://waon.sourceforge.net/" including a demo video. You can download an executable file compiled from the latest code on my website "www.stockinger.org".

Debian 12 - MOTU M4, ESI Maya22 USB - Rosegarden, Reaper

joe-b
Established Member
Posts: 19
Joined: Sun Jun 02, 2019 7:25 pm

Re: Guitar-to-MIDI (or, adventures in pitch tracking with free software)

Post by joe-b »

WaoN is very interesting, thanks for that. Amazingly it has polyphony, pitch bend, and velocity detection. Unfortunately my preliminary tests have shown a lot of problems. In particular there are a lot of artifacts/false notes detected. I'm going to play around and see if I can get better results.

GPL as well. I'm surprised I've never seen it before, or that no one else has developed it further.
User avatar
English Guy
Established Member
Posts: 525
Joined: Wed Oct 17, 2012 7:28 pm
Location: England
Has thanked: 8 times
Been thanked: 7 times

Re: Guitar-to-MIDI (or, adventures in pitch tracking with free software)

Post by English Guy »

I will be very interested to hear how you get on.
joe-b
Established Member
Posts: 19
Joined: Sun Jun 02, 2019 7:25 pm

Re: Guitar-to-MIDI (or, adventures in pitch tracking with free software)

Post by joe-b »

Well, I've played with different parameters in the program and rolling off some of the higher frequencies on the guitar wav file (which I think are responsible for a lot of the artifacts/false notes). I cannot get decent results, much less the amazing results he gets in that video.

If any one else has any ideas, I'd like to hear them.
Post Reply