fix: brush draw preview note uses wrong instrument
Line 5273 called playNote with undefined program + no channel, defaulting to channel 0 with last-set instrument (may be Track 2's). Fix: resolve parent track from st.trackId, pass correct channel and synth_engine/instrumentProgram.
This commit is contained in:
@@ -5270,7 +5270,9 @@ const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, activeTracks, onClos
|
||||
// Play the note with SoundFont
|
||||
if (window.SonicSF) {
|
||||
const ctx = getAudioContext();
|
||||
window.SonicSF.playNote(pitch, 0.8, 300, ctx.currentTime, undefined, null);
|
||||
var dwTrk = activeTracks.find(function(t) { return t.id === st.trackId; });
|
||||
var dwCh = window.SonicPianoRoll ? window.SonicPianoRoll.getTrackMidiChannel(dwTrk, activeTracks) : (dwTrk ? dwTrk.midiChannel : 0);
|
||||
window.SonicSF.playNote(pitch, 0.8, 300, ctx.currentTime, dwTrk ? dwTrk.instrumentProgram : undefined, null, dwCh, dwTrk ? dwTrk.synth_engine : undefined);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user