diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index 1f1d9fa36..fa13b1ea8 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -68,7 +68,11 @@ public: virtual void setVolume( const volume_t volume = DefaultVolume ); virtual void setPanning( const panning_t panning = DefaultPanning ); - int midiVelocity() const; + int midiVelocity() const + { + return volumeToMidi( getVolume() ); + } + int midiKey() const; int midiChannel() const { diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index e833a8d47..b40c335b7 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -179,19 +179,6 @@ void NotePlayHandle::setPanning( const panning_t panning ) -int NotePlayHandle::midiVelocity() const -{ - int vel = getVolume(); - if( m_instrumentTrack->getVolume() < DefaultVolume ) - { - vel = ( vel * m_instrumentTrack->getVolume() ) / DefaultVolume; - } - return qMin( MidiMaxVelocity, vel * MidiMaxVelocity / DefaultVolume ); -} - - - - int NotePlayHandle::midiKey() const { return key() - m_origBaseNote + instrumentTrack()->baseNoteModel()->value(); diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 431dd9eb5..62f880cfe 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -193,13 +193,6 @@ void InstrumentTrack::processAudioBuffer( sampleFrame* buf, const fpp_t frames, m_soundShaping.processAudioBuffer( buf, frames, n ); v_scale *= ( (float) n->getVolume() / DefaultVolume ); } - else - { - if( getVolume() < DefaultVolume && m_instrument->isMidiBased() ) - { - v_scale = 1; - } - } m_audioPort.setNextFxChannel( m_effectChannelModel.value() );