From a2aafd79d0118f3928fd97a984ca2a750e416d4a Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 25 Jul 2010 00:18:48 +0200 Subject: [PATCH] NotePlayHandle: fix broken note detuning feature Commit 884b9ca671b8c1ea340846e97d0a82c80b721e44 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. (cherry picked from commit b30e91042b6e9ca5f520855854bf49cc23a68fe1) --- src/core/note_play_handle.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index f2f437000..ecda32aa2 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -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 );