How thomasj/fm1-sidj works
SiDJ is FM-1 firmware for playing C64 SID tunes and remixing them live. The main device workflow is song selection and loading, cycle-counted C64 emulation, remix processing, SID synthesis, then audio and optional external outputs. UI actions reach the audio engine through queued events; the engine owns the emulation/output work. The README also documents USB audio, ASID, MIDI clock, screen-reader support, and browser-based installation and song management. Several peripheral implementations were not sampled, so only documented or indexed relationships are shown.
Main entry points: engine.c Playback engine · ui.c Panel UI · usb.c USB and MIDI · fm1songs.js Browser install and songs
Components 24
FM-1 player
- Panel UI
firmware/src/app/ui.c - Song library
firmware/src/app/songs.c - Settings storage
firmware/src/storage.c - FM-1 application
firmware/src/app/main_fm1.c - FM-1 platform
firmware/src/app/plat_fm1.c
Tune and audio engine
- SID file parser
firmware/src/c64/sidfile.c - C64 emulator
firmware/src/c64/c64.c - Playback engine
firmware/src/app/engine.c - Live remix
firmware/src/app/remix.c - SID synthesis
sid/sid.c - SID model tables
sid/sid_tables.c - Beat detection
firmware/src/app/beat.c - FM-1 audio output
firmware/hal/fm1_audio.h
Computer and MIDI
- USB and MIDI
firmware/src/usb.c - ASID output
firmware/src/app/asid.h - Screen-reader output
firmware/src/announce.c - Browser install and songs
web/site/fm1songs.js
Firmware updates
- OTA service
firmware/src/ota.c - Update loader
firmware/loader/ldr_core.c - Flash access
firmware/hal/fm1_flash.h
Other components
- Listener / performer
- Computer
- ASID receiver
- MIDI keyboard / clock
Connections 25
- Listener / performer → Panel UI: operates
README.md - Panel UI → Playback engine: posts events
- Panel UI → Song library: selects tunes
README.md - Song library → SID file parser: loads tune data
- Playback engine → C64 emulator: runs tune
- Playback engine → SID file parser: loads tune
- Playback engine → Live remix: processes writes
- Playback engine → SID synthesis: renders chips
- Playback engine → ASID output: sends chip state
- Playback engine → Beat detection: uses detection
firmware/src/app/engine.c - SID synthesis → SID model tables: uses tables
sid/sid.c - Playback engine → FM-1 audio output: renders audio
- Playback engine → USB and MIDI: outputs audio and MIDI
- FM-1 platform → Panel UI: supplies controls
- FM-1 application → Panel UI: runs interface
- Panel UI → Settings storage: saves settings
- USB and MIDI → MIDI keyboard / clock: receives and sends
- ASID output → ASID receiver: sends remix
README.md - USB and MIDI → Computer: provides USB audio
README.md - Playback engine → Screen-reader output: announces screen
- Computer → Browser install and songs: opens site
README.md - Browser install and songs → Song library: manages songs
- Browser install and songs → OTA service: installs firmware
- OTA service → Update loader: serves update package
firmware/loader/ldr_core.c - Update loader → Flash access: writes app image
firmware/loader/ldr_core.c