Watsyn: use fast sinc instead of medium quality (not much diff in this case), increase oversampling to 32 because why not

Graph: optimize graph widget codepaths so that we don't send redundant samplesChanged signals, which in watsyn cause recalculation of the wavetable
This commit is contained in:
Vesa
2014-04-14 14:15:08 +03:00
parent 79120eb0b1
commit 49d05f466d
4 changed files with 38 additions and 29 deletions

View File

@@ -116,14 +116,13 @@ void WatsynObject::renderOutput( fpp_t _frames )
///////////// A-series /////////////////
// A2
sample_t A2_L = m_A2wave[ static_cast<int>( m_lphase[A2_OSC] ) ] * m_parent->m_lvol[A2_OSC];
/*interpolate( m_A2wave[ static_cast<int>( m_lphase[A2_OSC] ) % WAVELEN ],
sample_t A2_L = linearInterpolate( m_A2wave[ static_cast<int>( m_lphase[A2_OSC] ) ],
m_A2wave[ static_cast<int>( m_lphase[A2_OSC] + 1 ) % WAVELEN ],
fraction( m_lphase[A2_OSC] ) ) * m_parent->m_lvol[A2_OSC];*/
sample_t A2_R = m_A2wave[ static_cast<int>( m_rphase[A2_OSC] ) ] * m_parent->m_rvol[A2_OSC];
/*interpolate( m_A2wave[ static_cast<int>( m_rphase[A2_OSC] ) % WAVELEN ],
fraction( m_lphase[A2_OSC] ) ) * m_parent->m_lvol[A2_OSC];
sample_t A2_R = linearInterpolate( m_A2wave[ static_cast<int>( m_rphase[A2_OSC] ) ],
m_A2wave[ static_cast<int>( m_rphase[A2_OSC] + 1 ) % WAVELEN ],
fraction( m_rphase[A2_OSC] ) ) * m_parent->m_rvol[A2_OSC];*/
fraction( m_rphase[A2_OSC] ) ) * m_parent->m_rvol[A2_OSC];
// if phase mod, add to phases
if( m_amod == MOD_PM )
{
@@ -143,14 +142,12 @@ void WatsynObject::renderOutput( fpp_t _frames )
///////////// B-series /////////////////
// B2
sample_t B2_L = m_B2wave[ static_cast<int>( m_lphase[B2_OSC] ) ] * m_parent->m_lvol[B2_OSC];
/*interpolate( m_B2wave[ static_cast<int>( m_lphase[B2_OSC] ) % WAVELEN ],
m_B2wave[ static_cast<int>( m_lphase[B2_OSC] + 1 ) % WAVELEN ],
fraction( m_lphase[B2_OSC] ) ) * m_parent->m_lvol[B2_OSC];*/
sample_t B2_R = m_B2wave[ static_cast<int>( m_rphase[B2_OSC] ) ] * m_parent->m_rvol[B2_OSC];
/*interpolate( m_B2wave[ static_cast<int>( m_rphase[B2_OSC] ) % WAVELEN ],
m_B2wave[ static_cast<int>( m_rphase[B2_OSC] + 1 ) % WAVELEN ],
fraction( m_rphase[B2_OSC] ) ) * m_parent->m_rvol[B2_OSC];*/
sample_t B2_L = linearInterpolate( m_B2wave[ static_cast<int>( m_lphase[B2_OSC] ) ],
m_B2wave[ static_cast<int>( m_lphase[B2_OSC] + 1 ) % WAVELEN ],
fraction( m_lphase[B2_OSC] ) ) * m_parent->m_lvol[B2_OSC];
sample_t B2_R = linearInterpolate( m_B2wave[ static_cast<int>( m_rphase[B2_OSC] ) ],
m_B2wave[ static_cast<int>( m_rphase[B2_OSC] + 1 ) % WAVELEN ],
fraction( m_rphase[B2_OSC] ) ) * m_parent->m_rvol[B2_OSC];
// if crosstalk active, add a1
const float xt = m_parent->m_xtalk.value();

View File

@@ -59,7 +59,7 @@
const int GRAPHLEN = 220; // don't change - must be same as the size of the widget
const int WAVERATIO = 25; // oversampling ratio
const int WAVERATIO = 32; // oversampling ratio
const int WAVELEN = GRAPHLEN * WAVERATIO;
const int PMOD_AMT = WAVELEN / 2;
@@ -177,7 +177,7 @@ private:
inline void srccpy( float * _dst, float * _src )
{
int err;
SRC_STATE * src_state = src_new( SRC_SINC_MEDIUM_QUALITY, 1, &err );
SRC_STATE * src_state = src_new( SRC_SINC_FASTEST, 1, &err );
SRC_DATA src_data;
src_data.data_in = _src;
src_data.input_frames = GRAPHLEN;