From 63a1acb16d8f08cdb761e56d49d99958d5992e5e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 1 May 2022 07:16:02 +0100 Subject: [PATCH] Really correct octave Signed-off-by: falkTX --- plugins/Cardinal/src/AudioToCVPitch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Cardinal/src/AudioToCVPitch.cpp b/plugins/Cardinal/src/AudioToCVPitch.cpp index ddec7bd4..b556ef79 100644 --- a/plugins/Cardinal/src/AudioToCVPitch.cpp +++ b/plugins/Cardinal/src/AudioToCVPitch.cpp @@ -120,7 +120,7 @@ struct AudioToCVPitch : Module { if (detectedPitchInHz > 0.f && pitchConfidence >= params[PARAM_CONFIDENCETHRESHOLD].getValue() * 0.01f) { - const float linearPitch = 12.f * (log2f(detectedPitchInHz / 440.f) + octave - 6) + 69.f; + const float linearPitch = 12.f * (log2f(detectedPitchInHz / 440.f) + octave - 3) + 69.f; cvPitch = std::max(-10.f, std::min(10.f, linearPitch * (1.f/12.f))); lastKnownPitchInHz = detectedPitchInHz; cvSignal = 10.f;