Guitar to MIDI: a trained algorithm, an honest dataset and a proposed contributor program

Reef can listen to a guitar and play its synth from what it hears. This post is about the part of that which is a trained algorithm, called FFT Collapse: where it comes from, what it can and cannot do, and a proposal for making it better in a way that is fair to the people who would help.

Two things first, because they matter more than the rest:

  • FFT Collapse is a local, trained algorithm, trained on my own playing, for the Guitar to MIDI project. It runs on your computer.
  • Reef Synth does not collect data on its users. No audio, no analytics, no usage statistics, no account.
Block diagram: guitar to FFT Collapse to notes to Reef voices
Guitar to MIDI inside Reef: everything happens on your machine.

What it does

There are two ways to turn a guitar into notes. The classic way is pitch tracking: find the strongest repeating period in the signal and call it a note. It works on single notes, and on a clean signal it is fast. It struggles with chords, because a chord has no single pitch.

The second way is to learn the relationship between what a guitar sounds like and what is being played. FFT Collapse reads the spectrum of the guitar as it arrives (the FFT is the standard way to compute one) and answers, for each string, whether it sounds and which fret it is on. A chord is just six answers at once. It sits next to the classic tracker as an option on the Input page, and you choose which one to use.

(The guide’s input section describes the controls. It has no audio example for Guitar to MIDI itself, because a synthetic example would say nothing useful about a real guitar.)

Where it comes from

The algorithm was trained on my own playing: one person, one set of habits. That is its biggest strength and its biggest limit, and the rest of this post is about both. We are deliberately general about how it was built: the architecture, size, training data and recipe are the project’s own work and stay private, as for any product.

Strengths

  • Chords. Reading six strings at once is the thing a classic tracker can’t do, and it is the main reason to use it.
  • Fretted detail. It answers in strings and frets, not only pitches, which gives it more to work with: the same note on two strings is different information.
  • It runs locally. No network, no latency from a server, no privacy cost. It uses a noticeable share of a processor core (roughly a tenth), so it is something you turn on for the part you need.
  • It improves with data. More examples make it better in a way a hand-written rule can’t.

Weaknesses, and what the dataset limits

A learned system is only as good as the examples it has seen. Be clear about what that means here.

  • One player. Anyone’s playing has habits: where the pick hits, how hard, which voicings, how clean the fretting is. The algorithm learns those habits along with the guitar. A player whose technique is very different may find it less reliable.
  • A limited set of instruments and setups. A guitar, a pickup, an interface, an amp and a room all color the sound. The training signals cover what was recorded, and no more. Different pickups, other tunings, 7-string guitars, basses, heavy distortion and noisy rooms are all outside what it has really seen.
  • Some chords are weaker than others. The ones the player used more are better represented. We have seen it handle common shapes well and less common voicings, such as some suspended and minor shapes, less well.
  • Articulation. Hammer-ons, slides, bends, muted strokes and ghost notes are hard, for people and for algorithms. They are weaker than plain picked notes.
  • More training is not automatically better. Newer training runs of this project did not measurably beat the earlier one on held-out playing, which is the honest way to assess it. Held-out means material the algorithm never trained on. Improvement from here probably needs different data, not more of the same.

That last point leads to the real problem: the way to make it robust across guitars is more recordings from more players and instruments. Which raises the question of how to get them.

How data is usually collected

It’s worth describing the usual practices, because they are the reason this proposal exists. These are patterns that are common in the wider industry, not an accusation against anyone in particular.

  • Taking it by default. Settings that send audio or usage to the company are often switched on, and the off switch is hard to find.
  • Broad licenses. Terms of service that grant a perpetual, worldwide, sublicensable license over what you upload, so your recording can be used for any purpose, including ones that did not exist when you agreed.
  • No payment, no credit. The people whose playing makes the product work are the least likely to share in its revenue.
  • No way back. Once data is in a training set, deleting the file does not remove its influence, and the company rarely commits to anything about that.
  • Scraping. Gathering recordings that were published for some other purpose, without asking.

Reef doesn’t do any of those. The plugin doesn’t upload, and it doesn’t phone home about how you play. If there is ever a way to contribute, it must be the opposite of all of the above.

A proposal: a contributor program

This is a proposal, not a feature, and not an offer. Nothing is open for submissions. We are describing it now so that the principles are public before any recordings are, and so that people can tell us what is wrong with it.

Diagram of the proposed contributor program
The proposed contributor flow. The contributor keeps the files and the copyright; the license is limited to Guitar to MIDI training; revenue set aside for contributors is shared.

The principles would be:

  1. You keep control of your data. You record it, you hold it, and you decide what to send. You can choose what is included.
  2. You keep the copyright. Submitting is a license, not a transfer.
  3. The license is narrow. It would allow use for training the Guitar to MIDI project, and nothing else: not other products, not resale, not general machine-learning work, not sublicensing.
  4. Contributors are partners. A defined portion of the revenue is set apart for contributors and shared among them. The method, and the percentage, need to be published before anyone submits, so that nobody is agreeing to something undefined. We are deliberately not naming a figure here, because it needs proper terms.
  5. You can withdraw. You can stop future use of your contribution at any time. Honestly, there is a limit: a model that is already trained and released can’t be un-trained. The fair commitment is that withdrawn data is excluded from the next training run, and that this is written down.
  6. It’s private by design. Only what’s needed to pay and to administer is held. Recordings are not shared with third parties.
  7. It is separate from the plugin. The synth itself would still collect nothing. A program like this would live outside it, opt-in, with its own sign-up.

What it’s for

The purpose is not to build a bigger dataset for its own sake. It is to make FFT Collapse fair, private and robust. Fair, because the people whose playing improves it share in what it earns. Private, because they keep control. Robust, because the way to make it work across many guitars is to learn from many guitars and many players, including the unusual ones.

What we don’t know yet

  • The legal form: a contract, a license, perhaps a co-operative structure. This needs a lawyer, not a blog post. Nothing here is legal advice, and nothing here is a binding offer.
  • How to calculate shares fairly when contributions differ in size and usefulness.
  • How to check the quality of submissions without taking over the data.
  • Whether it is financially realistic. A revenue share only means something if there is revenue.

What you can do now

Nothing needs doing. If it is useful to you, try FFT Collapse and the classic tracker on your own guitar and judge honestly. If the idea of contributing interests you, or if you think the terms above are wrong, we want to hear it before it exists. And if you would prefer that no such program existed, that’s a legitimate answer too, and the plugin works exactly the same either way.