Close

SynestR

MIDI Sequencer and Synesthetic Instrument Framework

SynestR is a software sequencer and instrument framework written in Processing. It is not a sketch that plays a sample when you click. It is a 16-channel MIDI performance environment: a Gervill General MIDI synthesizer, a looping 4-track / 32-step sequencer, live note recording with program-change and note-off events, and a plugin architecture for building new “synestruments” without touching the engine.

The brief was to make an audiovisual instrument whose audio and visual modalities are equally expressive — easy to learn, inexhaustible in play. The reference point was Brian Eno and Peter Chilvers’ Bloom: tap, and a circle grows while a tone evolves. SynestR takes that coupling seriously and then goes further. Every gesture writes MIDI. Every MIDI event draws. Hold duration becomes note length. Drag speed becomes velocity. A bouncing ball is a generative phrase generator. A row of stained-glass pixels is an FFT that you can play.

Create an open-ended system where the audio and visual modalities are equally expressive. Its results should be inexhaustible, deeply variable, and dependent on the performer's choices.

View Code

Engine
Java Sound API + Gervill
Voices
16 channels × 128 GM patches
Sequencer
4 tracks × 32 steps, looping
Timing
PPQ MIDI, live BPM
I/O
Soft synth, MIDI out, serial
Range
MIDI 36–84 · Ch. 9 percussion

MIDI engine

Playback is the JDK’s Gervill software synthesizer, addressed through javax.sound.midi. Each channel holds a patch index and display name; channel 9 is locked to the General MIDI percussion kit. Left/right arrows (or a right-click sweep across the 128-instrument map) send bank-select CC and a program-change, then preview middle C so you hear the new voice immediately.

Notes fire on two paths at once: Synthesizer.getChannels()[ch].noteOn for local Gervill audio, and Receiver.send(ShortMessage) for whatever MIDI device is selected — Gervill, loopMIDI, or hardware like a Novation Circuit Tracks. That dual send means a synestrument can be a soft instrument or a controller for a hardware rack without changing a line of performance code.

Visual notes are MIDI objects. Pitch maps to color across the 36–84 range. Remaining duration maps to radius and opacity, so a held note blooms like Bloom and collapses on note-off. Hovering a circle shows velocity. Panic (0) all-notes-off clears sounding voices and the draw list together.

4 × 32 sequencer

The transport is a real Java Sequencer, not a millis() loop pretending to be one. A Sequence is created at PPQ resolution 4 with four tracks padded to 32 ticks so the loop length is stable. Play sets LOOP_CONTINUOUSLY. Mouse wheel sets BPM via setTempoFactor(bpm / 120). Up/down arrows select the record track. Clicking the strip sets the write head.

Record (R) is live capture, not step-grid painting. On note-off, the engine writes three events onto the current track at the current tick: a program-change (so the loop recalls the patch you were on), a note-on with velocity, and a note-off at tick + duration. If the sequencer is running, duration is the tick delta from mouse-down — wrapping correctly if the playhead crosses the loop. If it is stopped, hold time is converted through milliseconds-per-tick and clamped to the remaining steps. The strip draws occupied steps in pitch-mapped color and a live playhead; a red LED sits on the armed track while recording. Clear (C) deletes every track and rebuilds an empty 32-step sequence.

Keyano overview: 16 MIDI channels, active piano row, and 32-step sequencer
Keyano — 16 MIDI channels on the Y axis, pitch on X, 32-step sequencer along the bottom. R records, P loops playback.

Synestrument framework

The interesting part is not the five included instruments. It is that they all subclass Synestrument. The base class owns bounds, name, getNote / getChannel mapping, and empty mouse/key hooks. A new instrument is a tab: override display() and the gestures, add it to the syns list, cycle with Q. Recording, patch changes, serial pitch-bend, and the note bloom layer stay in the engine. That is how Keyano, a bezier guitar, a circle-of-fifths wheel, a physics drone, and an image FFT can share one sequencer.

Keyano: 16-channel piano grid with C4 highlighted
Keyano Sixteen stacked channels. X is MIDI 36–84 with C highlighted gold; Y is channel. Click to play, drag for velocity from mouse speed, right-click to scrub 128 patches. Channel 9 is the GM drum kit.
BeZtar: sixteen bezier strings with blooming note circles
BeZtar Sixteen strummable bezier strings, one per MIDI channel. Pitch lives on Y; only natural notes fire. The curve is a live control point — strum across strings, hold for duration, each channel keeps its own patch.
FekCOF circle of fifths wheel with octave and channel bars
FekCOF Circle of fifths as a playable wheel: C, G, D, A, E, B, F#, Db, Ab, Eb, Bb, F. 1 toggles single notes vs. three-note chords (root, fifth, relative). Side bars set octave; the top strip selects channel. Chord tones can octave-decay and retrigger as they bloom.
BaWler generative bouncing note circles
BaWler Physics as sequencer. A bawl is a MIDI note with gravity, wall bounce, and 0.8 ground damp. Each landing retriggers; hold time sets radius. Right-click drops a circle-of-fifths chord. Mouse wheel over a bawl rides its velocity.
Pixelah: stained glass image with FFT spectrum mapped to MIDI
Pixelah A row of pixels becomes a time-domain signal. Minim FFT (Gaussian window) maps red, green, blue, or brightness into MIDI 36–84. Y selects channel; click-hold sets band skip and play direction. The spectrum is the score.
Keyano with blooming note circles over the piano grid
Bloom layer Every sounding note is a circle. Color is pitch, radius is remaining duration, fill collapses toward note-off. Audio and image are the same object in the same clock.

Serial and hardware

The sketch opens a serial port and parses live commands. BEND maps a 0–1023 sensor into pitch-bend around the MIDI center of 8192, then writes it to the active synestrument’s channel (resetting the previous channel so bends do not stick). Control-change stubs are ready for knobs. That path is how physical experiments — including my BounceHouse MicroPython / Pico work — hook into the same sequencer the mouse is using.

Keys

  • Q Cycle synestruments
  • K Jump to Keyano
  • R Arm / disarm record
  • P Play / stop loop
  • C Clear sequence
  • 0 All notes off
  • ← → Patch · step while recording
  • ↑ ↓ Sequencer track
  • Wheel BPM
  • B Pitch-bend mode
  • 1 FekCOF chord / note
  • Enter Save frame