ken

Teensy Sequencer

Embedded Logic Under Hardware Constraints

Overview

The Teensy Sequencer began as my first venture into embedded audio development. As this was my first big embedded project, I wanted to create something that would not be overwhelming, but still capable of producing a decent and presentable result that would be fun to share.

I chose to build a sequencer because it provided an accessible way to generate complex, rhythmic sounds that "sound good" without requiring virtuoso performance skills. The project quickly became a puzzle of two halves: how to architect a stable system while squeezing a functional user interface into a very small, limited set of hardware components.

Technical Implementation

Because I was out of town with only a few components, I had to find creative workarounds for the physical interface. Instead of a professional button matrix, I used cardboard and aluminum foil to create DIY capacitive touch pads for instrument selection.

To manage six synthesis tracks with only three potentiometers, I implemented a modal software architecture. By toggling an Override Mode, the hardware controls are re-mapped in real-time; the pots stop controlling individual tracks and instead perform "master sweeps" for tempo and volume across all six voices at once.

MicrocontrollerTeensy 4.0
Audio EngineTeensy Audio Library

The project utilizes an object-oriented structure where a base Instrument Class manages common attributes like pattern data and envelope proportions. The audio architecture relies on the Teensy Audio Library as a backbone for the audio engine, and the code acts as a controller that interfaces with a static graph of audio objects to modulate parameters like frequency and filter cutoff in real-time.

Key Outcomes

01

Functional First Project

Successfully built a "sounding" instrument that produces stable, multi-track audio.

02

Hardware Workarounds

Used software logic and DIY aluminum foil sensors to bypass the need for expensive, pin-heavy hardware components.

03

Optimized Modal UI

Designed a dual-layer interface that allows for both granular track-by-track tweaking and global performance sweeps.

04

Standalone DSP Engine

Leveraged the Teensy Audio Library to run 6 concurrent synthesis engines, including FM synthesis and stereo reverb.

Challenges & Solutions

Problem Extreme Hardware Limitations

Having only three pots and three buttons made it impossible to provide a dedicated control for every instrument parameter.

Solution:

Implemented a modal 'Override' system that re-maps the existing hardware to global parameters like Master Tempo and Volume.

Problem Non-Existent Pattern Editor

I didn't have enough physical inputs or a screen to build a real-time pattern editor for users to draw their own notes.

Solution:

Accepted the limitation by hardcoding sequences directly into the C++ source code as MIDI note arrays, prioritizing high-quality audio output and interactability over complex on-device editing.

Problem Input Instability

Standard potentiometer readings were jittery, and standard digital reads for touch pads could lag the audio clock.

Solution:

Developed a SmoothPot struct using Exponential Moving Average filtering and utilized the FastTouch library to poll sensors at a 30ms interval to ensure UI stability.

Future Work