NotePlayHandle: fix broken note detuning feature

Commit 884b9ca671 completely broke the
note detuning feature as the detuning value was not incoorporated into
the frequency calculation anymore. Fix this by adding the detuning value
to the pitch variable.
This commit is contained in:
Tobias Doerffel
2010-07-25 00:18:48 +02:00
parent 8ef98b63db
commit b30e91042b

View File

@@ -467,8 +467,11 @@ bool notePlayHandle::operator==( const notePlayHandle & _nph ) const
void notePlayHandle::updateFrequency()
{
const float pitch =
( key() - m_instrumentTrack->baseNoteModel()->value() +
engine::getSong()->masterPitch() ) / 12.0f;
( key() -
m_instrumentTrack->baseNoteModel()->value() +
engine::getSong()->masterPitch() +
m_baseDetuning->value() )
/ 12.0f;
m_frequency = BaseFreq * powf( 2.0f, pitch +
m_instrumentTrack->pitchModel()->value() / ( 100 * 12.0f ) );
m_unpitchedFrequency = BaseFreq * powf( 2.0f, pitch );