Skip to main content

File map

Arduino builds every .ino in the sketch root as one program. Treat the filenames as modules even though they share a global namespace.

Sketch root​

FileResponsibility
toern.inoVersion, includes, enums, Mode/Note/Device/GlobalVars, encoder + touch input, mode switching, playback timers, setup/loop, most glue
toern_ui.inoLED matrix drawing: grid, cursor, status, BPM screen, overlays
toern_touchy.inoTOUCHY input mapping and flying cat display; reuses voice audition, pitch/effects, Fastrec, SMP and FILTER
toern_menu.inoNested menu UI (PATT / KIT / SMP / BPM / VOL / SETT / REC / MIDI / MODE / ETC), settings persistence hooks
toern_helpers.inoPattern generation helpers, sample browser lists, misc utilities
toern_sample.inoSample preview, trim, load into voices, SD I/O yielding while audio runs
toern_synths.inoPoly/mono synth voice allocation, presets, playSound / stopSound
toern_midi.inoMIDI in/out, clock master/slave, transport, pulse-clock options
toern_filter.inoApply filter/FX graph parameters; smooth mixer gain transitions
toern_filterUI.inoFilter-mode sliders on the matrix, encoder color cues
toern_parameters.inoDefaults and parameter setters (setParams, envelopes, synth presets)
toern_fileoperations.inoPattern/project save & load on SD
toern_sd_serial.inoUSB-serial SD file server (Menu → ETC → SD)
toern_leds.inoOptional external WS2812 strip ripples synced to notes

Headers​

FileResponsibility
audioinit.hFull Teensy Audio object graph + connections
notes.hPitch/frequency tables
colors.hChannel / UI color definitions
font_3x5.hTiny bitmap font for matrix text
icons.hIcon bitmaps for menu/status

src/ (custom audio and storage helpers)​

FileResponsibility
src/resamplerReader.hModified variable-rate sample playback (from teensy-variable-playback lineage)
src/effect_freeverb_dmabuf.*Freeverb variant that keeps large buffers in DMAMEM

Other trees (not the firmware sketch)​

PathRole
handbook/End-user guide (HTML); published at handbook.toern.live
PCB/toern_revH/Current KiCad board — see Hardware overview
tools/, standalone-tools/Host-side utilities — see Tools overview
devdocs/This Docusaurus site (code + hardware + tools docs) → docs.toern.live
website/Project website (local / deploy-only; gitignored)
_internal-docs/Scratch notes / plans (gitignored)

Size intuition​

toern.ino is the largest file by far (~8k+ lines). Prefer adding focused logic to an existing toern_*.ino (or a new one) rather than growing the main file further when practical.

src/pattern_transaction.h provides destination-specific pattern commit, recovery and explicit slot deletion helpers. Tests for storage and MIDI live under tests/.