TuxGuitar plugin
This plugin lets OxiGuitar open songs made in TuxGuitar 2, and save songs TuxGuitar 2 opens. If you have been writing tabs in TuxGuitar, you can bring them over, or go back and forth between the two programs.
It reads and writes .tg files made by TuxGuitar 2. It only handles files. It makes no sound.
What TuxGuitar is
TuxGuitar is a free, open-source tablature editor and player, written in Java, that has been around for many years. For many Linux users it was the tab editor, and it still reads Guitar Pro files and plays songs with a General MIDI synthesiser. It was started by Julian Casadesus and is maintained today by helge17 and contributors.
TuxGuitar has its own file format, .tg, and it changed shape over the years:
- TuxGuitar 0.7 to 1.5 wrote a compact binary format.
- TuxGuitar 2 writes a ZIP archive holding two files:
version.txtwith the format’s version, andcontent.xml, the song itself in XML.
This plugin reads and writes the TuxGuitar 2 form. An older file opens fine in TuxGuitar 2, which can save it in the new form; OxiGuitar can then read the result.
What comes across
Tracks, tunings, repeats and alternate endings, lyrics, chord diagrams, both of TuxGuitar’s voices and the note effects all come along. What OxiGuitar has no place for, such as stem directions, is listed in the import log. When saving, OxiGuitar tells you first what a TuxGuitar file can’t hold, such as voices past the second, slurs, hairpins, segno and coda signs, and fingerings.
How to use it
Check it is installed
Tools → Plugins… lists every plugin OxiGuitar found, with its version, and lets you switch any of them off:
Open and save
- Open: File → Open… and pick a
.tgfile, or double-click one if your system links the file type to OxiGuitar. OxiGuitar looks inside the file to decide which plugin reads it; the extension doesn’t matter. - Save: File → Save As… and pick TuxGuitar (
.tg) as the format. If the format can’t hold everything in your score, OxiGuitar says what would be lost before it saves, and you can keep the rest in the.oxgfile beside it. - The import log: anything the TuxGuitar plugin couldn’t bring across is listed in the footer at the bottom of the window when the file opens.
What you can do with it
- Open a TuxGuitar song. Tracks, tunings, repeats, endings, lyrics, chord diagrams, both voices and the note effects all come along. What OxiGuitar has no place for is listed in the import log.
- Move a song from OxiGuitar to TuxGuitar 2 and back.
- Keep working with a collection you started in TuxGuitar.
The older binary .tg format of TuxGuitar 0.7 to 1.5 is not read. Open such a file in TuxGuitar 2, save it there, and OxiGuitar can read the result. TuxGuitar 1.x can’t open what this plugin writes.
OxiGuitar tells you before saving what a TuxGuitar file can’t hold, such as voices past the second, slurs, hairpins, segno and coda signs, and fingerings.
Architecture and strategy
No Rust library reads TuxGuitar files, so the format code is our own, a port of TuxGuitar’s Java code (LGPL-2.1) onto the roxmltree, quick-xml and zip libraries. A TuxGuitar 2 file is a ZIP archive with a content.xml inside, and the plugin reads and writes that.
The strategy is to match TuxGuitar’s own meaning for each value: its unit of time, velocities, harmonics, bends in quarter tones, and the capo. Tests read TuxGuitar’s own test files and compare them to what TuxGuitar’s tests say they hold. What we write is checked against TuxGuitar’s schema.
The plugin recognises a TuxGuitar 2 file by the ZIP archive holding version.txt, not by the extension.
Current limitations
- TuxGuitar 2 files only. The binary
.tgof TuxGuitar 0.7 to 1.5 isn’t read: open it in TuxGuitar 2 and save it there first. - TuxGuitar 1.x can’t open what we write. Some Linux distributions still ship TuxGuitar 1.6; its users need TuxGuitar 2.
- Two voices. TuxGuitar has two voices a track; OxiGuitar has four. Voices three and four are lost when saving, and OxiGuitar says so first.
- Stem directions and a few layout details are named in the import log and dropped.
Left out on purpose
- The old binary format. TuxGuitar is free, and TuxGuitar 2 converts every older file, so reading the old form would be a lot of code for files anyone can convert in a minute (Mateus, 9 November 2026).
- Guessing from the extension. A
.tgfile is recognised by the ZIP archive holdingversion.txt.
Where you can help
- Files from real TuxGuitar 2 users to test with, especially with unusual tunings, many tracks or lots of effects. Never attach files you aren’t allowed to share.
- Checking what we write in TuxGuitar 2, on your system, and telling us what looks wrong.
- Following TuxGuitar’s changes: when its format moves on, the port here needs to follow (
src/,docs/design.md).
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 (the plugin asks for interface 3.0). See the OxiGuitar manual.
- Windows, macOS or Linux.
- To hear a song you also need a plugin that plays scores and an audio output plugin.
Assumptions
- Your files come from TuxGuitar 2. Version 1 files need a trip through TuxGuitar 2 first.
- Anyone who opens what you save uses TuxGuitar 2.0 or later.
Installing
You need OxiGuitar first: its manual says how to get it. This page is about the TuxGuitar 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 tuxguitar.oxp in your plugins folder:
| System | Your 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-tuxguitar. 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-tuxguitar
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-tuxguitar
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.tuxguitar
flatpak update keeps it current and flatpak remove takes it away.
Features and their tests
Everything the TuxGuitar plugin does, and the tests that check it. The test names are the ones cargo test prints; a stage: is a step of scripts/test-all.py. The script 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, on your own files too).
Many of the tests use TuxGuitar’s own test files (fixtures/tuxguitar/, LGPL-2.1, with their notice).
| Feature | What it does | Tests |
|---|---|---|
| Recognises TuxGuitar 2 files | A ZIP holding version.txt and content.xml; major 2 is read, a newer minor with a note; other versions, the old binary .tg and files TuxGuitar itself refuses are refused. | contract::its_signature_recognises_tuxguitar_2_files_only, corpus::tuxguitar_files_are_recognised_by_their_contents, container::tests::versions, tuxguitar_files::a_newer_minor_version_reads_with_a_note, tuxguitar_files::the_files_tuxguitar_refuses_are_refused |
| Reads songs as TuxGuitar means them | The song’s texts, channels as instruments and mix, measure headers (time, tempo, repeats, alternatives, markers, line breaks), tracks with strings, capo and lyrics, both voices, notes and their effects; what TuxGuitar’s own tests assert holds. | tuxguitar_files::test_20_reads_as_tuxguitar_says, tuxguitar_files::reference_20_reads_as_tuxguitar_says, tuxguitar_files::every_2x_file_reads, tg::tests::the_unit_of_time_is_tuxguitars, tg::tests::velocities_and_dynamics, time::tests::fills_lengths, spell::tests::the_other_names |
| Writes TuxGuitar 2 files | What it reads is written and reads back exactly; what it writes validates against TuxGuitar’s schema (where xmllint is installed). | read_write::tuxguitars_files_round_trip, read_write::our_fixture_round_trips, read_write::what_is_written_validates_against_tuxguitars_schema, container::tests::an_archive_opens_again |
| Names what it can’t write | Voices past the second, slurs, hairpins, segno and coda, fingerings and the rest: each kind of loss once, counted, before saving. | log::tests::one_entry_per_kind_counted |
| Your TuxGuitar files | Every TuxGuitar 2 file of the corpus reads and round-trips: exactly where no losses are named, stable from the second trip otherwise. | corpus::every_corpus_tuxguitar_file_round_trips |
| Through the newest OxiGuitar | Every corpus file OxiGuitar opens (TuxGuitar by this plugin, Guitar Pro by the released Guitar Pro plugins) is written as .tg three times and read back by this plugin, settling after the first trip. | stage:corpus through the core |
| A working plugin file | The .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 --corpus /path/to/your/files
On Windows, type python instead of python3 if that’s what you have.
You need:
- Rust, from rustup (the version in
Cargo.toml’srust-versionor 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-devandlibclang-devon Debian and Ubuntu (alsa-lib-devel,pipewire-develandclang-develon Fedora);
It runs:
- every Rust test of the repository (
cargo testover the whole workspace), with a progress bar; - 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-allon macOS,%LOCALAPPDATA%\oxiguitar-test-allon Windows, orOXIGUITAR_TEST_CACHE), builds itsoxiguitar-cliandoxiguitar-plugin-test, builds this repository’s plugin file for your system and runs the plugin contract on it; - every corpus file the plugin recognises, through that release’s
oxiguitar-cli: recognised, read, written as.tgand read back, a second round trip changing nothing; - 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.
Your corpus
The corpus is any folder of files you have (searched recursively, hidden files left out): give it with --corpus DIR, or set OXIGUITAR_CORPUS=DIR. Each corpus test takes the files it understands and skips the rest, and only checks what must hold for every file (it opens, nothing panics, a round trip is stable), so your corpus doesn’t have to be ours to pass. Files are never uploaded, and never belong in the repository.
cargo test on its own uses OXIGUITAR_CORPUS too, or the repository’s ignored corpus/files/ folder, and quietly checks nothing when neither is there (that’s how CI runs). --no-corpus runs the script without one.
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, and your corpus’s file names, sizes and SHA-256 sums;corpus-*.json: what each corpus test made of each file.
The script exits with 0 when everything passed, 1 when something failed, and 2 when it couldn’t start.
When something fails
- Update to the newest
develop(git checkout develop && git pull) and run it again: it may be fixed already. - Look for an issue about the same test at github.com/mateusrdp/oxiguitar-tuxguitar/issues.
- Otherwise open one: call it
test-all: <the first failing test>, paste the wholesummary.md, and attachtest-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 and your corpus’s file names, so change anything you’d rather keep private. - Don’t attach corpus files unless they’re yours to share. The summary lists each failing file’s SHA-256, which is often enough for us to find the same file. If a failing file is yours, attaching it helps a lot.
- You can also give
summary.mdandtest-all.logto 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 thanrust-version(unsupported, but handy).--core DIR: test against a checkout of OxiGuitar you already have, instead of its newest release;--core-version v0.21.5picks 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
Thank you to the people whose work this plugin is built on, and above all to the TuxGuitar project.
Code we use
| Project | Authors | What it does here | Licence |
|---|---|---|---|
OxiGuitar’s plugin SDK (oxiguitar-plugin, oxiguitar-model, and oxiguitar-plugin-test for the tests) | Mateus Rocha de Paula and the OxiGuitar contributors | The plugin interface and the score model | MIT OR Apache-2.0 for the interface and SDK; GPL-3.0-or-later for the model |
| roxmltree | Yevhenii Reizner and contributors | Reading content.xml | MIT OR Apache-2.0 |
| quick-xml | Johann Tuffe, Mingun and contributors | Writing content.xml | MIT |
| zip | Mathijs van de Nes, Marli Frost, Ryan Levick, Chris Hennick and contributors | The .tg archive | MIT |
| zlib-rs | The Trifecta Tech Foundation | Deflate compression, in pure Rust, under zip | Zlib |
| serde_json | David Tolnay, Erick Tryzelaar and contributors | Tests only | MIT OR Apache-2.0 |
| Rust and its standard library | The Rust Project | Everything else | MIT OR Apache-2.0 |
Ported from
| Project | Authors | What we took | Licence |
|---|---|---|---|
| TuxGuitar | Julian Casadesus, helge17 and contributors | The .tg reader and writer, ported from its Java (TGSongReaderImpl, TGSongWriterImpl and friends), its test files to check against, and its schema to check what we write | LGPL-2.1 |
Each ported file says so at its top, with TuxGuitar’s copyright line.
Tools
| Tool | Use |
|---|---|
| cargo-fuzz and libfuzzer-sys | Fuzzing the reader and the writer (fuzz/) |
| mdBook | Builds this manual |
| cargo-deny | Checks the licences of everything we build with |
Thanks
To Julian Casadesus, who started TuxGuitar, and to helge17 and everyone who keeps it going: for a free tab editor that has served guitarists for years, and for code clear enough to port.