diff --git a/ChangeLog b/ChangeLog index 9af6dcb42..6d18c75d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,45 @@ 2008-04-05 Tobias Doerffel + * plugins/patman/patman.cpp: + * plugins/patman/patman.h: + * plugins/lb302/lb302.cpp: + * plugins/lb302/lb302.h: + * plugins/organic/organic.cpp: + * plugins/organic/organic.h: + * plugins/bit_invader/bit_invader.cpp: + * plugins/bit_invader/bit_invader.h: + * plugins/vibed/vibed.h: + * plugins/vibed/vibed.cpp: + * plugins/triple_oscillator/triple_oscillator.h: + * plugins/triple_oscillator/triple_oscillator.cpp: + * plugins/audio_file_processor/audio_file_processor.cpp: + * plugins/audio_file_processor/audio_file_processor.h: + * plugins/stk/mallets/mallets.cpp: + * plugins/stk/mallets/mallets.h: + * plugins/sf2_player/sf2_player.cpp: + * plugins/sf2_player/sf2_player.h: + * plugins/vestige/vestige.cpp: + * plugins/vestige/vestige.h: + * plugins/kicker/kicker.cpp: + * plugins/kicker/kicker.h: + * include/instrument_play_handle.h: + * include/mixer.h: + * include/instrument_track.h: + * include/instrument.h: + * include/note_play_handle.h: + * include/sample_play_handle.h: + * include/dummy_instrument.h: + * include/preset_preview_play_handle.h: + * include/play_handle.h: + * src/tracks/instrument_track.cpp: + * src/core/preset_preview_play_handle.cpp: + * src/core/note_play_handle.cpp: + * src/core/sample_play_handle.cpp: + * src/core/mixer.cpp: + * src/core/instrument.cpp: + made rendering happen with one global working-buffer per thread - + hopefully improves L1/L2-cache-efficiency + * include/file_browser.h: * src/gui/file_browser.cpp: do not examine directories for being empty when adding them - speeds diff --git a/include/dummy_instrument.h b/include/dummy_instrument.h index 8b92b03f9..068467b5b 100644 --- a/include/dummy_instrument.h +++ b/include/dummy_instrument.h @@ -43,6 +43,9 @@ public: { } + virtual void playNote( notePlayHandle *, bool, sampleFrame * ) + { + } virtual void saveSettings( QDomDocument &, QDomElement & ) { diff --git a/include/instrument.h b/include/instrument.h index a17226499..768c30a92 100644 --- a/include/instrument.h +++ b/include/instrument.h @@ -54,25 +54,26 @@ public: // -------------------------------------------------------------------- // if the plugin doesn't play each note, it can create an instrument- - // play-handle and re-implement this method, so that it mixes it's + // play-handle and re-implement this method, so that it mixes its // output buffer only once per mixer-period - virtual void play( bool _try_parallelizing = FALSE ); + virtual void play( bool _try_parallelizing, + sampleFrame * _working_buffer ); - // to be overloaded by actual plugin - virtual void FASTCALL playNote( notePlayHandle * note_to_play, - bool _try_parallelizing ); + // to be implemented by actual plugin + virtual void playNote( notePlayHandle * _note_to_play, + bool _try_parallelizing, + sampleFrame * _working_buf ) = 0; // needed for deleting plugin-specific-data of a note - plugin has to // cast void-ptr so that the plugin-data is deleted properly // (call of dtor if it's a class etc.) - virtual void FASTCALL deleteNotePluginData( notePlayHandle * - _note_to_play ); + virtual void deleteNotePluginData( notePlayHandle * _note_to_play ); // Get number of sample-frames that should be used when playing beat // (note with unspecified length) // Per default this function returns 0. In this case, channel is using // the length of the longest envelope (if one active). - virtual f_cnt_t FASTCALL beatLen( notePlayHandle * _n ) const; + virtual f_cnt_t beatLen( notePlayHandle * _n ) const; // some instruments need a certain number of release-frames even @@ -91,6 +92,7 @@ public: return( FALSE ); } + // instrument-play-handle-based instruments should return FALSE inline virtual bool notePlayHandleBased( void ) const { return( TRUE ); @@ -111,7 +113,7 @@ public: // instantiate instrument-plugin with given name or return NULL // on failure - static instrument * FASTCALL instantiate( const QString & _plugin_name, + static instrument * instantiate( const QString & _plugin_name, instrumentTrack * _instrument_track ); virtual bool isFromTrack( const track * _track ) const; diff --git a/include/instrument_play_handle.h b/include/instrument_play_handle.h index 2cc274812..81d9a9083 100644 --- a/include/instrument_play_handle.h +++ b/include/instrument_play_handle.h @@ -44,9 +44,10 @@ public: } - inline virtual void play( bool _try_parallelizing ) + inline virtual void play( bool _try_parallelizing, + sampleFrame * _working_buffer ) { - m_instrument->play( _try_parallelizing ); + m_instrument->play( _try_parallelizing, _working_buffer ); } inline virtual bool done( void ) const diff --git a/include/instrument_track.h b/include/instrument_track.h index 75fb813a0..669e2e6d8 100644 --- a/include/instrument_track.h +++ b/include/instrument_track.h @@ -85,7 +85,8 @@ public: // for capturing note-play-events -> need that for arpeggio, // filter and so on - void playNote( notePlayHandle * _n, bool _try_parallelizing ); + void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); QString instrumentName( void ) const; inline const instrument * getInstrument( void ) const diff --git a/include/mixer.h b/include/mixer.h index 755177645..6e0e4aa83 100644 --- a/include/mixer.h +++ b/include/mixer.h @@ -38,7 +38,6 @@ #include "types.h" #include "note.h" -#include "play_handle.h" #include "fifo_buffer.h" @@ -87,6 +86,9 @@ const Keys BaseKey = Key_A; const Octaves BaseOctave = DefaultOctave; +#include "play_handle.h" + + class mixerWorkerThread; @@ -342,6 +344,8 @@ private: fpp_t m_framesPerPeriod; + sampleFrame * m_workingBuf; + surroundSampleFrame * m_readBuf; surroundSampleFrame * m_writeBuf; diff --git a/include/note_play_handle.h b/include/note_play_handle.h index 5866cedf2..29d308c63 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -2,7 +2,7 @@ * note_play_handle.h - declaration of class notePlayHandle which is needed * by LMMS-Play-Engine * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,7 +27,7 @@ #ifndef _NOTE_PLAY_HANDLE_H #define _NOTE_PLAY_HANDLE_H -#include "play_handle.h" +#include "mixer.h" #include "basic_filters.h" #include "bb_track.h" #include "note.h" @@ -63,7 +63,8 @@ public: void updateFrequency( void ); - virtual void play( bool _try_parallelizing ); + virtual void play( bool _try_parallelizing, + sampleFrame * _working_buffer ); virtual inline bool done( void ) const { diff --git a/include/play_handle.h b/include/play_handle.h index ed3ddbf61..6b9df7d85 100644 --- a/include/play_handle.h +++ b/include/play_handle.h @@ -2,7 +2,7 @@ * play_handle.h - base-class playHandle which is needed by * LMMS-Player-Engine * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -60,7 +60,8 @@ public: return( m_type ); } - virtual void play( bool _try_parallelizing = FALSE ) = 0; + virtual void play( bool _try_parallelizing, + sampleFrame * _working_buffer ) = 0; virtual bool done( void ) const = 0; // returns how many frames this play-handle is aligned ahead, i.e. diff --git a/include/preset_preview_play_handle.h b/include/preset_preview_play_handle.h index a922c2867..c91a5177c 100644 --- a/include/preset_preview_play_handle.h +++ b/include/preset_preview_play_handle.h @@ -2,7 +2,7 @@ * preset_preview_play_handle.h - play-handle for playing a short preview-sound * of a preset * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -40,7 +40,8 @@ public: presetPreviewPlayHandle( const QString & _preset_file ); virtual ~presetPreviewPlayHandle(); - virtual void play( bool _try_parallelizing ); + virtual void play( bool _try_parallelizing, + sampleFrame * _working_buffer ); virtual bool done( void ) const; virtual bool isFromTrack( const track * _track ) const; diff --git a/include/sample_play_handle.h b/include/sample_play_handle.h index 03106a2f6..27664944d 100644 --- a/include/sample_play_handle.h +++ b/include/sample_play_handle.h @@ -1,7 +1,7 @@ /* * sample_play_handle.h - play-handle for playing a sample * - * Copyright (c) 2005-2007 Tobias Doerffel + * Copyright (c) 2005-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -28,7 +28,7 @@ #include -#include "play_handle.h" +#include "mixer.h" #include "sample_buffer.h" #include "automatable_model.h" @@ -48,7 +48,8 @@ public: samplePlayHandle( pattern * _pattern ); virtual ~samplePlayHandle(); - virtual void play( bool _try_parallelizing ); + virtual void play( bool _try_parallelizing, + sampleFrame * _working_buffer ); virtual bool done( void ) const; virtual bool isFromTrack( const track * _track ) const; diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index cab905e11..33dae9c90 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -1,7 +1,7 @@ /* * audio_file_processor.cpp - instrument for using audio-files * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -105,24 +105,24 @@ audioFileProcessor::~audioFileProcessor() -void audioFileProcessor::playNote( notePlayHandle * _n, bool ) +void audioFileProcessor::playNote( notePlayHandle * _n, bool, + sampleFrame * _working_buffer ) { const fpp_t frames = _n->framesLeftForCurrentPeriod(); - sampleFrame * buf = new sampleFrame[frames]; if( !_n->m_pluginData ) { _n->m_pluginData = new handleState( _n->hasDetuningInfo() ); } - if( m_sampleBuffer.play( buf, (handleState *)_n->m_pluginData, + if( m_sampleBuffer.play( _working_buffer, + (handleState *)_n->m_pluginData, frames, _n->frequency(), m_loopModel.value() ) == TRUE ) { - applyRelease( buf, _n ); - getInstrumentTrack()->processAudioBuffer( buf, frames, _n ); + applyRelease( _working_buffer, _n ); + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } - delete[] buf; } diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index e9ed1cb9b..983e00e79 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -2,7 +2,7 @@ * audio_file_processor.h - declaration of class audioFileProcessor * (instrument-plugin for using audio-files) * - * Copyright (c) 2004-2007 Tobias Doerffel + * Copyright (c) 2004-2008 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -54,20 +54,20 @@ public: audioFileProcessor( instrumentTrack * _instrument_track ); virtual ~audioFileProcessor(); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void loadSettings( const QDomElement & _this ); - virtual void FASTCALL setParameter( const QString & _param, + virtual void setParameter( const QString & _param, const QString & _value ); virtual QString nodeName( void ) const; - virtual Uint32 FASTCALL getBeatLen( notePlayHandle * _n ) const; + virtual Uint32 getBeatLen( notePlayHandle * _n ) const; virtual f_cnt_t desiredReleaseFrames( void ) const { diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index 033f0b216..98a17ab21 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -1,7 +1,7 @@ /* * bit_invader.cpp - instrument which uses a usereditable wavetable * - * Copyright (c) 2006-2007 Andreas Brandmaier + * Copyright (c) 2006-2008 Andreas Brandmaier * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -261,7 +261,8 @@ QString bitInvader::nodeName( void ) const } -void bitInvader::playNote( notePlayHandle * _n, bool ) +void bitInvader::playNote( notePlayHandle * _n, bool, + sampleFrame * _working_buffer ) { if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { @@ -283,7 +284,6 @@ void bitInvader::playNote( notePlayHandle * _n, bool ) } const fpp_t frames = _n->framesLeftForCurrentPeriod(); - sampleFrame * buf = new sampleFrame[frames]; bSynth * ps = static_cast( _n->m_pluginData ); for( fpp_t frame = 0; frame < frames; ++frame ) @@ -291,15 +291,13 @@ void bitInvader::playNote( notePlayHandle * _n, bool ) const sample_t cur = ps->nextStringSample(); for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl ) { - buf[frame][chnl] = cur; + _working_buffer[frame][chnl] = cur; } } - applyRelease( buf, _n ); + applyRelease( _working_buffer, _n ); - getInstrumentTrack()->processAudioBuffer( buf, frames, _n ); - - delete[] buf; + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } diff --git a/plugins/bit_invader/bit_invader.h b/plugins/bit_invader/bit_invader.h index c4606f07a..9e87d29f5 100644 --- a/plugins/bit_invader/bit_invader.h +++ b/plugins/bit_invader/bit_invader.h @@ -2,7 +2,7 @@ * bit_invader.h - declaration of class bitInvader and bSynth which * are a wavetable synthesizer * - * Copyright (c) 2006-2007 Andreas Brandmaier + * Copyright (c) 2006-2008 Andreas Brandmaier * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -67,14 +67,14 @@ public: bitInvader(instrumentTrack * _channel_track ); virtual ~bitInvader(); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index 2d9422432..ade1869f9 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -119,7 +119,8 @@ typedef effectLib::distortion<> distFX; typedef sweepOscillator > sweepOsc; -void kickerInstrument::playNote( notePlayHandle * _n, bool ) +void kickerInstrument::playNote( notePlayHandle * _n, bool, + sampleFrame * _working_buffer ) { const float decfr = m_decayModel.value() * engine::getMixer()->sampleRate() / 1000.0f; @@ -148,11 +149,10 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool ) const float f1 = m_startFreqModel.value() + tfp * fdiff / decfr; const float f2 = m_startFreqModel.value() + (frames+tfp-1)*fdiff/decfr; - sampleFrame * buf = new sampleFrame[frames]; - sweepOsc * so = static_cast( _n->m_pluginData ); - so->update( buf, frames, f1, f2, engine::getMixer()->sampleRate() ); + so->update( _working_buffer, frames, f1, f2, + engine::getMixer()->sampleRate() ); if( _n->released() ) { @@ -163,18 +163,17 @@ void kickerInstrument::playNote( notePlayHandle * _n, bool ) desiredReleaseFrames(); for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch ) { - buf[f][ch] *= fac; + _working_buffer[f][ch] *= fac; } } } - getInstrumentTrack()->processAudioBuffer( buf, frames, _n ); - - delete[] buf; + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } + void kickerInstrument::deleteNotePluginData( notePlayHandle * _n ) { delete static_cast( _n->m_pluginData ); @@ -191,6 +190,8 @@ pluginView * kickerInstrument::instantiateView( QWidget * _parent ) + + kickerInstrumentView::kickerInstrumentView( instrument * _instrument, QWidget * _parent ) : instrumentView( _instrument, _parent ) diff --git a/plugins/kicker/kicker.h b/plugins/kicker/kicker.h index 7cd07caaa..757f31dd8 100644 --- a/plugins/kicker/kicker.h +++ b/plugins/kicker/kicker.h @@ -41,14 +41,13 @@ public: kickerInstrument( instrumentTrack * _instrument_track ); virtual ~kickerInstrument(); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index 29734de33..8776352b8 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -2,7 +2,7 @@ * lb302.cpp - implementation of class lb302 which is a bass synth attempting * to emulate the Roland TB303 bass synth * - * Copyright (c) 2006-2007 Paul Giblock + * Copyright (c) 2006-2008 Paul Giblock * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -785,7 +785,8 @@ void lb302Synth::initNote( lb302Note *n) } -void lb302Synth::playNote( notePlayHandle * _n, bool ) +void lb302Synth::playNote( notePlayHandle * _n, bool, + sampleFrame * _working_buffer ) { fpp_t framesPerPeriod = engine::getMixer()->framesPerPeriod(); @@ -947,12 +948,8 @@ void lb302Synth::playNote( notePlayHandle * _n, bool ) } - sampleFrame *buf = new sampleFrame[frames]; - - process(buf, frames); - getInstrumentTrack()->processAudioBuffer( buf, frames, _n ); - - delete[] buf; + process( _working_buffer, frames); + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); lastFramesPlayed = frames; //_n->framesLeftForCurrentPeriod(); //_n->totalFramesPlayed(); } diff --git a/plugins/lb302/lb302.h b/plugins/lb302/lb302.h index 99a88f88c..16abea6d6 100644 --- a/plugins/lb302/lb302.h +++ b/plugins/lb302/lb302.h @@ -2,7 +2,7 @@ * lb302.h - declaration of class lb302 which is a bass synth attempting to * emulate the Roland TB303 bass synth * - * Copyright (c) 2006-2007 Paul Giblock + * Copyright (c) 2006-2008 Paul Giblock * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -191,14 +191,13 @@ public: lb302Synth( instrumentTrack * _channel_track ); virtual ~lb302Synth(); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index a863f608d..6a7bdad15 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -1,7 +1,7 @@ /* * organic.cpp - additive synthesizer for organ-like sounds * - * Copyright (c) 2006-2007 Andreas Brandmaier + * Copyright (c) 2006-2008 Andreas Brandmaier * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -182,7 +182,8 @@ QString organicInstrument::nodeName( void ) const -void organicInstrument::playNote( notePlayHandle * _n, bool ) +void organicInstrument::playNote( notePlayHandle * _n, bool, + sampleFrame * _working_buffer ) { if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { @@ -256,10 +257,9 @@ void organicInstrument::playNote( notePlayHandle * _n, bool ) )->oscRight; const fpp_t frames = _n->framesLeftForCurrentPeriod(); - sampleFrame * buf = new sampleFrame[frames]; - - osc_l->update( buf, frames, 0 ); - osc_r->update( buf, frames, 1 ); + + osc_l->update( _working_buffer, frames, 0 ); + osc_r->update( _working_buffer, frames, 1 ); // -- fx section -- @@ -269,17 +269,15 @@ void organicInstrument::playNote( notePlayHandle * _n, bool ) for (int i=0 ; i < frames ; i++) { - buf[i][0] = waveshape( buf[i][0], t ) * m_volModel.value() - / 100.0f; - buf[i][1] = waveshape( buf[i][1], t ) * m_volModel.value() - / 100.0f; + _working_buffer[i][0] = waveshape( _working_buffer[i][0], t ) * + m_volModel.value() / 100.0f; + _working_buffer[i][1] = waveshape( _working_buffer[i][1], t ) * + m_volModel.value() / 100.0f; } // -- -- - getInstrumentTrack()->processAudioBuffer( buf, frames, _n ); - - delete[] buf; + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } diff --git a/plugins/organic/organic.h b/plugins/organic/organic.h index 9576d4d46..c1e62d8d0 100644 --- a/plugins/organic/organic.h +++ b/plugins/organic/organic.h @@ -1,7 +1,7 @@ /* * organic.h - additive synthesizer for organ-like sounds * - * Copyright (c) 2006-2007 Andreas Brandmaier + * Copyright (c) 2006-2008 Andreas Brandmaier * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -83,14 +83,13 @@ public: organicInstrument( instrumentTrack * _channel_track ); virtual ~organicInstrument(); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 9950cb52e..f61998e90 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -132,7 +132,8 @@ QString patmanInstrument::nodeName( void ) const -void patmanInstrument::playNote( notePlayHandle * _n, bool ) +void patmanInstrument::playNote( notePlayHandle * _n, bool, + sampleFrame * _working_buffer ) { if( m_patchFile == "" ) { @@ -140,7 +141,6 @@ void patmanInstrument::playNote( notePlayHandle * _n, bool ) } const fpp_t frames = _n->framesLeftForCurrentPeriod(); - sampleFrame * buf = new sampleFrame[frames]; if( !_n->m_pluginData ) { @@ -151,12 +151,12 @@ void patmanInstrument::playNote( notePlayHandle * _n, bool ) float play_freq = hdata->tuned ? _n->frequency() : hdata->sample->frequency(); - if( hdata->sample->play( buf, hdata->state, frames, play_freq, - m_loopedModel.value() ) ) + if( hdata->sample->play( _working_buffer, hdata->state, frames, + play_freq, m_loopedModel.value() ) ) { - getInstrumentTrack()->processAudioBuffer( buf, frames, _n ); + getInstrumentTrack()->processAudioBuffer( _working_buffer, + frames, _n ); } - delete[] buf; } diff --git a/plugins/patman/patman.h b/plugins/patman/patman.h index 98fd175d2..ae49d504e 100644 --- a/plugins/patman/patman.h +++ b/plugins/patman/patman.h @@ -68,13 +68,12 @@ public: patmanInstrument( instrumentTrack * _track ); virtual ~patmanInstrument(); - virtual void playNote( notePlayHandle * _n, - bool _try_parallelizing ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void saveSettings( QDomDocument & _doc, - QDomElement & _parent ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); virtual void setParameter( const QString & _param, diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 0a223600c..cfae2b658 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -210,7 +210,7 @@ void sf2Instrument::updatePatch( void ) -void sf2Instrument::playNote( notePlayHandle * _n, bool ) +void sf2Instrument::playNote( notePlayHandle * _n, bool, sampleFrame * ) { const float LOG440 = 2.64345267649f; @@ -245,19 +245,18 @@ void sf2Instrument::playNote( notePlayHandle * _n, bool ) -void sf2Instrument::play( bool _try_parallelizing ) +void sf2Instrument::play( bool _try_parallelizing, + sampleFrame * _working_buffer ) { const fpp_t frames = engine::getMixer()->framesPerPeriod(); - sampleFrame * buf = new sampleFrame[frames]; - m_synthMutex.lock(); - fluid_synth_write_float( m_synth, frames, buf, 0, 2, buf, 1, 2 ); + fluid_synth_write_float( m_synth, frames, _working_buffer, 0, 2, + _working_buffer, 1, 2 ); m_synthMutex.unlock(); - getInstrumentTrack()->processAudioBuffer( buf, frames, NULL ); - - delete[] buf; + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, + NULL ); } diff --git a/plugins/sf2_player/sf2_player.h b/plugins/sf2_player/sf2_player.h index baa01b7c7..817cd6826 100644 --- a/plugins/sf2_player/sf2_player.h +++ b/plugins/sf2_player/sf2_player.h @@ -49,16 +49,16 @@ public: sf2Instrument( instrumentTrack * _instrument_track ); virtual ~sf2Instrument(); - virtual void play( bool _try_parallelizing ); + virtual void play( bool _try_parallelizing, + sampleFrame * _working_buffer ); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index ca729599c..8cd3868e9 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -126,8 +126,6 @@ malletsInstrument::malletsInstrument( instrumentTrack * _instrument_track ): m_scalers.append( 16.0 ); m_presetsModel.addItem( tr( "Tibetan Bowl" ) ); m_scalers.append( 7.0 ); - - m_buffer = new sampleFrame[engine::getMixer()->framesPerPeriod()]; } @@ -135,7 +133,6 @@ malletsInstrument::malletsInstrument( instrumentTrack * _instrument_track ): malletsInstrument::~malletsInstrument() { - delete[] m_buffer; } @@ -209,7 +206,8 @@ QString malletsInstrument::nodeName( void ) const -void malletsInstrument::playNote( notePlayHandle * _n, bool ) +void malletsInstrument::playNote( notePlayHandle * _n, bool, + sampleFrame * _working_buffer ) { if( m_filesMissing ) { @@ -274,18 +272,13 @@ void malletsInstrument::playNote( notePlayHandle * _n, bool ) } for( fpp_t frame = 0; frame < frames; ++frame ) { - const sample_t left = ps->nextSampleLeft() * - ( m_scalers[m_presetsModel.value()] + add_scale ); - const sample_t right = ps->nextSampleRight() * - ( m_scalers[m_presetsModel.value()] + add_scale ); - for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS / 2; ++chnl ) - { - m_buffer[frame][chnl * DEFAULT_CHANNELS / 2] = left; - m_buffer[frame][( chnl + 1 ) * DEFAULT_CHANNELS / 2] = right; - } + _working_buffer[frame][0] = ps->nextSampleLeft() * + ( m_scalers[m_presetsModel.value()] + add_scale ); + _working_buffer[frame][1] = ps->nextSampleRight() * + ( m_scalers[m_presetsModel.value()] + add_scale ); } - getInstrumentTrack()->processAudioBuffer( m_buffer, frames, _n ); + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } diff --git a/plugins/stk/mallets/mallets.h b/plugins/stk/mallets/mallets.h index f0f18a32e..b15134736 100644 --- a/plugins/stk/mallets/mallets.h +++ b/plugins/stk/mallets/mallets.h @@ -123,19 +123,19 @@ public: malletsInstrument( instrumentTrack * _channel_track ); virtual ~malletsInstrument( void ); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; virtual pluginView * instantiateView( QWidget * _parent ); + private: knobModel m_hardnessModel; knobModel m_positionModel; @@ -160,7 +160,6 @@ private: knobModel m_spreadModel; QVector m_scalers; - sampleFrame * m_buffer; bool m_filesMissing; diff --git a/plugins/triple_oscillator/triple_oscillator.cpp b/plugins/triple_oscillator/triple_oscillator.cpp index a4dfe4c96..894e45736 100644 --- a/plugins/triple_oscillator/triple_oscillator.cpp +++ b/plugins/triple_oscillator/triple_oscillator.cpp @@ -319,7 +319,8 @@ QString tripleOscillator::nodeName( void ) const -void tripleOscillator::playNote( notePlayHandle * _n, bool ) +void tripleOscillator::playNote( notePlayHandle * _n, bool, + sampleFrame * _working_buffer ) { if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { @@ -383,16 +384,13 @@ void tripleOscillator::playNote( notePlayHandle * _n, bool ) )->oscRight; const fpp_t frames = _n->framesLeftForCurrentPeriod(); - sampleFrame * buf = new sampleFrame[frames]; - osc_l->update( buf, frames, 0 ); - osc_r->update( buf, frames, 1 ); + osc_l->update( _working_buffer, frames, 0 ); + osc_r->update( _working_buffer, frames, 1 ); - applyRelease( buf, _n ); + applyRelease( _working_buffer, _n ); - getInstrumentTrack()->processAudioBuffer( buf, frames, _n ); - - delete[] buf; + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } diff --git a/plugins/triple_oscillator/triple_oscillator.h b/plugins/triple_oscillator/triple_oscillator.h index a00a1523c..487995044 100644 --- a/plugins/triple_oscillator/triple_oscillator.h +++ b/plugins/triple_oscillator/triple_oscillator.h @@ -98,16 +98,15 @@ public: tripleOscillator( instrumentTrack * _track ); virtual ~tripleOscillator(); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); - virtual void FASTCALL setParameter( const QString & _param, + virtual void setParameter( const QString & _param, const QString & _value ); virtual QString nodeName( void ) const; diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index c912c80e0..afacd1c95 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -231,7 +231,7 @@ void vestigeInstrument::waitForWorkerThread( void ) -void vestigeInstrument::play( bool _try_parallelizing ) +void vestigeInstrument::play( bool _try_parallelizing, sampleFrame * ) { m_pluginMutex.lock(); if( m_plugin == NULL ) @@ -254,7 +254,7 @@ void vestigeInstrument::play( bool _try_parallelizing ) -void vestigeInstrument::playNote( notePlayHandle * _n, bool ) +void vestigeInstrument::playNote( notePlayHandle * _n, bool, sampleFrame * ) { m_pluginMutex.lock(); if( _n->totalFramesPlayed() == 0 && m_plugin != NULL ) diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index dc9a1b87b..927487464 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -50,20 +50,20 @@ public: vestigeInstrument( instrumentTrack * _channel_track ); virtual ~vestigeInstrument(); - virtual void play( bool _try_parallelizing ); + virtual void play( bool _try_parallelizing, + sampleFrame * _working_buffer ); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; - virtual void FASTCALL setParameter( const QString & _param, + virtual void setParameter( const QString & _param, const QString & _value ); virtual bool supportsParallelizing( void ) const diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index dda79e1bc..e94649e7b 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -271,7 +271,7 @@ QString vibed::nodeName( void ) const -void vibed::playNote( notePlayHandle * _n, bool ) +void vibed::playNote( notePlayHandle * _n, bool, sampleFrame * _working_buffer ) { if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == NULL ) { @@ -304,12 +304,10 @@ void vibed::playNote( notePlayHandle * _n, bool ) stringContainer * ps = static_cast( _n->m_pluginData ); - sampleFrame * buf = new sampleFrame[frames]; - for( fpp_t i = 0; i < frames; ++i ) { - buf[i][0] = 0.0f; - buf[i][1] = 0.0f; + _working_buffer[i][0] = 0.0f; + _working_buffer[i][1] = 0.0f; Uint8 s = 0; for( Uint8 string = 0; string < 9; ++string ) { @@ -319,19 +317,17 @@ void vibed::playNote( notePlayHandle * _n, bool ) const float pan = ( m_panKnobs[string]->value() + 1 ) / 2.0f; - const sample_t sample = ps->getStringSample( - s ) * + const sample_t sample = + ps->getStringSample( s ) * m_volumeKnobs[string]->value() / 100.0f; - buf[i][0] += ( 1.0f - pan ) * sample; - buf[i][1] += pan * sample; + _working_buffer[i][0] += ( 1.0f - pan ) * sample; + _working_buffer[i][1] += pan * sample; s++; } } } - getInstrumentTrack()->processAudioBuffer( buf, frames, _n ); - - delete[] buf; + getInstrumentTrack()->processAudioBuffer( _working_buffer, frames, _n ); } diff --git a/plugins/vibed/vibed.h b/plugins/vibed/vibed.h index 4ad3494ad..a30208f2d 100644 --- a/plugins/vibed/vibed.h +++ b/plugins/vibed/vibed.h @@ -45,14 +45,13 @@ public: vibed( instrumentTrack * _channel_track ); virtual ~vibed(); - virtual void FASTCALL playNote( notePlayHandle * _n, - bool _try_parallelizing ); - virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n ); + virtual void playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ); + virtual void deleteNotePluginData( notePlayHandle * _n ); - virtual void FASTCALL saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void FASTCALL loadSettings( const QDomElement & _this ); + virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); + virtual void loadSettings( const QDomElement & _this ); virtual QString nodeName( void ) const; diff --git a/src/core/instrument.cpp b/src/core/instrument.cpp index 9e51a9496..7b77efd05 100644 --- a/src/core/instrument.cpp +++ b/src/core/instrument.cpp @@ -49,14 +49,7 @@ instrument::~instrument() -void instrument::play( bool ) -{ -} - - - - -void instrument::playNote( notePlayHandle *, bool ) +void instrument::play( bool, sampleFrame * ) { } diff --git a/src/core/mixer.cpp b/src/core/mixer.cpp index 8c0ce5da6..70888900f 100644 --- a/src/core/mixer.cpp +++ b/src/core/mixer.cpp @@ -68,6 +68,39 @@ sample_rate_t SAMPLE_RATES[QUALITY_LEVELS] = { 44100, 88200 } ; + +#define ALIGN_SIZE 64 + +void aligned_free( void * _buf ) +{ + if( _buf != NULL ) + { + int *ptr2=(int *)_buf - 1; + _buf = (char *)_buf- *ptr2; + free(_buf); + } +} + +void * aligned_malloc( int _bytes ) +{ + char *ptr,*ptr2,*aligned_ptr; + int align_mask = ALIGN_SIZE- 1; + ptr=(char *)malloc(_bytes +ALIGN_SIZE+ sizeof(int)); + if(ptr==NULL) return(NULL); + + ptr2 = ptr + sizeof(int); + aligned_ptr = ptr2 + (ALIGN_SIZE- ((size_t)ptr2 & align_mask)); + + + ptr2 = aligned_ptr - sizeof(int); + *((int *)ptr2)=(int)(aligned_ptr - ptr); + + return(aligned_ptr); +} + + + + class mixerWorkerThread : public QThread { public: @@ -146,6 +179,9 @@ public: private: virtual void run( void ) { + sampleFrame * working_buf = (sampleFrame *) aligned_malloc( + m_mixer->framesPerPeriod() * + sizeof( sampleFrame ) ); m_jobWait.acquire(); m_jobAccepted.acquire(); m_idle = TRUE; @@ -167,7 +203,7 @@ private: switch( it->type ) { case PlayHandle: - it->playHandleJob->play(); + it->playHandleJob->play( FALSE, working_buf ); break; case AudioPortEffects: { @@ -196,6 +232,7 @@ private: m_idle = TRUE; m_sem->release(); } + aligned_free( working_buf ); } mixer * m_mixer; @@ -211,6 +248,7 @@ private: mixer::mixer( void ) : m_framesPerPeriod( DEFAULT_BUFFER_SIZE ), + m_workingBuf( NULL ), m_readBuf( NULL ), m_writeBuf( NULL ), m_cpuLoad( 0 ), @@ -249,10 +287,14 @@ mixer::mixer( void ) : m_fifo = new fifo( 1 ); } + m_workingBuf = (sampleFrame*) aligned_malloc( m_framesPerPeriod * + sizeof( sampleFrame ) ); for( Uint8 i = 0; i < 3; i++ ) { - m_readBuf = new surroundSampleFrame[m_framesPerPeriod]; - + m_readBuf = (surroundSampleFrame*) + aligned_malloc( m_framesPerPeriod * + sizeof( surroundSampleFrame ) ); + clearAudioBuffer( m_readBuf, m_framesPerPeriod ); m_bufferPool.push_back( m_readBuf ); } @@ -287,8 +329,10 @@ mixer::~mixer() for( Uint8 i = 0; i < 3; i++ ) { - delete[] m_bufferPool[i]; + aligned_free( m_bufferPool[i] ); } + + aligned_free( m_workingBuf ); } @@ -435,7 +479,7 @@ const surroundSampleFrame * mixer::renderNextBuffer( void ) playHandle * n = m_playHandles[idx]; if( !n->done() && n->supportsParallelizing() ) { - n->play( TRUE ); + n->play( TRUE, m_workingBuf ); par_hndls.push_back( n ); } ++idx; @@ -489,7 +533,7 @@ if( COND_NPH ) if( !( *it )->done() ) { - ( *it )->play(); + ( *it )->play( FALSE, m_workingBuf ); } } } diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index 43fce715e..7e57576d5 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -157,7 +157,8 @@ notePlayHandle::~notePlayHandle() -void notePlayHandle::play( bool _try_parallelizing ) +void notePlayHandle::play( bool _try_parallelizing, + sampleFrame * _working_buffer ) { if( m_muted == TRUE ) { @@ -177,7 +178,8 @@ void notePlayHandle::play( bool _try_parallelizing ) if( framesLeft() > 0 ) { // play note! - m_instrumentTrack->playNote( this, _try_parallelizing ); + m_instrumentTrack->playNote( this, _try_parallelizing, + _working_buffer ); } if( m_released == TRUE ) @@ -238,7 +240,7 @@ void notePlayHandle::play( bool _try_parallelizing ) for( notePlayHandleVector::iterator it = m_subNotes.begin(); it != m_subNotes.end(); ) { - ( *it )->play( _try_parallelizing ); + ( *it )->play( _try_parallelizing, _working_buffer ); if( ( *it )->done() ) { delete *it; diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index fd49786b2..89c902f5a 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -161,9 +161,10 @@ presetPreviewPlayHandle::~presetPreviewPlayHandle() -void presetPreviewPlayHandle::play( bool _try_parallelizing ) +void presetPreviewPlayHandle::play( bool _try_parallelizing, + sampleFrame * _working_buffer ) { - m_previewNote->play( _try_parallelizing ); + m_previewNote->play( _try_parallelizing, _working_buffer ); } diff --git a/src/core/sample_play_handle.cpp b/src/core/sample_play_handle.cpp index 4af9e3a13..1ea51f72d 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/sample_play_handle.cpp @@ -116,7 +116,8 @@ samplePlayHandle::~samplePlayHandle() -void samplePlayHandle::play( bool /* _try_parallelizing */ ) +void samplePlayHandle::play( bool /* _try_parallelizing */, + sampleFrame * _working_buffer ) { //play( 0, _try_parallelizing ); if( framesDone() >= totalFrames() ) @@ -128,14 +129,11 @@ void samplePlayHandle::play( bool /* _try_parallelizing */ ) if( !( m_track && m_track->muted() ) && !( m_bbTrack && m_bbTrack->muted() ) ) { - sampleFrame * buf = new sampleFrame[frames]; stereoVolumeVector v = { { m_volumeModel->value(), m_volumeModel->value() } }; - m_sampleBuffer->play( buf, &m_state, frames ); - engine::getMixer()->bufferToPort( buf, frames, offset(), v, - m_audioPort ); - - delete[] buf; + m_sampleBuffer->play( _working_buffer, &m_state, frames ); + engine::getMixer()->bufferToPort( _working_buffer, frames, + offset(), v, m_audioPort ); } m_frame += frames; diff --git a/src/tracks/instrument_track.cpp b/src/tracks/instrument_track.cpp index aad734b8d..4f841cd30 100644 --- a/src/tracks/instrument_track.cpp +++ b/src/tracks/instrument_track.cpp @@ -338,7 +338,8 @@ void instrumentTrack::processOutEvent( const midiEvent & _me, -void instrumentTrack::playNote( notePlayHandle * _n, bool _try_parallelizing ) +void instrumentTrack::playNote( notePlayHandle * _n, bool _try_parallelizing, + sampleFrame * _working_buffer ) { // arpeggio- and chord-widget has to do its work -> adding sub-notes // for chords/arpeggios @@ -400,7 +401,8 @@ void instrumentTrack::playNote( notePlayHandle * _n, bool _try_parallelizing ) } } // all is done, so now lets play the note! - m_instrument->playNote( _n, _try_parallelizing ); + m_instrument->playNote( _n, _try_parallelizing, + _working_buffer ); } }