fix: route PR notes through bridge when active (VST3/SF2 playback via Play button)
Two guards: schedulePianoRollMidi skips native SF item scheduling while bridge is active; scheduleMidiNoteDispatch lets notes pass to the MIDI router when a piano-roll sub-tab is playing. Verified on Windows: SF2 peak 0.026, VST3 ACDD native GUI + peak 0.074 via Play button. Docs: TEST_NOTES.md, TASKS.md.
This commit is contained in:
@@ -21693,7 +21693,7 @@ const App = () => {
|
||||
const startAt = startTime || ctx.currentTime; // undefined/null = phát ngay
|
||||
const delayMs = Math.max(0, (startAt - ctx.currentTime) * 1000);
|
||||
// Guard chống note-on trễ sau Stop: CHỈ khi là timeline (startTime thật).
|
||||
const guardPlay = startTime != null ? function () { return isPlayingRef.current; } : function () { return true; };
|
||||
const guardPlay = startTime != null ? function () { return isPlayingRef.current || (subTabsRef.current && subTabsRef.current.some(s => s.isPlaying)); } : function () { return true; };
|
||||
const trkId = track ? track.id : 0;
|
||||
// Percussion (bank 128) → router allocateChannel ch 9; melodic → round-robin.
|
||||
const isPerc = !!(synthEngine && synthEngine.soundfont_bank === 128);
|
||||
@@ -22171,7 +22171,7 @@ const App = () => {
|
||||
// future (silence when pressing play). Ghost notes are already relative to
|
||||
// the item window, so no absolute-session offset is applied anywhere here.
|
||||
const routeCarla = shouldRouteCarla(synthEngine);
|
||||
if (isStandaloneSf() && !routeCarla && isSfTrackEngine(synthEngine)) {
|
||||
if (isStandaloneSf() && !routeCarla && isSfTrackEngine(synthEngine) && !(window.SonicMidiRouter && window.SonicMidiRouter.isBridgeActive())) {
|
||||
scheduleNativeSfItem(track, { startTime: 0, notes: midiNotes }, offsetSeconds, context, destNode, bpm, { sources: activeSourcesRef.current, isActive: () => !!isPlayingRef.current });
|
||||
return; // native render cả tab → audio buffer (không per-note WASM/Carla)
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user