first attempt at adding effects
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@294 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -44,6 +44,7 @@ vibratingString::vibratingString( float _pitch,
|
||||
m_stringLoss( 1.0f - _string_loss ),
|
||||
m_state( 0.1f )
|
||||
{
|
||||
m_outsamp = bufferAllocator::alloc<sample_t>( m_oversample );
|
||||
int string_length;
|
||||
|
||||
string_length = static_cast<int>( m_oversample *_sample_rate /
|
||||
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
|
||||
inline ~vibratingString( void )
|
||||
{
|
||||
bufferAllocator::free( m_outsamp );
|
||||
bufferAllocator::free( m_impulse );
|
||||
vibratingString::freeDelayLine( m_fromBridge );
|
||||
vibratingString::freeDelayLine( m_toBridge );
|
||||
@@ -56,15 +57,14 @@ public:
|
||||
|
||||
inline sample_t nextSample( void )
|
||||
{
|
||||
sample_t outsamp[m_oversample];
|
||||
sample_t ym0;
|
||||
sample_t ypM;
|
||||
for( Uint8 i = 0; i < m_oversample; i++)
|
||||
{
|
||||
// Output at pickup position
|
||||
outsamp[i] = fromBridgeAccess( m_fromBridge,
|
||||
m_outsamp[i] = fromBridgeAccess( m_fromBridge,
|
||||
m_pickupLoc );
|
||||
outsamp[i] += toBridgeAccess( m_toBridge,
|
||||
m_outsamp[i] += toBridgeAccess( m_toBridge,
|
||||
m_pickupLoc );
|
||||
|
||||
// Sample traveling into "bridge"
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
// Update and then increment pointer
|
||||
toBridgeUpdate( m_toBridge, -ypM );
|
||||
}
|
||||
return( outsamp[m_choice] );
|
||||
return( m_outsamp[m_choice] );
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -104,6 +104,8 @@ private:
|
||||
int m_choice;
|
||||
float m_state;
|
||||
|
||||
sample_t * m_outsamp;
|
||||
|
||||
delayLine * FASTCALL initDelayLine( int _len, int _pick );
|
||||
static void FASTCALL freeDelayLine( delayLine * _dl );
|
||||
void FASTCALL resample( float *_src,
|
||||
|
||||
Reference in New Issue
Block a user