diff --git a/plugins/monstro/Monstro.cpp b/plugins/monstro/Monstro.cpp index 2940813bc..554756c97 100644 --- a/plugins/monstro/Monstro.cpp +++ b/plugins/monstro/Monstro.cpp @@ -231,8 +231,6 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) // frequency helpers - const int srquot = 1.0 / static_cast( m_samplerate ); - /////////////////////////// // // // start buffer loop // @@ -286,8 +284,8 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) modulatevol( O1R, o1v ) // update osc1 phases - m_osc1l_phase = fraction( m_osc1l_phase + srquot / o1l_f ); - m_osc1r_phase = fraction( m_osc1r_phase + srquot / o1r_f ); + m_osc1l_phase = fraction( m_osc1l_phase + 1.0f / ( static_cast( m_samplerate ) / o1l_f ) ); + m_osc1r_phase = fraction( m_osc1r_phase + 1.0f / ( static_cast( m_samplerate ) / o1r_f ) ); ///////////////////////////// // // @@ -318,8 +316,8 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) modulatevol( O2R, o2v ) // update osc2 phases - m_osc2l_phase = fraction( m_osc2l_phase + srquot / o2l_f ); - m_osc2r_phase = fraction( m_osc2r_phase + srquot / o2r_f ); + m_osc2l_phase = fraction( m_osc2l_phase + ( 1.0f / static_cast( m_samplerate ) / o2l_f ) ); + m_osc2r_phase = fraction( m_osc2r_phase + ( 1.0f / static_cast( m_samplerate ) / o2r_f ) ); ///////////////////////////// // // @@ -379,8 +377,8 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) } // update osc3 phases - m_osc3l_phase = fraction( m_osc3l_phase + srquot / o3l_f ); - m_osc3r_phase = fraction( m_osc3r_phase + srquot / o3r_f ); + m_osc3l_phase = fraction( m_osc3l_phase + ( 1.0f / static_cast( m_samplerate ) / o3l_f ) ); + m_osc3r_phase = fraction( m_osc3r_phase + ( 1.0f / static_cast( m_samplerate ) / o3r_f ) ); _buf[f][0] = O1L + O3L + ( omod == MOD_MIX ? O2L : 0.0f ); _buf[f][1] = O1R + O3R + ( omod == MOD_MIX ? O2R : 0.0f );