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 a native Gt1Player; 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 one class deriving from pysidtracker.MemPlayer; its render is validated byte-exactly against a sidplayfp oracle across GoatTracker play-routine variations (see docs/oracle-testing.md).

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, and docs/oracle-testing.md for the byte-exact oracle tests.

Development

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

License

Apache 2.0 — see LICENSE.

Metadata

Release files for pygoattracker 0.6.0

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.6.0
File Size Uploaded Provenance Actions
pygoattracker-0.6.0.tar.gz 150.1 kB With provenance Details for pygoattracker-0.6.0.tar.gz

Built distribution (wheel)

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

Total release size: 256.2 kB

Release files / pygoattracker-0.6.0.tar.gz

Download URL pygoattracker-0.6.0.tar.gz
Size 150.1 kB
Tags Source
SHA-256 checksum
How to use checksums
aec9eecc83cf6acf3688fcc1debe82a30d30670edd1504db7c36254731533160
BLAKE2b-256 checksum
How to use checksums
05d797227e0918610e5c4664c5e5441d55f8b7d19d4ed6e3979eece3fcc08ad7
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 22, 2026.

Transparency log

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

Download URL pygoattracker-0.6.0-py3-none-any.whl
Size 106.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26540d8cc2fc14ee1fd2e01be59f5988ec30261212f5c85b145a09e600c5f958
BLAKE2b-256 checksum
How to use checksums
9ddf9cd972f615d1d4ad24ca4935cfddacc797eff4ced5f3318831874fcc0a73
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 22, 2026.

Transparency log

Security for pygoattracker 0.6.0

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.6.0.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 22, 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