Add Transpose knob: ±12 semitone pitch shift on raw input - #133
Open
VivekRadhakrishna77 wants to merge 3 commits into
Open
VivekRadhakrishna77 wants to merge 3 commits into
VivekRadhakrishna77 wants to merge 3 commits into
Conversation
Adds an input-stage Transpose control (-12..+12 semitones, default 0) that pitch-shifts the raw DI signal before it reaches NAM/amp/cab modeling, mirroring the Neural DSP X-series input transpose. - TransposeProcessor wraps Signalsmith Stretch (MIT), configured with a ~20ms analysis window (vs. the library's ~120ms offline preset) to keep added latency low for live monitoring. - Bypassed at 0 semitones (the default): zero added latency and a bit-exact passthrough, preserving this codebase's "empty chain is transparent" invariant. Latency is re-reported to the host via setLatencySamples() on the bypass<->active edge so PDC stays correct. - Wired into the React/WebView Faceplate UI between Input and Gate, following the existing knob relay/attachment convention. Includes screenshots of the knob and its hover help text (docs/screenshots/). Closes tone-3000#77.
Single notes tracked fine at the previous 20ms window, but chords warbled badly: a phase vocoder's window size sets frequency resolution as well as pitch stability, and 20ms wasn't enough to keep closely- spaced simultaneous fundamentals from blurring together in the engine's peak-picking. Manually bisected up through 40/60/65/70/75ms (all still warbled on chords) to 80ms, the shortest window that holds up; 85-120ms confirmed no cleaner, just more latency, so 80ms is the one to keep for now. Left a TODO on a multi-resolution STFT as the real fix if this latency proves too much for live monitoring. Claude-Session: https://claude.ai/code/session_01JPfwsFhvizbEChYzzE5WEg
Member
|
pretty cool excited to check this out |
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.
Closes #77
Summary
TransposeProcessorwrapping Signalsmith Stretch (phase vocoder), configured with an 80ms analysis window / 4x STFT overlap.setLatencySamples()on the bypass↔active edge so PDC stays accurate.Design notes / known limitation
TransposeProcessor.hproposing a multi-resolution STFT as the real fix if ~80ms proves too much for live monitoring. Deliberately deferred as separate follow-up work rather than blocking this version.Automated testing
test/src/transpose_tests.cpp: 8 tests covering bypass bit-exactness/zero-latency, active-latency bounds, mono-buffer-against-stereo-configured-engine (regression for an OOB read), sample-rate/block-size changes, extreme (±12) shift stability, bypass↔active toggling churn, and octave-up/down pitch-shift correctness (Goertzel-based frequency detection).DspTestssuite: 148/148 passing after this change.Manual testing