Merge pull request #870 from diizy/watsyn

Watsyn updates
This commit is contained in:
Vesa V
2014-06-20 02:59:29 +03:00
2 changed files with 13 additions and 5 deletions

View File

@@ -153,8 +153,8 @@ void WatsynObject::renderOutput( fpp_t _frames )
const float xt = m_parent->m_xtalk.value();
if( xt > 0.0 )
{
B2_L += ( A1_L * xt ) / 100.0f;
B2_R += ( A1_R * xt ) / 100.0f;
B2_L += ( A1_L * xt ) * 0.01f;
B2_R += ( A1_R * xt ) * 0.01f;
}
// if phase mod, add to phases

View File

@@ -183,17 +183,25 @@ private:
inline void srccpy( float * _dst, float * _src )
{
int err;
const int margin = 64;
// copy to temp array
float * tmp = new float [ GRAPHLEN + margin ];
memcpy( tmp, _src, sizeof( float ) * GRAPHLEN );
memcpy( tmp + GRAPHLEN, _src, sizeof( float ) * margin );
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;
src_data.data_in = tmp;
src_data.input_frames = GRAPHLEN + margin;
src_data.data_out = _dst;
src_data.output_frames = WAVELEN;
src_data.src_ratio = static_cast<double>( WAVERATIO );
src_data.end_of_input = 1;
src_data.end_of_input = 0;
err = src_process( src_state, &src_data );
if( err ) { qDebug( "Watsyn SRC error: %s", src_strerror( err ) ); }
src_delete( src_state );
delete tmp;
}
// memcpy utilizing cubic interpolation