From 6b7a47aa04871bf3de073b0cc596f35bff2d9749 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sat, 12 Apr 2008 15:09:14 +0000 Subject: [PATCH] do not synthesize anything if frequency is above half of samplerate git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@909 0778d3d1-df1d-0410-868b-ea421aaaa00d --- src/core/oscillator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/oscillator.cpp b/src/core/oscillator.cpp index 7fe9aa5a2..767ae8e25 100644 --- a/src/core/oscillator.cpp +++ b/src/core/oscillator.cpp @@ -55,6 +55,11 @@ oscillator::oscillator( const intModel & _wave_shape_model, void oscillator::update( sampleFrame * _ab, const fpp_t _frames, const ch_cnt_t _chnl ) { + if( m_freq >= engine::getMixer()->sampleRate()/2 ) + { + mixer::clearAudioBuffer( _ab, _frames ); + return; + } if( m_subOsc != NULL ) { switch( m_modulationAlgoModel.value() )