Commit Graph

819 Commits

Author SHA1 Message Date
admin 17e22bcf32 D2: LimiterFx brickwall — lookahead 1-5ms + oversample 4x + hard clip, UI toggle SOFT/BRICKWALL + LOOKAHEAD ms 2026-08-23 07:23:52 +07:00
admin fe82b19557 D1: LUFS EBU R128 + true peak sau render (app/core/loudness.py), API /plugins/render tra them lufs/true_peak_db, test 4 cases 2026-08-22 21:50:29 +07:00
admin 2a5e2af04a master strip: L/R volume + LINK + MUTE that, bo soloBtn 2026-08-22 21:41:54 +07:00
admin c3aba40ffe Phase 4+5: WebAudio I/O shim + verify DAW checklist — live=export, order, fader, PDC, smoke 2026-08-22 21:02:52 +07:00
admin e5c957fc87 Phase 3: engine render chain hop nhat — track/master doc mastering_settings.chain (imager/maximizer), PDC probe FX_LATENCIES, fix daw_vst_bridge link BuiltinFxChain, pytest 3.2/3.3 2026-08-22 20:17:59 +07:00
admin 1390ad545b Phase 2: BuiltinFxChain C++ (8 DSP) + control ring SET_PARAM/REPORT_LATENCY
- native_bridge/src/BuiltinFxChain.{h,cpp}: 8 builtin DSP port 1:1 từ
  Python _apply_builtin_fx_chain (eq/eqpro/compressor/limiter/exciter/rebalance)
  và JS MASTER_MODULE_IO (imager/maximizer). Biquad RBJ DF2T, block-wise
  stateful. createBuiltinFx trả nullptr cho gain/normalize (legacy).
- RenderFxJob: FxSlot thêm bfx, parse builtin 8 loại, runBuiltinSlotSafe SEH,
  realtimeRunChain nhánh builtin, chainGen()/entryLatencies(), setParam
  áp live lên bfx; Vst3Fx latencySamples từ getLatencySamples().
- RealtimeFxLoop: drain ctrl ring (SET_PARAM -> chain.setParam, drop cũ khi
  đầy) + REPORT_LATENCY khi gen đổi (ipc->lat[] ring, lastGen).
- FxRealtimeIPC.h: header 18 u32 (72B), ctrl/lat slots 8, FxCtrlCmd 24B,
  FxLatReport 8B, static_asserts.
- app/core/fx_realtime.py: mirror header 72B (ctrl_write/read, lat_write/read,
  slots), set_param ghi ctrl ring qua _ctrl_enqueue_locked (guard shm),
  get_latencies drain lat ring qua _lat_drain.
- tests/test_builtin_fx_golden.py: golden SNR C++ vs Python (8 cases, ngưỡng
  30dB) + order test eq/compressor xen kẽ.
- TASKS_DAW_A.md: tick 2.1-2.9.

Test: 136 passed (4 fx_realtime_chain + 8 builtin golden + regression).
2026-08-22 19:55:08 +07:00
admin fd790c1dc6 feat(fx): Phase 1 DAW chain hop nhat — fx_realtime chain JSON giu thu tu, SET_PARAM/REPORT_LATENCY qua WS text, native_render chain builtin+vst3 xen ke, pytest 2026-08-22 19:26:43 +07:00
admin 5ad2c681e7 Remove Carla native VSTi bridge entirely
Drop Carla integration across frontend and backend:
- plugins.py: remove /carla-midi, /carla-status, /carla-stop, /open-in-carla,
  /carla-play-notes endpoints and Carla process management
- runtime.py: remove find_carla / _carla_* helpers, detect and capabilities
- app.jsx: remove Carla bridge UI, SonicCarlaMidi routing, shouldRouteCarla
  guards, VST row Carla button and preset fallback
- system.py: remove /carla-path
- Keep audio path unchanged (tracks -> masterBus -> output -> analyser),
  directOut only for offline render

Build frontend, tests pass (124 passed).
2026-08-22 18:39:49 +07:00
admin 14265515aa fix(exit): taskkill rieng tung process — kill het plugin_host/fx_vst_bridge khi thoat app (truoc day /IM gop chi chay lenh dau); CREATE_NO_WINDOW cho moi subprocess engine (het terminal chớp chớp) 2026-08-22 18:06:26 +07:00
admin 4bb0db2b21 fix(fx-gui): meter VST chạy đúng — bỏ điều kiện inRead chặn peek + chống race lúc load + ẩn cửa sổ native floating 2026-08-22 17:36:31 +07:00
admin 8346bc3041 build(native): rebuild bridge + commit sidecar binary để feature theo push
- fix compile: performEdit dùng setParamNormalized (setParamFromEdit không tồn tại trong SDK này)
- rebuild fx_vst_bridge.exe/daw_vst_bridge.exe/plugin_host.exe (chứa /shm route + SHM audio feeder)
- src-tauri/binaries: hết ignore, commit binary + dll + vst3scan.json — máy khác clone về có ngay feature native
- xóa rác app.precompiled.js.bak + dọn bundle dirs (.bak/.new/_diag/.pytest_cache)
2026-08-22 17:12:18 +07:00
admin 6dfe390bda feat(fx-gui): đưa audio vào process GUI — meter VST nhảy theo âm thật qua SHM peek
- GUI process peek ring SHM đầu vào (không consume, không tranh chấp RealtimeFxLoop)
- gọi fx->processAudio() trên instance GUI để meter/UI plugin chuyển động theo âm thật
- performEdit forward sang controller -> meter điều khiển bởi param cũng cập nhật
- bridge /shm: frontend đẩy tên session live vào mỗi GUI đang mở (start/stop/open)
- tests: 127 passed
2026-08-22 17:06:37 +07:00
admin 6ba38286ad fix(master-fx): loại double-processing khi load VST FX vào master fx chain
- Bỏ push setFxChain xuống native bridge (T2.4) — SHM fxRt loop (fx_vst_bridge
  --realtime-fx) là nơi xử lý live master mix duy nhất; trước đây MIDI/VSTi
  instrument bị xử lý 2 lần (native bridge + SHM loop) → over-process,
  âm bể/crackle. setFxChain vẫn dùng khi Export/Offline render.
- closeMasterGui/closeFxGui: POST /close (kill process) thay vì /hide —
  không còn cửa sổ floating always-on-top lơ lửng, tắt được dứt điểm.
- openFxGui already_running kèm embed_url → mở lại embed panel thay vì chỉ toast.
- open_fx_gui (plugins.py): spawn fx-gui với SF_PARENT_PID=<engine pid>.
- RenderFxJob.cpp: watchdog thread trong run_open_fx_gui/run_fx_gui_server —
  engine chết → WM_CLOSE, GUI process tự thoát, không để lại cửa sổ mồ côi.
2026-08-22 16:53:20 +07:00
admin e22757d5be fix(mastering): master dry mac dinh — built-in modules tat khi khoi tao
- App default + 2 fallback (ProfileModal, load project): eqActive/
  imagerActive/maximizerActive = false (truoc day chain rong nhung cac
  flag van true -> Imager+Maximizer van xu ly am mac du MASTERING PANEL
  trong)
- applyMasteringSettings doc flag truc tiep, khong check chain — user
  phai them module trong MASTERING PANEL moi bat built-in processing
- bump cache-bust app.precompiled.js -> 202608212330
2026-08-22 16:27:57 +07:00
admin edc647ded6 fix(rt): restart fxRt khi chain VST doi trong luc realtime dang chay
- masteringSettings effect goi fxRtStart() khong dieu kien: early-return
  khi active + cung chainKey, stop+start lai khi chain doi (insert/remove/
  bypass/reorder VST trong MASTER FX CHAIN) — truoc day nhanh chainKey
  chet vi branch chi chay khi !fxRt.active
- test list_scan_all: path plugin phai ton tai tren dia (loc entry chet
  truoc cache); dung _scan_json helper voi file that trong tmp_path
- bump cache-bust app.precompiled.js -> 202608212300
2026-08-22 16:13:10 +07:00
3dtours eef8603f98 build: rebuild app.precompiled.js (mastering empty-chain fix) 2026-08-22 16:06:19 +07:00
3dtours d74ccdaa8d fix(mastering): empty chain by default, allow removing all modules
MASTERING PANEL auto-seeded 3 modules (Dynamic EQ/Imager/Maximizer) and
removeChainModule re-added them when the chain hit zero. Chain now starts
empty everywhere (init, restore fallback, migration, graph fallback) and
can be removed down to empty; activeModule guards empty chain (null).

Cache-bust precompiled.js ?v= bump.
2026-08-22 15:58:39 +07:00
3dtours 9c6e200708 fix(plugin-dirs): remove het dir - rescan khong con VST trong thu muc mac dinh (authoritative user dirs, khong fallback default khi da luu rong; list_scan_all/_scan_plugins chi scan dir user khai) 2026-08-22 15:29:31 +07:00
3dtours 681cab4f25 fix(plugin-manager): xoa/add dir luu dung dir moi (stale closure); loc plugin file da mat khoi disk; scan VST3 giam timeout module con lai 4s va subprocess 300s 2026-08-22 15:10:35 +07:00
3dtours 384827d1e7 fix(available): iZotope khong san xuat VST instrument — loai moi module iZ* trong path chua 'izotope' khoi nut Synth (iZOzonePro, iZRXPro*, iZTonalBalanceControlPro) 2026-08-22 04:10:43 +00:00
3dtours aeec85604f fix(available): loai iZotope VST2 legacy (Steinberg\VSTPlugins\iZotope\*.dll) trung ten VST3 FX da scan — block theo ten normalized (bo prefix iZ, lowercase alnum); giu VST2 that (DSK/Kong) 2026-08-22 04:07:19 +00:00
3dtours aaf97b1255 fix(available): bo qua .dll trong thu muc da co .vst3 (iZotope installs .vst3 + module .dll cung thu muc) — FX khong con lot vao nut Synth (3/3) 2026-08-22 03:57:14 +00:00
3dtours a09a30c79d fix(available): _scan_plugins bo qua file .dll ben trong folder .vst3 — FX Ozone/Neutron khong con lot vao nut Synth (2/2, dong bo _scan_vst_in_dirs) 2026-08-22 03:49:03 +00:00
3dtours ece5f313b3 fix(available): _scan_vst_in_dirs bo qua file .dll ben trong folder .vst3 (bundle) — FX Ozone/Neutron khong con lot vao nut Synth (path trung khong khop block set) 2026-08-22 03:46:13 +00:00
3dtours 34d43f5018 fix(fx-list): MASTERING PANEL khong hien thi VST FX da scan trong Plugin Manager (cache _fx_scan_all ket [] vinh vien)
- vst_engine: list_scan_all cache co TTL 300s (FX_SCAN_TTL) + chi cache khi
  find_fx_bridge_exe() co exe (thieu bridge -> tra [] NHUNG khong cache de
  lan sau thu lai) — truoc day ket [] vi mui gio, MASTERING PANEL rong.
- vst_engine: them invalidate_fx_scan() clear cache scan VST.
- plugins.py: POST /scan (Plugin Manager Scan) goi _invalidate_fx_scan_cache()
  -> MASTERING PANEL lan mo ke tiep quet lai voi dirs moi; response them
  fx_cache_invalidated.
- app.jsx: MasteringModal/FXRackModal load listFx() lai moi lan mo modal
  (deps [isOpen]/[track.id]) + loading state; VstPluginPicker nhan prop
  loading -> hien 'Dang quet VST FX...' thay vi 'Khong co VST FX'.
- precompiled rebuild (LF) + index.html ?v=202608220330; dist sync.
- tests: +4 test cache TTL/invalidate/no-bridge (TestFxScanCache).
2026-08-22 03:34:33 +00:00
3dtours eecc4501bc perf(scan): timeout/module 30s->12s (Ozone treo vinh vien), subprocess 600->180s 2026-08-22 02:05:49 +00:00
3dtours 67245a6f61 fix(fx-list): UNKNOWN entries (Ozone treo scan) van vao list_fx de MASTERING PANEL khong mat plugin; nut Synth loai qua is_unknown 2026-08-22 02:00:48 +00:00
3dtours dd2a320b2a fix(scan): fx_vst_bridge --scan timeout per-module 30s + emit UNKNOWN thay vi is_instrument=true
- RenderFxJob: safeScanModule chay tren worker thread + TerminateThread neu
  Module::create treo >30s (Ozone 11 Clarity treo vinh vien, SEH khong bat
  hang) -> scan khong bao gio ket thuc -> list_fx() timeout -> fx_paths rong
  -> filter /available vo hieu -> nut Synth hien ca VST FX
- Module crash/hang -> emit is_fx=false,is_instrument=false (UNKNOWN) thay vi
  is_instrument=true (truoc day xep VST FX crash vao danh sach instrument)
- vst_engine: list_scan_all() tra toan bo (FX+instrument+unknown); list_fx()
  loc is_fx tu cache chung
- plugins.py /available: loai ca fx_paths lan unknown_paths khoi
  vst_instruments -> nut Synth chi hien VSTi that
2026-08-22 01:53:21 +00:00
3dtours 1a8b210063 feat(fx-rt): VST master chain realtime khi insert/bypass/reorder + VU meter đo sau VST node
- fxRtStart: so chainKey signature — insert/remove/bypass/reorder VST trong
  MASTER FX CHAIN giờ restart session SHM với chuỗi FX mới (trước đây
  early-return khi active → VST mới không bao giờ được áp dụng realtime)
- masterBus.splitter (leftAnalyser/rightAnalyser) chuyển sang sau fxRt.node
  khi realtime active → VU meter master strip + peak graph hiển thị audio
  data ĐÃ QUA VST; khôi phục output khi stop
- MasteringModal outPeak/outRms/LUFS đọc masterBus.analyser (post-VST) thay
  vì outputAnalyser (pre-VST)
2026-08-21 15:39:23 +00:00
admin bb6658e03d fix(fx): realtime VST ngắt quãng khi mở MASTERING PANEL + PWR master không ảnh hưởng âm; pacing WS input/output, gate fxRt theo masterConnected, worklet cap 32 2026-08-21 21:48:56 +07:00
admin 4e3f2fd08a Fix 3 bug standalone: save project lỗi schema, export MIDI/WAV không hỏi nơi lưu
- Bug 1: serializeTracksList bỏ section item không có sectionId (do insertSectionAtPlayhead tạo) — tránh source_data {} làm schema oneOf fail
- Bug 2: export MIDI qua save-dialog + write file, toast kèm đường dẫn
- Bug 3: export mix WAV/MP3/OGG qua save-dialog + write file, toast kèm đường dẫn
- Marker tauri_bridge_ready: xóa khi window destroy + guard SF_PARENT_PID — tránh standalone treo 120s
2026-08-21 17:13:28 +07:00
admin 9b14c99a7a Fix 3 bug standalone: VKB chiếm phím V, TCP FX button mở FX chain, VST GUI embed qua bridge
- VKB: stopImmediatePropagation thay stopPropagation (keydown+keyup) — chặn
  transport hotkey 'v' mở prompt Gain khi VKB đang mở (VKB đăng ký trước).
- TCP FX button: onClick -> window.__openFxRack(track.id, track.name), title
  'Mở Track FX Chain', giữ caret ▾ (title 'FX nhanh (cũ)') cho dropdown legacy.
- VST FX GUI embed: copy fx_vst_bridge.exe vào bundle (engine.spec binaries),
  find_bridge_exe tìm được trong _internal/ — hết lỗi 409 'Không tìm thấy bridge'.

Verified bằng Playwright: VKB không mở Gain prompt, FX chain rack mở + GUI VST
embed hiển thị (cả track FX rack lẫn Master FX Chain).
2026-08-21 16:17:33 +07:00
admin bcd8e37e86 feat(build): Phase 7 — verify 10 mục + fix export MIDI thiếu delta-time + fix WAV float32 2026-08-21 15:29:47 +07:00
admin a667d0354f feat(chords): thêm Chords Panel — chordTheory service + presets/custom/AI tab, insert progression vào timeline, Shift+K/menu/toolbar 2026-08-21 12:35:20 +07:00
admin ec85e7d1a9 Phase 5: Virtual MIDI Keyboard (F2/menu Tools) — QWERTY mapping spec §3, note routing theo attachMidiHandler (bridge/native SF-VST/SonicSF/Carla), live record forward, drag+persist localStorage, verify Playwright + 3 regression PASS 2026-08-21 12:16:03 +07:00
admin 5fc45a59f8 Phase 3: gộp builtin DSP + VST FX thành 1 FX CHAIN (track + master), đổi tên panel/nút/menu, fix lookup track cho nút FX TCP 2026-08-21 11:36:48 +07:00
admin 2c93c701ce feat(export): Export Mix loop không fade (checkbox + cắt buffer client) + server download thay blob (WebView2 chặn) 2026-08-21 11:25:49 +07:00
admin 96da8b5ac0 fix(export): MIDI export qua server endpoint thay blob download (WebView2 chặn) + velocity 1..127, bỏ rest-track 2026-08-21 11:10:32 +07:00
admin d7756b08ab fix(bridge): đồng đều âm lượng VSTi jbridge, GUI native lên top, modal instrument lọc FX
- calibrate: probe sandbox (jbridge) theo real-time pacing — child render qua SHM
  consumer-sync, probe µs-speed chỉ đo được silence/attack → makeup=1.0 mọi channel.
  Thêm virtual probeNeedsRealtime() (SandboxVst2Host → true), calibrate() Sleep
  ~1 block/5.8ms để child kịp nhận MIDI + render steady-state → makeup đo peak thật
  (3 channel Qin ≈ 2.6, trước đây = 1.0 → âm lượng đồng đều giữa các track/VSTi).
- OPEN_GUI: SetWindowPos(HWND_TOPMOST) + SetForegroundWindow + BringWindowToTop
  → GUI VSTi hiển thị ở top window, tương tác ngay.
- /api/v1/plugins/available: filter vst_instruments + extra theo is_fx của
  fx_vst_bridge --scan (trước merge entry) — modal Select Instrument chỉ còn
  soundfont + VSTi, không hiện VST FX (90 → 33).
2026-08-21 10:18:25 +07:00
admin 7c22ae1f02 refactor(bridge): split fx bridge, stabilize VST3 host chain, drop old install engines
- remove diagnostic canaries from audio hot path (crackle fix) and
  stuck C5 note raw-MIDI test (Vst2Instrument::init noteOff)
- split native bridge into daw_vst_bridge (VSTi) + fx_vst_bridge (VST FX)
- VST3: processData prepare before setActive, zero input buses, accept
  both .vstpreset and bridge-state blob in RenderJob presets
- native_render/vst_engine: bridge-exe discovery + render_fx_chain + /fx-gui
- delete old install/ engine binaries (install via sidecar+resources now)
- add BUILD_LAYOUT.md, build_selfcheck, tools/ diagnostics
2026-08-20 09:42:42 +07:00
admin 5df96aef1e fix(bridge): deploy ABI-fixed VST2 binary to install + open GUI for VST2 tracks
Qin_RV_x64.dll (Kong Audio) crashed with SEH 0xc0000005 in Bridger64.dll
using the stale install binary (pre-ABI-fix). Copy native_bridge build
Release binary into install/ so the packaged app runs the fixed host.

Also open the native GUI after loading a VST2 instrument (previously
VST3-only), so Qin_RV's editor (Qin_VST_Window via auxhost.exe) shows
automatically on track load.
2026-08-19 22:36:28 +07:00
admin 819257a1b3 Fix bypass JSON bool + load SF2 tracks into bridge on restore
- RenderFxJob: parse bypass as JSON bool (memberBool) — bypass:true
  previously ignored (memberInt parses numbers only), plugin kept
  processing. Verified: bypass RMS == plain, VST3 loaded once.
- preloadTrackInstruments / bridge reconnect: load SF2 instruments
  into bridge too (loadAnyTrackToBridge) — opened projects with SF2
  tracks sent MIDI to empty bridge channels (C++ silent), never
  reaching the native mastering chain.
- rebuild app.precompiled.js from app.jsx (was stale: missing A14).
2026-08-19 21:55:48 +07:00
admin 6a3b430da0 A14: MIDI-out từ plugin (VST2/VST3) → SHM → Rust emit → DAW track
- Vst2Instrument: audioMaster callback thu VstEvents, push SHM midiOutQueue
- Vst3Instrument: IEventList output bus (kAudioMasterWantMidi) — check
- SharedMemoryIPC.h: midiOutQueue[64] + midiOutCount (offset 27556/28324, sizeof 28328)
- shm.rs: MidiEventIPC Serialize, drain_midi_out() emit 'bridge-midi-out'
- lib.rs: pump emit midi-out events
- nativeBridgeService.js: onMidiOut API
- app.jsx: route MIDI-out về selected track qua SonicMidiRouter (feedback guard)
- TASKS.md: A14 ✅
2026-08-19 21:12:07 +07:00
admin 927597a822 fix(tcp): prevent panel scroll when wheeling volume ruler
React onWheel is passive so e.preventDefault() was a no-op, letting the
TCP panel scroll and the ruler slip away from the cursor (no snap).
Add native non-passive capture listener that preventDefault()s wheel
events starting on [data-sf-wheel] ruler containers.
2026-08-19 15:05:37 +07:00
admin 2f5c70ac29 Fix master volume + VST3FX GUI state restore on save/reload
- serializeProjectToSchema now writes master volume_db and mastering gui_open_path/name
- deserialize restores masterVolume + masteringSettings.gui_open_path/name
- track vst_gui_open_path/name fallback to live state (not just _persistFxGui*)
- MasteringModal/FXRackModal reopen effects react to isOpen + restored gui path
- openMasterVstGui/openVstGui store gui name for reopen
- bridge: /preset capture endpoint + RenderFxJob.captureState for GUI knob state
2026-08-19 14:44:40 +07:00
admin 8874e42596 fix(tcp): move vol/pan ruler wheel+dblclick handler to whole row
Scroll wheel giảm/tăng volume chỉ hoạt động trên input 4px; chuyển
onWheel+onDoubleClick lên row div (label+dB span cũng ăn), giữ bubbling
từ input. Áp dụng cho main TCP và sub-tab, cả app.jsx và precompiled.
2026-08-19 12:29:11 +07:00
admin 77360578fd fix(gui): embed VST GUI show on mount, health-check timeout/retry, send preset in fx chain (issues 1/3/4) 2026-08-19 10:56:22 +07:00
admin 1dfba14114 fix(gui): persist embedded VST GUI state across panel close/reopen
Close/reopen of Mastering panel or FX Rack unmounted the modal, losing
masterGuiOpen/fxGuiOpen state. The native bridge window stayed alive but
hidden, so reopening the panel showed no GUI and no /show was re-posted —
user could not interact with the VST GUI. Persist the embed state at module
scope so remount re-anchors and re-shows the window automatically.
2026-08-19 10:34:52 +07:00
admin e5ce9ca90a fix(vst-gui): borderless fx-gui window + anchored re-show (mouse stable)
- RenderFxJob: offscreen fx-gui window now WS_POPUP (borderless) so
  GetWindowRect == client rect; anchored placement over the embed panel is
  exact. WS_OVERLAPPEDWINDOW put the client ~31px lower/right -> cursor
  jumped on hover and clicks hit the webview (relay rejected).
- AdjustWindowRect sizes to the window's own style (no caption for POPUP).
- FxGuiServer: mousemove only SetCursorPos while dragging (buttons!=0);
  hover no longer teleports the cursor.
- FxGuiServer /show: skip SetWindowPos/resize when rect unchanged (frontend
  now re-POSTs /show every ~500ms to re-anchor on scroll/resize).
- app.jsx VstGuiEmbed: drop shownRef one-shot; re-POST /show each refresh.
- Rebuilt bridge (6 locations) + Tauri release (embedded sidecar) + v=202608190002.
2026-08-19 10:22:35 +07:00
admin da0f8fa40e feat(native): realtime master FX chain + fx-gui fast start, hide/show, non-topmost
- FxGuiServer: HWND_TOP (no longer always-on-top), /hide + /show endpoints,
  onStarted callback prints SF_FXGUI_PORT before plugin load (fast connect)
- RenderFxJob: RealtimeFxChain (mutex+worker, SEH-guarded, bypass slots,
  deferred Vst3Fx dtor); --fx-gui split into parse/create/load-attach stages
- main: FreeConsole unless SF_KEEP_CONSOLE; control type 6 SET_FX_CHAIN feeds
  g_fxChain on the audio loop; shutdown before CoUninitialize
- plugins.py: CREATE_NO_WINDOW on both Popen paths
- lib.rs: set_fx_chain command -> push_control(6)
- app.jsx/nativeBridgeService: setFxChain sync from MasteringModal; panel close
  uses /hide + refs to fix closure bug; VstGuiEmbed rect refresh -> /show
2026-08-19 09:59:13 +07:00