From 626a451c3fa3e988bd7a069f557c6b880720dbdb Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Thu, 28 Sep 2017 09:55:16 +0900 Subject: [PATCH] Fix sound while playing from piano roll, when BB tracks are muted (#3804) * Don't set BB track for tracks not in the BB * Don't check for BB track mute state if we're playing a single pattern --- src/tracks/InstrumentTrack.cpp | 8 ++++++-- src/tracks/SampleTrack.cpp | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 3c53e4d4c2b..6aaf3eb75e9 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -157,7 +157,8 @@ InstrumentTrack::~InstrumentTrack() void InstrumentTrack::processAudioBuffer( sampleFrame* buf, const fpp_t frames, NotePlayHandle* n ) { // we must not play the sound if this InstrumentTrack is muted... - if( isMuted() || ( n && n->isBbTrackMuted() ) || ! m_instrument ) + if( isMuted() || ( Engine::getSong()->playMode() != Song::Mode_PlayPattern && + n && n->isBbTrackMuted() ) || ! m_instrument ) { return; } @@ -613,7 +614,10 @@ bool InstrumentTrack::play( const MidiTime & _start, const fpp_t _frames, { TrackContentObject * tco = getTCO( _tco_num ); tcos.push_back( tco ); - bb_track = BBTrack::findBBTrack( _tco_num ); + if (trackContainer() == (TrackContainer*)Engine::getBBTrackContainer()) + { + bb_track = BBTrack::findBBTrack( _tco_num ); + } } else { diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index 0dd491c64d5..3c16025a540 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -587,7 +587,10 @@ bool SampleTrack::play( const MidiTime & _start, const fpp_t _frames, return false; } tcos.push_back( getTCO( _tco_num ) ); - bb_track = BBTrack::findBBTrack( _tco_num ); + if (trackContainer() == (TrackContainer*)Engine::getBBTrackContainer()) + { + bb_track = BBTrack::findBBTrack( _tco_num ); + } } else {