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
merged 1 commit into from Feb 6, 2019

Conversation

Projects
None yet
4 participants
@DomClark
Copy link
Member

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.

@T0NIT0RMX

This comment has been minimized.

Copy link
Contributor

T0NIT0RMX commented Jan 29, 2019

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

@PhysSong

This comment has been minimized.

Copy link
Member

PhysSong commented Feb 5, 2019

Merge?

@zonkmachine zonkmachine merged commit c907fcd into LMMS:stable-1.2 Feb 6, 2019

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.