From 71217c0d85cf9b5f9624b5e914dc90f5208a734a Mon Sep 17 00:00:00 2001 From: Vesa Date: Sun, 29 Jun 2014 23:28:51 +0300 Subject: [PATCH] Addition to earlier: Fix monstro --- plugins/monstro/Monstro.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/monstro/Monstro.cpp b/plugins/monstro/Monstro.cpp index 9feeae411..86ecdcbec 100644 --- a/plugins/monstro/Monstro.cpp +++ b/plugins/monstro/Monstro.cpp @@ -1245,23 +1245,22 @@ MonstroInstrument::~MonstroInstrument() void MonstroInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) { - fpp_t frames = _n->framesLeftForCurrentPeriod(); - + const fpp_t frames = _n->framesLeftForCurrentPeriod(); + const f_cnt_t offset = _n->offset(); + if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { - _working_buffer += _n->offset(); - frames -= _n->offset(); const sample_rate_t samplerate = m_samplerate; _n->m_pluginData = new MonstroSynth( this, _n, samplerate, m_fpp ); } MonstroSynth * ms = static_cast( _n->m_pluginData ); - ms->renderOutput( frames, _working_buffer ); + ms->renderOutput( frames, _working_buffer + offset ); //applyRelease( _working_buffer, _n ); // we have our own release - instrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); + instrumentTrack()->processAudioBuffer( _working_buffer, frames + offset, _n ); } void MonstroInstrument::deleteNotePluginData( NotePlayHandle * _n )