mirror of
https://github.com/LMMS/lmms.git
synced 2026-01-27 15:58:11 -05:00
Fix monstro slopes
This commit is contained in:
@@ -817,18 +817,11 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float *
|
||||
}
|
||||
|
||||
|
||||
inline sample_t MonstroSynth::calcSlope1( sample_t s )
|
||||
inline sample_t MonstroSynth::calcSlope( int slope, sample_t s )
|
||||
{
|
||||
if( m_parent->m_slope1 == 1.0f ) return s;
|
||||
if( m_parent->m_slope[slope] == 1.0f ) return s;
|
||||
if( s == 0.0f ) return s;
|
||||
return fastPow( s, m_parent->m_slope1 );
|
||||
}
|
||||
|
||||
inline sample_t MonstroSynth::calcSlope2( sample_t s )
|
||||
{
|
||||
if( m_parent->m_slope2 == 1.0f ) return s;
|
||||
if( s == 0.0f ) return s;
|
||||
return fastPow( s, m_parent->m_slope2 );
|
||||
return fastPow( s, m_parent->m_slope[slope] );
|
||||
}
|
||||
|
||||
|
||||
@@ -1439,14 +1432,14 @@ void MonstroInstrument::updateSamplerate()
|
||||
void MonstroInstrument::updateSlope1()
|
||||
{
|
||||
const float slope = m_env1Slope.value();
|
||||
m_slope1 = exp10f( slope * -1.0f );
|
||||
m_slope[0] = exp10f( slope * -1.0f );
|
||||
}
|
||||
|
||||
|
||||
void MonstroInstrument::updateSlope2()
|
||||
{
|
||||
const float slope = m_env2Slope.value();
|
||||
m_slope2 = exp10f( slope * -1.0f );
|
||||
m_slope[1] = exp10f( slope * -1.0f );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user