Commit Graph

789 Commits

Author SHA1 Message Date
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
admin c6de0720f4 fix(bridge): anchored fx-gui embed - dance dat window dung panel rect, khong park/restore cursor, resize view qua WM_FXGUI_RESIZE 2026-08-19 09:25:43 +07:00
admin 0334c2a5a3 fix(backend): find_bridge_exe frozen onedir thieu exe_dir candidate - bridge sidecar nam canh app root ngoai _MEIPASS lam list_fx tra rong (Mastering/FX Rack khong load VST duoc); mirror logic runtime._vst_render_available 2026-08-19 08:15:59 +07:00
admin 0cf771242f VST FX integration: plugin picker theo category + GUI embed fill viewport (FX Rack & Mastering) 2026-08-19 07:55:57 +07:00
admin ec8b57ecb3 V12: fix VSTi GUI khong mo lan 2 khi bridge_status thieu loaded_channels
bridge_status (Rust binary cu, chua co V10 field loaded_channels) -> queryStatus
fallback khong co loaded_channels -> lc undefined -> silent return 6626 lam GUI
chet im lang o click 2. Bo silent return: mo GUI truc tiep tren bch, an toan vi
C++ handleOpenGui DEFER khi channel chua co instrument.
2026-08-18 22:58:14 +07:00
admin 0cde007d26 V11 fix GUI silent-return: only skip load when path resolved; refresh bridge state via queryStatus and open GUI on any restored channel 2026-08-18 21:51:02 +07:00
admin d07f626a6c Fix FX GUI panel frozen: prefer PrintWindow live frame + real-input fallback for GPU-rendered editors 2026-08-18 21:24:33 +07:00
admin 7bc96eebbc fix(playback): het note chong am echo o bass - KHONG huy note-off cu cung pitch (Bug 2 huy mui lam note cu khong bao gio tat); giu neu note-off cu bam truoc note-on moi, doi ve ngay truoc note-on neu overlap; sync 6 ban JS + index.html ?v=202608181900 2026-08-18 20:13:53 +07:00
admin be8af7a6ee fix(playback): het fade-out dai dang khi stop - restore gain LUON (ke ca stale/play moi trong cua so fade) qua pending fade session, huy fade ngay khi play moi (het dip 200ms); sync 6 ban JS + index.html ?v=202608181840 2026-08-18 19:53:59 +07:00
admin 4ddaf1f26a fix(playback): het retrigger 'play lai roi tat' khi stop - stop ngay clip source chua phat (playbackState=scheduled) truoc fade, source dang keu giu lai ramp 200ms; sync 5 ban JS + index.html ?v=202608181835 2026-08-18 18:45:32 +07:00
admin eb5a1483ca fix(playback): stop transport fade-out that - handleStop goi stopAllPlayback(true) (bo sot v14) + FADE_MS 80->200ms de fade nghe ro, het cat dung; sync 5 ban JS + index.html ?v=202608181827 2026-08-18 18:45:32 +07:00
admin 1e16189da8 fix(playback): stop fade-out 80ms khi nhan Stop/Pause - ramp gain track + bridge gain xuong 0 truoc hard-stop, guard play-gen tranh STOP tre giet play moi; sync 5 ban JS + index.html ?v=202608181818 2026-08-18 18:45:32 +07:00
admin 45a15da55e fix(midi): playback khong cam loop pass 2+ va note cung pitch khong bi cat (bugs 1-2) - set isPlayingRef truoc bridge PLAY (startTrackPlayback/local/piano-roll), cancel STOP#2 retry khi loop restart; dedupe NOTE_OFF theo channel:pitch (pendingNoteOffMap + scheduleNoteOff) de NOTE_OFF tre (dur+30ms) khong cat note-on cung pitch ke tiep (bar lien nhau, piano roll note chong), clear map khi stop; sync 5 ban JS + index.html ?v=202608181807, rebuild exe release 2026-08-18 18:45:31 +07:00
admin 351ee56080 fix(bridge): load dung VSTi theo track (V9) - bo early-return mui theo flag, load qua Tauri invoke khi co path, guard path sai (WaveObserver vs Nexus), chi mo GUI khi load OK; sync 6 ban JS + index.html ?v; kem cac fix bridge truoc (bugs 1-4, GUI restore) 2026-08-18 16:56:05 +07:00
admin cbcc1f658c merge: Normalize Linux audio pipeline to lossless Float32 (a2f9313) 2026-08-18 12:10:24 +07:00
3dtours a2f93138be Normalize Linux audio pipeline to lossless Float32 (skill: lossless-audio-compliance)
- native bridge WAV writers: 16-bit PCM truncation -> IEEE Float32 (fmt 3, bit-exact)
- vendor sheredom_json.h (vst3sdk 3.8.1 lacks moduleinfo/json.h)
- Dockerfile: drop nonexistent sfizz tag v1.2.3
- Python sf.write -> subtype=FLOAT everywhere
- resample_poly -> kaiser(16) window (>=130dB stopband)
- audio_editor._write_wav_lossless(): FLOAT passthrough, TPDF dither only for
  8/16/24-bit final exports
- app.jsx WAV encoders: Float32 default, TPDF dither for integer depths, fix 24-bit
- tests: lossless compliance gate (null test < -140dBFS, float32 format) 9/9 pass
- TASKS_WINDOWS_AUDIO_NORMALIZE.md: Windows-side remaining tasks
2026-08-18 11:50:26 +07:00
admin 4eadf897a4 feat(mastering): remove redundant VST FX MASTERBUS row from panel
VSTs are now added via the chain '+' button (addVstToChain mirrors into
vstFxChain for offline render), so the old bottom row (slot list + '+
Thêm VST FX...' select + offline preview) duplicated the chain and is
removed.
2026-08-18 09:43:30 +07:00
admin c9b35d60ff fix(mastering): VST chain edits no longer reverted by cross-device temp sync
Guard the 3s applyRemote sync so it does not clobber masteringSettings
while the Mastering panel is open (user actively editing chain). Another
connected session's temp snapshot (written every 30s) was reverting
chain add/remove/toggle of VST modules within ~3s.
2026-08-18 09:36:24 +07:00
3dtours c382afe2a6 feat: embed native VST GUI in mastering + fx rack panels (bridge --fx-gui frame capture + input relay)
Linux parts (0L1-4L1 per TASKS_LINUX_WINDOWS.md):
- native_bridge: FxGuiServer.cpp HTTP server (Winsock) — /frame BitBlt +
  PrintWindow fallback -> JPEG (libjpeg-turbo q70), /input PostMessage relay
  (mouse/wheel/key, coords scaled), /close, /ping; RenderFxJob fxGuiSetup +
  run_fx_gui_server (offscreen); main.cpp --fx-gui dispatch; vcpkg +
  CMakeLists WIN32-only + JPEG.
- api: open_fx_gui embed flag spawn --fx-gui, parse SF_FXGUI_PORT -> embed_url,
  fx-gui/close endpoint; 4 unit tests.
- ui: VstGuiEmbed component (frame refresh 100ms, ping 2s, input relay,
  scale coords) shared by MasteringModal + FXRackModal; swap graph<->GUI,
  cleanup on unmount, dead-bridge toast fallback.
- docs: TASKS_LINUX_WINDOWS.md, WALKTHROUGH_WINDOWS.md, PLAN status.
Windows tasks 0W1-4W1 remain (build + E2E real VST).
2026-08-17 22:37:55 +07:00
admin 38f4cbd8b5 feat: open native VST FX GUI from mastering panel + FX rack (bridge --open-fx-gui) 2026-08-17 21:52:40 +07:00
admin b261eb0d7e feat: VST FX rack per-track + masterbus render via native_bridge 2026-08-17 21:31:57 +07:00
admin 8fbacd1d2b fix(tcp): open VSTi GUI via bridge API on LAN browser; scale vol/pan ruler wheel by deltaY 2026-08-17 20:44:44 +07:00
admin bbde74f1a7 fix: normalize peak audio render offline chống clip polyphony; TCP wheel điều chỉnh volume/pan 2026-08-17 20:04:34 +07:00
admin dc331f39d8 phase5: mặc định RENDER_ENGINE=bridge, gỡ pedalboard khỏi requirements/source/LICENSE
- config.py: SF_RENDER_ENGINE default 'bridge' (pedalboard GPL-3.0 đã gỡ)
- requirements.txt: bỏ pedalboard==0.9.19
- vst_engine.py: bỏ HAS_PEDALBOARD/check_pedalboard_safe/load_vst/import pedalboard;
  midi_events_to_messages giữ làm utility thuần (không gate pedalboard)
- render_engine.py: bỏ nhánh elif vst and HAS_PEDALBOARD + import thừa
- plugins.py: preview/midi-render chỉ qua native_bridge; guard SF_RENDER_ENGINE=bridge
- runtime.py: _vst_render_available() check bridge exe (SF_BRIDGE_PATH/install/) thay find_spec('pedalboard')
- LICENSE.md/THIRD_PARTY_LICENSES.md: bỏ cảnh báo GPL-3.0 pedalboard, đánh số lại
- tests: bỏ test golden so pedalboard + test requires_pedalboard; 114 passed 0 skip
2026-08-17 12:58:51 +07:00
admin e79dae5d5c phase4: Linux native_bridge build (Docker) — sfizz from source, --render SF2/SFZ
- Dockerfile: build sfizz tu native_bridge/sfizz-src (hoac git clone v1.2.3),
  sed fix sfizz.pc (-llibsfizz -> -lsfizz), cmake bridge voi 3 flag SMTG OFF
  (VSTGUI/plugin/hosting examples) — bridge headless chi can --render.
- CMakeLists: nhanh non-WIN32 build daw_vst_bridge tu main_linux.cpp +
  RenderJob.cpp + NativeInstrumentEngine.cpp (SF2/SF3 + SFZ; VST3/VST2
  hosting Windows-only, guard #ifdef _WIN32). gui_probe/plugin_host/
  seh_channel_test chi build tren Windows.
- RenderJob.cpp: JSON parser (sheredom json.h) khong con phu thuoc
  HAVE_VST3SDK — render SF2/SFZ chay duoc khong can VST3 SDK.
- NativeInstrumentEngine.cpp: guard windows.h/VST3/VST2/Sandbox/SEH.
- main.cpp: g_engine unconditional + guard disable_ime_contexts (_WIN32).
- engine.spec: bo pedalboard collect_dynamic_libs + hidden imports.
- vst_engine/render_engine: DecentSampler -> NotImplementedError + huong
  dan convert .dspreset -> .vstpreset; pianobook fallback synth.
- Verified: WSL Ubuntu 24.04 build OK, bridge Linux --render SF2 ra WAV
  44100 stereo peak 1575; Python tests 115 passed 1 skipped.
- Dockerfile build chua test duoc (may khong co Docker).
2026-08-17 11:46:24 +07:00
admin efe26e3277 phase3: render_engine export qua native_bridge, FX scipy fallback, bỏ pedalboard branch
- VSTi track: SF_RENDER_ENGINE=bridge → native_render.render_offline (velocity
  float 0..1 từ midi_events MIDI 0..127), fallback oscillator khi lỗi
- chorus/reverb/gain: luôn dùng scipy/numpy fallback, xóa nhánh HAS_PEDALBOARD
- bỏ top-level import pedalboard (Pedalboard/Gain/Chorus/Reverb)
- test mới: bridge branch fallback, FX chorus/reverb scipy
2026-08-17 11:10:43 +07:00
admin 3d963eb8dd phase2: fix velocity double-scaling in bridge job, bank/program parity, golden RMS test
- render_offline: send velocity as float 0..1 (RenderJob.cpp scales *127);
  old int(0.8*127) was scaled again -> clamp 127, velocity ignored
- forward soundfont_bank/program into bridge job (presence-based, matches
  midi_events_to_messages)
- new tests: bridge branch dispatch (SF_RENDER_ENGINE=bridge -> 404),
  bridge vs pedalboard golden RMS comparison (plan section 6)
2026-08-17 11:04:01 +07:00
admin 235dee103d Phase 2: native_render Python client (bridge --render) + SF_RENDER_ENGINE flag cho preview/midi-render 2026-08-17 10:49:54 +07:00
admin 4111995a5c Add VST2 hosting to native bridge; fix CC7 data2 routing verified via SHM test
VST2 (Steinberg 2.4 ABI) host via Vst2Instrument: aeffect.h, dispatcher,
process events/replacing, kEffectStartProcess, headless GUI skip.
- create_instrument returns Vst2Instrument for InstrumentType::VST2
- 64B-aligned scratch buffers for SIMD plugins; SEH crash capture module+stack
- plugins.py: VST2 resolves .dll/.so; vst_engine.py reports VST2 type
- app.jsx: derive instrumentType from scan (VST3 vs VST2), not hardcoded
- Install exes refreshed from Release build

SF2 FluidSynth audio verified end-to-end through SHM ring (energy 1.33):
silence was a test-harness bug (CC7 value written to velocity field, bridge
reads data2) — app sends data2 correctly. All temporary diagnostics removed.
2026-08-17 07:55:46 +07:00
admin cead8c8c71 fix(vsti): crackle fix P1-P3 — SHM 8-slot ring + drain-delta pump + AudioWorklet sink
- SharedMemoryIPC.h/main.cpp: render into ring slot (idx & ringMask), 8 slots
- shm.rs: ring fields + read_ring_audio; lib.rs pump drains FULL delta, not just latest
- bridgeAudioNode.js: AudioWorklet primary (bridge-audio-sink), ScriptProcessor fallback
- bridgeAudioWorklet.js: ring 64 blocks, underrun fade, overrun drop + crossfade
- layout tests: sizeof 27560 (8-align via u64)
2026-08-16 20:43:50 +07:00
admin ed26e1706d fix(latency): threadpool renders + RENDER_LOCK + client pre-render cache 2026-08-16 20:21:48 +07:00