$ show eh2k/squares-and-circles
This repository provides an alternate firmware for the Ornament & Crime (O_C) Eurorack module, running on a Teensy 4.0 microcontroller. It implements a modular audio processing platform where individual 'engines' (synthesizers, drum machines, effects, sequencers, CV generators, and utilities) are compiled as separate .bin files and dynamically loaded via the udynlink linker. The firmware features a 128x64 OLED UI, two encoders/buttons, MIDI I/O, CV/gate handling, and a modulation routing system. The codebase is a hybrid of custom engine code and extensively vendored third‑party DSP libraries from Mutable Instruments (plaits, rings, marbles, peaks, streams, braids), open303 (TB‑303 emulation), MSFA (DX7 FM synthesis), SAM (text‑to‑speech), soundpipe, Faust‑generated models, and others. The architecture is monolithic with a plugin‑style engine API (setup/process/draw), and the build system uses a custom shell script and Python tools. While the API is explicitly marked as unstable and the code contains some hacks (e.g., #define private public), the DSP components are of high craftsmanship and many are reusable in other audio projects. The project is actively maintained by a single developer and has a small but engaged community.
The LLM identified 5 files worth highlighting for reuse:
Provides reusable implementations of SVF (state‑variable filter), OnePole, NaiveSvf, ModifiedSvf, and CrossoverSvf with multiple frequency approximation modes (EXACT, ACCURATE, FAST, DIRTY). The code is well‑structured, templated, and can be extracted for any audio DSP project requiring analog‑style filters.
A template‑based delay line with linear/cubic interpolation and fractional delay support. Used extensively across reverb, chorus, and echo effects. Self‑contained and easily portable to other embedded or desktop audio applications.
Hand‑optimized ARM Cortex‑M assembly inline functions for saturating addition, subtraction, multiply‑accumulate, and packed 16‑bit operations. Demonstrates low‑level DSP optimization skill and is reusable in any ARM‑based audio project requiring fast, safe arithmetic.
A template‑based reverb/delay engine with polyphase interpolation and LFO modulation. Used by diffuser, chorus, ensemble, and pitch shifter effects across multiple Mutable Instruments modules. The pattern is self‑contained and can be adapted for custom reverb or delay implementations.
A complete implementation of the Software Automatic Mouth (SAM) text‑to‑speech engine, including phoneme parsing, rule‑based reciter, and audio rendering. The code is standalone (no external dependencies) and can be integrated into any embedded or desktop project requiring speech synthesis.