You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
granular: live master-output ring buffer + CAPTURE button
Answers "can we visualize the ring buffer?" directly: the granular
panel now shows its own 3-second rolling tap of the master output,
and CAPTURE freezes whatever's currently in it as the granular
voice's source — in-memory, no file written.
Audio side (src/audio/mod.rs):
- New rtrb ring granular_capture_tx / rx (≈15s @ 44.1k mono).
Audio callback always pushes master-output mono alongside the
existing scope / capture / stereo taps. Dropped when full so
the UI always has the most recent samples without back-pressure.
- AudioEngine carries granular_capture_rx through to AudioChannels
and ImpulseApp.
UI (src/ui/panels/granular.rs):
- Every frame, drain granular_capture_rx into the app's local
granular_tap (Vec<f32> of length 3s @ 44.1k, circular with
head index).
- Compact min/max waveform strip (~260×28 px) renders the ring
chronologically, oldest-left to newest-right. A CHALK cursor
marks the head (freshest sample). Repaints at ~30Hz so the
waveform scrolls smoothly.
- "LIVE 3.0s" label + CAPTURE button row below. CAPTURE re-orders
the ring into chronological Vec<f32>, wraps in Arc, and sends
AudioCommand::LoadGranular to the audio thread — the granular
voice starts reading the captured buffer immediately.
- Capture path stored as "«captured»" in granular.path so the auto-
reload-from-disk logic doesn't try to load it as a file.
Button renames match the amen panel convention:
- RND → RANDOM
- LD → LOAD
LOC: moved three doc-comments to inline-comment form in ui/mod.rs
to stay under the 1000-line file cap after adding the three new
ImpulseApp fields.
481 tests still passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments