Reduced CPU usage

This commit is contained in:
Wong Cho Ching
2014-01-28 11:21:46 +08:00
parent d4e5648dca
commit ec71c08816
2 changed files with 3 additions and 4 deletions

View File

@@ -23,7 +23,8 @@
* Boston, MA 02110-1301 USA.
*/
#include <stdlib.h>
#include <cstdlib>
#include <time.h>
#define rnd(n) (rand()%(n+1))
@@ -447,7 +448,6 @@ QString sfxrInstrument::nodeName() const
void sfxrInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffer )
{
m_synthMutex.lock();
fpp_t frameNum = _n->framesLeftForCurrentPeriod();
if ( _n->totalFramesPlayed() == 0 )
{
@@ -456,6 +456,7 @@ void sfxrInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffe
else if( static_cast<SfxrSynth*>(_n->m_pluginData)->isPlaying() == false )
{
_n->noteOff();
return;
}
fpp_t pitchedFrameNum = (_n->frequency()/BaseFreq)*frameNum;
@@ -470,7 +471,6 @@ void sfxrInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffe
}
delete[] pitchedBuffer;
m_synthMutex.unlock();
instrumentTrack()->processAudioBuffer( _working_buffer, frameNum, NULL );
}

View File

@@ -184,7 +184,6 @@ public:
private:
QMutex m_synthMutex;
SfxrZeroToOneFloatModel m_attModel;
SfxrZeroToOneFloatModel m_holdModel;
SfxrZeroToOneFloatModel m_susModel;