Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e74b622
feat(vocal-throw): implement bounded zero-added-latency phrase captur…
masarray Nov 8, 2026
070ed0c
feat(vocal-throw): add native JUCE insert, lock-free DSP commands and…
masarray Nov 8, 2026
e13c3fc
feat(vocal-throw): install real native FX node on authoritative Chann…
masarray Nov 8, 2026
29ab439
feat(vocal-throw): restore schema-validated native FX settings in sav…
masarray Nov 8, 2026
56b5cca
feat(vocal-throw): catalog stable native effect identity
masarray Nov 8, 2026
f8917ec
test(vocal-throw): include deterministic RT-safe DSP tests in existin…
masarray Nov 8, 2026
07ae515
fix(vocal-throw): validate exact 48-byte settings state
masarray Nov 8, 2026
080bd84
feat(vocal-throw): route native insert and lifecycle through approved…
masarray Nov 8, 2026
b47fe83
feat(vocal-throw): expose accepted FX settings, capture activity and …
masarray Nov 8, 2026
8729862
feat(vocal-throw): validate tempo/settings/trigger commands at native…
masarray Nov 8, 2026
b9ecd8a
feat(vocal-throw): compact approved FX editor with TAP BPM, phrase se…
masarray Nov 8, 2026
6043d30
feat(vocal-throw): expose native effect in same FX picker and compile…
masarray Nov 8, 2026
49034ce
feat(vocal-throw): open approved native editor for exact ChannelId FX…
masarray Nov 8, 2026
40621bd
test(vocal-throw): verify manual and phrase-aware echo, BPM grid, dry…
masarray Nov 8, 2026
4fc0de8
fix(vocal-throw): use faster vocal-end envelope for responsive phrase…
masarray Nov 8, 2026
d37aa3a
perf(vocal-throw): amortize frozen phrase copy with fixed RT work budget
masarray Nov 8, 2026
04d8dc7
fix(vocal-throw): share approved 24px close-button chrome and red pre…
masarray Nov 8, 2026
7475cf6
test(vocal-throw): guard single approved picker, editor, DSP ACK and …
masarray Nov 8, 2026
4d6e677
style(vocal-throw): integrate compact editor in existing FX CSS owner
masarray Nov 8, 2026
1fdb7c2
refactor(vocal-throw): remove runtime CSS injection, reuse canonical …
masarray Nov 8, 2026
a493896
docs(vocal-throw): live DSP architecture, acceptance test and auto-BP…
masarray Nov 8, 2026
d240148
ci(vocal-throw): verify native FX editor syntax in existing cheap UI …
masarray Nov 8, 2026
c035f40
fix(vocal-throw): bound compact editor to mobile viewport and allow v…
masarray Nov 8, 2026
62edf74
test(vocal-throw): Chromium native FX insertion, manual cue ACK and c…
masarray Nov 8, 2026
32e1cc4
ci(vocal-throw): one scoped Chromium FAT for actual approved editor a…
masarray Nov 8, 2026
3a00451
test(vocal-throw): increment graph revision when simulating FX-instan…
masarray Nov 8, 2026
1bf4290
fix(vocal-throw): manual throw rejects stale silence instead of repor…
masarray Nov 8, 2026
a5e2565
test(vocal-throw): reject long-after-singing manual cue
masarray Nov 8, 2026
bb9ed6b
perf(vocal-throw): keep overlapping tails and optimize RT capture copy
masarray Nov 8, 2026
bbe0e86
test(vocal-throw): assert overlapping tails, bounded cues and manual-…
masarray Nov 8, 2026
5cc4400
audio(vocal-throw): contain dense multi-tap wet peak without touching…
masarray Nov 8, 2026
29b92b7
test(vocal-throw): bound dense overlap level at full wet
masarray Nov 8, 2026
63d8618
docs(vocal-throw): qualification evidence and RT/musical hardening co…
masarray Nov 8, 2026
b2657cd
test(vocal-throw): clear dry fixture between PCM comparison blocks
masarray Nov 8, 2026
2a7c6a6
test(vocal-throw): account for envelope release in hybrid rearm gate
masarray Nov 8, 2026
f6ad2d6
fix(vocal-throw): reject late manual duplicate of auto-triggered voca…
masarray Nov 8, 2026
4db3848
test(vocal-throw): manual-after-auto idempotence and next-phrase rearm
masarray Nov 8, 2026
f95b748
feat(vocal-throw): bounded native music-channel onset monitor and con…
masarray Nov 8, 2026
3c52659
feat(music-tempo): tap exactly one accepted ChannelId pre-FX inside n…
masarray Nov 8, 2026
c7c62bb
feat(music-tempo): source/epoch admission and control-only insert tra…
masarray Nov 8, 2026
853785f
feat(music-tempo): expose verified native tempo tap to existing JUCE …
masarray Nov 8, 2026
d8ce4db
feat(vocal-throw): consume precomputed native music BPM interval with…
masarray Nov 8, 2026
014c83a
feat(vocal-throw): consume precomputed native music BPM interval with…
masarray Nov 8, 2026
91bfdca
feat(vocal-throw): native music-source selector, tempo polling and DS…
masarray Nov 8, 2026
f11b0b5
ui(vocal-throw): compact native music source and lock status controls
masarray Nov 8, 2026
1339cb6
ui(vocal-throw): verified backing-source selection, ACK and real BPM …
masarray Nov 8, 2026
00a16e2
style(vocal-throw): compact source and auto BPM state in approved FX …
masarray Nov 8, 2026
920d949
test(music-tempo): real PCM tap, BPM rhythm, holdover and stale-graph…
masarray Nov 8, 2026
2254afc
build(music-tempo): register deterministic native CTest in existing W…
masarray Nov 8, 2026
699a0e0
fix(music-tempo): rebind valid source safely across native graph revi…
masarray Nov 8, 2026
ad599a8
fix(music-tempo): preserve validated music ChannelId across WIRE/FX c…
masarray Nov 8, 2026
7e80f00
test(vocal-throw-ui): native music-source ACK and live BPM readback d…
masarray Nov 8, 2026
d6daf5d
test(vocal-throw): verify tempo ACK before exercising stale FX instance
masarray Nov 8, 2026
9906d9a
style(test): normalize native music tempo smoke fixture indent
masarray Nov 8, 2026
1576c23
perf(music-tempo): deduplicate control BPM packets and avoid repeated…
masarray Nov 8, 2026
9662de5
ci(vocal-throw): run focused Chromium FAT for native and music tempo …
masarray Nov 8, 2026
cce6323
test(music-tempo): prove actual accepted graph PCM tap and revision f…
masarray Nov 8, 2026
2376345
fix(vocal-throw): read music tempo before same-block throw and reset …
masarray Nov 8, 2026
88af4f4
test(vocal-throw): auto music BPM freeze, no tail retime, Manual/TAP …
masarray Nov 8, 2026
632cb47
test(music-tempo): use valid 180 BPM interval vs 120 BPM fallback
masarray Nov 8, 2026
39ba9a4
docs(music-tempo): architecture, evidence and explicit live-qualifica…
masarray Nov 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
node --check site/preview-v2/assets/gui-perf-probe.js
node --check site/preview-v2/assets/mixer-native-peq.js
node --check site/preview-v2/assets/mixer-native-compressor.js
node --check site/preview-v2/assets/mixer-native-vocal-throw.js
python tests/native_peq_assembly_test.py
python tests/approved_operator_ux_smoke.py
python scripts/build_ui_css.py --check
Expand All @@ -126,6 +127,32 @@ jobs:
- name: Block incomplete product release only when preparing product review
if: ${{ github.event_name == 'pull_request' && !github.event.pull_request.draft && startsWith(github.head_ref, 'integration/product-') }}
run: node scripts/check_console_puzzle.mjs --release
vocal-throw-preview:
name: Vocal Throw native editor desktop/mobile Chromium FAT
needs: quick
if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'feature/arson-vocal-throw-') }}
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Chromium for targeted Vocal Throw UI
run: |
python -m pip install playwright
python -m playwright install --with-deps chromium
- name: Check exact mixer picker, native ACK and editor in desktop/mobile
run: python tests/approved_native_vocal_throw_smoke.py
- name: Keep compact editor screenshot evidence
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: ArSonMix-Vocal-Throw-Desktop-Mobile-${{ github.run_id }}
path: arsonmix-vocal-throw-*.png
if-no-files-found: ignore
retention-days: 7

operator-ux-fat:
name: Operator UX real Chromium / native-assembled GUI (5 viewports)
needs: quick
Expand Down
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,18 @@ if(BUILD_TESTING)
add_test(NAME NativeCompressorZeroLatencyAndLinkedStereoPCM COMMAND ARMixNativeCompressorTests)
add_dependencies(ARMixMixerRoutingTests ARMixNativeCompressorTests)

add_executable(ARMixNativeVocalThrowTests tests/builtin_vocal_throw_test.cpp
engine/builtin_fx/VocalThrow.h)
target_compile_features(ARMixNativeVocalThrowTests PRIVATE cxx_std_20)
add_test(NAME NativeVocalThrowPhraseCaptureManualAutoAndNoHeap COMMAND ARMixNativeVocalThrowTests)
add_dependencies(ARMixMixerRoutingTests ARMixNativeVocalThrowTests)
add_executable(ARMixNativeMusicTempoTests tests/native_music_tempo_test.cpp
engine/core/NativeMusicTempoMonitor.h)
target_compile_features(ARMixNativeMusicTempoTests PRIVATE cxx_std_20)
add_test(NAME NativeMusicTempoSourceOnsetsAndFallback COMMAND ARMixNativeMusicTempoTests)
add_dependencies(ARMixMixerRoutingTests ARMixNativeMusicTempoTests)


add_executable(ARMixNativeMasterLoudnessTests tests/native_master_loudness_test.cpp engine/dsp/NativeMasterLoudness.h)
target_compile_features(ARMixNativeMasterLoudnessTests PRIVATE cxx_std_20)
add_test(NAME P1KMeasuredNativeBS1770StereoAnd4xTruePeak COMMAND ARMixNativeMasterLoudnessTests)
Expand Down
45 changes: 45 additions & 0 deletions docs/ARSON_VOCAL_THROW_MUSIC_TEMPO_M2_20261108.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# ArSon Vocal Throw M2 — Native Music Channel Tempo Detection

**Status:** implementation and qualification draft, stacked on Vocal Throw M1 PR #469. M1 green head `4db384851e6f6378cca4fd037b744c98bd1f0ba3`; M2 is PR #474 and tracks issue #473.

## Signal authority

```
Authoritative ChannelId native PCM graph, single JUCE / ASIO callback
MUSIC ChannelId selected explicitly by singer/operator
-> PRE-FX non-mutating read-only music tap
-> 10ms stereo absolute-energy summary, bounded SPSC<Frame,2048>
-> existing 12Hz JUCE control timer: onset search + BPM confidence
-> accepted tempo precomputed into sample intervals, CONTROL only
-> per-VocalThrow atomic pending interval
-> next dry/vocal PCM callback copies interval BEFORE any THROW
-> new frozen vocal echo gets music interval, old tails keep prior schedule
VOICE ChannelId -> VocalThrow (no added dry PCM delay) -> WIRE/BUS/MAIN
```

**AUDIO callback contract:** no memory allocations, FFT, file I/O, logging, locks, networking, JS DSP, or new audio threads. Only the explicitly selected source channel's input stereo samples are summarized; every other channel skips the per-sample music tap. Existing JUCE callback remains the only audio authority. Core audio buffers and retained FX leases remain with the native graph.

**CONTROL contract:** only an accepted `ChannelId` with input / GROUP / FX_RETURN role and an actually scheduled PCM lane is a permissible tempo source. The native FX editor validates both its own vocal insert instance and source identity, device epoch and graph revision. Monitor/MAIN and the vocal channel itself are not accepted. On a valid structural graph recompile, an existing source ID is rebound with a new analysis generation; if absent or stale, the music clock is disabled, and Vocal Throw falls back to its saved BPM or TAP tempo.

## Detector

- A 10ms energy onset, 80ms transient refractory and adaptive floor reject a simple repeated rise from a sustained note.
- Bounded pairwise onset-period candidate scoring (60–180 BPM), with penalty for octave half/double candidates, three consistent estimates and confidence threshold.
- Native readback distinguishes **AUTO BPM locked**, **Listening**, and **Manual/TAP fallback**. A silence period exceeding 3.2s resets lock.
- UI conveys confidence as measured by estimator; this number is not field-certified reliability.

**Explicit limitations:** Music/onset BPM estimation does not provide sample-perfect beat-phase grid alignment. A recent transient anchor is retained for diagnostics only; it is not used as a globally compensated sample clock. Syncopated and heavily compressed music, live mic bleed, time-signature changes, half/double-time ambiguity and device-specific ASIO timing remain hardware field gates. Tempo selection is ephemeral song-wide, not yet persisted per Show. The fallback path always remains audible on the singer's dry stream.

## Qualification evidence

- Prior M1 Windows MSVC/JUCE: 63/63 CTest on exact SHA `4db384851e6f6378cca4fd037b744c98bd1f0ba3`.
- M2 Windows MSVC/JUCE: 64/64 CTest, including `NativeMusicTempoSourceOnsetsAndFallback`, on exact SHA `cce63231da52f69e6789873ecc406adba69aa1cb`. See [Actions run 42498186748](https://github.com/masarray/arsonmix/actions/runs/42498186748).
- Chromium FAT M2 native Vocal Throw picker, music source ACK, BPM readback and stale instance handling passed on same SHA.
- Later hardening: inbound tempo sampled before same-callback THROW and reset on plugin audio reprepare; corresponding regression checks for manual fallback and active tail interval stability. Qualification on the later SHA must be checked independently.
- Deterministic PCM: 72, 95, 120, 160 BPM; non-vocal source, stale revision, source change, dropout, default fallback. The CTest calls the *actual* native publisher to verify a music signal traverses the accepted graph, not only the isolated estimator.

**Not qualified:** physical ASIO 64/128 frame load at 44.1/48/96 kHz; prolonged simultaneous singer/backing test; live beat-grid sync / stereo echo hearing test; WASAPI secondary stream callback load; long-run xrun/restart and voice-music bleed reliability. Green CI is necessary but not sufficient for release.

## Next DSP/UX milestone

Prove stable beat phase with a source-specific latency-compensated anchor; handle half/double-time ambiguity with confidence floor and long-window hysteresis; permit song/Show fallback preference; add footswitch mapping and live capture metrics without callback work. Until then label UI as estimated **AUTO BPM** rather than **sample-accurate beat quantization**.
54 changes: 54 additions & 0 deletions docs/ARSON_VOCAL_THROW_NATIVE_20261108.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# ArSon Vocal Throw — native phrase-aware live delay

**Status: functional prototype on a separate feature branch; not a certified live-performance release.**

This is a first-class native ChannelId insert in ArSonMix's single JUCE PCM render graph, not a second audio callback, browser-generated sound or independent DAW.

## Implemented

- **Manual:** rolling ring buffer holds up to 1.5 seconds of the most recent vocal. THROW captures a word or phrase and schedules up to six decaying repeats. Two independent tail voices allow a subsequent phrase to overlap an existing echo instead of cutting it.
- **Auto:** energy envelope, minimum voice duration, silence threshold and cooldown detect the end of a sung phrase without letting the wet echo re-trigger itself.
- **Hybrid (default):** phrase-end automation and manual cue together, with manual-cue suppression of a subsequent auto event for the same phrase.
- **Tempo:** BPM entry (60-200), TAP BPM, quarter/eighth/dotted-eighth/half note subdivisions. Interval timing is in native samples at the actual device rate.
- **Mix:** direct dry input with zero added samples, stereo echo, decay, short fades, smoothed wet edits, and ducking while the singer is active. A bounded active-tap gain normalizer prevents dense repeats/overlapping phrases from amplifying the wet bus simply because taps stack; dry is never attenuated.
- **Real-time:** all rolling/frozen buffers are allocated off-callback; a fixed maximum 24-stereo-frame-per-sample capture copy budget per active tail avoids a single large callback memcpy. Contiguous copy chunks eliminate per-frame modulo, and the ring write cursor rolls over without division. A lock-free SPSC transfers host settings and manual cue to the audio callback. Callback never allocates/logs/locks.
- **Identity & persistence:** stable native catalog ID; ChannelId, device epoch, graph revision, and insert instance fencing. DSP completed ACK and later readback precede accepted display. Schema-versioned 48-byte AVTH settings blob validated during Show restore; audio capture and tails are not persisted.
- **UX:** a compact FX editor inside the exact approved /preview/ mixer; presets in header, uniform power/close, BPM/note/repeat, THROW, TAP and collapsible advanced controls. One shared FX stylesheet.

## Architecture

Hardware input → ChannelId mixer strip → upstream EQ/Compressor/VST3 → VocalThrowProcessor → downstream inserts → fader/pan → WIRE/BUS/MAIN → hardware output.

Core files: engine/builtin_fx/VocalThrow.h (DSP), VocalThrowProcessor.h (JUCE), src/LiveAudioEngine.h (graph install), src/Main.cpp (validated command/readback), src/NativeMixerSessionFxRestore.h (versioned state), scripts/compose_native_peq.py (one picker), web/approved-native-bridge.js (real insert), site/preview-v2/assets/mixer-native-vocal-throw.js (controls only).

## Tests / qualification

The ARMixNativeVocalThrowTests CTest covers zero-added-sample dry, tempo divisions, captured stereo echoes after manual cue, auto-end detection and no self-trigger, bad parameter rejection, 8/44.1/48 kHz sample rates and a global allocator guard around realtime processing. Additional deterministic tests cover 8/48/96 kHz two-tail preservation during a second cue, a full two-tail pool reporting cue refusal rather than overwriting a running phrase, suppression of manual/auto double-cues, and peak containment of dense six-tap echoes. Python native picker/compiled-gui tests enforce no extra mixer screen and real-ACK event names.

Before shipping: exact-SHA Windows MSVC + CTest, actual approved /preview/ Chromium screenshots, ASIO 64/128-frame stress at 44.1/48/96 kHz, live singer audition, device restart, bypass/tail behavior, and Show restore.

## Explicit limitations

1. **Automatic BPM analysis from the music/backing bus is not yet implemented.** Auto currently means automatic vocal phrase-end trigger, not auto-estimated music tempo. BPM is entered or TAP-derived. Full beat tracking requires an independent music-bus feed, beat confidence and phase tracking.
2. Voice end detector uses an adjustable energy-envelope heuristic, not linguistic speech recognition or a trained singing model. Breaths, falsetto and microphone bleed can cause false cues.
3. No MIDI footswitch binding, more than two simultaneous phrase layers, stretchable echo phrases, global music BPM transport integration, or direct song-snapshot binding in this milestone. When both frozen-tail slots are busy, further THROW requests are rejected (native ACK reports not applied) rather than cutting an existing musical phrase.
4. Green quick CI is not equivalent to real Windows native compilation or ASIO device certification. Zero reported PDC applies only to the FX DSP's dry path; end-to-end hardware/driver latency and callback CPU load still require ASIO measurements.
5. Existing channel routing and independent secondary audio clock remain authoritative; the FX insert makes no new claims about unresolved WIRE/SOURCE ONLY issues.

## Field test

Insert ID armix.builtin.vocal-throw.v1 into real ChannelId vocal strip; confirm graph ACK; sing “atau tidak” then press THROW at 72/95/120/160 BPM; try Auto with varying held notes and short breaths; toggle bypass while dry vocal remains direct; change device/quantum and reject stale instance requests. Compare physical ASIO callback xruns, stereo/feedback, click-free fades and singer subjective quality.

## 2026-11-08 — performance and musicality hardening audit

Audit of the first native revision identified these concrete risks:
- Triggering a second phrase reset `playing_` and overwrote the frozen buffer of the first tail; audible repeat discontinuity was possible.
- The original capture copied 24 frames via two per-frame ring modulo operations; this was an avoidable callback hot-path cost.
- Hybrid manual cues could be followed by auto-trigger of the same sung phrase, producing unintended double repeats.
- Wet level changed immediately on edits; close-spaced six-tap feedback-like echoes could produce unnecessarily high wet peaks.

Hardening: two independent frozen voices, bounded cue admission (explicit rejection if full), bulk contiguous ring capture, write cursor without modulo, continuous smoothing of wet/duck gain, current-phrase manual suppression of auto replay, and peak-aware wet overlap normalization. Silence counters are now saturating for multi-hour sessions.

**Realtime caveats:** No heap, locks, logging or file operations in `processStereo`, `throwNow`, or parameter application. Worst-case processing still includes two simultaneous 24-frame copy budgets, and an up-to-twelve-tap mix; on low-buffer ASIO that requires measured xrun and callback-duration evidence, not just source inspection. Extra frozen buffer memory is allocated only on channels with this effect. A full two-voice pool intentionally rejects a new cue, so polyphony and cue policies should be evaluated with vocalist/operator tests.

**Next release gates:** exact-SHA MSVC CTest and native JUCE compile, 64/128-frame ASIO at 44.1/48/96 kHz, overnight stability and lifecycle/device-rate restart, phrase-ending listening sessions including breath/bleed/falsetto, bypass/re-enable and FX graph routing, and latency/xrun baseline comparisons versus bypass. Beat tracking from an isolated backing/music bus (confidence, phase and half/double-time hysteresis) remains a separate architecture milestone, not an already delivered feature.
1 change: 1 addition & 0 deletions engine/builtin_fx/BuiltInFxCatalog.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace armix::builtin_fx {
inline constexpr std::string_view channelEqId = "armix.builtin.channel-eq.v1";
inline constexpr std::string_view channelCompressorId = "armix.builtin.channel-compressor.v1";
inline constexpr std::string_view vocalThrowId = "armix.builtin.vocal-throw.v1";

enum class FilterKind : std::uint8_t { highPass, lowShelf, bell, highShelf, lowPass };
enum class Slope : std::uint8_t { db12 = 12, db24 = 24 };
Expand Down
Loading
Loading