diff --git a/include/note_play_handle.h b/include/note_play_handle.h index 84ec7c20f..2c2b2e3f1 100644 --- a/include/note_play_handle.h +++ b/include/note_play_handle.h @@ -233,7 +233,6 @@ private: private: - DetuningHelper * m_detuning; float m_value; } ; diff --git a/src/core/note_play_handle.cpp b/src/core/note_play_handle.cpp index a8f0604fd..9654cde23 100644 --- a/src/core/note_play_handle.cpp +++ b/src/core/note_play_handle.cpp @@ -34,8 +34,7 @@ notePlayHandle::BaseDetuning::BaseDetuning( DetuningHelper *detuning ) : - m_detuning( detuning ), - m_value( m_detuning->automationPattern()->valueAt( 0 ) ) + m_value( detuning ? detuning->automationPattern()->valueAt( 0 ) : 0 ) { } @@ -503,12 +502,11 @@ void notePlayHandle::updateFrequency() -void notePlayHandle::processMidiTime( const midiTime & _time ) +void notePlayHandle::processMidiTime( const midiTime& time ) { - if( _time >= songGlobalParentOffset()+pos() ) + if( detuning() && time >= songGlobalParentOffset()+pos() ) { - const float v = detuning()->automationPattern()-> - valueAt( _time - songGlobalParentOffset() - pos() ); + const float v = detuning()->automationPattern()->valueAt( time - songGlobalParentOffset() - pos() ); if( !typeInfo::isEqual( v, m_baseDetuning->value() ) ) { m_baseDetuning->setValue( v );