made rendering happen with one global working-buffer per thread - hopefully improves L1/L2-cache-efficiency
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@890 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* audio_file_processor.cpp - instrument for using audio-files
|
||||
*
|
||||
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* audio_file_processor.h - declaration of class audioFileProcessor
|
||||
* (instrument-plugin for using audio-files)
|
||||
*
|
||||
* Copyright (c) 2004-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* bit_invader.cpp - instrument which uses a usereditable wavetable
|
||||
*
|
||||
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
* Copyright (c) 2006-2008 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
*
|
||||
* 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<bSynth *>( _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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* bit_invader.h - declaration of class bitInvader and bSynth which
|
||||
* are a wavetable synthesizer
|
||||
*
|
||||
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
* Copyright (c) 2006-2008 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
*
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -119,7 +119,8 @@ typedef effectLib::distortion<> distFX;
|
||||
typedef sweepOscillator<effectLib::monoToStereoAdaptor<distFX> > 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<sweepOsc *>( _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<sweepOsc *>( _n->m_pluginData );
|
||||
@@ -191,6 +190,8 @@ pluginView * kickerInstrument::instantiateView( QWidget * _parent )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
kickerInstrumentView::kickerInstrumentView( instrument * _instrument,
|
||||
QWidget * _parent ) :
|
||||
instrumentView( _instrument, _parent )
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 <pgib/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Paul Giblock <pgib/at/users.sourceforge.net>
|
||||
*
|
||||
* 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();
|
||||
}
|
||||
|
||||
@@ -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 <pgib/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Paul Giblock <pgib/at/users.sourceforge.net>
|
||||
*
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* organic.cpp - additive synthesizer for organ-like sounds
|
||||
*
|
||||
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
* Copyright (c) 2006-2008 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
*
|
||||
* 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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* organic.h - additive synthesizer for organ-like sounds
|
||||
*
|
||||
* Copyright (c) 2006-2007 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
* Copyright (c) 2006-2008 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
*
|
||||
* 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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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<sample_t> m_scalers;
|
||||
sampleFrame * m_buffer;
|
||||
|
||||
bool m_filesMissing;
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<stringContainer *>(
|
||||
_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 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user