From 20eb81c955344c602ba2b0dc801fd9cec2826c2d Mon Sep 17 00:00:00 2001 From: Wong Cho Ching Date: Wed, 29 Jan 2014 23:46:50 +0800 Subject: [PATCH] bug fix --- plugins/sfxr/sfxr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/sfxr/sfxr.cpp b/plugins/sfxr/sfxr.cpp index 070be1358..66740bca2 100644 --- a/plugins/sfxr/sfxr.cpp +++ b/plugins/sfxr/sfxr.cpp @@ -48,6 +48,7 @@ float frnd(float range) #include "templates.h" #include "tooltip.h" #include "song.h" +#include "midi.h" #include "embed.cpp" @@ -157,7 +158,7 @@ void SfxrSynth::resetSample( bool restart ) - +#include void SfxrSynth::update( sampleFrame * buffer, const fpp_t frameNum ) { for(int i=0;iframesLeftForCurrentPeriod(); - if ( _n->totalFramesPlayed() == 0 ) + if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { _n->m_pluginData = new SfxrSynth( this ); } @@ -467,7 +468,7 @@ void sfxrInstrument::playNote( notePlayHandle * _n, sampleFrame * _working_buffe { for( ch_cnt_t j=0; j(); InstrumentTrack * it = s->m_instrumentTrack; - it->processInEvent( midiEvent( MidiNoteOff, 0, it->baseNoteModel()->value(), 0 ), midiTime() ); + it->silenceAllNotes(); it->processInEvent( midiEvent( MidiNoteOn, 0, it->baseNoteModel()->value(), MidiMaxVelocity ), midiTime() ); }