Skip to content

Latest commit

 

History

31 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pydefmon

test PyPI

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.

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.

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.

About

python reader and writer for defMON songs

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages