dart_gp_tab_reader 0.2.0
dart_gp_tab_reader: ^0.2.0 copied to clipboard
Pure-Dart, read-only reader for Guitar Pro tablature files (GP3, GP4, GP5, and GP7/GP8 .gp). Parses them into a Song > Track > Measure > Voice > Beat > Note tree.
dart_gp_tab_reader #
A pure-Dart, read-only reader for Guitar Pro tablature files — GP3, GP4,
GP5 and GP7/GP8 (.gp).
The GP3–5 binary readers are a Dart port of
PyGuitarPro by Sviatoslav Abakumov,
which is itself a port of AlphaTab /
TuxGuitar; the binary format
parsing logic mirrors PyGuitarPro closely. The GP7/GP8 .gp reader parses the
zip-packed GPIF (score.gpif) XML score into the same model tree, so callers
don't need to care which container a file came in — parseGp detects the
format from the bytes.
The GP6 (
.gpx) format is not supported: it wraps the same GPIF XML in a proprietary BCFS/BCFZ container that this package doesn't decode. Re-save such files as.gp(GP7+) or.gp5. (parseGpifis exported, so if you unpack the container yourself you can still parse the score.)
Usage #
import 'dart:io';
import 'package:dart_gp_tab_reader/dart_gp_tab_reader.dart';
void main() {
final bytes = File('song.gp5').readAsBytesSync();
final Song song = parseGp(bytes);
print('${song.title} — ${song.artist} @ ${song.tempo} bpm');
for (final track in song.tracks) {
print('Track: ${track.name} (${track.strings.length} strings)');
}
}
See example/example.dart for a runnable version.
The returned Song is a tree of Track → Measure → Voice → Beat →
Note. Durations are expressed in ticks (Duration.quarterTime == 960 per
quarter note); convert to seconds against Song.tempo if you need wall-clock
timing.
License #
Because this is a derivative of PyGuitarPro, it is distributed under the GNU LGPL-3.0 (see LICENSE). It is intentionally kept as a separate package: an application may depend on it (e.g. via a normal pub dependency) without the LGPL extending to the application's own proprietary code, as long as this package's source remains available and replaceable.
Original work © Sviatoslav Abakumov and the PyGuitarPro contributors.
Trademark notice #
"Guitar Pro" is a registered trademark of Arobas Music. This project is an independent, unofficial reader for the Guitar Pro file format and is not affiliated with, endorsed by, or sponsored by Arobas Music. The name is used only descriptively to identify the supported file format.