Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't let silent instruments wake up sleeping effects #4792

merged 1 commit into from Feb 6, 2019


Copy link

@DomClark DomClark commented Jan 25, 2019

Fixes #4564.

Ensures a PlayHandle's buffer is not silent before mixing it in to the audio port. This avoids waking up all downstream effects unless there is some audio present. The test is not performed for NotePlayHandles for performance reasons, in line with similar code in InstrumentTrack::processAudioBuffer.

// Test for silent input data if instrument provides a single stream only (i.e. driven by InstrumentPlayHandle)
// We could do that in all other cases as well but the overhead for silence test is bigger than
// what we potentially save. While playing a note, a NotePlayHandle-driven instrument will produce sound in
// 99 of 100 cases so that test would be a waste of time.
if( m_instrument->flags().testFlag( Instrument::IsSingleStreamed ) &&
MixHelpers::isSilent( buf, frames ) )

Using a slightly different approach from #4564 (comment) as suggested by gi0e5b06.

Copy link

@T0NIT0RMX T0NIT0RMX commented Jan 29, 2019

I tried it and it works great ! Definetly fixes #4564.

Copy link

@PhysSong PhysSong commented Feb 5, 2019


@zonkmachine zonkmachine merged commit c907fcd into LMMS:stable-1.2 Feb 6, 2019
2 checks passed
2 checks passed
ci/circleci Your tests passed on CircleCI!
continuous-integration/travis-ci/pr The Travis CI build passed
@DomClark DomClark deleted the DomClark:single-streamed-silence-fix branch Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants