diff --git a/include/Piano.h b/include/Piano.h index a9d112a38..1673d9479 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -50,7 +50,7 @@ public: return m_pressedKeys[key]; } - void handleKeyPress( int key ); + void handleKeyPress( int key, int midiVelocity = MidiMaxVelocity ); void handleKeyRelease( int key ); InstrumentTrack* instrumentTrack() const diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 160d413cc..3bd85ee8d 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -92,11 +92,11 @@ void Piano::setKeyState( int key, bool state ) * * \param key the key being pressed */ -void Piano::handleKeyPress( int key ) +void Piano::handleKeyPress( int key, int midiVelocity ) { if( isValidKey( key ) ) { - m_midiEvProc->processInEvent( midiEvent( MidiNoteOn, 0, key, MidiMaxVelocity ), midiTime() ); + m_midiEvProc->processInEvent( midiEvent( MidiNoteOn, 0, key, midiVelocity ), midiTime() ); m_pressedKeys[key] = true; } }