Repository navigation
feat(harmony): add per-voice mix controls and formant banks - #62
Closed
google-labs-stitch[bot] wants to merge 6 commits into
Closed
google-labs-stitch[bot] wants to merge 6 commits into
google-labs-stitch[bot] wants to merge 6 commits into
Conversation
- Add lead_gain to ResynthesisConfig with validation. - Add per-voice gain, pan, mute and formant controls to HarmonyConfig. - Preallocate five forward synthesis banks and histories in Formant. - Run per-voice formant synthesis and glottal de-emphasis in Harmony. - Scale the harmony voices by harmony_gain in mono and stereo modes. - Accept absent mix and formant fields in the Wasm configuration. - Document the new controls in the rustdoc and README.md.
- Resolve the merge conflicts in README.md. - Update Formant synthesis banks for i64 fixed-point saturation. - Keep per-voice mix and formant controls in Resynthesis.
- Resolve the merge conflict in src/resynthesis.rs. - Share reader bounds across the five harmony slots. - If formants are disabled, skip silent slot interpolation. - Keep per-voice formant synthesis for the five harmony slots.
- Resolve the merge conflict in src/formant.rs. - Borrow steady models for the five synthesis banks. - Blend bank pairs on the stack only during transitions. - Calculate synthesis feedback sums with ring_sum.
- Resolve the merge conflicts in src/formant.rs. - Keep ORDER-sized inverse banks and four-byte stamps. - Set dirty state in Formant::forward_voices for resets.
- Iterate the stretch map with enumerate in Formant::prepare_bank - Iterate the harmony histories as a slice in clear_harmony_history - Keep the audio output identical across all stages
Contributor
Author
|
[CI/CD Fix Attempt 1] Root CauseGitHub Actions Changes
Verification
|
Contributor
byteland-app
deleted the
stitch/per-voice-harmony-mix-and-formant-banks-jm0-b8fbdb20-fd2e-46f0-a8cb-e3106517af94
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 change adds per-voice mix controls (
lead_gain,voice_gains,voice_pansandvoice_mutes) and five separate LPCFormantsynthesis banks (SYNTHESIS_BANKS = 5) for the lead voice and the four harmony voices.Changes
ResynthesisConfig(src/resynthesis.rs):lead_gain: f32(0.0..=1.0, default1.0) with validation inResynthesisConfig::validate.harmony_gain,voice_gainsandvoice_mutesin both mono (stereo_output = false) and stereo (stereo_output = true) output modes, with constant-power stereo placement fromvoice_pans.Formant::forward_voices) and per-voice glottal de-emphasis (model_glottalwith five feedback slots) inHarmonymode before gain and pan summation.Choirmode (render_leadand Choir mix loop),LATENCY_FRAMES(1,593) andtail_frames()unchanged.HarmonyConfig(src/harmony.rs):voice_gains: [f32; 4](0.0..=1.0, default[1.0; 4]),voice_pans: [f32; 4](-1.0..=1.0, default[-1.0 / 3.0, 1.0 / 3.0, -1.0, 1.0]),voice_mutes: [bool; 4](default[false; 4]),voice_formant_stretch: [f32; 4](0.5..=2.0, default[1.0; 4]) andvoice_formant_width: [f32; 4](0.5..=2.0, default[1.0; 4]).HarmonyConfig::validateand scope chord table updates inHarmonyState::apply_configto chord-related fields.Formant(src/formant.rs):ANALYSIS_FRAMES = 441) and preallocate five forward synthesis model rings (66KB) and five synthesis feedback histories inFormant::new.areasinto forward PEF coefficients for the lead bank and each harmony bank throughareas_to_parcorandparcor_to_pef.NumericContextper frame for shared aspiration noise sorandom_seedsequences stay deterministic.src/wasm.rs,README.md):leadGain,voiceGains,voicePans,voiceMutes,voiceFormantStretchandvoiceFormantWidthfields in JavaScript and TypeScript configurations.README.md.Verification
cargo build --locked --release,cargo fmt --check,cargo clippy --locked --lib -- -D warnings,cargo doc --locked --no-depsandnpm run buildpass with zero warnings.process,process_with_events,set_control,apply_config,resetanddrain.ChoirPCM output, zero clipped mono frames (peak = 0.9708) on-6dBFS 4-voiceHarmonyinput atharmony_gain = 0.5, distinct per-voice LPC formant envelopes (4.59dB minimum pairwise RMS separation), single-voice parity with the lead formant bank, and Node.js Wasm configuration roundtrip and validation.Automated PR initiated by user @byteland-app via Stitch Loop.