Skip to main content

pydefmon

test PyPI

Pure-Python reader, writer, and player for defMON C64 tracker tunes (latest V20201008 on csdb). DefmonPlayer runs a tune's own relocatable replay on a jennings 6502 and emits the per-frame SID register writes, verified byte-exact against the sidtrace sidplayfp oracle over real HVSC tunes.

Reads .sid files (PSID/RSID containers), bare .prg editor workfiles, and defMON's own pack-save export PRGs (SHIFT+P: the $1000 raw export and the $0801 executable with its BASIC stub + host boot) through the shared pysidtracker base, decoding all of them to the same $1800..$7166 structural model — including the stereo (2SID) SID#2 arranger pages and the per-tune tempo fields on the runtime-state page. Prehistoric 2008-build worktunes (raw $1700 saves with no RLE codec) are detected by load address and rejected with a specific DefmonParseError (see docs/format.md). A .prg workfile is the composer's editor form, the export PRGs and .sid the packer's canonical form — the same tune, not the same bytes — compare them with DefmonSong.diff (not a raw snapshot ==). The relocatable player is located by signature; container headers are not trusted; DefmonPlayer plays any of the three containers.

Install

pip install pydefmon

Usage

from pydefmon import DefmonSong, DefmonPlayer

# Read / edit a tune (either container auto-dispatches on magic).
song = DefmonSong.from_file("tune.sid")
print(song.pattern_events(0)[:4])
print(song.sidtab_row(0))

# Play a .sid replay: per-frame SID register writes / grid.
player = DefmonPlayer("tune.sid")           # bytes, path, or SidImage
for reg, value in player.play_frame():      # reg is a 0..24 SID register offset
    ...
grid = DefmonPlayer("tune.sid").render_grid(250)   # 250 x 25-register frames

See docs/usage.md for editing, the register-write API, and the shared pysidtracker command line (info / reglog / wav, which pydefmon plugs into), and docs/format.md for the canonical file-format and runtime-RAM reference. The HVSC oracle survey runs the player against every HVSC defMON tune.

Development

pip install -e ".[dev]"
pytest -n auto

Tests that need real defMON tunes fetch + cache them on demand (the copyright editor workfiles from the csdb release, the HVSC replays for the corpus) and skip when offline; nothing needs pre-populating.

License

GPL-3.0-or-later. See LICENSE.

Metadata

Release files for pydefmon 0.10.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 pydefmon 0.10.0
File Size Uploaded
pydefmon-0.10.0.tar.gz 71.4 kB Details

Built distribution (wheel)

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

Total release size: 116.1 kB

Release files / pydefmon-0.10.0.tar.gz

Download URL pydefmon-0.10.0.tar.gz
Size 71.4 kB
Tags Source
SHA-256 checksum
How to use checksums
778f383bfe925c688ea3df79035a5e27062fa5550bc58224c633cbcd7e04ceb8
BLAKE2b-256 checksum
How to use checksums
87cf7031f28447973d9e15ef01e75b7365e38295ba716e2309401f465c08755e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 18, 2026.

Transparency log

Release files / pydefmon-0.10.0-py3-none-any.whl

Download URL pydefmon-0.10.0-py3-none-any.whl
Size 44.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da3ab365f25dcbd72543aa2ef8371fbc428848119b52203a7237ca788ca01fe5
BLAKE2b-256 checksum
How to use checksums
6114b92a951941f895b363a9328653601c024a9accf449112d9ec196ec30ef51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 18, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

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