dart_gp_tab_reader library

A pure-Dart, read-only reader for Guitar Pro tablature files (GP3/GP4/GP5 binary, GP6 .gpx and GP7/GP8 .gp).

The GP3–5 binary readers are a port of PyGuitarPro; the GP6–8 readers parse the score.gpif XML score out of its container (zip for .gp, BCFS/BCFZ for .gpx). See parseGp for the format-detecting entry point and the models types for the song tree.

Distributed under the GNU LGPL-3.0 (see the package LICENSE).

Classes

ArtificialHarmonic
An artificial harmonic, optionally targeting a pitch and octave (GP4/5 files) or a touch-node fret distance (GP7/8 files).
Barre
A barre across several strings at a given fret.
Beat
A beat: a chord/strum of notes sharing a duration.
BeatDisplay
Beaming/layout display options for a beat.
BeatEffect
Effects applied to a whole beat (as opposed to a single note).
BeatStroke
A strum (brush) across the strings on a beat.
BendEffect
A string bend or whammy-bar effect, described by a list of points.
BendPoint
One control point of a bend/whammy curve.
Chord
A chord diagram annotation on a beat. Read faithfully (so the byte cursor stays aligned) even though the game only needs the fretted notes.
ChordExtension
Chord extension (ninth, eleventh, thirteenth). Lenient.
ChordType
Type of a chord (major, minor, …). Lenient: unknown values are preserved.
Clipboard
Clipboard fragment bounds, present when a song is a copied selection.
Color
An RGB color (the 4th, blank, byte is dropped on read).
DirectionSign
A navigation sign (Coda, Segno, …).
Duration
A note/beat duration. Tick values are derived from quarterTime.
Fingering
Left/right-hand fingering. Lenient.
GraceEffect
A grace note attached to a principal note.
GuitarString
A guitar string with its open-note MIDI value.
HarmonicEffect
Harmonic effect base — type mirrors PyGuitarPro's numeric tag.
KeySignature
Key signature, identified by (root, type) where type 0 = major, 1 = minor.
LyricLine
A single line of lyrics anchored to a measure.
Lyrics
The lyrics block of a song (up to maxLineCount lines).
Marker
A section marker shown above a measure.
Measure
A measure: holds maxVoices voices of beats. Several header properties are promoted here for convenience, matching PyGuitarPro.
MeasureHeader
Per-measure metadata shared across tracks.
MidiChannel
A MIDI channel describing playback for a track.
MixTableChange
A mix-table change event applied at a beat.
MixTableItem
A single mix-table change (value + transition duration).
NaturalHarmonic
A natural harmonic, optionally carrying the touch-node fret position.
Note
A single note on a string.
NoteEffect
All effects applicable to a single note.
NoteType
Note is normal, tied to a previous one, dead/muted, or a rest.
Padding
Page margins, in the order stored by Guitar Pro.
PageSetup
Score page layout and header/footer templates.
PinchHarmonic
A pinch (artificial) harmonic.
PitchClass
A pitch class. Only the integer constructors used by the readers are ported (note-name parsing from PyGuitarPro is omitted).
Point
A 2D integer point (e.g. page size in millimetres).
RSEEqualizer
A graphic equaliser used by the Realistic Sound Engine.
RSEInstrument
An RSE instrument/effect selection.
RSEMasterEffect
The song-level RSE master effect.
SemiHarmonic
A semi-harmonic.
Song
Top-level node of the song model.
TappedHarmonic
A tapped harmonic at an optional fret.
TimeSignature
A time signature. denominator is stored as a Duration.
Track
A track: a sequence of measures on a tuned instrument.
TrackRSE
Per-track RSE settings.
TrackSettings
Notation/diagram display options for a track.
TremoloPickingEffect
Tremolo (repeated) picking of a note.
TrillEffect
A trill between the note's fret and another fret.
Tuplet
An n:m tuplet. enters notes are played in the time of times.
Velocities
MIDI velocity presets, matching PyGuitarPro's Velocities.
Voice
A voice: an ordered list of beats within a measure.
WahEffect
A wah-wah pedal change.

Enums

Accentuation
Auto-accentuation strength used by the RSE.
BeatStatus
Whether a beat is empty, a normal beat, or a rest.
BeatStrokeDirection
Direction of a strum (brush) across the strings.
BendType
Shape of a string bend / whammy-bar event.
ChordAlteration
Alteration applied to a chord degree.
GraceEffectTransition
How a grace note transitions into its principal note.
LineBreak
Line-break behaviour for a measure in the score layout.
Octave
Octave transposition mark (ottava/quindicesima, up or down).
SlapEffect
Bass slap technique on a beat.
SlideType
Slide articulation between notes.
TripletFeel
Swing/triplet feel applied to a measure.
TupletBracket
Position of a tuplet bracket relative to its group.
VibratoKind
How hard a vibrato shakes the pitch. Guitar Pro authors it per note as Slight (the plain ~ wobble) or Wide (the exaggerated one, written as a fatter squiggle) — GP6/7/8 store the word itself, the GP3–5 binaries only have flags, so their note-level vibrato reads as slight and their beat-level (trem-bar) one as wide, which is what those flags mean.
VoiceDirection
Stem/beam direction of a voice.

Functions

parseGp(Uint8List bytes) Song
Parses a Guitar Pro (GP3/GP4/GP5 binary, GP6 .gpx, or GP7/GP8 .gp) file from its raw bytes and returns the decoded Song.
parseGp7(Uint8List bytes) Song
Parses a Guitar Pro 7/8 .gp file (a zip archive with Content/score.gpif inside) from its raw bytes into a Song.
parseGpif(Uint8List xmlBytes) Song
Parses raw score.gpif XML xmlBytes (the GPIF score shared by the GP6 .gpx and GP7/8 .gp containers) into a Song.
parseGpx(Uint8List bytes) Song
Parses a Guitar Pro 6 .gpx file from its raw bytes into a Song.

Exceptions / Errors

GpException
Raised for malformed files or unsupported versions.