Device editors: grouped, colour-coded cards with knobs, switches, tabs and live drawings (0.35.0)

Instruments and effects without a bespoke editor are laid out by DeviceLayouts
as titled cards per function (source, filter, envelope, modulation, output),
with knobs, segmented switches for short choices, tabs for the larger devices,
envelope / filter / LFO drawings, unit-aware values and a fader-bank graphic EQ.
Replaces the two-column slider grid and the fixed-height swipe pager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Reactorcoremeltdown
2026-11-13 12:31:46 +01:00
co-authored by Claude Opus 5.5
parent e38e2a2707
commit 2d285592e2
14 changed files with 695 additions and 216 deletions
+35 -5
View File
@@ -225,17 +225,17 @@ cc.tiredsysadmin.android.sizzle
│ └── AudioEngine.kt Oboe/AudioTrack + sample-accurate sequencer + voice/FX mixing
│
├── frasil/ MPL-2.0 (not GPL): the Morph Pad, ported from FRASIL (see §5.7)
│ ├── FrasilDefs.kt Its settings, editor pages, engine-unit mapping, the 36 drone presets
│ ├── FrasilDefs.kt Its settings, engine-unit mapping, the 36 drone presets
│ ├── FrasilPatch.kt Parsed slot snapshot (+ morph target); FrasilClock (the shared TIDE time)
│ └── FrasilVoice.kt One pad note: choir + partials + breath, drift, tide, warmth
│
├── wavetable/ The Wavetable synth (Sizzle's own, GPL; see §5.9)
│ ├── WaveTables.kt Band-limited tables: FFT, one mip level per octave, 12 generated tables, WAV import
│ ├── WaveDefs.kt Its settings, editor pages, 12 factory presets
│ ├── WaveDefs.kt Its settings, 12 factory presets
│ └── WaveVoice.kt WavePatch + one note: 2 table oscillators, bend, unison, sub, SVF, 2 envelopes, LFO
│
├── echofield/ MIT: the Grain Cloud, ported from ECHOFIELD (see §5.8)
│ ├── EchofieldDefs.kt Its settings, editor pages, 14 factory presets, the source list
│ ├── EchofieldDefs.kt Its settings, 14 factory presets, the source list
│ └── GrainCloud.kt GrainPatch + one channel's cloud: modes, scheduler, grains, gate, auto-level
│
├── cpp/native_audio.cpp Low-latency Oboe stream; RT callback pulls audio via JNI
@@ -323,6 +323,32 @@ enum entry that lists its `ParamSpec`s. A `ToolboxSlot` stores the chosen type +
a `name -> value` string map. The parameter editor UI and the preset text format
are both **generated** from that list. See §6 to add a new device.
### 5.4.0 The generic device editor: cards, tones, tabs (0.35.0)
Every device without a bespoke editor is drawn by `DevicePanels`
(`ui/toolbox/Panels.kt`) from a layout in `DeviceLayouts.pagesFor(type)`: a list of
`Page`s (tabs, shown only when there are several), each a list of `Panel`s (cards).
A panel names its parameter keys, a `Tone` (SOURCE / FILTER / ENV / MOD / OUT, which
picks the card and knob colour), an optional `Viz` (envelope, filter response or
LFO wave, read live from the slot) and optional short-label overrides. Inside a
card, choices come first (a segmented switch when the choices are short, else a
dropdown), then knobs, up to six to a row. A panel with `faders` draws its keys
as vertical bipolar faders instead (the graphic EQ).
Why: the old editor was two columns of horizontal sliders, hard to scan and easy
to scroll past; grouping by function with a picture per group is how hardware
synth pages read. Why tabs and not the old swipe pager: the pager had a fixed
height, which clipped long sections, and swiping fought the knobs' vertical
drags; tabs let each page take its natural height inside the editor's scroll.
Labels and values are derived, not written per device: `shortLabel` strips a
section prefix and unit from `ParamSpec.label` ("Osc1 Level" → "Level", "LFO >
Pitch" → "→ Pitch"), and `formatParam` picks the unit (time keys in ms / s, "(dB)"
labels in dB, 0..1 as %, TimeDivision indices by name, plus a small key → unit
table). `DeviceLayoutsTest` checks that every parameter of every laid-out device
is on exactly one card and that knob labels stay short. A device missing from
`DeviceLayouts` falls back to one card with all its parameters.
### 5.4.1 Opening a device's settings from another tab
The Toolbox owns its editor state (`editing` in `ToolboxScreen`). Other screens ask
@@ -598,8 +624,12 @@ of real time on a desktop JVM.
- **MIDI effect** (arp/transpose/LFO-style): hook into the sequencer instead
of the signal path (see `advanceArps` / `applyLfos` in `AudioEngine`).
The Toolbox picker, parameter editor, and preset save/load all work automatically
from the `ParamSpec` list. A device with many parameters can ship a bespoke
editor (see `ui/toolbox/DelayEditor.kt`, `SamplerEditor.kt`).
from the `ParamSpec` list (the editor then shows one card with every parameter).
3. Group its controls: add a case to `DeviceLayouts.pagesFor` (cards, tones,
drawings; see §5.4.0) and add the type to nothing else — `DeviceLayoutsTest`
fails if a parameter is missing or listed twice. A device that needs a custom
gesture can ship a bespoke editor instead (see `ui/toolbox/DelayEditor.kt`,
`SamplerEditor.kt`) and join the test's `bespoke` set.
### Add a new input gesture/control
1. Add a case to `InputAction`.