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_menu.inoNested menu UI (LOOK / RECS / MIDI / VOL / 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)

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)
PCB/toern_revG/Current KiCad board — see Hardware overview
tools/, standalone-tools/Host-side utilities — see Tools overview
website/devdocs/This Docusaurus site (code + hardware + tools docs) → published at /docs/
website/docs/Built static output of the docs site (generated by npm run build:docs)
website/ (rest)Project website (mostly local / deploy-only; see This docs site)
_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.