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 frame. 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"

Native core

Wheels carry a Rust implementation of the call machine that play uses by default; the Python Player plays the same documents where the extension is absent (UNITRACKER_PLAYER_NATIVE=0 switches it off). See docs/native.md.

Use

from unitracker_player import load, play, Player

frames = play(text)               # np.uint8 array (frames, 25), to the end of an ending song
frames = play(text, ticks=3000)   # 3000 frames; 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 frame; None once the song ends
player.regs                       # the register file the last call wrote, one store per register

It plays formats 2.3 to 2.5, the grammar's formats: their sugar (prelude templates, chord names, instrument and phrase templates, groups, sections, first-use definitions) as the grammar's core expansion (unitracker_grammar.expand.core), and once bindings (pw:'v + 3'!), plain integers as once writes (pw:800), lag:k, calls, holds, global:[cut,res,route,mode,vol], the cells ctrl ad sr res route mode vol, and 2.4's program layers (layers:{ctrl:[a,b]}, b.ctrl:c7, b.run:c7) and per-voice orderlists ( - voice:[p1,p2+2|loop:1]) itself; 2.4's prelude hard restart (restart:hr(2), restart:hr(2,15,0)) plays as the restart rows it stands for. Code templates run as 6502 routines on a jennings MPU, with per-voice state from the document's state line; templates, in the 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. 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:arp(7,4)). Any definition may also stand inline at its one use (C4.{ad:9}, run:pw[{pw:5},end], play:[[C4,-*3]+2], C4 pw:asm{lda phi; sta v; rts}, C4 pw:'v + 40') and plays as its named form. A cell's repeated keys and commands apply in the order written, reset restarts a binding's phi (C4 pw:ptab(3) pw:reset), and a regs line gives the 25 registers before tick 0.

read(text) returns the document as unitracker-grammar's model (unitracker_grammar.document.Document) after its expand.expanded. 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 frame, 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. tools/corpus.py: records the documents a test suite parses, plays a directory of them and compares two such runs, to check that a change keeps what documents play.

Metadata

Release files for unitracker-player 0.30.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 unitracker-player 0.30.1
File Size Uploaded Provenance Actions
unitracker_player-0.30.1.tar.gz 104.2 kB With provenance Details for unitracker_player-0.30.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for unitracker-player 0.30.1
File Interpreter ABI Platform Actions
unitracker_player-0.30.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for unitracker_player-0.30.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
unitracker_player-0.30.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for unitracker_player-0.30.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Total release size: 797.5 kB

Release files / unitracker_player-0.30.1.tar.gz

Download URL unitracker_player-0.30.1.tar.gz
Size 104.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5bf9891bcd0aafe0e4ca1ecc84b2cf1f4fa932768e1be016cc65ec4369e0c40a
BLAKE2b-256 checksum
How to use checksums
d4aaff405d3e3058c8c5f5bdc0ead8356a8f0d3452c9eee599e7db83758e3883
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 Nov 1, 2026.

Transparency log

Release files / unitracker_player-0.30.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL unitracker_player-0.30.1-cp312-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 347.7 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5e31f71684b62100be5b52bbef2fb83aa1a332cbe4aad6faaaad85d56494100f
BLAKE2b-256 checksum
How to use checksums
3be8c08eb4a11ef5389f46d5b96b4a593c2e071a654a7ea12c321f4180503804
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 Nov 1, 2026.

Transparency log

Release files / unitracker_player-0.30.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL unitracker_player-0.30.1-cp312-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 345.6 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
80401299f1e68d650218574a494d1a5bcba96c352787aed92d5223b9ebd1edd7
BLAKE2b-256 checksum
How to use checksums
19b854fce69015b128a05c02eddfe457e0b1be12ecdd7f5cf97a32fd07e01205
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 Nov 1, 2026.

Transparency log

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

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

Select from 3 files

Attestation for unitracker_player-0.30.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 Nov 1, 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