Complex time-stretch: HQ offline render + real-time STFT play mode#307
Draft
SynthsBack-lab wants to merge 3 commits into
Draft
Complex time-stretch: HQ offline render + real-time STFT play mode#307SynthsBack-lab wants to merge 3 commits into
SynthsBack-lab wants to merge 3 commits into
Conversation
AudioWarpRender renders a time-stretch/pitch-stretch region offline through the signalsmith-stretch WASM engine, following its warp markers as a piecewise-linear schedule, then replaces the region with the rendered result. Adds the "Render HQ Stretch" region context-menu action and the signalsmith-stretch dependency + typings. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
STFT band phase-prediction time-stretcher ported from signalsmith-stretch v1.3.2 (MIT, (c) Signalsmith Audio): a complex radix-2 FFT, the DynamicSTFT (modified half-bin spectrum, Kaiser perfect-reconstruction window, self-normalising overlap-add), and the stretch core (4-way vertical phase prediction with channel phase-locking, peak-based frequency map with tonality limit, formant preservation). no_std, wasm32 + SIMD128, 17 unit tests. Not yet wired as an engine play mode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wire the ported Signalsmith stretcher into the engine as a live play mode beside the granular one. ComplexStretchSequencer drives the STFT stretcher from a region's warp map per block (output pulse span -> source-sample span via ppqn_to_seconds), pitch as a semitone transpose. Adds an 'algorithm' field (0 granular, 1 complex) to AudioTimeStretchBox, a StretchAlgorithm enum, a parallel per-region sequencer pool with the same pre-warm/recycle lifecycle, adapter get/set, math::log2, and a 'Complex Engine' toggle in the region Play Mode menu. Real-time only in the WASM engine; the TS engine falls back to granular. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Complex time-stretch — HQ offline render + real-time STFT play mode
Draft / RFC — opening early for feedback on the approach before polishing.
Adds a phase-vocoder ("Complex") time-stretch alongside the existing granular one, in three logical commits:
Render HQ Stretchregion action (right-click → Play Mode context) that renders a warped region through thesignalsmith-stretchWASM engine (MIT), following the region's warp markers as a piecewise-linear schedule, and replaces the region with the baked result.no_stdRust port of the Signalsmith Stretch core (complex FFT, dynamic STFT with a Kaiser PR window, 4-way phase prediction with peak-based frequency map + formant preservation) intocrates/engine/src/stretch. Derived fromsignalsmith-stretchv1.3.2 (MIT, © Signalsmith Audio); credited in the module header. 16 unit tests.ComplexStretchSequencerdrives the ported stretcher live from a region's warp map per block (output pulse span → source-sample span viappqn_to_seconds; pitch as a semitone transpose). A newalgorithmenum field onAudioTimeStretchBox(0 granular, 1 complex, default granular so existing projects are unaffected) routes a region to a parallel per-region sequencer pool that mirrors the granular pool's pre-warm/recycle lifecycle. Exposed as a Complex Engine toggle in the region Play Mode menu.How to try it
Set an audio region to Timestretch, then Play Mode → Complex Engine. (Real-time playback uses the WASM engine — on the TS engine a Complex region falls back to granular.)
Known limitations (why this is a draft)
Testing
104 engine tests pass (incl. the new stretch + sequencer tests);
wasm32-unknown-unknownrelease build clean; verified end-to-end in the browser (region → Complex Engine plays through the WASM engine, no panics, correct pitch-preserving stretch).🤖 Generated with Claude Code