Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Temperament plugin

OxiGuitar’s sound plugins play every note at its exact textbook pitch. A real guitar never does: its notes drift a few hundredths of a semitone sharp or flat depending on the string and the fret. This plugin makes a guitar or bass track play the way a real instrument would, or the way a guitar with True Temperament frets would.

It changes only what you hear. The score, the tablature and the saved file stay exactly as written. You pick it per track, in the Track tab’s Temperament section (How to use it shows where).

The effect is small, a few cents, which is why this page spends a while on what a cent is and why any of it matters. If you just want to try it, skip to How to use it.

Notes, frequencies and cents

Every note is a frequency: the A string of a guitar vibrates 110 times a second, the A an octave up 220 times, the next 440. An octave is always a doubling. The question is how to split that doubling into the twelve notes we play.

Musicians measure small differences in cents: a hundredth of a semitone. Twelve semitones make an octave, so an octave is 1200 cents. Most people start to hear a difference somewhere around 5 cents between two notes played one after the other, and much less when they are held together, because two notes slightly out of tune with each other “beat”: the sound wobbles in volume.

Pure intervals, and why they don’t fit

When a string vibrates it doesn’t make one frequency but a whole stack of them, the harmonic series: the note itself, twice it, three times, four times, five times and so on. Two notes sound smooth together when their harmonics line up, and that happens when their frequencies are a simple ratio:

  • an octave is 2:1
  • a fifth (C to G) is 3:2
  • a fourth (C to F) is 4:3
  • a major third (C to E) is 5:4
  • a minor third (E to G) is 6:5

Intervals tuned to these exact ratios are called pure or just. Tuning that uses only pure intervals is just intonation, and it is the sweetest-sounding tuning there is, for one chord at a time.

The trouble is that the ratios don’t add up. Stack twelve pure fifths, and you should land back on the note you started from, seven octaves up. You don’t: you overshoot by about 23.5 cents, a gap called the Pythagorean comma. Pure thirds have the same problem. There is no way to give an instrument with fixed notes (a piano, or a guitar with frets) pure intervals in every key. Something has to give, and how you share out that error is called a temperament.

Equal temperament and 12-TET

Equal temperament shares the error out as evenly as possible: the octave is cut into steps that are all exactly the same size. With twelve steps it is called 12-TET (twelve-tone equal temperament) or 12-EDO, and every step is a semitone of exactly 100 cents. Each frequency is the one before it times the twelfth root of two, about 1.0595.

It exists because it makes every key the same. A song can be played in E or in F, can change key halfway through, and the guitar can play with a piano, and it all works, with nothing to retune. It is also what makes straight frets possible: one fret serves all six strings. The cost is that no interval except the octave is pure. Fifths are 2 cents narrow, which nobody notices; major thirds are about 14 cents wide, which you can hear as a slight shimmer in a long, held major chord.

The idea was worked out independently by Zhu Zaiyu in China in 1584 and by Simon Stevin in the Low Countries in 1585. It took two centuries to win: Europe’s keyboards moved to it during the late 1700s and 1800s. Today it is the standard tuning of almost all Western music, and the one every synthesizer and every MIDI sound set plays.

Why a guitar doesn’t play the notes exactly

Frets are placed for an ideal string, one with no thickness that only vibrates. Real strings aren’t ideal, and two things move a fretted note away from where the fret means it to be:

  • Stretching. To play a note you press the string down to the fret. The string now runs from the nut, down under your finger, over the fret and back up to the saddle: a slightly longer path than when it was open. A longer, stretched string is tighter, and a tighter string plays sharper.
  • Stiffness. A real string is a thin metal rod, and it resists bending. That stiffness makes it vibrate a little sharp, and more so the shorter the vibrating part is. Thick wound strings and the plain G of an electric set are the worst.

A guitar’s intonation setup (moving each saddle back a little, the screws at the bridge) fixes the 12th fret so that it is an exact octave. It can’t fix every fret at once. On a typical electric guitar the result is that the first frets play up to about 11 cents sharp on the low strings, the middle of the neck is nearly right, and the highest frets end up a few cents flat:

This chart is what the plugin’s Standard Frets mode plays. The numbers come from its model of the string, described in Architecture and strategy.

Perfect temperament

“Perfect temperament” usually means giving up on a fixed tuning altogether and playing every chord in just intonation: each interval pure, adjusted chord by chord to fit the key and the harmony. Singers, string quartets, trombones and fretless instruments do something like this by ear all the time. A guitar with frets can’t, because its frets are glued in place.

A computer isn’t stuck with frets, so OxiGuitar could one day play a score this way. It isn’t built yet: what it should do exactly (by key, by the way a note is spelled, chord by chord) is still being decided, and it is listed under what’s left out.

True Temperament and Thidell’s formula

True Temperament is a fretting system from the Swedish company of the same name. Its frets aren’t straight: each one is bent into a wiggle, so that under every string it sits exactly where that string needs it. The system was invented by Anders Thidell, who spent more than 15 years on it. His first idea used 31 curved frets per octave. In 2005 he teamed up with the guitar builder Paul Guy, who convinced him to keep the twelve notes per octave every guitarist knows.

The curved frets fix two things at once:

  1. The stretching and stiffness errors above, string by string and fret by fret. With straight frets nothing can.
  2. The temperament itself. The frets aren’t aimed at equal temperament but at Thidell Formula 1, a temperament Thidell designed for the guitar. It is a well temperament, the family of tunings Bach’s Well-Tempered Clavier belongs to: all twelve keys work, but the common ones are sweeter. Each note is nudged by at most 4 cents from equal temperament, which makes the thirds purer in the keys guitarists play most.

The open strings are tuned to match: E −2, A 0, D +2, G +4, B −1 and E −1 cents. Players tune them with a tuner that has Thidell presets; Peterson’s strobe tuners do.

The plugin’s True Temperament Frets mode plays the notes as a perfectly built True Temperament neck would: every fret exactly on its Formula 1 target.

Who plays what

True Temperament necks are played by, among others, Steve Vai, Steve Lukather, John Petrucci, Steve Morse, Mattias IA Eklundh (an advocate since 2008), Fredrik Thordendal of Meshuggah, Per Nilsson of Scar Symmetry and Plini, and, according to the company, Nuno Bettencourt recorded acoustics fitted with it on an Extreme album. One of Anders Thidell’s last jobs was converting Brian May’s Tokai Hummingbird acoustic to the system.

Equal temperament on the guitar is the norm, not a law of nature, and plenty of players went another way:

  • Renaissance and Baroque lutenists and viol players tied their frets of gut and could move them. Many of the best tuned in one of the meantone temperaments, which favour pure thirds in the common keys.
  • J. S. Bach’s Well-Tempered Clavier (1722) was written for a well temperament, not today’s equal one.
  • Harry Partch built his own instruments, two Adapted Guitars among them, for his 43-note scale in just intonation.
  • Jon Catler plays blues and rock in just intonation on refretted guitars, with his band Willie McBlind.
  • King Gizzard & the Lizard Wizard went the other way, to more equal steps: from Flying Microtonal Banana (2017) on, they refretted guitars and basses for 24-tone equal temperament, with quarter tones between the usual notes.

In short

ModeWhat you hear
OffEvery note exactly in 12-TET, as every sound plugin plays it. The default.
Standard FretsA real guitar’s small errors: sharp near the nut, flat high up. Pick nylon, steel, electric or bass, or let the track’s instrument decide.
True Temperament FretsA perfect True Temperament neck: every fret on its Thidell Formula 1 target, open strings tuned to match.

The effect is subtle. It is a matter of taste and of curiosity more than of correction.

How to use it

Pick a temperament for a track

  1. Open a song, and click any note of the guitar or bass track you want to change. The right-hand panel follows the track you are in.
  2. Choose the Track tab on the right.
  3. Scroll down to the Temperament section. It only shows for fretted tracks: guitars, basses, banjo and sitar.

  1. Open the list under the title and pick one of the three modes:

  1. Press Play. The change applies the next time the song starts playing, and it is saved with the song.

Hear a real guitar’s intonation

Pick Standard Frets. A second list, Guitar, picks which kind of instrument is modelled:

  • From the instrument, the default, follows the track’s instrument: a nylon-string guitar plays as nylon, an electric as electric, a bass as bass, anything else as steel.
  • Nylon, Steel, Electric or Bass force one, for example to hear an acoustic part as it would sound on an electric.

Fretted notes then come out a little sharp near the nut and a little flat high up the neck, as on a real, well set-up guitar (why). Open strings, natural harmonics and dead notes stay as written.

Hear True Temperament frets

Pick True Temperament Frets:

Every note moves to its Thidell Formula 1 pitch, at most 4 cents from equal temperament, and the open strings are tuned to match. Major chords in the common guitar keys (E, A, D, G, C) ring a touch smoother. Hold a chord and compare it with Off.

Go back to normal

Pick Off, the default. Every note plays exactly as written, as with any other sound plugin.

Good to know

  • The effect is a few cents. It is easiest to hear on long, held chords with a clean sound, and on two notes ringing together.
  • Bends, slides and vibrato keep their shape: the whole note is moved, curve and all.
  • A capo counts as a fret, just as on a real guitar.
  • It changes only what you hear. The score, the tablature and the saved .gp or other file are untouched; the choice is kept in the song’s .oxg file beside it.
  • It also applies to audio exports, if you have the audio export plugin.

Architecture and strategy

How it fits into OxiGuitar

The plugin is a performer: when OxiGuitar gets a song ready to play or to export, it hands the plugin each track’s notes, and the plugin gives the same notes back with their pitch moved by a whole number of cents. It never touches the score. The MIDI plugin then plays each string on its own channel with its own pitch bend, so every note of a chord gets its own correction.

  • Only fretted tracks (guitars, basses, banjo, sitar) and only notes on a string. Any other track passes through untouched.
  • A note’s fret is its pitch less its open string’s. A capo counts as a fret, since it presses the strings like a finger.
  • A note keeps the offset of the fret it starts on for its whole length, so bends, slides and vibrato keep their shape.
  • Dead notes have no pitch to move. Natural harmonics sound the open string, so they take the open string’s offset.
  • The choice is saved per track in the song’s .oxg file beside it, which OxiGuitar keeps for plugin settings. No score format has a place for it.

The realistic guitar

The model treats the string as straight segments: nut, finger, fret, saddle. It adds up the two effects from the overview, following two published papers:

  • G. U. Varieschi and C. M. Gower, Intonation and compensation of fretted string instruments, American Journal of Physics 78, 47 (2010), for the stretching and the stiffness.
  • M. B. Anderson and R. G. Beausoleil, Classical guitar intonation and compensation: the well-tempered guitar, Journal of the Acoustical Society of America 156, 683 (2024).

Each string’s saddle is then moved back until its 12th fret is an exact octave, the way a guitar tech sets one up. Whatever error is left is the guitar’s own, and that is what you hear.

The four guitars are plausible examples with real string sets and tensions from the makers’ charts (D’Addario EJ45 on nylon, EJ16 on steel, EXL110 on electric, EXL170 on bass). They are not copies of any one instrument. docs/design.md in the repository has every number, and a table of the result per string and fret.

True Temperament

The model is a neck whose frets hit Thidell Formula 1’s published targets exactly: C +2, C# −4, D +2, Eb −4, E −2, F 0, F# −4, G +4, G# −4, A 0, Bb −4, B −1 cents, with the open strings tuned E −2, A 0, D +2, G +4, B −1, E −1. The fret shapes that get a real neck there are True Temperament’s own and aren’t modelled: the plugin assumes they do their job.

Current limitations

  • One finger pressure for every note. How hard you press changes how sharp a note goes. The model uses one light touch, 0.2 mm past the fret. That number isn’t measured; it was chosen to land between the published extremes, and it is the first thing to revisit by ear.
  • Slides ignore the frets they pass. A slide keeps the offset of the fret it starts on. Each fret it crosses would really have a slightly different error, a cent or two.
  • Whole cents only. The plugin interface carries pitch in whole cents, so a note can be up to half a cent off the model. Nobody can hear that.
  • Four presets, no custom guitar. You can’t enter your own scale length, string gauges or action yet.
  • No nut compensation. Most guitars don’t have one, so the model doesn’t either. Guitars with a compensated nut (such as the Buzz Feiten system) play a little closer to equal temperament near the nut than this model does.
  • Frets above the 24th take the 24th fret’s error.
  • A bass uses the same Thidell table as a guitar. True Temperament publishes a separate bass preset, which isn’t modelled.

Left out on purpose

  • True Temperament’s equal-tempered fret set. True Temperament also makes necks aimed at plain equal temperament. In this plugin that would sound exactly like Off, since the sound plugins already play every note in equal temperament, so it isn’t offered (Mateus, 19 November 2026).
  • Perfect temperament, for now. Just intonation chord by chord is the third option in the issue that started this plugin (mateusrdp/oxiguitar#294). It waits until what it should do is decided: tuned by key, by how each note is spelled, or by each chord. It will be its own task.
  • Changing the score. Temperament is about the sound only. The plugin never edits notes, tablature or files.
  • Other kinds of instrument. Keyboards, winds and voices aren’t fretted, so the plugin leaves them alone. It is a guitar plugin.

Where you can help

  • Ears. The finger-pressure number and the four presets want checking against real guitars. A recording of a guitar with a strobe tuner reading per fret would be gold.
  • Custom setups. A small dialog for scale length, gauges and action, in place of the presets, is a well-contained job (src/strings.rs, src/section.rs, ui/temperament.slint).
  • Slides that follow the frets. Needs the note’s pitch curve to be split by fret (src/perform.rs).
  • Perfect temperament. If you know just intonation well, join the discussion in mateusrdp/oxiguitar#294 before writing code.

Every change needs its tests and a row on the Features page; the Testing page says how to run them.

Requirements and assumptions

Requirements

  • OxiGuitar 0.25 or later (plugin interface 3.0). See the OxiGuitar manual.
  • A sound plugin that plays each string on its own pitch. The MIDI plugin does this.
  • Windows, macOS or Linux.

Assumptions

  • The guitar is set up as most are, with the 12th fret an exact octave.
  • Whole cents are enough. Rounding moves a note by at most half a cent, far below what anyone hears.
  • A slide’s passing frets are left alone. Each would carry a slightly different error, a cent or two.

Installing

You need OxiGuitar first: its manual says how to get it. This page is about the Temperament plugin.

From a release

Each release on the releases page has a zip for each system (Linux, Windows and macOS; Linux and Windows for x86_64 and ARM64), a .deb, an .rpm and a Flatpak for Linux, a setup program for Windows that installs for you alone (no administrator password), a .pkg for macOS that does the same, and a SHA256SUMS file to check the downloads against. Take the file that matches your system.

Copying the file yourself

A plugin is a single file ending in .oxp. Unzip the release for your system and put temperament.oxp in your plugins folder:

SystemYour plugins folder
Linux~/.local/share/oxiguitar/plugins/
macOS~/Library/Application Support/OxiGuitar/plugins/
Windows%APPDATA%\OxiGuitar\plugins\

Start OxiGuitar again. Tools → Plugins… lists what it found. The same menu switches a plugin off, and deleting the file removes it.

On macOS, a plugin file you downloaded yourself may be refused as coming from an unverified developer. Clear the download mark and start OxiGuitar again:

xattr -d com.apple.quarantine ~/Library/Application\ Support/OxiGuitar/plugins/*.oxp

A plugin installed with the .pkg is not marked this way.

Linux package managers

The package is called oxiguitar-temperament. It lives in a signed package repository on GitHub Pages that you add once.

Debian, Ubuntu and relatives:

sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://mateusrdp.github.io/oxiguitar-packages/oxiguitar.gpg -o /etc/apt/keyrings/oxiguitar.gpg
sudo curl -fsSL https://mateusrdp.github.io/oxiguitar-packages/oxiguitar.sources -o /etc/apt/sources.list.d/oxiguitar.sources
sudo apt update
sudo apt install oxiguitar-temperament

Fedora and relatives:

sudo curl -fsSL https://mateusrdp.github.io/oxiguitar-packages/oxiguitar.repo -o /etc/yum.repos.d/oxiguitar.repo
sudo dnf install oxiguitar-temperament

Normal system updates keep the plugin current from then on.

OxiGuitar’s Flatpak is a sandbox that cannot see the system’s plugin folders, so it needs the plugin as a Flatpak extension. Flathub comes first because Flatpak takes its runtime from there:

flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists oxiguitar https://mateusrdp.github.io/oxiguitar-packages/flatpak/oxiguitar.flatpakrepo
flatpak install oxiguitar io.github.mateusrdp.OxiGuitar.Plugin.temperament

flatpak update keeps it current and flatpak remove takes it away.

Features and their tests

Everything the temperament plugin does, and the tests that check it. The test names are the ones cargo test prints. scripts/test-all.py fails when a feature here names no test, or names a test that doesn’t exist, so a new feature gets its row and its tests in the same pull request (the Testing page says how to run them).

FeatureWhat it doesTests
Off by defaultPlain equal temperament: every note as written, also for settings this version doesn’t know.perform::tests::off_changes_nothing, settings::tests::settings_read_back_and_unknowns_are_off
Standard FretsEach fretted note moved by the cents a real string plays off: sharp near the nut, the 12th fret in tune, higher action sharper.perform::tests::realistic_is_sharp_near_the_nut, intonation::tests::a_set_up_guitar_is_in_tune_at_the_octave_and_sharp_near_the_nut, intonation::tests::an_ideal_string_plays_equal_temperament, intonation::tests::higher_action_is_sharper
Four guitars, or the track’s ownNylon, steel, electric or bass strings, or “From the instrument”, which follows the track’s General MIDI program.strings::tests::the_guitar_follows_the_track_s_instrument, strings::tests::every_guitar_s_key_reads_back
True Temperament FretsEach note moved by its published offset (-4 to +4 cents), open strings tuned to match.perform::tests::formula_1_moves_each_note_by_its_table, true_temperament::tests::the_published_offsets
Bends, slides and vibrato keep their shapeA note’s whole pitch curve moves by the offset of the fret it starts at.perform::tests::formula_1_moves_each_note_by_its_table, perform::tests::realistic_keeps_curves_and_harmonics_and_counts_the_capo
Open strings, harmonics and dead notesOpen strings and natural harmonics stay exact in the realistic mode (Formula 1 gives them the open string’s offset); dead notes have no pitch to move. A capo counts as a fret.perform::tests::realistic_keeps_curves_and_harmonics_and_counts_the_capo, perform::tests::realistic_is_sharp_near_the_nut, perform::tests::formula_1_moves_each_note_by_its_table
Fretted tracks onlyGuitars, basses, banjo and sitar; any other track is left alone.perform::tests::off_changes_nothing, contract::the_host_plays_a_track_at_its_temperament
The Temperament section of the Track tabPicks the mode and the guitar; saved with the track. Drawn by ui/temperament.slint, which compiles with what the plugin sets and hears.section::tests::the_section_picks_a_mode_and_a_guitar, section::tests::the_slint_file_has_what_the_section_sets_and_hears, settings::tests::settings_read_back_and_unknowns_are_off
Through OxiGuitar’s playerThe host asks the plugin for each track’s notes as it gets the song ready to play or export.contract::the_host_plays_a_track_at_its_temperament, tests::the_manifest_is_valid_for_the_plugin
A working plugin fileThe .oxp file keeps the plugin contract, with this repository’s SDK version and with the newest release of OxiGuitar.contract::the_plugin_file_keeps_the_contract, oxiguitar_plugin_checks::the_manifest_matches_the_plugin, stage:contract (latest core)

Testing

Every test of this repository runs with one command, on your own machine, and anyone can run it. When something fails, it tells you how to report it.

Run everything

python3 scripts/test-all.py

On Windows, type python instead of python3 if that’s what you have.

You need:

  • Rust, from rustup (the version in Cargo.toml’s rust-version or newer);
  • git, and Python 3.8 or newer (nothing to install with pip);
  • on Linux, the libraries a build needs: libasound2-dev, libpipewire-0.3-dev and libclang-dev on Debian and Ubuntu (alsa-lib-devel, pipewire-devel and clang-devel on Fedora);

It runs:

  1. every Rust test of the repository (cargo test over the whole workspace), with a progress bar;
  2. the plugin against the newest release of OxiGuitar: it fetches that release’s source with git (once per release, kept in a cache folder every OxiGuitar repository on your machine shares: ~/.cache/oxiguitar-test-all, ~/Library/Caches/oxiguitar-test-all on macOS, %LOCALAPPDATA%\oxiguitar-test-all on Windows, or OXIGUITAR_TEST_CACHE), builds its oxiguitar-cli and oxiguitar-plugin-test, builds this repository’s plugin file for your system and runs the plugin contract on it;
  3. a check of the Features page: every feature names a test, and every test it names exists.

It tests the system and processor it runs on, and only those (as Rust sees them: rustc -vV’s host). Tests for other systems are left out and the summary says so; they are not failures.

What you get

A line per stage while it runs, then the result. In target/test-all/<date>-<time>/:

  • summary.md: the result, your system, what failed and why, short enough to paste into a GitHub issue;
  • test-all.log: everything that happened, every command and its output;

The script exits with 0 when everything passed, 1 when something failed, and 2 when it couldn’t start.

When something fails

  1. Update to the newest develop (git checkout develop && git pull) and run it again: it may be fixed already.
  2. Look for an issue about the same test at github.com/mateusrdp/oxiguitar-temperament/issues.
  3. Otherwise open one: call it test-all: <the first failing test>, paste the whole summary.md, and attach test-all.log (drag it onto the text box; zip it first if it’s over 25 MB). Read the log first: it has your folder names, so change anything you’d rather keep private.
  4. You can also give summary.md and test-all.log to a language model along with this repository and ask it to find the cause.

Options

  • --release: an optimised test build: slower to build, faster corpus tests.
  • --ignore-rust-version: for a Rust older than rust-version (unsupported, but handy).
  • --core DIR: test against a checkout of OxiGuitar you already have, instead of its newest release; --core-version v0.21.5 picks a release.
  • --out DIR: where the results go.

Adding a feature

A new feature comes with its tests and a row on the Features page, in the same pull request; a new corpus test uses tests/support/corpus.rs. The script fails until the row names tests that exist.

Credits

This plugin is small, and it stands on other people’s work. Thank you to everyone below: the people who wrote the code we build on, and the people who measured, published and explained what the plugin plays.

Code we use

ProjectWhat it does hereLicence
OxiGuitar’s plugin SDK (oxiguitar-plugin, and oxiguitar-host and oxiguitar-plugin-test for the tests)The plugin interface, and OxiGuitar’s own host to test the plugin againstMIT OR Apache-2.0
Rust and its standard libraryEverythingMIT OR Apache-2.0

The models themselves (src/intonation.rs, src/true_temperament.rs) are our own code, with no other library.

Research and published data

SourceWhat we took
G. U. Varieschi and C. M. Gower, Intonation and compensation of fretted string instruments, American Journal of Physics 78, 47 (2010)The model of the stretched, stiff string
M. B. Anderson and R. G. Beausoleil, Classical guitar intonation and compensation: the well-tempered guitar, Journal of the Acoustical Society of America 156, 683 (2024)A second model to check ours against, and the nylon guitar
Anders Thidell and True TemperamentThidell Formula 1’s published offsets. True Temperament and Thidell Formula 1 are theirs; this plugin only plays the targets they publish and has nothing to do with the company.
D’Addario’s string tension chartsGauges and tensions of the four guitars

Tools

ToolUse
mdBookBuilds this manual
cargo-denyChecks the licences of everything we build with

Thanks

To the late Anders Thidell, whose curved frets started all this, and to Paul Guy, who helped turn them into something every guitarist can play. To the physicists who publish how a guitar actually behaves. And to everyone who tries this plugin and tells us how it sounds to them.