Pure-Python reader, writer, and player for
defMON C64 tracker tunes. 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) and bare .prg editor workfiles
through the shared pysidtracker
base, reconstructing the same runtime image either way — the relocatable player
is located by signature and container headers are not trusted. The player runs
the replay embedded in a .sid.
pip install pydefmonfrom 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 framesSee 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.
pip install -e ".[dev]"
pytest -n autoTests 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.
GPL-3.0-or-later. See LICENSE.