- use fast noise generation
- simplified user-wave call, frames must never be 0 git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@320 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -140,20 +140,16 @@ public:
|
||||
|
||||
static inline sample_t noiseSample( const float )
|
||||
{
|
||||
return( 1.0f - 2.0f * ( ( float )rand() * ( 1.0f /
|
||||
RAND_MAX ) ) );
|
||||
// Precise implementation
|
||||
// return( 1.0f - rand() * 2.0f / RAND_MAX );
|
||||
|
||||
// Fast implementation
|
||||
return( 1.0f - fast_rand() * 2.0f / FAST_RAND_MAX );
|
||||
}
|
||||
|
||||
inline sample_t userWaveSample( const float _sample )
|
||||
{
|
||||
if( m_userWave->frames() > 0 )
|
||||
{
|
||||
return( m_userWave->userWaveSample( _sample ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( 0.0f );
|
||||
}
|
||||
return( m_userWave->userWaveSample( _sample ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user