Skip to content

Commit

Permalink
Really correct octave
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed May 1, 2022
1 parent bab148c commit 1edead1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/Cardinal/src/AudioToCVPitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 - 5) + 69.f;
cvPitch = std::max(-10.f, std::min(10.f, linearPitch * (1.f/12.f)));
lastKnownPitchInHz = detectedPitchInHz;
cvSignal = 10.f;
Expand Down

0 comments on commit 1edead1

Please sign in to comment.