From dcfa4ebe43dc827e54c6d7f1b68604ca06646822 Mon Sep 17 00:00:00 2001 From: Vesa Date: Sun, 15 Jun 2014 17:29:24 +0300 Subject: [PATCH] Monstro: oops... corrected an error --- plugins/monstro/Monstro.cpp | 23 +++++++++++------------ plugins/monstro/Monstro.h | 1 - 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/plugins/monstro/Monstro.cpp b/plugins/monstro/Monstro.cpp index d3ebbf6b2..660a73476 100644 --- a/plugins/monstro/Monstro.cpp +++ b/plugins/monstro/Monstro.cpp @@ -112,7 +112,6 @@ MonstroSynth::MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph, m_counter3r = 0; m_counterMax = ( m_samplerate * 10 ) / 44100; - m_minfreq_pd = 1.0f / ( m_samplerate / MIN_FREQ ); m_fmCorrection = 44100.f / m_samplerate * FM_AMOUNT; } @@ -152,12 +151,13 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) if( mod##_l2 != 0.0f ) car += m_lfo2_buf[f] * mod##_l2; #define modulatevol( car, mod ) \ - if( mod##_e1 > 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f - mod##_e1 + mod##_e1 * m_env1_buf[f] ), MODCLIP ); \ - if( mod##_e1 < 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f + mod##_e1 * m_env1_buf[f] ), MODCLIP ); \ - if( mod##_e2 > 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f - mod##_e2 + mod##_e2 * m_env2_buf[f] ), MODCLIP ); \ - if( mod##_e2 < 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f + mod##_e2 * m_env2_buf[f] ), MODCLIP ); \ - if( mod##_l1 != 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f + mod##_l1 * m_lfo1_buf[f] ), MODCLIP ); \ - if( mod##_l2 != 0.0f ) car = qBound( -MODCLIP, car * ( 1.0f + mod##_l2 * m_lfo2_buf[f] ), MODCLIP ); + if( mod##_e1 > 0.0f ) car *= ( 1.0f - mod##_e1 + mod##_e1 * m_env1_buf[f] ); \ + if( mod##_e1 < 0.0f ) car *= ( 1.0f + mod##_e1 * m_env1_buf[f] ); \ + if( mod##_e2 > 0.0f ) car *= ( 1.0f - mod##_e2 + mod##_e2 * m_env2_buf[f] ); \ + if( mod##_e2 < 0.0f ) car *= ( 1.0f + mod##_e2 * m_env2_buf[f] ); \ + if( mod##_l1 != 0.0f ) car *= ( 1.0f + mod##_l1 * m_lfo1_buf[f] ); \ + if( mod##_l2 != 0.0f ) car *= ( 1.0f + mod##_l2 * m_lfo2_buf[f] ); \ + car = qBound( -MODCLIP, car, MODCLIP ); // pre-render env's and lfo's renderModulators( _frames ); @@ -192,8 +192,8 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) // get volumes const float o1lv = m_parent->m_osc1l_vol; const float o1rv = m_parent->m_osc1r_vol; - const float o1v_e1 = ( m_parent->m_vol1env1.value() * 2.0f ); - const float o1v_e2 = ( m_parent->m_vol1env2.value() * 2.0f ); + const float o1v_e1 = ( m_parent->m_vol1env1.value() ); + const float o1v_e2 = ( m_parent->m_vol1env2.value() ); const float o1v_l1 = ( m_parent->m_vol1lfo1.value() ); const float o1v_l2 = ( m_parent->m_vol1lfo2.value() ); const bool o1v_mod = o1v_e1 != 0.0f || o1v_e2 != 0.0f || o1v_l1 != 0.0f || o1v_l2 != 0.0f; @@ -246,8 +246,8 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) // get pitch modulators const float o3fb = ( m_parent->m_osc3_freq * m_nph->frequency() ); - const float o3f_e1 = ( m_parent->m_pit3env1.value() ); - const float o3f_e2 = ( m_parent->m_pit3env2.value() ); + const float o3f_e1 = ( m_parent->m_pit3env1.value() * 2.0f ); + const float o3f_e2 = ( m_parent->m_pit3env2.value() * 2.0f ); const float o3f_l1 = ( m_parent->m_pit3lfo1.value() ); const float o3f_l2 = ( m_parent->m_pit3lfo2.value() ); const bool o3f_mod = o3f_e1 != 0.0f || o3f_e2 != 0.0f || o3f_l1 != 0.0f || o3f_l2 != 0.0f; @@ -289,7 +289,6 @@ void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) // // /////////////////////////// - // declare working variables for for loop // phase manipulation vars - these can be reused by all oscs diff --git a/plugins/monstro/Monstro.h b/plugins/monstro/Monstro.h index 1143ddcd1..4b2066c88 100644 --- a/plugins/monstro/Monstro.h +++ b/plugins/monstro/Monstro.h @@ -344,7 +344,6 @@ private: int m_counter3r; int m_counterMax; - float m_minfreq_pd; float m_fmCorrection; };