Repository navigation
feat(pitch)!: enforce vocal range presets and period holdoff - #124
google-labs-stitch[bot] wants to merge 6 commits into
Conversation
- Add VocalRange presets to PitchConfig for Rust and Wasm - Convert the active vocal range bounds into Q6 period limits - Increase ACQUISITION_LAGS to 305 for bass pitch acquisition - Enforce the Q6 period limits in PitchTracker and host reports - Check the cycle clarity at each 5-frame period update - Clear previous_period after 20 ms without a tracked pitch - Clear previous_period and the harmony envelopes on reset - Release the harmony gains when the output period is zero - Set the voice ratios to unity when the output period is zero
- Merge main into the vocal range branch - Keep output peak and dry delay notes in src/lib.rs - Keep vocal range bounds and cycle clarity checks in PitchTracker - Use u32::ilog2 for the parabolic shift count in PitchTracker
|
Round 2 review: DSP holdoff, clarity gate, 40 Hz acquisition, and #125/#87 adaptation look solid, but two Round 1 items were missed:
|
- Merge main 0.3.4 into the vocal range branch - Use tracking_difference in PitchTracker after the clarity check - Clear the harmony envelopes before clear_dirty_ring on reset - Update the reset documentation in Processor for keys 0..=127
- Mark VocalRange as #[non_exhaustive] in src/pitch.rs - Make PitchConfig::vocal_range optional in Wasm and TypeScript - Map an absent or undefined vocalRange value to VocalRange::Custom - Document optional resynthesis.pitch.vocalRange in src/wasm.rs - Document optional resynthesis.pitch.vocalRange in README.md
|
Addressed both Round 1 items and synced with updated
|
- Keep unity ratio on zero period in Resynthesis::move_choir_reader - Clear dwell in Resynthesis::apply_config on a pitch restart - List optional vocalRange with humanize, flexTune and voices in docs - Map VocalRange and PitchConfig links in scripts/normalize-jsdoc.mjs - Check optional vocalRange in scripts/verify-pack.mjs
|
Synced the branch with updated
|
|
Review: Please sync onto updated
|
- Merge the latest main branch into the vocal range branch. - Keep the pitch diff guards and telemetry fields from main. - Document the Q6 period tolerance for boundary pitch reports. - Check each choir voice delay for unvoiced ratio telemetry.
|
Merged
|
Summary
This change adds vocal range presets to
PitchConfig, extends decimated pitch acquisition down to 40 Hz at 44.1 kHz and 48 kHz, enforces the active vocal range inPitchTracker, and clears stale fallback periods after a 20 ms holdoff.#[non_exhaustive]VocalRange(Custom,Soprano,AltoTenor,BaritoneBass) toPitchConfigand re-export it in Rust, WebAssembly and TypeScript.resynthesis.pitch.vocalRangeoptional in WebAssembly and TypeScript (defaulting to"custom"when absent orundefined), and list it in the optional-fields documentation insrc/wasm.rsandREADME.md.Soprano(240..=1100 Hz),AltoTenor(120..=600 Hz),BaritoneBass(45..=360 Hz) andCustom(min_frequency_hz..=max_frequency_hz) to shared inclusiveQ6period limits inPitchConfig::period_bounds, and document the(raw >> 10).max(8)Q6quantization tolerance for boundary pitch reports.threshold,min_frequency_hzandmax_frequency_hzalso whenvocal_rangeselects a named preset.ACQUISITION_LAGS = 305and use2 * ACQUISITION_LAGS - 1for the decimated ring wrap insideHISTORY = 11_568.Q6period limits inPitchTracker::set_config,PitchTracker::detection_lag,PitchTracker::process_sampleandPitchConfig::reportwhile keeping#61threshold-only diff guards (PitchTracker::set_threshold).previous_periodonProcessor::reset, and expireprevious_periodtoQ6::ZEROafter 20 ms without a tracked pitch.Q14::ONE(using each secondary choir voice's own delayed period in bothmove_choir_readerandvoicestelemetry) and release harmonysmoothed_gainwithGAIN_RELEASEwhen the selected period isQ6::ZERO.Verification
40.0..=1100.0 Hz(withBaritoneBass55.00 HzA1to87.31 HzF2) at 44.1 kHz and 48 kHz.103.83 HzinSopranoandCustom200..=800 Hz,500 HzinBaritoneBass,82.41 Hzand880 HzinAltoTenor) producefeedback().voiced == false,telemetry().voiced == false,voice_ratios[0] == 1.0andvoice_gains[1..5] == [0.0; 4].1.0, while 1.0 s of sibilants or breath decaysvoice_gains[1..5]to[0.0; 4]and restoresvoice_ratios[0] == 1.0inHarmonyandChoir(with per-voice delayed unvoiced transitions inChoirTelemetry).Processor::resetclearsprevious_periodand harmony envelopes with0.000 dBRMS difference (<= 0.1 dB) on post-reset sibilants, and verified zero post-construction heap allocations.vocalRangeor settingvocalRange: undefineddefault to"custom"underexactOptionalPropertyTypes: true.cargo fmt --check,cargo rustc --locked --lib --release -- -D warnings,cargo clippy --locked --lib -- -D warnings,RUSTFLAGS="-D warnings" cargo build --locked --release,RUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps,cargo package --locked,npm run check:wasm,npm run verify:pack, and MSRV1.88builds (cargo build --locked --liband--target wasm32-unknown-unknown --features wasm).Automated PR initiated by user @byteland-app via Stitch Loop.