Skip to content

Commit

Permalink
Fix bad pitch shifter init values
Browse files Browse the repository at this point in the history
  • Loading branch information
LostRobotMusic authored Jun 27, 2024
1 parent 9a0db6a commit 701afd9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/GranularPitchShifter/GranularPitchShifterEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@ void GranularPitchShifterEffect::changeSampleRate()
m_grains.reserve(8);// arbitrary

m_dcCoeff = std::exp(-2.0 * F_PI * DcRemovalHz / m_sampleRate);

const float pitch = m_granularpitchshifterControls.m_pitchModel.value();
const float pitchSpread = m_granularpitchshifterControls.m_pitchSpreadModel.value();
m_truePitch[0] = pitch - pitchSpread;
m_truePitch[1] = pitch + pitchSpread;
m_speed[0] = std::exp2(m_truePitch[0] * (1. / 12.));
m_speed[1] = std::exp2(m_truePitch[1] * (1. / 12.));
}


Expand Down

0 comments on commit 701afd9

Please sign in to comment.