diff --git a/ChangeLog b/ChangeLog index c0ce0777c..44d458b01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-5-23 Danny McRae + * include/oscillator.h: + FM mixing sometimes calculates a negative "time" for the sampling + which causes bad things to happen when pulling the data out of + a user defined wave. Changed userWaveSample to use the absolute + value of the sample, which fixes the segfaulting problem. Not + sure whether I should care about the negative times elsewhere. + 2006-05-22 Danny McRae * plugins/audio_file_processor/audio_file_processor.h: diff --git a/include/oscillator.h b/include/oscillator.h index 18227922c..fd91f9767 100644 --- a/include/oscillator.h +++ b/include/oscillator.h @@ -196,7 +196,7 @@ public: const sampleFrame * _user_wave, const f_cnt_t _user_wave_frames ) { - const float frame = fraction( _sample ) * _user_wave_frames; + const float frame = fraction( fabs( _sample ) ) * _user_wave_frames; const f_cnt_t f1 = static_cast( frame ); const f_cnt_t f2 = ( f1 + 1 ) % _user_wave_frames; return( linearInterpolate( _user_wave[f1][0],