SID chip sound effects toolkit for Commodore 64 game development.
- Python SID emulation with multiple backends:
sid_emulator.py,resid_emulator.py,vice_emulator.py - JSON-based SFX patch format with dataclass/schema validation in
schema.py - Built-in SFX preset library in
presets.py - WAV preview/export pipeline (
wav_export.py) - 6502 ASM export for C64 integration (
asm_export.py) - Command-line tool (
sid_sfx/cli.py) - Pygame SFX Tweaker GUI (
tools/sfx_tweaker.py) - Native C64 audition tool (
tools/sfx_audition.py+tools/sfx_audition.asm)
pip install .Optional GUI dependencies (Pygame tools):
pip install '.[tools]'Render a built-in preset to WAV:
sid-sfx play fireRender a patch JSON to WAV with a specific backend:
sid-sfx preview patches/powerup_speed.json --emulator resid --chip 8580 -o out/powerup_speed.wavExport one or more patch JSON files to 6502 ASM:
sid-sfx export patches/xwing_blaster_filtered.json patches/tie_cannon_filtered.json -o out/sfx_data.asmExport in separate table format:
sid-sfx export patches/xwing_blaster_filtered.json -f tables -o out/sfx_tables.asmtools/sfx_tweaker.py is a real-time patch editor for rapid sound design iteration. It loads presets, lets you tweak waveform/envelope/frequency/sweep/filter/vibrato/loop parameters with sliders, and re-renders audio live via the SID renderer.
Key controls:
P: play onceSpace: toggle auto-repeatS: print/save current patch (patches/<name>.json)L/RightandLeft: cycle presetsR: randomize parametersN: create a new preset
Run:
python tools/sfx_tweaker.pyOr start on a specific preset:
python tools/sfx_tweaker.py fireEach patch is a JSON object mapping directly to SID-oriented parameters (SfxPatch in schema.py). Core fields include:
- Identity/voice:
name,voice - Oscillator:
waveform,freq_hi,freq_lo,pw_hi - Envelope:
attack,decay,sustain,release - Timing:
duration_frames - Optional modulation:
sweep_target_hi,sweep_target_lo,sweep_frames,sweep_type,vibrato_rate,vibrato_depth - Optional preview filter:
filter_mode,filter_cutoff,filter_resonance - Optional sustain behavior:
loop,loop_preview_seconds
Example:
{
"name": "fire",
"voice": 3,
"waveform": "TRIANGLE",
"freq_hi": 143,
"freq_lo": 92,
"attack": 8,
"decay": 3,
"sustain": 8,
"release": 4,
"pw_hi": 57,
"duration_frames": 15,
"sweep_target_hi": 14,
"sweep_target_lo": 33,
"sweep_frames": 13,
"sweep_type": "exponential",
"filter_mode": "lowpass",
"filter_cutoff": 47,
"filter_resonance": 5,
"vibrato_rate": 0.0,
"vibrato_depth": 0,
"loop": false,
"loop_preview_seconds": 5.0,
"description": "Triangle sweep laser pew"
}Built-in presets (sid-sfx play --list):
fireexplodehitweakpoint_hitenemy_hitmarchkraft_alarmgame_overdeathwarpportal_pingpowerupbounceblaster_boltxwing_blasterheavy_repeaterturbolasertie_cannonshield_on_v3ion_cannonpowerup_spreadpowerup_shieldcombopowerup_speed
MIT
