InstrumentTrack::masterKey(): fixed miscalculation

Global master pitch wasn't taken into account correctly when calculating
master key of a given key. Made MIDI based instruments behave in the
opposite direction regarding pitch when changing global master pitch.

Thanks to Skiessi for pointing out this issue.
This commit is contained in:
Tobias Doerffel
2009-04-08 23:36:43 +02:00
parent c0ff1aa95c
commit 6e30ae3369

View File

@@ -524,7 +524,7 @@ void instrumentTrack::updatePitch( void )
int instrumentTrack::masterKey( int _midi_key ) const
{
int key = m_baseNoteModel.value() + engine::getSong()->masterPitch();
int key = m_baseNoteModel.value() - engine::getSong()->masterPitch();
return tLimit<int>( _midi_key - ( key - DefaultKey ), 0, NumKeys );
}