Skip to main content

Pure-Python reader and player for Future Composer (MoN/Deenen) SID songs

Project description

pyfuturecomposer

A standalone, pure-Python reader and player for Future Composer (MoN / Deenen) C64 SID songs. It parses a Future Composer tune into a typed song model and runs the playroutine to produce byte-exact per-frame SID register output, with an optional WAV render through an emulated SID.

The player is a faithful integer transcription of Future Composer's entry_1806 6502 play routine (the tempo divider, the per-voice DEC-duration row advance, the opcode-stream SEQUENCE + PATTERN walks, and the dense per-frame modulation engine: slide-target vibrato / portamento, the $E0 glide, a 16-bit pulse-width sweep, the filter-cutoff program and the wave / arp tables). It reproduces the preframr-sidtrace register oracle of the reverse-engineering reference tune We R Da Best (tune 2) (Warren Pilbrough / Jade Tiger) byte-exact.

Read/play/register-log is pure stdlib; only WAV rendering needs the optional audio extra (pyresidfp).

pip install pyfuturecomposer          # reader/player/reglog
pip install pyfuturecomposer[audio]   # + WAV rendering via pyresidfp

Quick start

import pyfuturecomposer as fc

song = fc.read("tune.sid")            # PSID/.sid or bare .prg

# Per-frame SID register writes (the writes the playroutine emits each frame).
for writes in fc.iter_frames(song, max_frames=50 * 60):
    ...                               # writes: list[(register, value)]

# Forward-filled 25-register-per-frame snapshot grid (the oracle form).
grid = fc.render_grid(song, nframes=400)

# Register log (clock reg val triples), and WAV via an emulated SID.
fc.write_reglog(fc.iter_register_writes(song, max_frames=2500), "tune.reglog")
fc.render_wav(song, "tune.wav", seconds=30)   # needs the audio extra

Command line

pyfuturecomposer info   tune.sid
pyfuturecomposer reglog tune.sid tune.reglog --seconds 30
pyfuturecomposer wav    tune.sid tune.wav --seconds 30 --model 8580

Register-surface convention

iter_register_writes(song, max_frames=..) -> (clock, reg, val) is the shared py* register-log surface (matching pymusicassembler / pygoattracker), so the output cross-validates byte-exact against the deplayroutine generic interpreter and the preframr-sidtrace oracle.

Tests

Test tunes are HVSC copyright works and are never committed; they are fetched on demand into a gitignored cache (scripts/fetch_tunes.py), and the byte-exact player test validates against a committed frozen oracle grid when the preframr-sidtrace binary ($SIDTRACE_BIN) is unavailable.

./run_tests.sh          # black + pylint + pytest with coverage

License

Apache-2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfuturecomposer-0.1.0.tar.gz (30.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfuturecomposer-0.1.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file pyfuturecomposer-0.1.0.tar.gz.

File metadata

  • Download URL: pyfuturecomposer-0.1.0.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyfuturecomposer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b3f4c085d07536bacc5ca32b3e6ffac763cb52248f3b7169230966f93964d323
MD5 a17961227d799df33c702f2645b7036e
BLAKE2b-256 3a2921b1b90ecd5d83f0ff3e9abcbce78da579cedabf072e70bee522c8890163

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfuturecomposer-0.1.0.tar.gz:

Publisher: release.yml on anarkiwi/pyfuturecomposer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfuturecomposer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyfuturecomposer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ac24fb91d9c2a72d8b4b77801a7566749dc70d8522808bfa159e624ef0ab10f
MD5 ae46b8531fa3d270bb1153130de96754
BLAKE2b-256 e779fe0aae2203ddd18af5149dcf3d6f29f26baa864add047fa987080ac4227f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfuturecomposer-0.1.0-py3-none-any.whl:

Publisher: release.yml on anarkiwi/pyfuturecomposer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page