Skip to main content

unitracker-player

The generic player of canonical unitracker documents, and their builder into standalone PSID .sid files. It reads a document with the grammar of unitracker-grammar and plays it to the state of the 25 SID registers ($D400-$D418) at the end of each tick. It knows only the document: its instruments, programs, expressions, phrases and timeline, and the note table F(k) at its clock.

Install

pip install "unitracker-player @ git+https://github.com/anarkiwi/unitracker-player"

Use

from unitracker_player import load, play, Player

frames = play(text)               # np.uint8 array (ticks, 25), to the end of an ending song
frames = play(text, ticks=3000)   # a looping song needs ticks
song = load(text)                 # parse and compile once; play(song, ...) reuses it
player = Player(song)
regs = player.step()              # the 25 registers after one tick; None once the song ends
player.regs                       # the register file the last tick wrote, one store per register

Format 1.23's code templates run as 6502 routines on a jennings MPU, with per-voice state from the document's state line; its templates, in a top-level mod section keyed by signatures (vib(c, s): |), are bound by calls (wob.freq: vib(3,40)), and code reads the note table as F.lo / F.hi. Any definition may also stand inline at its one use (C4.{ad: 9}, run: pw[{pw: 5}, end], play: [[C4, -*3]+2], !pw:asm{lda phi; sta v; rts}, !pw:'v + 40') and plays as its named form. A program record may be a template keyed by its signature (arp(a, b): [{ctrl: 65, note: +a}, {wait: a, note: -b}, {loop: 0}]), which a call binds wherever a program's name stands (ctrl: arp(7,4), restart: hr(2,9,220), run: ctrl:arp(7,4)) and plays as its program with each parameter its argument. In 1.23 the restart, ins, ctrl, pw and filter sections are top-level, after mod:; a row's def: keeps its phrases.

read(text) returns the document as plain dataclasses. A text outside the grammar raises unitracker_grammar.CanonicalError; a document the player refuses raises PlayError.

unitracker-play song.yaml --ticks 3000 --out frames.npz   # array "frames"
unitracker-play song.yaml --out frames.csv                # one row per tick, d400..d418
unitracker-play song.yaml                                 # CSV to stdout
unitracker-sid song.yaml                         # song.sid
unitracker-sid song.yaml --out x.sid --ticks 3000 --load 0x2000

unitracker-sid renders the song here, proves where a looping song repeats, and assembles a 6502 playroutine (llvm-mos, locally or in the docker-mos-llvm-sdk image) whose raster IRQ plays the same registers tick for tick.

Docs

docs/semantics.md: the meaning of every construct of the grammar as played. docs/sid.md: how a document becomes a .sid, and the tests that check it.

Metadata

Release files for unitracker-player 0.17.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 unitracker-player 0.17.0
File Size Uploaded Provenance
unitracker_player-0.17.0.tar.gz 80.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for unitracker-player 0.17.0
File Interpreter ABI Platform
unitracker_player-0.17.0-py3-none-any.whl Python 3 none any Details

Total release size: 136.8 kB

Release files / unitracker_player-0.17.0.tar.gz

Download URL unitracker_player-0.17.0.tar.gz
Size 80.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6e18c4258132d0ed5bb28f7f46b59311dddcdfb953ef979cb61c0c17024d1432
BLAKE2b-256 checksum
How to use checksums
73357f24b0752d2d454ca4b7813831e20b4b6f6fda009a8aa0104f5a49a9d682
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 24, 2026.

Transparency log

Release files / unitracker_player-0.17.0-py3-none-any.whl

Download URL unitracker_player-0.17.0-py3-none-any.whl
Size 56.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1e3fff7e075c76052a7f251c3eec247839089811ac0d01b2ed31777b40bcd49a
BLAKE2b-256 checksum
How to use checksums
d9e617a2ee10bb3558ff5276bff1264396f36cf68cad8e4a1703790f16769ed4
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 24, 2026.

Transparency log

Security for unitracker-player 0.17.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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for unitracker_player-0.17.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 24, 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