V45.18: fix seek khi play master FX active - clear_queue mode 'seek' (wipe queue cu + resume nhanh 8 block ~43ms thay vi FILL 24 ~128ms) het am tre 1 beat; DIAG preview_diag src=keybed cho Bug 2 ARM piano roll v=202608311222
This commit is contained in:
+17
-1
@@ -1778,6 +1778,7 @@ const fxRt = { active: false, starting: false, startToken: 0, sessionId: null, w
|
||||
// new-project / export-end → teardown bình thường.
|
||||
let fxRtKeepForRestart = false;
|
||||
let fxRtWrapRestart = false; // V38: loop wrap restart -- clear_queue mode 'loop' (always-wipe + RESUME_FILL)
|
||||
let fxRtSeekRestartFlag = false; // V45.18: seek khi play master FX active -- clear_queue mode 'seek' (wipe queue cu + resume nhanh 8 block ~43ms)
|
||||
// V21: user stop (fade=true) giữ master FX session warm — play kế tiếp có FX
|
||||
// ngay, không chờ reload VST ~4s. Idle timeout: ngừng chơi lâu → teardown
|
||||
// giải phóng CPU/VST (chấp nhận ~4s delay ở play sau khi idle lâu).
|
||||
@@ -11084,6 +11085,20 @@ const PianoRollTabEditor = ({ st, zoom, bpm, viewportWidth, activeTracks, onClos
|
||||
// keybed PHẢI qua mastering FX của main out khi chain đang bật
|
||||
// (trước đây phải bật/tắt power mới có tác dụng).
|
||||
try { if (window.__ensureMasteringRouting) window.__ensureMasteringRouting(); } catch (er) {}
|
||||
// DIAG Bug 2 (keybed ARM khong am): routing + ARM state tai note-on.
|
||||
try {
|
||||
let _pdDest = 'none';
|
||||
if (window.AudioRoutingEngine && window.AudioRoutingEngine._connected) {
|
||||
_pdDest = (window.AudioRoutingEngine._dest && window.AudioRoutingEngine._dest.constructor) ? window.AudioRoutingEngine._dest.constructor.name : 'null';
|
||||
_pdDest += '/' + window.AudioRoutingEngine._trackId;
|
||||
} else { _pdDest = 'NOT_CONNECTED'; }
|
||||
const _pdD = window.BridgeAudioNode ? window.BridgeAudioNode.getDiag() : null;
|
||||
const _pdTab = activeTabRef.current;
|
||||
const _pdSub = subTabsRef.current ? (subTabsRef.current.find(s => s.id === _pdTab) || {}).type : null;
|
||||
const _kbArmedTab = !!(subTabsRef.current || []).some(function (s) { return s.type === 'PIANO_ROLL' && s.isArmed && s.trackId === st.trackId; });
|
||||
_dbgLog('preview_diag', 'src=keybed trk=' + st.trackId + ' kbTrk=' + (kbTrk ? kbTrk.id : 'UNDEF') + ' kbArmedTab=' + (_kbArmedTab ? 1 : 0) + ' armedTrk=' + (kbTrk && kbTrk.isArmed ? 1 : 0) + ' tab=' + _pdTab + ' sub=' + (_pdSub || 'none') + ' play=' + (isPlayingRef.current ? 1 : 0) + ' br=' + (window.SonicMidiRouter && window.SonicMidiRouter.isBridgeActive() ? 1 : 0) + ' fxRt=' + (fxRt.active ? 1 : 0) + ' dest=' + _pdDest + ' bd=' + (_pdD ? ('i=' + _pdD.initialized + ' wl=' + _pdD.useWorklet + ' nd=' + _pdD.hasWorkletNode + ' pre=' + _pdD.preBufferLen + ' ch=' + _pdD.chunksLen + ' g=' + _pdD.gain) : 'MISSING') + ' mb=' + (!!masterBus));
|
||||
} catch (e) {}
|
||||
try { window.__dbgPreviewAudioArmed = { count: 0, nz: 0, t0: performance.now() }; } catch (e) {}
|
||||
if (window.triggerMidiVuActivity) {
|
||||
window.triggerMidiVuActivity((st.parent_tab_id && st.parent_tab_id.startsWith('session_') ? '_sess_' : '') + st.trackId, 100);
|
||||
}
|
||||
@@ -19410,6 +19425,7 @@ const App = () => {
|
||||
startOffsetTimeRef.current = time;
|
||||
setCurrentTime(time);
|
||||
fxRtKeepForRestart = true; // restart/resume — giữ session FX realtime
|
||||
fxRtSeekRestartFlag = true; // V45.18: seek khi play — startTrackPlayback clear_queue mode 'seek' (wipe queue cu + resume nhanh)
|
||||
stopAllPlayback();
|
||||
try { if (window.__fxRtPlayheadFreeze) window.__fxRtPlayheadFreeze(true); } catch (e) { }
|
||||
setTimeout(() => {
|
||||
@@ -25559,7 +25575,7 @@ const App = () => {
|
||||
// tail pass cu + block moi (bridge render lien tuc); flush tai seam = gap
|
||||
// trong → giat beat 0:0. Play that van flush (V30) de bo block idle cu.
|
||||
const _wrapRestart = fxRtWrapRestart;
|
||||
const _wrapMode = _wrapRestart ? 'loop' : 'play'; fxRtWrapRestart = false; // V38
|
||||
const _wrapMode = _wrapRestart ? 'loop' : (fxRtSeekRestartFlag ? 'seek' : 'play'); fxRtWrapRestart = false; fxRtSeekRestartFlag = false; // V38/V45.18
|
||||
try { if (!_wrapRestart && window.BridgeAudioNode && window.BridgeAudioNode.flush) window.BridgeAudioNode.flush(); } catch (e) {}
|
||||
// V31: xoa backlog outQueue master FX (block idle ~341ms) — play moi khong
|
||||
// cho phia sau; flush ring bridge (V30) khong chaym queue nay.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -138,6 +138,25 @@ class SfFxRealtimeProcessor extends AudioWorkletProcessor {
|
||||
this.wrapFadeBlocks = this.outQueue.length + Math.ceil((this.latencySamples || 0) / this.BLOCK);
|
||||
return;
|
||||
}
|
||||
if (d.mode === 'seek') {
|
||||
// V45.18: seek khi play master FX active — wipe queue cu (audio cu
|
||||
// choi tiep 0-50ms sau click) + resume nhanh RESUME_FILL 8 (~43ms)
|
||||
// thay vi FILL 24 (~128ms) — het "am tre 1 beat" (hit dau roi vao
|
||||
// vung cam 128ms). Giong resume wrap V45.4 (proven khong gap).
|
||||
this.outQueue.length = 0;
|
||||
this.outPos = 0;
|
||||
this.playing = false;
|
||||
this.wrapFadeBlocks = -1;
|
||||
this.wrapMode = false;
|
||||
this.resumeFadeIn = true;
|
||||
this.resumeFill = this.RESUME_FILL;
|
||||
this.silenced = false;
|
||||
this.fadeFromL = this.lastOutL;
|
||||
this.fadeFromR = this.lastOutR;
|
||||
this.holdFadeLeft = this.HOLD_FADE * this.BLOCK;
|
||||
this.port.postMessage({ type: 'dbg', tag: 'fx_seek_clear', t: Math.round(currentTime * 1000), q: 0 });
|
||||
return;
|
||||
}
|
||||
if (d.mode !== 'play' && this.outQueue.length < this.FILL) return;
|
||||
// V31: play/ARM live note — main thread bao xoa backlog block idle
|
||||
// (engine render lien tuc khi STOP -> outQueue day ~32 block ~170ms
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<script src="/static/js/services/promptTemplateManager.js?v=202608290945"></script>
|
||||
<script src="/static/js/services/undoRedoEngine.js?v=202608290945"></script>
|
||||
<script src="/static/js/services/chordTheory.js?v=202608290945"></script>
|
||||
<script src="/static/js/app.precompiled.js?v=202608311151" defer></script>
|
||||
<script src="/static/js/app.precompiled.js?v=202608311222" defer></script>
|
||||
<link rel="stylesheet" href="/static/css/styles.css?v=202608290945">
|
||||
<style>
|
||||
:root {
|
||||
|
||||
Reference in New Issue
Block a user