A comprehensive suite of tools for parsing, manipulating, and visualizing Guitar Pro files in Rust.
Project Structure
This workspace is divided into several crates:
- lib (
guitarpro): The core library to read and write Guitar Pro files (GP3, GP4, GP5, GPX, GP7) and MuseScore files (MSCZ). It provides a unified data model for musical scores.
- cli (
score_tool): A command-line interface to inspect files, view metadata, and generate ASCII tablatures.
- web_server: (Experimental) A web server to search and browse music scores through an API.
- ffi (
guitarpro-ffi): A C ABI over the core library, so C, C++, Swift, Kotlin or Python ctypes can parse and convert scores. Ships libguitarpro_ffi.{so,a} and a generated guitarpro.h.
| Format |
Read |
Write |
Notes |
.gp3 / .gp4 / .gp5 |
✅ |
✅ |
High-fidelity legacy binary |
.gpx (GP6) |
✅ |
✅ |
BCFZ/BCFS container |
.gp (GP7+) |
✅ |
✅ |
ZIP container with GPIF XML |
.mscz (MuseScore 4.x) |
✅ |
✅ |
ZIP container with MSCX XML — see docs/Roadmap-mscz.md |
MusicXML (.xml / .musicxml) |
✅ |
✅ |
Score-partwise and timewise |
Features
- Multi-format support: GP3/GP4/GP5, GP6 (
.gpx), GP7+ (.gp), MuseScore (.mscz), MusicXML.
- Rich Data Model: Exhaustive representation of tracks, measures, beats, notes, and musical effects.
- ASCII Visualization: Generate text-based tablatures directly from the CLI.
- Extensible Architecture: Module-based design with traits for easy extension.
Usage
To get started with the CLI, run:
cargo run -p cli -- --input path/to/song.gp5 --tab
Inspect a MuseScore file:
cargo run -p cli -- info -i path/to/song.mscz
cargo run -p cli -- mscz list -i path/to/song.mscz
Web viewer on NixOS
The flake exports the web server as a package (nix run .#score-server)
and a NixOS module running it as a hardened systemd service:
{
inputs.guitar-io.url = "git+https://gitlab.com/slundi/guitar-io";
outputs = { nixpkgs, guitar-io, ... }: {
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
modules = [
guitar-io.nixosModules.default
{
services.guitar-io = {
enable = true;
openFirewall = true;
supplementaryGroups = [ "music" ]; # a group that can read the scores
settings = {
host = "0.0.0.0";
root = "/srv/music/scores";
};
};
}
];
};
};
}
settings becomes the score_server.toml (same keys as the CLI flags);
favorites live in /var/lib/guitar-io, the search index in
/var/cache/guitar-io, and SoundFonts dropped in
/var/lib/guitar-io/soundfonts/ are picked up. All options are in
nix/module.nix; its evaluation tests run with
nix flake check.
Roadmap
Library
CLI
Documentation
License
This project is licensed under the MIT License.
评论