From 724b42d506b5fb956b4d88da5623ad35781e6104 Mon Sep 17 00:00:00 2001 From: 3dtours Date: Sun, 26 Jul 2026 11:28:54 +0700 Subject: [PATCH] wiki: fix realtime velocity + ruler restart --- wiki.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wiki.md b/wiki.md index ea806e2..1c39ae3 100644 --- a/wiki.md +++ b/wiki.md @@ -235,3 +235,8 @@ - **Tóm tắt thay đổi:** (1) Thêm `onRescheduleMidi` prop — khi edit velocity trong CC lane lúc đang play, gọi `window.SonicSF.stopAll()` + `schedulePianoRollMidi` với velocity mới. (2) Click ruler: set `currentTime` + nếu đang play thì `onStop` + `setTimeout` `onPlayPause` để play từ vị trí click. (3) Thêm nút Export cạnh Save — inline MIDI writer, xuất `.mid` file từ notes array. - **Các file ảnh hưởng:** `app/static/js/app.jsx` - **Ghi chú/Test (nếu có):** `npm run build` pass. + +### [2026-07-26 11:27] Task: Fix realtime velocity stale notes + ruler click restart +- **Tóm tắt thay đổi:** (1) Compute `updatedNotes` synchronously trước khi gọi `setNotes`, pass into `onRescheduleMidi(updatedNotes)`. `schedulePianoRollMidi` nhận tham số `notesOverride` — dùng notes mới thay vì `st.notes` (stale). (2) Ruler click: thay `onStop()` (reset currentTime) bằng `stopAllPlayback()` trực tiếp + `schedulePianoRollMidi` + `startSubTabPlayback` + RAF từ `clickTime`. +- **Các file ảnh hưởng:** `app/static/js/app.jsx` +- **Ghi chú/Test (nếu có):** `npm run build` pass.