Open PhysSong opened 7 years ago
NotePlayHandle::resize( const bpm_t _new_tempo )
changes m_totalFramesPlayed
, so EnvTotalFrames
and EnvReleaseBegin
in InstrumentSoundShaping::processAudioBuffer()
can have wrong values.
NotePlayHandle::resize()
has introduced in 52d9ca47, which was done in 2007. I don't know why it exists and why it should be there.
That function is there because notes should be resized when the tempo changes. However, it shouldn't change m_totalFramesPlayed
. Instead of this, left frames should be recalculated.
There are some exceptions, like notes from MIDI input or arpeggio sub-notes(if tempo-sync is disabled, at least). Creating a new variable m_shouldBeResized
may be handy, in my opinion.
This sounds to me like another case where it would be easier to troubleshoot/test if https://github.com/LMMS/lmms/issues/2606 is fixed, as some of the symptoms are overlapping. Dropped notes etc.
TempoNaN.mmp.zip
The tempo model is connected to a LFO controller. Instruments with envelope sounds weird, ~some notes may be skipped.~ Edit: some notes may be skipped regardless of the envelope's status. If arpeggio is enabled, it sounds more glitchy. Infs and/or NaNs are also generated.