Repository navigation
fix: crossfade live voice, formant, stereo and effect switches - #54
Closed
google-labs-stitch[bot] wants to merge 4 commits into
Closed
google-labs-stitch[bot] wants to merge 4 commits into
google-labs-stitch[bot] wants to merge 4 commits into
Conversation
- Preallocate active and shadow 16-reader voice banks. - Crossfade pitch-period jumps across all 16 reader slots. - Write the rendered lead history on every frame. - Separate the delayed raw and LPC filtered source buffers. - Run the LPC inverse analysis continuously on the input. - Remove the audio and effect resets on stereo output changes. - Crossfade the mono and panned voice buses over 256 frames. - Pair reverse cursors in Alien with 200-frame wet ramps. - Preallocate dual reverb banks and decay tails on bypass. - Update the documentation and the README reset section.
- Resolve the merge conflicts in resynthesis, formant and reverb. - Apply harmony_gain to mono harmony voices in VoiceBank. - Use i64 arithmetic and i32 saturation in Q14 crossfades.
- Resolve the merge conflicts in processor and resynthesis. - Keep the crossfade on stereo changes without stage resets. - Share the reader limits across the five harmony slots. - Skip the history interpolation for silent harmony voices.
- Resolve the merge conflict in src/resynthesis.rs - Iterate the voice slices directly in VoiceBank and apply_config - Iterate the reverb banks with enumerate in Reverb::process_frame
Contributor
|
Closing as superseded by #74 (which has a much cleaner architecture for live crossfades). This PR has severe regressions: it runs Formant LPC analysis unconditionally even when formant is disabled, introduces ~2 seconds of silence when enabling Alien (due to offset = 2*k > captured), adds +114 KB of extra buffers, and conflicts with main. |
byteland-app
deleted the
stitch/shadow-bank-dual-buffer-crossfades-jm1-9c1ca476-f7af-4a8a-bc2d-e1a1f444d7e3
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 preallocated shadow banks and dual source buffers so live switches across voice modes, formants, stereo width, Alien and reverb crossfade without clicks, dropouts or stale audio bursts.
src/resynthesis.rs,src/formant.rs): Preallocate active and shadow 16-reader banks (VoiceBank) with per-voice jump crossfades on all 16 reader slots. Writeself.leadon every frame acrossChoirandHarmony, and crossfade the two banks over 256 frames onmodeandchoir_delayswitches.src/resynthesis.rs,src/formant.rs): Preallocate separate 11,568-frame raw (filtered) and LPC (lpc_filtered) buffers with independent shift filter pairs. RunFormant::process_analysiscontinuously on input audio soformant.enabledcrossfades over 256 frames immediately at the event offset.src/resynthesis.rs,src/processor.rs,README.md): Delete the audio, Alien, reverb and feedback resets onstereo_outputchanges. Crossfade the mono and panned voice buses over 256 frames, and update rustdoc andREADME.md.src/effects/alien.rs): Keep pairedReverseCursorstates to start a new capture epoch onalien.enabledand crossfadeloop_frameschanges over 200 frames. Ramp theQ14wet mix over 200 frames on enable and disable switches, and set the boundary fade length to zero atloop_framesof1andmin(200, loop_frames / 2)above1.src/effects/reverb.rs,src/effects.rs): Preallocate two 17,000-sampleDelayLinebuffers and damping filter pairs. Clear the idle or quieter bank whenReverbModechanges while the previous bank decays, and feed zero input acrosstail_framesbefore clear whenreverb.enabledturns off.Verification
cargo build --locked --release,cargo fmt --check,cargo clippy --locked --lib -- -D warningsandcargo doc --locked --no-depspass with zero warnings.GlobalAllocconfirms 0 allocations (0bytes) acrossprocess,set_config,TimedEvent,feedback,telemetry,begin_drain,drainandreset.HEADbit-for-bit across raw mono (0xc9812e128b1492a1), formant mono (0x73e2f09139a992d1) and stereoLargeHallreverb (0x17eed680669fba15).NumericContext::randomstream state stays bit-exact across shadow switches and background lead synthesis when aspiration orChoiris off.HarmonytoChoirpost-silence ghost peak drops from18,214PCM to0PCM;Formantlive enable peak drops from32,767PCM clip to21,008PCM and disable min 128-frame RMS rises from30.3to5,395.4;stereo_outputpost-switch RMS stays at5,712.9(voiced = true);Alien4.35 s stale burst drops from17,554PCM to0PCM with bit-exact unity gain atloop_frames = 1;Reverbpost-tail_framesre-enable stale peak drops from16,736PCM to0PCM.Automated PR initiated by user @byteland-app via Stitch Loop.