Skip to main content

UI & LEDs

The 16×16 (optionally dual-module) matrix is both display and note grid. Drawing primitives live in toern_ui.ino; optional external strip effects in toern_leds.ino.

Matrix primitives​

FunctionRole
light(x, y, color)Set a logical grid pixel
light_single(...)Address a specific module
drawBase / drawCursor / drawPages / drawStatusCompose the main sequencer view
drawIndicatorEncoder-related on-matrix cues
drawNumber / overlaysTransient values (volume, channel, load %). drawPageNrOverlay flashes the page number on the right when CRSR is CHNR and CTRL is PAGE: digits on rows 11–15, no underline. The channel overlay stays on the left.

Colors come from colors.h and mode knobcolor[] values.

FastLED constraints​

  • FASTLED_ALLOW_INTERRUPTS 0 — LED show must not nest badly with audio.
  • Prefer one show per frame from the main loop path.
  • WS2812 data pin and module count: DATA_PIN, LED_MODULES, runtime maxX.

Encoder RGB​

i2cEncoderLibV2 LEDs mirror mode colors and status (e.g. blink helpers triggerExternalOneBlink). I2C writes belong in loop(), not in the playback ISR.

External strip​

toern_leds.ino maintains an optional WS2812 strip: length/enable settings, triggerLedStripRipple(channel) on note triggers, updateLedStrip() from the main loop.

Current display contract​

PATT shows the slot number and load/save indicators. Occupied slots use green numbers; empty slots use blue. There is no USED/NEW text. showSaveSuccessAnimation draws a green checkmark; showSaveFailureAnimation draws a red cross. Both yield during animation to keep audio service running.

In note detail, the condition fraction belongs under encoder 3 and voice volume under encoder 4 in both panel layouts. The matrix is a display controlled by the encoders and touch pads, not a matrix of physical playable buttons.