Repository navigation
Tablature Editors FAQ
Written for gtrsnipe v0.2, whose mapper chose each chord's fingering greedily, as described below. Since v0.3.0 the default mapper chooses the fingerings of the whole piece together; see the note under "The 'Where Do I Play This Note?' Problem".
--optimizer greedystill gives the behavior described here.
A short while back, I announced my new transcription tool, gtrsnipe. The reception was mostly great from folks who get excited about such things (and the common question asking if gtrsnipe could support transcribing tablature from an audio file (as opposed to MIDI) lead to me actually implementing the feature), but one comment on an online forum from a user who was not too impressed with my announcement stood out to me; it perfectly captured the core challenge of any automated tablature software:
Many tablature programs can already do this. The issue... is that software doesn't inherently put notes on strings in the most logical or effective or economical way... people used to upload tabs that had the right notes but arranged in a way that is clearly unplayable (such as wanting you to fret the 11th fret and 3rd fret at the same time)... if the tab may or not be playable and needs to be double checked, it's probably easier to just do it manually in the first place.
This user is 100% right.
Getting the notes right is the easy part. The real challenge - the problem I had to solve for gtrsnipe to be useful - is playability. This post is my answer to their challenge, that playability is the problem "you need to have solved and need to address how you solved it." Here is a look under the hood at how gtrsnipe decides where to place its virtual fingers.
Let's start with a simple fact: a guitar is an ambiguous instrument. Unlike a piano where one key plays one note, a guitar offers many options. The note E4, for example, can be played as:
The open high E string
The 5th fret of the B string
The 9th fret of the G string
The 14th fret of the D string
Now, take a simple three-note chord. The number of possible ways to arrange those three notes across the fretboard explodes. This "combinatorial explosion" is why so many auto-generated tabs look like they were written for a polydactyl octopus.
gtrsnipe tackles this not with a simple set of rules, but with a multi-constraint scoring system. In simple terms, it looks at every possible fingering for a note or chord and gives it a score. The fingering with the highest score wins.
Note (v0.6.10): since v0.3.0 the winner is no longer chosen one chord at a time. Every fingering of every chord is still scored as described below, including the move from each possible fingering of the chord before it (Rule #2). The mapper then picks the sequence of fingerings with the highest total score for the whole piece, by dynamic programming (the Viterbi algorithm). A fingering that scores a little lower on its own can win when it makes the next bars easier.
So, how does it calculate that score? It thinks like a guitarist. At least, it thinks like this guitarist.
The heart of the tool is a function that scores every potential fingering based on a combination of factors, each of which you can tune yourself, so that it thinks more like you.
- First, gtrsnipe looks at the shape of the chord by itself. It measures the distance between the highest and lowest notes (fret_span; an open string counts as fret 0 unless you pass
--ignore-open). - A compact chord gets a good score.
- A wide, stretchy chord gets a heavy penalty (fret_span_penalty).
- Any fingering that requires a stretch wider than a defined limit (e.g., 4 frets) is immediately thrown out as unplayable. This directly prevents the "11th and 3rd fret" problem.
This is the most important part. gtrsnipe doesn't just look at one chord in isolation; it looks at the movement required to get there from the previous chord.
- Movement Penalty: A big jump from the 2nd fret all the way to the 12th gets a penalty. Small, efficient movements are rewarded.
- String Switch Penalty: It prefers fingerings that keep you on a similar set of strings, penalizing awkward, cross-string hops.
- Contextual Span Check: This is the real secret weapon. When you turn it on (
--diagonal-span-penalty; it is off by default), it checks the fret span not just within one chord, but between the notes of the current chord and the previous one (diagonal_span_penalty). This nips those impossible diagonal stretches in the bud.
A good guitarist uses the instrument's resonance. gtrsnipe tries to do the same.
- Let-Ring Bonus: If a fingering leaves the string of a note from the previous chord alone, so that note can keep ringing out, it gets a bonus (let_ring_bonus; 0, meaning off, by default). Open and fretted strings count alike. This is crucial for styles like classical or acoustic folk.
- Open String Preference: The algorithm can be told (
--prefer-open) to prefer using an open string over a fretted note of the same pitch (like open B vs. G-string, 4th fret).
Finally, the algorithm considers where on the neck it's playing.
- It gives a small bonus for playing in a comfortable, defined "sweet spot" (e.g., frets 0-12).
- It applies a penalty for playing very high up the neck, especially on the thickest strings, which can sound muddy.
The best part is that this "brain" is not a black box. Every single one of these penalties and bonuses is a parameter you can adjust from the command line. Don't like how --prefer-open is prioritizing open strings? Turn down the fretted-open-penalty. Want to encourage it to find more ways to let notes ring out? Crank up the let-ring-bonus.
No automated tool will ever be perfect, and they will never replace the intuition of an experienced musician. But the goal of gtrsnipe isn't to be perfect. The goal is to solve the fundamental playability problem by building a system that evaluates trade-offs in the same way a human player does.
So, to the forum user (theogonia777) who laid down the challenge: thank you. You were right to be skeptical, and you pointed directly to the problem that I was most interested in solving. I hope this gives you - and everyone else - a clearer picture of how gtrsnipe works to create tabs that are meant for human hands.
Guttersnipe. From audio to ascii. Tablature.