Commit Graph
70 Commits
Author SHA1 Message Date
ReactorcoremeltdownandClaude Opus 5.5 3088912264 Mix: long-press an instrument or FX slot to open its settings (0.33.0)
The mixer's INSTRUMENT and FX dropdowns take a long-press (with a haptic
tick) that opens that toolbox slot's editor via a view-model request; the
Toolbox consumes it and returns to the Mix tab on CLOSE or Back. A tap
still opens the slot menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:55:50 +01:00
ReactorcoremeltdownandClaude Opus 5.5 c8d760ed17 Wavetable instrument: two-oscillator band-limited wavetable synth (0.32.0)
Written for Sizzle (the hub's candidates are GPL-3.0-only, so nothing was
copied): tables kept as spectra and rendered per octave by inverse FFT with
a taper, level picked per control block so high notes don't alias; twelve
generated tables plus Serum / WaveEdit WAV import (clm chunk, frame-size
guessing, rebuilt from the kept WAV after a restart); two oscillators with
position, phase bend and up to 4-voice unison, sub, noise, drive, SVF,
amp and mod envelopes, tempo-synced LFO. 12 factory presets. Played inside
SynthVoice like the Morph Pad.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:30:09 +01:00
ReactorcoremeltdownandClaude Opus 5.5 aa023d1f01 Grain Cloud instrument: ECHOFIELD's granular engine ported to Kotlin (0.31.0)
A granular drone machine from ECHOFIELD FM-1 (Philip Bos, MIT): six modes
(Cloud, Dust, Tape, Bloom, Pulse, Drift), up to 32 grains, held notes pitch
the grains, freeze, auto-level. One shared cloud per mixer channel (plus one
for editor audition) with note ownership, so sequencer releases never cut a
held MIDI note. Ten built-in sources synthesised at startup (GrainSources,
GPL), or a loaded/recorded sample kept across restarts. 14 factory presets.
The echofield/ package stays MIT, LICENSES/MIT.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:18:04 +01:00
ReactorcoremeltdownandClaude Opus 5.5 2d59b0429d Morph Pad instrument: FRASIL's drone voice ported to Kotlin (0.30.0)
A new instrument for evolving pads and drones, ported from FRASIL 3.3
(Styves Goupil, an M-VAVE FM-1 firmware, MPL-2.0): a detuned saw choir,
eight drifting additive partials and noise through resonators, an
Ornstein-Uhlenbeck MOTION walk and a shared TIDE. Morph toward any of
FRASIL's 36 drone sounds by hand, by MIDI LFO or over a set time while a
note is held. Played by SynthVoice (so the tracker, live MIDI and audition
pools all get it); the frasil/ package stays MPL-2.0, LICENSES/MPL-2.0.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:04:31 +01:00
ReactorcoremeltdownandClaude Opus 5.5 dae8ac46ac Sound-module mode ignores clock Start/Stop for Sizzle's own song (v0.29.2)
With "Receive MIDI clock" on, Mikro Seq's Start also started Sizzle's
sequencer, so a song imported from Mikro Seq played along with the live
notes, doubling parts that Mikro Seq's mutes could not reach. While
sound-module mode is on, Start/Stop are now ignored (traced as such);
tempo is still followed. Verified on the emulator with MidiTrace, plus a
control run with the mode off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:04:41 +01:00
ReactorcoremeltdownandClaude Opus 5.5 3c248028c9 MIDI trace, spaced block names survive save/load, clearer clock-receive text (v0.29.1)
- input/MidiTrace: optional (setprop log.tag.SizzleMidiTrace VERBOSE) log of
  every received packet with lateness and every note handed to the engine
  with the mixer strips it reaches; flags Sizzle's own transport playing and
  clock Start/Stop acting on it. AudioEngine.describeBusTargets backs it.
- ProjectIo percent-encodes spaces/%/] in [PATTERN name=...], so "C1 muted"
  no longer comes back as "C1"; old files load unchanged.
- "Receive MIDI clock" explains that it starts Sizzle's own song, which then
  plays along with incoming notes (the cause of "mutes don't work / only C2"
  reports when used as a sound module with an imported Mikro Seq song).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 23:00:39 +01:00
ReactorcoremeltdownandClaude Opus 5.5 df64af8c9b MIDI inputs list with per-source switches; reconnect dead virtual sources (v0.29.0)
- Setup -> MIDI Sync lists every MIDI source that can send to Sizzle with a
  switch and its state (Listening / Not connected / Off) plus Reconnect.
  Off-choices persist by a stable MidiSourceKey (Android ids change).
- When the app behind a virtual source dies/restarts, Android keeps the
  device and our connection, drops the service binding and sends no callback,
  so Sizzle went deaf to e.g. a restarted Mikro Seq. A worker thread now
  probes open virtual sources every 3 s (openOutputPort is null from a dead
  server) and reopens dead ones; resume re-scans; zero-open port status is
  also treated as dead.
- Verified on an Android 15 emulator: force-stop + restart Mikro Seq ->
  reconnected within ~3 s, notes flowing with both apps in background.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:32:04 +01:00
ReactorcoremeltdownandClaude Opus 5.5 fb9a219e27 Background MIDI sound module and opening .sng from other apps (v0.28.0)
- "Keep running as MIDI sound module" setting: a mediaPlayback foreground
  service (SoundModuleService) keeps Sizzle from being frozen in the
  background, so another app (Mikro Seq) can play its mixer over MIDI with
  the transport stopped. Notification shows open sources and has Stop.
- MIDI notes are routed by MidiSoundModule, owned by SizzleApp next to the
  engine, not by the ViewModel; the UI only mirrors/punches them in. Held
  notes are released per source on disconnect and on CC 120/123. MIDI clock
  follow is wired in SizzleApp. Engine and MIDI ports are ref-counted
  between the Activity and both services.
- MidiByteParser: running status, split packets, realtime, SysEx.
- VIEW/SEND intent filters for .sng (application/x-sizzle-song,
  application/octet-stream, text/plain, .sng path); confirm before replacing.
- SngFormat reader follows the desktop reader: spaced block names, comments,
  loop/group/scale/root, track slot fallback, on-roll blocks first, length
  cap. Mikro Seq 4/4 and 3/4 exports as test fixtures.
- CHANGELOG.md started; handover §5.5/§5.6 and user guide updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 22:11:18 +01:00
ReactorcoremeltdownandClaude Opus 5 bcec71597d Add an "off" block to the arrangement, with an OFF toolbar button (v0.27.0)
An arrangement slot can now hold Arrangement.NOTE_OFF instead of a block id.
When the playhead reaches one, every track of that lane is released — the
arrangement-level equivalent of a column of note-off cells, for cutting a held
pad or a looping sample without editing the block that started it.

The OFF button sits between FILL and the A/B region controls and writes markers
across the current selection, toggling them away if they are all markers
already. Its label stays "OFF" rather than flipping to CLEAR the way FILL does:
a marker is also "filled", so FILL already reads CLEAR for it, and two adjacent
CLEAR buttons was genuinely confusing on screen. Markers draw in the palette's
`danger` red so they never read as another block.

The note-off branch of triggerCell is factored out into releaseTrack(), so the
marker and a note-off cell release identically — including the whole mixer bus
rather than just that column's voices, which is the existing cell's documented
behaviour and not something worth diverging from here.

Two things the sentinel broke that are easy to miss:

  - The project writer filtered arrangement slots with `pid >= 0`, so a marker
    saved silently and came back empty. Both formats now carry it: .szg writes
    the value as-is, and .sng gets an 'x' alongside '#'/'.'. 'x' is an extension
    to the interchange format — a reader that only knows '#' treats it as empty,
    losing the marker but never mis-parsing the roll.
  - A marker is NOT empty, so the run walk-back in triggerArrangementLine would
    have treated it as part of a contiguous run and played the following block
    from the wrong beat. It is now a boundary (Arrangement.hasBlockAt), and a
    block after a marker restarts from its first beat. It still counts towards
    lastFilledBeat, so playback runs up to it.

Tests cover both round-trips, graceful degradation of an unknown roll
character, and the filled-but-not-a-block distinction. Checked on an emulator
that the button appears and toggles, the marker draws red and distinct from a
block, it survives a background/restore autosave cycle, and playback crosses it
without incident.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 22:42:55 +01:00
ReactorcoremeltdownandClaude Opus 5 68e9ed8b41 Edge-scroll the arrangement roll while dragging a selection (v0.26.0)
A long-press selection drag could only reach what was already on screen — about
four bars — so selecting a long span meant selecting, scrolling, and selecting
again. Dragging into either edge of the roll's viewport now scrolls it under the
finger, and the selection keeps extending while it moves.

Speed ramps with how deep into the 56.dp edge zone the finger is, so easing in
creeps for fine work and pushing to the rim covers roughly 15 bars a second.
Both edges, not just the right one: scrolling out is not much use without
scrolling back, and a drag that overshoots has to be able to return.

The subtlety is that a pointer's canvas-local x goes stale the moment the view
moves beneath it, and no new pointer event arrives at all while the finger is
held still at the rim — which is exactly the case that has to keep working. The
drag therefore tracks a VIEWPORT-relative x and recomputes the beat against the
live scroll.value each frame, rather than trusting the last reported position.

The per-frame loop only runs between onDragStart and onDragEnd/onDragCancel,
and it applies a selection update only when the beat under the finger actually
changes, so an edge scroll does not bump the revision sixty times a second.

Verified on an emulator with synthesised motionevents (adb input swipe cannot
hold still long enough to trigger a long press): a right-edge drag carried the
view from bar 1 to bar 34 with the selection following; a left-edge drag
carried it back to bar 12; the scroll stops dead on finger lift, with no drift
four seconds later; and an ordinary drag inside the viewport still selects a
single bar without scrolling at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 22:10:18 +01:00
ReactorcoremeltdownandClaude Opus 5 c2aedcc95c Add an LFO phase dropdown to the synth (v0.25.0)
The synth's LFO always started at phase 0 on every note, so a Square LFO could
only ever gate on-beat-first and a Saw could only ever ramp up. The new
lfophase parameter offsets it in eight 45-degree steps — enough to put the gate
on the off-beat (180) or land a ramp anywhere useful, without a dropdown nobody
wants to scroll.

The offset is applied where the LFO is READ, not seeded into lfoPhase at
note-on. Two reasons: setPatch swaps the patch under a sounding voice, so
turning the knob moves a held note's LFO immediately rather than waiting for
the next trigger; and it matches the toolbox LFO device, which offsets its
phase the same way. Sample & Hold is deliberately unaffected — it clocks on the
raw wrap, and a held random value has no phase to shift.

Presets saved before this existed have no lfophase key, read the default label
and land on 0, which is exactly what they played.

The control reuses the editor's existing EnumParam dropdown and sits beside
WAVE and RATE in the LFO card. Checked on an emulator that three dropdowns
still fit that row at the widest label (PHASE:180°) without crowding, and that
the selection sticks.

Tests: 180 degrees must inverse a square LFO's loud/quiet halves, 90 must leave
both halves audible (a shift, not just an inversion), and the labels must map
onto the cycle with an unknown or missing one falling back to no offset.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 21:53:04 +01:00
ReactorcoremeltdownandClaude Opus 5 deb582727f Harden untrusted-file parsing, drop two audio-thread allocations, prune dead code (v0.24.0)
SECURITY

A crafted .sf2 hung the app. SoundFontLoader's RIFF walk trusted the chunk
sizes in the file: a negative size moved the cursor BACKWARDS, so the walk
re-read the same chunk header forever. runCatching cannot catch that — there is
no exception, just a thread that never returns. 76 bytes was enough. Every seek
in both the chunk and sub-chunk loops is now forced forward, negative sizes end
the walk, and the sample offset is resolved in Long so a hostile 32-bit start
index can no longer wrap Int and land the read somewhere arbitrary.

Neither ZIP import had a decompression budget. The zip-slip path check does not
see a bomb, because its entries are perfectly well-named — they are just
enormous. A restore streams to disk and filled the device; a project bundle
accumulates in memory and exhausted the heap. New ZipLimits budgets both, with
different limits because they fail differently: 512 MB for a restore, 64 MB for
a bundle, 20k entries either way. An over-budget archive is rejected like any
other bad file, leaving existing data untouched.

PlaybackService was exported with no permission, so any app on the device could
bind the MediaSessionService and take transport control. Now exported="false".
Verified on an emulator that this changes nothing that matters: the session is
still the system's media button session, the notification still posts, the
foreground service survives backgrounding, no SecurityException. The only loss
is discovery by external media browsers (Auto, Assistant, Wear), which this app
never supported.

String.format("%.2f") in three parameter readouts used the default locale, so a
comma-decimal locale rendered knob values inconsistently with the rest of the
monospace UI. Pinned to Locale.US.

PERFORMANCE

Two allocations removed from threads documented as allocation-free:
  - applyLfos() called target.substring(sep + 1) every block for each active
    LFO (~250/s each), in a function that already parses the slot index
    character-by-character to avoid exactly this. Now matched with
    regionMatches, which allocates nothing.
  - busNoteOn() built `(0 until N).map { … }.firstOrNull { … }` twice — a range
    iterator plus an ArrayList per incoming MIDI note. Replaced with an indexed
    freeBusVoice() scan, matching the style used elsewhere in the file.

DEAD CODE

Arrangement.isLaneMuted had no callers (everything reads laneMuted[] directly).
Four tab-title strings and a notification-channel name were left over from an
earlier design — the tabs are composed with literals and media3 names its own
channel. Added the missing android:roundIcon, which is why lint thought
ic_launcher_round was unused; the asset was always meant to be referenced.

Lint is clean of UnusedResources, DefaultLocale and ExportedService. Its
remaining ObsoleteSdkInt advice — merge mipmap-anydpi-v26 into mipmap-anydpi —
is wrong for this AGP version and was reverted: aapt then fails to resolve the
launcher icons at all.

NOT CHANGED, flagged for a decision: android:allowBackup is still true, so
projects, presets, themes and the settings/bindings DataStore go to Google's
cloud backup. That is a standard hardening finding, but it is also a data
portability feature, and the app now has its own backup/restore — a product
call rather than a defect.

New tests: SoundFontLoaderTest (hostile SF2 headers, with timeouts — the hang
reproduces as a TestTimedOutException without the fix) and ZipBombTest (both
import paths, plus a guard that an ordinary backup still restores).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 21:16:29 +01:00
ReactorcoremeltdownandClaude Opus 5 3453f9f003 Band-limit amp modulation so a Square/Saw LFO no longer clicks (v0.23.1)
The amplifier is the only modulation destination with nothing downstream to
absorb a discontinuity. Pitch feeds a phase accumulator and cutoff feeds filter
coefficients, both of which integrate a step away; the amp multiplies the
output sample directly:

    a = ampE * velocity * (1 + mAmp)
    y = filtered * a * OUT_GAIN

A Saw, Square or S&H LFO steps instantaneously, so wiring one to Amp put a
full-scale jump straight on the output — a broadband click at every edge, and
at a musical LFO rate (8 Hz is a 1/8 note at 120 BPM) that is a stream of
clicks several times a second: the reported crackle. Sine and Triangle were
unaffected because they are continuous, which is why only the stepping
waveforms were reported.

mAmp now runs through a 2 ms one-pole, so each edge becomes a short ramp. At
8 Hz a half cycle is 62 ms, so 2 ms is 3% of it and a chop still reads as a
chop. The envelope itself is deliberately NOT smoothed — it is already
continuous, and rounding it there would soften every attack. A note starts at
its modulated level rather than ramping up to it, so triggering on a square
LFO's quiet half does not blip before ducking.

Measured by the new SynthAmpModTest, worst single-sample output jump during
sustain (C3 triangle, filter wide open, LFO -> Amp at full depth):

    waveform     before     after
    Square       0.804      0.018
    S&H          0.705      0.017
    Saw          0.590      0.011
    (no mod)     0.003      0.003

Not addressed, and worth a separate look: the toolbox LFO *device* writes its
target parameter once per ~4 ms block, which steps every target for every
waveform. That is a different mechanism from the synth's own mod matrix and was
not what was reported here.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 20:28:51 +01:00
ReactorcoremeltdownandClaude Opus 5 208de84012 Separate the flick from the tap on the tracker and arrangement canvases (v0.23.0)
Both canvases detected their tap with detectTapGestures, which is the wrong
tool next to a scroll container for two reasons:

  - it CONSUMES the initial down, so the scrollable/horizontalScroll wrapped
    around the canvas had to fight for the gesture. A quick flick frequently
    did nothing, or landed as a tap and moved the cursor; only a slow,
    deliberate drag scrolled reliably.
  - it knows nothing about an in-flight fling, so tapping to halt a flick — the
    reflex every scrolling surface trains — selected a cell under a view that
    was still moving.

Replaced with detectScrollAwareTaps, shared by both canvases: it leaves the
down unconsumed so the scroll container sees the whole gesture, drops the tap
as soon as the finger travels past touch slop or the container claims a drag,
and treats a touch landing on a moving view as "stop here" rather than
"select".

Also fixes a regression from v0.22.1: keeping the cursor row on screen was
written as a standing clamp inside the scroll accessor, which made it a
constraint on the viewport rather than a reaction to the cursor moving. With
the cursor on line 0 it pinned the grid to the top and no amount of dragging
could scroll it. It is now a snapshotFlow on the cursor line that nudges the
offset only when the cursor actually moves off screen, so free scrolling is
unconstrained and a tapped cell still never moves.

Verified on an emulator (Pixel, API 34): a fast flick on the pattern grid now
flings across the whole 64-line pattern where it previously did not move at
all; a slow drag tracks 1:1 with no overshoot; a tap lands on the exact cell
and leaves the view still; the arrangement roll flings from bar 1 to bar 31 and
taps the right lane/bar. The tap-stops-a-fling path is not covered — adb cannot
inject a tap inside the fling window.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 20:06:14 +01:00
ReactorcoremeltdownandClaude Opus 5 1815566b6c Keep the tapped cell under the finger on a scrolled pattern grid (v0.22.1)
On a pattern long enough to overflow the viewport, tapping a cell moved the
grid: the follow logic re-centred the viewport on the cursor the moment it
changed, so the row that was just tapped slid up to the middle of the screen,
well away from the fingertip. The hit test itself was correct — the view moved
out from under it.

While not playing the view now holds still and scrolls only far enough to keep
the cursor row on screen, so a tap never moves it and an off-screen cursor
(arrow keys, punch-in advancing a row) still comes back into view. Centring on
the playhead during playback is unchanged, as is the flick-to-detach.

Also clip the Canvas. Compose does not clip a Canvas to its bounds, and the
grid deliberately draws one row past each edge to fill the partially scrolled
rows, so a scrolled grid painted over the toolbar above it.

Verified on an emulator (Pixel, API 34): before the fix a tap near the bottom
of a 64-line pattern jumped the row to the middle; after it the row stays under
the tap, scroll-then-tap lands on the right cell, an off-screen cursor is
pulled back to the nearest edge, and the playhead still centres during
playback.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 17:09:39 +01:00
ReactorcoremeltdownandClaude Opus 5 fdee7853e5 Adopt the cc.tiredsysadmin namespace and a Makefile entrypoint (v0.22.0)
Brings the project in line with CLAUDE.md:

- Application id / namespace is now cc.tiredsysadmin.android.sizzle
  (cc.tiredsysadmin.<os>.<application>), including the two JNI symbols in
  native_audio.cpp — JNI resolves by mangled package path, so renaming the
  package alone would fail at runtime, not at build time.
- Versions move to versions.properties at the repo root, read by both Gradle
  and the Makefile, with slots for the other platforms. The release APK name
  now derives from applicationId instead of being spelled out.
- Makefile becomes the build/publish entrypoint: atomic targets with real
  dependencies (deps, check, staging, release, install, dist, bump-*), and a
  manual-only publish split into publish-apk / publish-metadata, which also
  regenerates the F-Droid metadata from versions.properties.
- Annotate the two lint errors in MainActivity that this surfaced
  (ComponentActivity.dispatchKeyEvent's LIBRARY_GROUP_PREFIX restriction,
  media3's UnstableApi) so `make check` is green rather than advisory.
- Document identity, versioning, build types and publishing in the handover
  doc; point the README at make.

NOTE: the id change makes this a different app to Android and to F-Droid.
Installs of space.rcmd.android.sizzle will not be upgraded by it and will sit
side by side with the new one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-11-03 16:54:48 +01:00
ReactorcoremeltdownandClaude Opus 4.8 924b84a4d5 Keep MIDI input alive with the screen off / app backgrounded (v0.21.1)
MIDI (and the MIDI clock) were started in onStart and stopped in onStop, so
turning the screen off — which drives the Activity to onStop — closed the MIDI
ports and dropped controller input. Move their lifecycle to onCreate/onDestroy so
input persists for the Activity's whole lifetime; onStop keeps only the project
autosave. The audio engine already runs a continuous output stream via the started
PlaybackService, which keeps the process alive (verified at PERSISTENT_SERVICE_ADJ
when backgrounded) to receive events with the screen off. USB MIDI needs no runtime
permission, so it works unconditionally.

Trade-off: the controller stays claimed by the app while backgrounded, and is
released only when the Activity is torn down (task removed / finishing).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 23:52:14 +02:00
ReactorcoremeltdownandClaude Opus 4.8 7296a3a72b MIDI-learn: map controller knobs to any toolbox device parameter (v0.21.0)
Every instrument/effect editor gains a "⇄ MIDI" button in its toolbar that opens
a MIDI-learn popup listing the device's adjustable parameters. Tap LEARN on a row,
move a knob/fader on a connected MIDI controller, and its CC binds to that
parameter; the CC's 0..127 sweep then drives the parameter's full range live
(scaled to the spec range, rounded for integer params, nearest choice for enums).

Reuses the existing RawControl path — MidiInput already forwards unbound CCs — so
no parser change was needed. Bindings are stored in the slot's value map under a
reserved `midicc@<param>` key, so they travel with the project/preset and are
thread-safe via the slot's ConcurrentHashMap; one physical control drives one
parameter. Learn is auto-disarmed when the popup or editor closes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 23:43:50 +02:00
ReactorcoremeltdownandClaude Opus 4.8 dfb6ee9c9b Route MIDI notes by channel; punch-in from MIDI on the Tracker tab (v0.20.0)
Incoming USB/BLE MIDI notes were dropping their channel and always playing the
generic default-synth pool, ignoring the mixer routing. Now the parser keeps the
channel nibble (exposed 1-based, 1..16) on InputAction.NoteOn/NoteOff, and the
ViewModel routes a channelled note through engine.busNoteOn/busNoteOff — sounding
the mixer track(s) whose midiChannel matches, through their instrument and full
insert chain, exactly like the on-screen keyboard. Channel-less sources (physical
keyboard) keep the previous audition path.

On the Tracker tab with punch-in armed, a MIDI note now also punches into the
focused cell, recording its own velocity and channel and advancing by the skip
step (punchNote gained velocity/channel parameters). Off the tracker tab or with
punch-in off, MIDI only auditions.

Note: routing is strict, so a note is audible only on a track whose MIDI channel
matches and that has an instrument assigned (new projects start with buses on the
empty channel 0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 23:26:50 +02:00
ReactorcoremeltdownandClaude Opus 4.8 9fdef7fee7 Play starts from the arrangement selection; Stop clears it (v0.19.0)
Highlight a cell on the arrangement roll and Play now begins at that selection's
first beat instead of always from the top. Stop clears the highlight, so the next
Play resumes from the beginning. The rectangular selection is hoisted from
ArrangementRoll to the ViewModel (four ints) so the transport can read/clear it;
engine.play() gains a startBeat that seeks playlistIndex in the built playlist
(A/B expansion respected; falls back to the top if the beat isn't in it) or
currentLine in pattern-loop mode. Loading/importing a project also clears the
selection so a stale one can't apply to a new arrangement.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 18:04:47 +02:00
ReactorcoremeltdownandClaude Opus 4.8 96bbc5a4cc MIDI clock sync + note output over USB/BLE (v0.18.0)
Add a MIDI Sync settings card (before the binding cards) with Send and Receive
MIDI clock toggles, both off by default and persisted.

Send: a dedicated thread emits clock (0xF8) at 24 PPQN plus Start/Stop on the
transport edges to every attached MIDI device (USB + Bluetooth), and — because a
sequencer should drive gear, not just its tempo — also forwards the tracks'
note-on/off on each cell's MIDI channel. Notes are queued from the audio thread
through a lock-free ring and drained by the send thread, mirroring the mono-per-
track cell lifecycle; stop/pause/panic release everything so external notes never
hang. (Per-channel Arpeggiator/Transposer are internal FX and aren't reflected.)

Receive: MidiInput now forwards real-time bytes to the clock module, which follows
an external clock — Start/Continue starts the transport, Stop pauses it, and the
pulse rate drives the tempo (a tempo + transport follow, not a sample-locked slave).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 12:10:40 +02:00
ReactorcoremeltdownandClaude Opus 4.8 682418d69e Move the Backup & Restore card to the bottom of Settings (v0.16.1)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 11:45:42 +02:00
ReactorcoremeltdownandClaude Opus 4.8 3c4c30bf1f Share full projects as .szgz bundles between instances (v0.16.0)
Add Export/Import project buttons to Settings → Project. A bundle is a ZIP holding
the full .szg project plus every sample WAV it references (Sampler pads, SoundFont),
so unlike a plain .szg — whose sample ids only resolve on the originating device —
it opens complete on another Sizzletracker instance.

Export shares the bundle via the system share sheet. Import replaces the current
project, extracts the WAVs to a persistent content-addressed samples dir, re-points
each slot's padNFile/sfFile at the extracted file, then rehydrates — so the audio is
restored for the session and survives a restart. Invalid files are rejected cleanly.
Covered by ProjectBundleIoTest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 11:45:18 +02:00
ReactorcoremeltdownandClaude Opus 4.8 b305f0a2b5 Arpeggiate the whole held chord, not just the last note (v0.15.1)
Holding a chord on an arpeggiated channel used to collapse to the last (rightmost)
note and retrigger only that — the other notes were killed by the per-note
releaseBus + single-note arp.start. ChannelArp now holds the whole chord (sorted,
de-duped) and cycles all its notes across the octave range in the chosen mode.

Notes entered on the same line accumulate into one chord via a per-line generation
stamp; a new line starts a fresh chord, and a looping chord keeps its running phase
so it doesn't glitch at the loop point. ChannelArp is made internal to cover the
sequencing with ChannelArpTest.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 09:07:28 +02:00
ReactorcoremeltdownandClaude Opus 4.8 79a1844512 Tap tempo by tapping the BPM readout (v0.15.0)
Tapping the "### BPM" label sets the tempo from the average interval of recent
taps (up to 8, refining as you go); a pause over 2 s starts a fresh count. The
−/+ nudge buttons are unchanged. Purely UI-side — a small remembered list of tap
timestamps, no model/engine changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 09:07:06 +02:00
ReactorcoremeltdownandClaude Opus 4.8 8c44ed5151 Add full backup & restore to Settings (v0.14.0)
A new Backup & Restore card saves everything the app persists — songs, presets
(with their sample WAVs), themes, the autosaved project, and the settings +
input-binding DataStore blobs — into one .zip via the system file picker, and
restores from one.

Restore is defensive: it extracts to a staging folder and only swaps it into
place once the archive validates, so a corrupt/wrong file can't destroy current
data; it's zip-slip guarded and runs off the main thread. Since DataStore caches
in memory, restore prompts to reopen the app to finish applying. Covered by
BackupIoTest (round-trip replace, bad-file safety, empty-zip rejection).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 22:28:24 +02:00
ReactorcoremeltdownandClaude Opus 4.8 3488bac1ca Group and enlarge the toolbox device picker (v0.13.4)
Split the SELECT DEVICE list into Instruments / MIDI effects / Audio effects,
each with a gap and a small header, and bump the device labels 13→18 sp with more
tap padding. The old [INS]/[EFF] prefix is dropped since the grouping conveys it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 18:11:30 +02:00
ReactorcoremeltdownandClaude Opus 4.8 5dfbda7c15 Tape bobbin holes: rounded trapezoids, narrow side outward (v0.13.3)
Replace the inward-pointing triangular reel cutouts with rounded trapezoids —
wide toward the hub, narrow toward the rim. Generalize the corner-rounding helper
(roundedTri → roundedPoly) to handle the four-corner shape.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 15:54:14 +02:00
ReactorcoremeltdownandClaude Opus 4.8 d43112f296 Redraw Tape Engine as a real tape transport (v0.13.2)
Reels are now NAB-style: a metal flange with three rotating rounded-triangular
bobbin holes and a hub, instead of chariot-wheel spokes. Tape runs under tension
as straight lines from each reel down to a rounded-rectangle playhead between and
below them (the top tape line is gone). The four controls are vintage round knobs
in a row — wow, flutter, hiss, wow-sync — replacing the sliders/stepper.

Each knob is weighted so all four are visible (the shared Knob's internal
fillMaxWidth text had let the first one swallow the row), and Knob gains an
optional knobSize (default 44 dp, so other editors are unchanged) which the tape
knobs set to 58 dp.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 15:48:31 +02:00
ReactorcoremeltdownandClaude Opus 4.8 71bb50c775 Add Tape Engine and Granular Glitch visual effects (v0.13.0)
Tape Engine: a varispeed reel-to-reel. Audio runs through a ring buffer read at a
glided 'speed'; the editor draws two spinning reels you press-and-hold to brake,
diving the pitch like a finger on a slowing tape. Wow (slow, tempo-synced via
division) and flutter (fast) wobble the rate; hiss adds tape noise.

Granular Glitch: records the signal and, driven by Intensity, jumps the read head
back to replay short grains (stutter/repeat/octave glitch). A new VizEffect
interface lets the processor publish a decimated scope + playhead; the engine
exposes it per slot (effectScope/effectPlayhead), and the editor draws a dotted
oscilloscope with the jumping playhead over it plus a horizontal Intensity slider.
The scope reads in the Canvas draw phase (redraw only, no recomposition), mirroring
the VU-meter path.

Also make the toolbox device picker scrollable so all types stay reachable.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 15:20:36 +02:00
ReactorcoremeltdownandClaude Opus 4.8 ef13a46026 Widen arrangement mute toggles and block headers ~1.5× (v0.12.1)
Bigger, easier thumb targets on the arrangement roll's left column: the mute
toggle 34→51 dp and the block-number header 34→51 dp (laneColWidth 68→102). The
scrollable ruler/roll to the right is unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 15:20:11 +02:00
ReactorcoremeltdownandClaude Opus 4.8 abdcf77ce5 Stacked keyboards go chromatic when routed to a Sampler (v0.12.0)
A Sampler maps a pad to each MIDI note, so scale filtering left out-of-scale
pads greyed-out and unreachable. When the punch-in / audition keyboard's channel
routes to a bus with a Sampler instrument, bypass the scale filter and enable all
twelve keys; otherwise scale filtering is unchanged. Non-destructive - the
project's scale/root setting is untouched, and switching the channel back to a
synth/SF2 restores filtering.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 23:59:36 +02:00
ReactorcoremeltdownandClaude Opus 4.8 8eee588780 Point Help user-guide link at the guide's heading anchor (v0.11.2)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 23:37:41 +02:00
ReactorcoremeltdownandClaude Opus 4.8 40a946a894 Add Help section to Settings (about, source, guide, support) (v0.11.1)
A new Help card under Project shows the app name + live version (read from the
package, so it never drifts from the build) and links to the source repo, the
user guide, and the support page. Each link is a full-width ~64 dp row with a
large label, the destination URL beneath, and a chevron affordance — a
comfortable thumb target that opens in the system browser (missing-browser safe).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 23:25:37 +02:00
ReactorcoremeltdownandClaude Opus 4.8 3508777ba9 Mono-per-track: a new note releases the track's previous one (v0.10.0)
A sustaining note held with no explicit note-off used to pile up until
voice-stealing killed it. Now, when a note appears under the playhead on a
track, that track's still-held note is released automatically, so a line moves
note-to-note like a real monophonic voice.

Each sequencer voice carries an ownerTrack tag (the lane+track that started it),
and triggerCell calls releaseTrackVoices(trackKey) before playing a new note. It
releases only voices this track owns and only gated (still-held) ones, so chords
built across several tracks on the same bus keep sounding and release tails ring
out. Uses note-off (not kill) for a click-free legato hand-off. Arp voices are
unowned and keep self-managing as mono-per-bus.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 22:55:51 +02:00
ReactorcoremeltdownandClaude Opus 4.8 7a0f2e4426 Make mixer VU meters optional via a Settings toggle (v0.9.1)
Add a persisted "Mixer VU meters" switch (Settings -> Interface, on by default),
backed by a DataStore boolean. When off, the mixer skips the per-frame poll loop
entirely (the LaunchedEffect is keyed on the flag) and doesn't draw the meter, so
disabling it removes the metering cost, not just the visuals; the volume fill and
thumb render exactly as before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 21:54:07 +02:00
ReactorcoremeltdownandClaude Opus 4.8 b07d758609 Add per-channel VU meters inside the mixer faders (v0.9.0)
The render loop now tracks each bus's post-fader/post-FX peak per block and folds
it into a decaying meter value (instant attack, ~300 ms release) plus a clip
latch (~0.8 s when the bus crosses 0 dBFS). Exposed via channelMeter /
channelClipped and surfaced on the ViewModel.

Each mixer fader paints, in one drawBehind, a VU meter inside its volume fill:
rising from the bottom, coloured green -> amber by absolute level with a red tip,
and solid red while the bus clips. A per-frame ticker writes into stable state
objects read only in the fader's draw phase, so meter movement repaints just the
four faders (no recomposition); an unchanged write is a no-op, so a silent mixer
costs nothing but the frame tick.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 21:53:35 +02:00
ReactorcoremeltdownandClaude Opus 4.8 a5b9837bbc Fix stuck audition notes under rapid / chord tapping (v0.8.1)
The synth/SF2 audition note-off matched a voice purely by pitch, and isActive
stays true through a voice's release tail. So tapping a key, then immediately
holding it again, landed the note-off on the still-releasing first voice (a
no-op) and left the held one stuck, needing a MIDI panic. Two fingers on one
key hit the same trap.

Give voices an isGated flag (held = ADSR not in release/idle) and make
auditionSlotOff / liveNoteOff release a gated voice of that pitch in preference
to one already ringing out. Add SynthVoiceGateTest covering the gate/release
distinction and the exact stuck-note scenario.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 21:51:41 +02:00
ReactorcoremeltdownandClaude Opus 4.8 5943040a2b Louder master via makeup gain + look-ahead limiter (v0.8.0)
The master stage was a flat 0.5x attenuation into a static tanh soft-clip,
leaving ~9 dB of unused headroom: even the loudest single preset with its mix
bus maxed peaked around -7 dBFS, well below other media playback.

Replace it with a generous makeup gain (1.5x, ~+9.5 dB) feeding a feed-forward,
look-ahead brickwall limiter. A short delay line lets the peak detector pull the
gain down before a loud sample reaches the output and hold it across the
look-ahead window, so the output is mathematically guaranteed to stay under the
ceiling (0.97) - loudness without clipping, and none of the tanh grit a static
clipper adds to a hot single voice. Allocation-free (results go to scratch
fields, not a Pair) and NaN-guarded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 21:50:39 +02:00
ReactorcoremeltdownandClaude Opus 4.8 b7ae8cfbff Glissando: slide across stacked keyboards to play (v0.7.3)
Input moves from per-key gestures to one octave-level multi-touch handler in
PianoOctave, so a finger can slide across keys and each note retriggers as it
crosses a key boundary (black keys win in their upper region via geometry-aware
hit-testing); multiple fingers still play independently for chords. Out-of-scale
keys are skipped mid-slide. onNoteOn carries a `slid` flag so the tracker
punch-in keyboard records only the initial press (a slide auditions a glide
without spraying a run of notes into the pattern), while the toolbox / editor
audition keyboards play every key crossed. StackedKeyboard and SlotAuditionKeyboard
both migrate to the new callback API; PianoOctave now renders the keys itself.

Verified on-device: a slow slide lights each in-scale key as the finger reaches
it and skips out-of-scale keys.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 20:19:00 +02:00
ReactorcoremeltdownandClaude Opus 4.8 3c0b93855b Scale-filter toolbox keyboards; pin sampler pads at keyboard height (v0.7.2)
- Scale/root filtering on the Toolbox audition keyboards, matching the tracker
  punch-in keyboard: out-of-scale keys are dimmed and inert (Chromatic = all
  playable). StackedKeyboard now filters in both punch-in and audition mode,
  and SlotAuditionKeyboard (synth / SF2 editors) gained the same filter.
- Sampler editor restructured so the 16-pad grid is pinned at the bottom at the
  same height the audition keyboards use, consistent across every instrument
  editor. The per-pad volume faders moved to a second swipe page (waveform on
  page 1, volumes on page 2, with dot pagination), and pad cells now fill the
  pinned region instead of a fixed 46dp. Selected-pad state is hoisted into
  ParamEditor so the detail area and the pinned grid stay in sync.

Verified on-device: audition keyboard dims to F harmonic minor; sampler pads
fill the pinned bottom region with volumes on the swipe page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 20:05:53 +02:00
ReactorcoremeltdownandClaude Opus 4.8 c4f4cf34c0 Mix Tightener: per-component Strength faders (EQ / Comp / Limiter) (v0.7.1)
The single Strength control becomes four faders: the master Strength plus a
per-stage trim for EQ, Compressor and Limiter. Each stage's effective amount
is master × its own fader, so you can keep the tone shaping but ease off the
compression, push only the limiter for loudness, etc. Backward compatible —
presets still set the master `strength`; the new eqAmt/compAmt/limAmt default
to 1 (full).

 * DSP (MixTightener): EQ gains scale by strength×eqAmt; compressor gain
   reduction + makeup by strength×compAmt (compActive skips the whole comp
   stage at compAmt 0); limiter ceiling + output make-up by strength×limAmt.
 * Editor: four labelled vertical faders (Strength / EQ / Comp / Limit). Fixed
   a refresh bug where a fader child composable didn't observe vm.revision, so
   its value didn't visibly update after a drag (the DSP did update); it now
   subscribes like ParamControl.

Verified on-device: dragging EQ to 19% left Strength/Comp/Limit at 100%
(independent control, UI refreshes). Test instance added on a spare slot for
verification, then cleared — project untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 18:35:58 +02:00
ReactorcoremeltdownandClaude Opus 4.8 58639d07cf Add Mix Tightener effect, multi-column preset menus, louder master (v0.7.0)
Mix Tightener — a preset-driven "channel strip in a box" (Neutron-style):
parametric EQ → 3-band multiband compressor → peak limiter, all behind ONE
visible control, Strength, which morphs the whole chain from transparent (0)
to the full preset (1). Every per-band value is a hidden slot param the
presets set; the editor shows only a vertical Strength fader.
 * DSP (Effects.kt): reusable RBJ biquad; LR-style 3-way crossover; per-band
   peak-follower compressors; fast peak limiter + output make-up. Performance:
   the expensive per-band gain computation (log/pow) runs at control rate while
   the envelope follower runs per sample; Strength≈0 bypasses the whole effect,
   and flat EQ bands / ratio≈1 comp bands are skipped. Output is clamped and
   NaN-guarded so a channel FX can never poison the master.
 * 30 factory presets (MixTightenerPresets) across drums (808 Crisp, Industrial
   Drums, Trap Hats, Techno Kick, DnB Breaks, …), bass (EBM Bass, Reese, Acid
   303, Sub Bass Tame, Goth Bass, Synthwave Bass, …), synths/leads/pads
   (Synthwave Lead, Cutting Lead, Darkwave Pad, Arp Sparkle, …) and bus glue
   (Mix Glue, Loudness Max), seeded via PresetLibrary.

Global: RetroDropdown now lays long option lists (>12) into balanced columns
so preset menus grow sideways instead of into a tall vertical scroll — applies
to every dropdown in the app.

Master loudness: raise MASTER_GAIN 0.35 → 0.5 (~+3 dB) so playback sits closer
to other media apps; the soft-knee limiter still catches peaks.

Builds clean (staging + release). On-device performance profiling and install
are pending — the device dropped off wireless adb mid-session.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 18:11:56 +02:00
ReactorcoremeltdownandClaude Opus 4.8 3a180eb983 Add detailed user guide with screenshots
docs/USER_GUIDE.md: a full walkthrough of every screen — Tracker (transport,
grid, note-offs, scrolling), the punch-in keyboard, Arrangement, Mix
(channels, FX routing, recording), Toolbox (tile gestures, Synth/Sampler/
SF2-XI editors, effects, presets) and Setup (projects, audio routing, themes,
input bindings). Also covers the four input methods incl. the new
hold-to-repeat, file formats, recording, and default keyboard/gamepad/MIDI
maps. 11 on-device screenshots under docs/screenshots/, linked from README.

Also refresh the README's stale "NES synth" wording to "3-oscillator synth"
(renamed in v0.5.0).

Docs only — no code change, so no version bump or rebuild.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 15:25:58 +02:00
ReactorcoremeltdownandClaude Opus 4.8 750d928ce1 Hold-to-repeat for navigation keys across keyboard, gamepad and MIDI (v0.6.0)
Navigation and value-step actions (Nav Up/Down/Left/Right, Next/Prev
Column, Increment/Decrement) now auto-repeat while their control is held —
fire once on press, then accelerate from 320ms to 45ms per step — and stop
the instant it's released. Implemented ONCE as a shared repeater in
InputRouter (pressRepeat/releaseRepeat, keyed by the physical control id),
so all three hardware inputs get identical behaviour:
 * Keyboard: the OS's own key auto-repeat is now ignored (held notes sustain
   instead of retriggering) and holds are driven by the shared repeater;
   key-up ends it.
 * Gamepad: buttons, D-pad hat AND analog sticks repeat (they all funnel
   through controlDown/controlUp); releasing the main control stops it,
   releasing a chord modifier does not.
 * MIDI: a momentary nav CC repeats between its press (value>=64) and
   release (value<64).

One-shots (transport, tab switch, notes, clear) are unaffected — they fire
once even when held. InputRouter takes an injectable dispatcher so the new
InputRouterTest drives the accelerating schedule on a virtual clock
(verifies repeat-while-held, stop-on-release, one-shot-fires-once, and that
an unrelated release doesn't stop the active repeat). All unit tests pass;
on-device smoke confirms single-press nav + transport still work, no crash.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 15:14:34 +02:00
ReactorcoremeltdownandClaude Opus 4.8 e0fe89d62c Rework toolbox tile gestures: tap to pick/edit, long-press to clear (v0.5.2)
Single tap now acts immediately instead of just selecting: an empty tile
opens the device picker, a filled tile opens its settings editor (this was
the double-tap behaviour; the highlight-only single-tap and the double-tap
are gone). Long-press clears the tile — but now via a confirmation dialog
("Clear tile") rather than wiping instantly, since clearing discards the
device and its settings with no undo (matches the preset DELETE confirm).
Long-pressing an empty tile does nothing.

Removes the now-unused per-tile `selected` state/highlight and onDoubleTap.
Verified on-device: filled→editor, empty→picker, long-press→confirm(Cancel
keeps the tile).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 15:00:17 +02:00
ReactorcoremeltdownandClaude Opus 4.8 2f671ed372 UI smoothness: distinct isPlaying flow + allocation-free grid draw (v0.5.1)
Two changes that cut playback-time UI jank (measured on-device):
- Expose a deduped isPlaying StateFlow (maps the transport flow through
  distinctUntilChanged) and collect THAT in the transport toolbar, so the
  PLAY/PAUSE button recomposes on play↔stop instead of ~12×/second as the
  playhead advances (the full transport emits every line).
- Precompute the pattern grid's fixed-width text (gutter hex, note names,
  velocity/channel) into class-load lookup tables. The grid redraws on
  every playhead line and scroll pixel, and the old toString/padStart
  formatting allocated a String per cell per frame — steady draw-phase
  garbage. The draw is now allocation-free (also improves GlyphCache hit
  rate via stable string instances).

gfxinfo over ~12s of playback on the busy track (moto g84):
  janky frames 47.2% → 32.0%; 99th-pct frame 129ms → 53ms;
  missed vsync 40 → 10; 50th 18ms → 14ms.

No engine/audio change. Remaining jank is the auto-follow scroll
redrawing the whole grid each line (everything shifts), not addressed here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 14:49:08 +02:00
ReactorcoremeltdownandClaude Opus 4.8 cf306d25e0 Generic synth name, calmer knobs, darkwave/industrial presets (v0.5.0)
- Rename the 3-osc synth's display name "NES Synth" → "Synth" (the enum
  NES_SYNTH stays as the serialized id, so saved projects/presets are
  unaffected).
- Knobs: replace absolute finger-position control (full range mapped onto
  the 44dp knob → very touchy) with relative drag over ~280dp of travel,
  so fine tweaks are easy and the control isn't sensitive.
- Add a darkwave/industrial preset family: Pluck Bass, Acid Pluck
  (punchy plucky basses), Razor Lead, Cold Lead (cutting leads), and
  Grit Sub, Detune Wall (harsh, detuned deep basses for layering under
  bass pads).
- Preset seeding now records seeded names in the per-type marker instead
  of a single flag, so factory presets added in a later version appear on
  upgrade without resurrecting presets the user deleted (legacy "1"
  markers upgrade cleanly).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 10:56:52 +02:00
ReactorcoremeltdownandClaude Opus 4.8 12c2092843 Render only active voices via per-block active-voice lists (v0.4.7)
Optimization B, superseding v0.4.6's per-bus skip. Instead of iterating
each active bus's whole POLYPHONY pool per sample (calling render() on
idle slots, which merely early-out), fillBlock now builds compact lists
of the voices that are actually sounding — once per block — and the
per-sample mix loop touches only those.

Correctness for mid-block starts: the sequencer can trigger a note part
way through a block, so the allocators queue the chosen voice into this
block's list (queueSeq/queueSmp), keeping note timing sample-accurate.
A per-voice generation stamp dedups the append so a voice that finishes
and is re-allocated within one block is never rendered twice (which would
double its amplitude). Live/bus-audition voices are snapshotted at block
start (a manual press mid-block sounds at the next block, ≤2 ms later —
imperceptible, and the pre-existing ~30 ms output buffer dwarfs it).

On-device (moto g84, 98% battery, real busy track, ~13 voices, 2.0 ms
budget), avg render callback:
  baseline 2.00 ms (xruns +250..+515) → A 1.44 ms (+0) → B ~1.00 ms (+0)
B removes ~51 inactive-slot render() calls per sample; ART's virtual
dispatch makes each ~90 ns, so this is a real ~30% gain over A (not the
~1% first estimated from the sample track — measurement corrected it).
Fast-tapping audition during playback stays ~1.0-1.3 ms, xruns +0,
voices drain cleanly (no stuck notes, no double-render).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 10:39:57 +02:00
ReactorcoremeltdownandClaude Opus 4.8 d54fd27c9e Skip idle voice pools per block — fix playback dropouts (v0.4.6)
fillBlock rendered EVERY pooled voice every sample: 32+32 sequencer +
32+32 bus-audition + 16 live/audition voices, render() called ~144×
per frame × 96 frames per callback — even at idle. The bus-audition
pool (64 voices) is only used by the Toolbox MIDI piano yet ran every
sample during normal playback. This fixed cost, not active-voice count,
dominated the render budget.

Now the pools are scanned once per block into per-bus active flags, and
the per-sample mix loop skips whole idle buses and the entire bus-
audition pool when nothing is being auditioned. The sequencer sets the
flag the instant it triggers a note mid-block, so newly-started notes
still sound sample-accurately within the same block.

On-device profiling (moto g84, 98% battery, real busy track, ~11 sample
voices, 96-frame/2.0ms callback):
  before: avg 2.00 ms, xruns +250..+515 per ~500 callbacks (audible drops)
  after:  avg 1.44 ms, xruns +0 (steady)
Fast-tapping the audition keyboard during playback: avg 1.1-1.4 ms,
xruns +0, voices peaked at 16 then drained cleanly — no stuck notes.

With this, under-load render time equals idle, so voice rendering is no
longer the bottleneck; the remaining ~1.4 ms is fixed JNI + per-channel
FX overhead. A block-based per-voice refactor was evaluated and dropped
as unnecessary (it would not reduce that fixed cost).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 10:28:35 +02:00