From 8621f1479f0c90de5c9fb3215a1157351ee92ede Mon Sep 17 00:00:00 2001 From: Geraint Luff Date: Tue, 29 Apr 2025 15:42:15 +0100 Subject: [PATCH] Clarify formant methods --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dc7b472..a4d06a3 100644 --- a/README.md +++ b/README.md @@ -124,9 +124,20 @@ Using `.seek()`/`.flush()` like this, you can perform an exact time-stretch on a ### Formant compensation -The two methods `.setFormantFactor()` and `.setFormantSemitones()` can specify a scaling-factor for the formants. They both have an optional `compensatePitch` flag, and enabling this . when performing formant correction/shifting. +```cpp +stretch.setFormantFactor(1.2); // up ~3 semitones -The formant correction is not a sharp as monophonic algorithms (such such as PSOLA). It also needs you to give it a rough estimate of fundamental frequency (relative to Nyquist) using `.setFormantBase()`. +stretch.setTransposeSemitones(3); +``` + +Both of those methods both have an optional `compensatePitch` flag. Enabling this adjust for the pitch-shift (or non-linear map) when correcting/shifting formants. + +The formant correction is not a sharp as monophonic algorithms (such such as PSOLA). It also needs you to give it a rough estimate of fundamental frequency (relative to Nyquist): + +```cpp +// if 200Hz is the middle-register of the instrument +stretch.setFormantBase(200/sampleRate); +``` ## Compiling