Skip to main content

pygoattracker

Pure-Python reader, writer, and player for GoatTracker 2 .SNG songs, with SID register-log output and audio rendering through an emulated SID.

Consumes .sid files (PSID/RSID containers) and bare .prg images through the shared pysidtracker base: the packed GoatTracker playroutine (as produced by gt2reloc) is detected and decompiled back to a Song, including crunched/relocated images whose init is run in a 6502 emulator — container headers are not trusted.

GoatTracker V1.x packed tunes (the V1.50–V1.53 standard playroutine and the V1.25 musicroutines 11.x) are recognized by their assembled playroutine, decompiled to a Gt1Song and played by Gt1Player, a playspec of the playroutine run on the tune's memory; see docs/gt1.md. V1.x editor songs (GTS!) parse with parse_gts1 for all three layouts — the V0.9x body (no restart byte, $00-terminated wavetables), the V1.25 musicroutine body, and the V1.4b–V1.53 body with its 256-byte filtertable — round-trip with write_gts1, and relocate ports the editor's F9 relocator before playback (the V0.9x body is native-only).

TypedSong states the same song as typed operations (commands, table steps, instruments) and round-trips losslessly to the .sng and to the packed bytes; see docs/format.md.

Install

pip install pygoattracker

Reading, writing, playing, register logs, .sid decompiling (crunched/relocated images run in a 6502 emulator) and WAV rendering (pyresidfp) all come with the core install via pysidtracker.

Usage

Recover a song from a .sid file:

from pygoattracker import decompile_sid, write_sng

result = decompile_sid("tune.sid")     # path, bytes, or binary file object
song = result.song                     # the parsed Song model
write_sng(song, "tune.sng")            # a .SNG this library reads and plays

Read a GoatTracker .SNG song:

from pygoattracker import read_sng

song = read_sng("tune.sng")
print(song.name, song.author, song.copyright)

The player is a pysidtracker playspec of the packed GoatTracker 2 playroutine (specs/goattracker.play) run on the song packed as the relocator packs it; its render is validated byte-exactly against a sidplayfp oracle across GoatTracker play-routine variations (see docs/oracle-testing.md); docs/spec-coverage.md proves the playspecs equal their 6502 playroutines on every reachable branch direction.

See docs/usage.md for building songs, playback, register logs, WAV rendering, NinjaTracker 2, and the command line, docs/format.md for the format specification, data model, and .sid decompilation notes, docs/spec-hook.md for playing a decompiled tune's own image through the spec (SidFormat.spec, the in-place binder, standard notes), docs/grammar.md for the GT2 and V1.x song grammars (abstract syntax, byte encodings, playback semantics, canonical text), and docs/oracle-testing.md for the byte-exact oracle tests.

Installed, it also registers the goattracker1 and goattracker2 formats with the pysidtracker CLI (pysidtracker info|reglog|wav|grammar tune.sid, and pysidtracker equiv a.sid b.sid for GT2); see docs/usage.md.

Development

pip install -e ".[dev]"
./run_tests.sh        # black + pylint + pytest (oracle included) with coverage gate

License

Apache 2.0 — see LICENSE.

Metadata

Release files for pygoattracker 0.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygoattracker 0.10.1
File Size Uploaded Provenance Actions
pygoattracker-0.10.1.tar.gz 261.8 kB With provenance Details for pygoattracker-0.10.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygoattracker 0.10.1
File Interpreter ABI Platform Actions
pygoattracker-0.10.1-py3-none-any.whl Python 3 none any Details for pygoattracker-0.10.1-py3-none-any.whl

Total release size: 455.1 kB

Release files / pygoattracker-0.10.1.tar.gz

Download URL pygoattracker-0.10.1.tar.gz
Size 261.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0e87e18ad94223acf5c70acbd24f7ac6d8bb77433ffead816cdf35f6ab464184
BLAKE2b-256 checksum
How to use checksums
7b9b6595acc17e78de0ab94f5d36b4bad139c2d6f57d80974e5ee86df3112fd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / pygoattracker-0.10.1-py3-none-any.whl

Download URL pygoattracker-0.10.1-py3-none-any.whl
Size 193.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06d59fd323d1c69b221830143f72dbc7e80ed365b6a1f7c7333b844c3201b533
BLAKE2b-256 checksum
How to use checksums
72a2257858162b26d981fde51d836b63f3164fb61d6495b49ad7b45a9f09775f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for pygoattracker 0.10.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pygoattracker-0.10.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page