Commit Graph

230 Commits

Author SHA1 Message Date
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 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 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
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 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 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 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 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
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 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 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
admin 90b5a63719 Bump frontend cache-buster to 202608141031 2026-08-16 19:11:15 +07:00
admin 29f7fecb35 fix(ui): GUI button inline same row + same height as Synth/File/FX in TCP 2026-08-14 08:04:33 +07:00
admin 7a8122f99d fix(v9): 5 bugs — GUI deferred until VST loaded (no white window), fixed retry 8x500ms, VST3 folder resolve for auto-load, sustain-CC64 dropped after STOP, taskkill process tree on exit, Synth+GUI same row in TCP 2026-08-13 21:57:23 +07:00
admin 96d31ee685 fix(v8): 5 bugs — orphan bridge watchdog+state overwrite, stuck-note stop race, white VST GUI retry, VSTi auto-load via saved plugin_path, track-header button overflow
- native bridge: dedicated watchdog thread (parent death / PID-reuse via GetProcessTimes) -> TerminateProcess self; transportStopped flag drops note-on after STOP + CC64 sustain release + allNotesOff on stop
- tauri: set_bridge_child overwrites managed BridgeProcess state (app.manage is no-op when state exists) so Destroyed handler kills restarted bridge
- ui: stopAllPlayback syncs isPlayingRef/subTabsRef + second transport stop at 150ms; onStatusChange resets __bridgeLoadedChannels at callback start (auto-restart never emits bridge-down); openVstGuiRetry waits for async C++ load before OPEN_GUI; loadVstToBridge uses synth_engine.plugin_path / listPlugins fallback and persists plugin_path on load; shrink track-header Synth/GUI buttons
2026-08-13 21:14:31 +07:00
locpham e3f5dad2ac fix(vst-bridge): reload VST3 on project open + bridge reconnect; GUI button ensure-load before open
- preloadTrackInstruments: also load VST3 tracks into bridge (no GUI) on project open
- onStatusChange(connected): reload all VST tracks after bridge restart/down recovery
- GUI button (track strip + piano roll): ensure-load then open — no white window when bridge restarted and instrument gone
- __bridgeLoadedChannels map: skip reload if already loaded (avoids plugin state reset); reset on bridge down
- piano roll: wrap Synth+GUI buttons in shrink-0 row so GUI stays on same line; compact track-strip GUI button
2026-08-13 20:32:08 +07:00
admin 4bb67b54ad feat(ui): add GUI button beside Synth button to reopen VSTi editor — track strip + piano-roll toolbar; sends bridge OPEN_GUI via router channel 2026-08-13 19:53:01 +07:00
admin 49549aba2e build: bump asset version to 202608121700 in source index.html 2026-08-13 08:53:13 +07:00
locpham 36fb546d58 fix: SF2 sound (audio sink FIFO underrun) + VST3 native GUI open + GUI load race
- bridgeAudioNode: ScriptProcessor 4096 drained only 1 of 16 blocks -> ~94% silence; now drains all queued blocks per callback, RING_DEPTH 8->24
- app.jsx: openNativeGUI had NO caller; wire after VST3 loadInstrument OK in track Synth dropdown + Plugin Manager Load Bridge
- main.cpp: OPEN_GUI polls up to 10s for LOAD completion (worker thread) before attach - fixes race 'no instrument loaded'
- index.html: bump bridgeAudioNode/app.precompiled cache versions
2026-08-12 22:32:10 +07:00
admin d8f8506077 fix: GUI VST native window qua bridge + audio path bridge (SF2 preview/play câm)
- open_vst_gui: bo WebviewWindowBuilder/thread, chi push_control type=4 (hwnd=0 -> bridge tao window)
- main.cpp: create_native_vst_window (class SonicForge_Native_VST3_Class, 800x600, khong TOPMOST),
  tao trong ChannelWorker job, map guiWindows, capture arg2 by value (fix dangling)
- app.jsx: guard isBridgeActive() 8 cho -> bridge active thi moi note di router -> pushEvent -> bridge
  (truoc day SF2 cam vi HAS_PYFLUIDSYNTH=FALSE -> /soundfont-render 501; VST3 path cu dung nativeSf/Carla)
- E2E: SF2 NOTE_ON qua dispatchMidiEvent -> SHM peak 0.029745; Nexus GUI native hwnd OK (license/preset)
- docs: TASKS.md + TEST_NOTES.md ghi batch fix + ket qua; gitignore vendor/junk
2026-08-12 22:12:43 +07:00
locpham c3368d0a91 feat: native host bridge integration — C++ bridge, Rust SHM, JS routing, build scripts, docs
- native_bridge/: InstrumentEngineManager multi-channel, sample-accurate, CC/program/pitchbend, transport, Vst3Instrument stub (HAVE_VST3SDK)
- src-tauri: shm.rs, bridge spawn + audio pump + health monitor, open_vst_gui, externalBin, commands
- app: UnifiedMidiRouter, NativeBridgeService, bridgeAudioNode, audioRoutingEngine, Plugin Manager UI, Bridge/WASM indicator, set_position sync
- build: 3 ps1 (force-added, build/ ignored), verify_bundle --check-bridge, CI workflow
- docs: TASKS.md, TEST_NOTES.md (Windows verify checklist), install/report updates
2026-08-11 23:37:29 +07:00
3dtours aa1cd8d5de fix: 3 bug standalone — soundfont preview/play, Carla bridge play item, realtime sync LAN/Tauri
Bug1: dispatcher CREATE_MIDI_ITEM track_id number vs state string -> String(); play+preview native soundfont verified.
Bug2: Carla play item — chờ OSC ready (poll carla-status, queue nốt khi cold start), chống spawn trùng (carla-status dò port bind, open-in-carla skip khi đã chạy).
Bug3: realtime sync — GET /temp/revision (updated_at+client_id), poll 3s, apply qua deserializeProjectFromSchema; hash-skip autosave + client_id chống ping-pong.
2026-08-10 22:10:12 +07:00
3dtours d31e226f00 LAN access: bind 0.0.0.0 + expose LAN URL (capabilities.lan, UI badge) 2026-08-10 20:46:06 +07:00
3dtours a0d8725541 feat: tách luồng âm instrument theo môi trường — docker dùng FluidSynthWASM, standalone dùng native pyfluidsynth (+Carla VSTi)
- runtime: detect()/capabilities() trả environment (docker|standalone)
- vst_engine: render_soundfont_midi_to_audio (pyfluidsynth native, event-stream, release tail)
- plugins: POST /soundfont-render — render MIDI notes -> WAV (auth, fallback default SF)
- frontend: SonicRuntime.environment + dataset.environment; app.jsx route preview/transport:
  standalone+SF -> soundfont-render WAV (playNativeSfNote/scheduleNativeSfItem),
  docker giữ WASM, VSTi standalone giữ Carla bridge
2026-08-10 20:38:54 +07:00
3dtours e89a594b7c FIX: 3 bugs - soundfont engine fallback, media explorer icons/drag, carla midi playback routing
- render_engine: soundfont track không có plugin_id giờ vẫn dùng instrument sf2 thay vì rơi về wave synth
- fontawesome: sửa đường dẫn webfonts (bỏ ../) hết 404 icon
- media explorer: drag MIDI library items vào timeline tạo được midi item (sinh 6 MIDI loop mẫu + resolve drop file)
- app.jsx: 3 path gate window.SonicSF cho phép route playback qua SonicCarlaMidi
2026-08-10 20:08:48 +07:00
3dtours 61cb4b846f FIX: 11 bugs bảo mật/ổn định (static mount chặn dotfile, delete traversal, cleanup giữ clips serverFileId, upload whitelist, password strength, auth audio endpoints, pedalboard==0.9.19, vendor CDN local) + FEATURE: Carla bridge preview/export MIDI notes âm VSTi (POST /midi-render, /carla-play-notes, nút Preview VSTi/Export MIDI->Audio; pedalboard 0.9.19 raw MIDI bytes; SONICFORGE_STORAGE_DIR cô lập test storage) 2026-08-10 18:46:54 +07:00
3dtours a1dc074e35 FIX: MIDI item route qua Carla giống hệt keybed — bỏ gate __carlaRunning (Carla mở thủ công/cũ vẫn route; gate cũ làm 'keybed kêu, item câm') + log chẩn đoán [Carla] item note 2026-08-10 10:03:41 +00:00
3dtours 75eba27dcf FIX: (1) masteringConnected default true + ensureMasteringRouting/refreshCarlaStatus ở mọi đường play — MIDI item/preview qua mastering ngay khi chạy app; (2) _instrumentEpoch chống cache stale + retry bank 0 — hết chọn Synth String nghe Piano; (3) /carla-status + auto-open Carla + route exclusive chỉ khi Carla sống (fallback FluidSynth tránh câm); (4) keybed giữ note theo thời gian bấm (auto-off 5s phòng hờ, mouseup dừng ngay) 2026-08-10 09:51:58 +00:00
3dtours f492104869 FIX: (1) MIDI item route CHỈ qua Carla bridge khi VSTi loaded (bỏ FluidSynth GM sai âm) ở mọi đường playback + ghosts; (2) updateSfRouting sync route gains nhánh gainNode + ensureMasteringRouting force-sync mọi node — preview MIDI keyboard qua mastering không cần bật/tắt power; (3) stopNote/panic dừng fallback oscillator theo channel:pitch — hết âm kêu liên tục sau khi thả phím 2026-08-10 09:07:42 +00:00
3dtours 75795653c5 FIX: ensureMasteringRouting gọi getAudioContext() trước — preview đầu tiên cũng sync mastering routing 2026-08-10 06:04:32 +00:00
3dtours 025e0f03a2 FIX: preview soundfont (MIDI keyboard) không tự động qua mastering FX main out
- Thêm ensureMasteringRouting() đồng bộ graph mastering + routing SF + route gains NGAY trước khi preview (keybed onMouseDown, playDrawPreview, playMidiPreview, mở piano roll tab) — hết phải bật/tắt nút power mới có tác dụng
- applyMasteringSettings sig thêm masterConnected/isBypassed — toggle power luôn re-apply tham số module
2026-08-10 06:04:12 +00:00