Repository navigation
feat(harmony): add per-voice harmony mix controls - #40
Closed
google-labs-stitch[bot] wants to merge 3 commits into
Closed
google-labs-stitch[bot] wants to merge 3 commits into
google-labs-stitch[bot] wants to merge 3 commits into
Conversation
- Add lead_gain to ResynthesisConfig and validate its range. - Add voice_gains, voice_pans and voice_mutes to HarmonyConfig. - Validate voice_gains and voice_pans in HarmonyConfig::validate. - Precompute Q14 lead, mono harmony and stereo pan gains. - Apply harmony mix gains in mono and stereo resynthesis. - Accept absent optional harmony mix fields in JavaScript. - Document the harmony mix fields and telemetry gains.
…harmony-mix-jm0-53bd2627-bd38-47e8-9b20-95beaaf0c130 # Conflicts: # README.md # src/resynthesis.rs
…harmony-mix-jm0-53bd2627-bd38-47e8-9b20-95beaaf0c130
Contributor
byteland-app
deleted the
stitch/add-per-voice-harmony-mix-jm0-53bd2627-bd38-47e8-9b20-95beaaf0c130
branch
November 25, 2026 08:06
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds per-voice mix controls for the four harmony voices and a lead voice gain control in
Harmonymode, while keeping the single shared post-mixFormantsynthesis stage and zero audio-path allocations:ResynthesisConfig::lead_gain: Addslead_gain: f32in0.0..=1.0(default1.0) with validation (resynthesis.lead_gain). Slot0scales its output bylead_gainand continues to advance its reader whenlead_gainis0.0, preserving formant stamp alignment.HarmonyConfigper-voice mix controls:voice_gains: [f32; HARMONY_VOICES]in0.0..=1.0(default[1.0, 1.0, 1.0, 1.0]), validated underresynthesis.harmony.voice_gains.voice_pans: [f32; HARMONY_VOICES]in-1.0..=1.0(default[-0.33333334, 0.33333334, -1.0, 1.0]), validated underresynthesis.harmony.voice_pans.voice_mutes: [bool; HARMONY_VOICES](default[false, false, false, false]).Resynthesis::configure_coefficientsprecomputesQ14lead_gain, mono harmony voice gains (harmony_mono), and constant-power stereo pan gains (harmony_pan).Resynthesis::process_sampleappliesharmony_gain,voice_gains, andvoice_mutesin both mono and stereo modes, eliminating default mono overload while keeping stereo output bit-identical to baseline when using default settings.camelCasefields (leadGain,voiceGains,voicePans,voiceMutes) withserdedefaults so existing JavaScript callers remain compatible.Resynthesis::voicesandTelemetry::voice_gainsreport controller envelopes independently of mix controls, and updatessrc/wasm.rsandREADME.md.Verification
cargo build --locked --releasecargo fmt --checkcargo clippy --locked --lib -- -D warningscargo clippy --locked --target wasm32-unknown-unknown --features wasm --lib -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --locked --no-depsnpm run build(wasm-pack+tsc)mainbaseline,0clipped frames on a-6dBFS 4-voice mono Harmony render (harmony_gain = 0.5), lead-only mono output whenharmony_gain = 0.0matchingvoice_mutes = [true; 4], formant envelope alignment whenlead_gain = 0.0, and Node.js Wasm backward compatibility andTimedEventautomation.Automated PR initiated by user @byteland-app via Stitch Loop.