diff --git a/src/core/InstrumentSoundShaping.cpp b/src/core/InstrumentSoundShaping.cpp index 22327ae8eed..56011de04c5 100644 --- a/src/core/InstrumentSoundShaping.cpp +++ b/src/core/InstrumentSoundShaping.cpp @@ -299,13 +299,22 @@ f_cnt_t InstrumentSoundShaping::envFrames( const bool _only_vol ) const f_cnt_t InstrumentSoundShaping::releaseFrames() const { + if( !m_instrumentTrack->instrument() ) + { + return 0; + } + + f_cnt_t ret_val = m_instrumentTrack->instrument()->desiredReleaseFrames(); + + if( m_instrumentTrack->instrument()->flags().testFlag( Instrument::IsSingleStreamed ) ) + { + return ret_val; + } + if( m_envLfoParameters[Volume]->isUsed() ) { return m_envLfoParameters[Volume]->releaseFrames(); } - f_cnt_t ret_val = m_instrumentTrack->instrument() - ? m_instrumentTrack->instrument()->desiredReleaseFrames() - : 0; for( int i = Volume+1; i < NumTargets; ++i ) {