Audio transformation: relative pitch, formants, grains and freeze
A separate investigation of incoming stereo-audio transformation and its latency and MIDI-control contract.
Technical research · edition 2 · reviewed 2026-10-24

Prismal Labs native editor capture, illustrating the corresponding software project. View full-size image
What we found
The audio-transformer work exposed a useful neutral-setting requirement: zero pitch/formant shift should preserve the delayed original stereo signal, rather than rebuild it through a vocoder bank. The bank is used for a bounded correction around that signal. We also made the MIDI contract relative: a note changes the transposition ratio, not the detected pitch of a singer.
The resulting design separates grain pitch shift, spectral-envelope correction and fixed latency. Those findings apply to creative vocal effects, stereo pitch processors and any wet/dry system with an internal delay.
Two overlapping read heads, one fixed latency
For grain window W in samples and requested pitch ratio r, the shared input engine advances a normalized delay phase by (1-r)/W. A second head is half a cycle away. The first uses Hann weight w = 0.5-0.5*cos(2*pi*phase) and the second uses 1-w.
The read delays are L+(phase-0.5)*W and L+(secondPhase-0.5)*W, where L=ceil(0.12*sampleRate). The source is read with interpolation from prepared stereo buffers. Both heads remain active at unity transposition. The dry path uses the same fixed latency, preventing a neutral wet/dry blend from mixing unrelated time positions.
The ratio is 2^((transpose + fineCents/100 + alternation)/12). At 48 kHz, the declared 120 ms delay is 5,760 samples. It remains present at neutral settings and bypass, so a host can compensate consistently rather than seeing a parameter-dependent latency jump.
Correct a stereo signal instead of resynthesizing it
The processor analyzes both the delayed input envelope and the pitch-shifted excitation. For a desired remapped band envelope d_j and carrier/excitation envelope c_j, its bounded target correction is clamp(d_j/max(0.001,c_j), 0.15, 4), smoothed over 12 ms.
Each stereo channel keeps its shifted signal and adds a band correction proportional to 0.7*(ratio_j-1). At the explicitly neutral setting the target ratios are one, so the correction vanishes. The left and right correction filters use the same gains while preserving their own signal histories; the audio is not collapsed into a mono resynthesis output.
The denominator floor and gain cap prevent weak bands from demanding unbounded boosts. They also limit how completely a formant transform can match a target envelope. That is a deliberate numerical and sonic tradeoff, not a transparent correction guarantee.
MIDI controls a relative interval
MIDI changes are enabled in new patches. Notes set a relative pitch offset from Reference note (default C3 / MIDI 60): MIDI 72 shifts incoming audio up twelve semitones. Manual Transpose and Fine add to that offset. This does not detect or correct the singer's absolute pitch. The last played note wins; releasing it falls back to a held note, or retains the last pitch when none remain. Audio continues before the first note and after note-off. MIDI never supplies sound without audio.
The MIDI / EXPRESSION page sets glide (20 ms by default), pitch-bend range (default ±2 semitones) and CC74 formant depth (default ±12 semitones, centered). MIDI changes and Reference note are on that page too. CC64 sustains held controls; CC123 resets the channel's MIDI changes without clearing audio processing. Turn MIDI changes off for knob-only processing. Older v1 sessions load with MIDI changes disabled, preserving their sound. Existing parameter IDs and plug-in identities are unchanged.
Evidence: AudioTransformer/README.md.
What to measure
First compare neutral output against the appropriately delayed input with effects disabled and known output trim. Account for the gentle 10 Hz DC blocker. Use distinct left/right signals to detect an accidental mono path. Then apply octave shifts and inspect frequency ratios without claiming absolute pitch tracking.
Test audio before the first note, after the last release and with MIDI changes disabled. Audio must continue because it is the excitation. Test the last-note/held-note fallback, sustain and CC123 without clearing the audio stream. Finally change pitch/formant while a grain is active and inspect continuity, fixed latency and saved-state recall.
Applying the findings
When designing an input effect, write the neutral-path contract before the special effects. Align every dry/bypass route with the declared processing delay. Use bounded spectral ratios around a preserved source when a filter-bank resynthesis would unnecessarily discard stereo detail.
Expose reference-note transposition as a relative interval: with reference MIDI 60, MIDI 72 adds twelve semitones. That is useful without pitch detection, provided the interface does not imply that the output has been tuned to an absolute C.
Limits and open questions
This is creative grain/spectral processing. It does not detect or correct a singer's fundamental, and it can introduce grain texture, spectral coloration and monitoring delay. Freeze needs active input to seed the held envelope. Version-1 states disable the newer MIDI changes on migration to preserve their behavior; the separate instrument cannot read another product's state.
Primary references
Research provenance
The methods and results above are drawn from these retained research records. Dates and product versions inside the article identify the scope of each experiment; publication review does not mean the hardware or numerical tests were rerun.
shared/include/prismal/dsp/vocal/input_engine.h— SHA-256d2ad9fb81a2a1bb2f72a01fd4c6a9b4a32ae65f2928dbbe3f3e389e9c6c33f2dAudioTransformer/README.md— SHA-256518002293a1a938709f628c17dd1ee0ba92095909624b459ff39c32604461f33
