moved constants out of loop

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1743 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-10-04 23:22:54 +00:00
parent f19aa7f1b6
commit bfb3a7f407
2 changed files with 28 additions and 7 deletions

View File

@@ -151,15 +151,13 @@ void kickerInstrument::playNote( notePlayHandle * _n,
if( _n->released() )
{
const float rfd = _n->releaseFramesDone();
const float drf = desiredReleaseFrames();
for( fpp_t f = 0; f < frames; ++f )
{
const float fac = 1.0f -
(float)( _n->releaseFramesDone()+f ) /
desiredReleaseFrames();
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
{
_working_buffer[f][ch] *= fac;
}
const float fac = 1.0f - ( rfd+f ) / drf;
_working_buffer[f][0] *= fac;
_working_buffer[f][1] *= fac;
}
}