Commit Graph

762 Commits

Author SHA1 Message Date
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
admin 90b5a63719 Bump frontend cache-buster to 202608141031 2026-08-16 19:11:15 +07:00
admin 781425588c fix(standalone): bundle pedalboard.midi_utils + pyfluidsynth dll path
- engine.spec hiddenimports: pedalboard.midi_utils (C++ ExternalPlugin.h
  import dong, PyInstaller khong phat hien duoc -> midi-render 500)
- engine.spec hiddenimports: fluidsynth (pyfluidsynth cffi) cho
  /soundfont-render native
- vst_engine.py: _ensure_fluidsynth_dll_on_path() - frozen app them
  exe_dir vao PATH de ctypes.util.find_library tim thay
  libfluidsynth-3.dll dat ke exe
2026-08-16 18:50:27 +07:00
admin 1d40cf27b7 feat(standalone): native VSTi midi-render cho browser client khi bridge inactive
- playNativeVstNote/scheduleNativeVstItem: render qua /api/v1/plugins/midi-render
  (pedalboard VST3 dung instrument_id/preset) -> play WAV, map token rieng
- Them nhanh nativeVst tai moi diem route nhanh cua: startTrackPlayback,
  section/subtrack, playMidiPreviewNote, piano roll preview (alt-scroll/click/
  brush/draw), keybed, MIDI hardware input
- Safety net trong scheduleMidiNoteDispatch fallthrough (ghost notes va caller khac)
- stopAllNativeVstNotes/stopNativeVstNote di kem cac diem stop hien co
2026-08-16 18:23:53 +07:00
admin b2470e1422 Show server port alongside IP in SERVER label 2026-08-16 17:59:47 +07:00
admin cdbff49ea2 Remove LAN access badge; show server IP in SERVER label 2026-08-16 17:56:55 +07:00
admin cca58c4893 feat(piano-roll): vào tab lúc main play -> chỉ play MIDI notes track đang edit, các track khác mute
useEffect [activeTab] mới: activeTab là PIANO_ROLL và main/section đang play ->
stopAllPlayback + restart play CHỈ track piano roll tại vị trí tương ứng trong
item (mainPos - item.startTime). mainResumeRef giữ để quay lại main/section
resume đúng vị trí (nhánh resume cũ không đổi).
2026-08-16 17:47:31 +07:00
admin 7bcaf19c28 feat(vst-gui): open VST3 GUI while playing (level 1)
- main.cpp: drop transportStopped defer in handleOpenGui (G0.1 legacy);
  G0.1b setReloading-before-job + single UiThread (G1.2) block the
  2-thread-1-DLL race. GUI opens immediately during PLAY, short mute
  (~0.1-0.3s first time, hasAttachedOnce_ false so reloadForGUI skips
  reload); notes already sounding are kept. Reopen after close still
  reloads (1-3s mute) - level 2 not feasible.
- app.jsx: remove !isPlayingRef.current guard before openNativeGUI in
  loadTrackInstrumentToBridge.
- rebuild app.precompiled.js + daw_vst_bridge.exe.
2026-08-16 17:27:38 +07:00
admin 223023615d fix(media-explorer): bridge preview channel 15 + NOTE_ON timing; synth dropdown portal 2026-08-16 16:58:18 +07:00
admin 574c2f885d fix(media-explorer): preview MIDI qua native bridge FluidSynth thay soundfontRender 501
- playMidiPreview standalone: thay soundfontRender backend (pyfluidsynth khong co
  trong bundle -> 501 -> cam) bang playMediaExplorerBridgePreview: allocate
  channel rieng, bridgeLoad SF2 + loadInstrument, CC0/CC32/PROGRAM, NOTE_ON/OFF
  theo beat, loop timer; bridge down -> fallback WASM
- stopMediaPlayback: NOTE_OFF toan pitch cho channel preview de note khong con
  ngan sau khi stop
2026-08-16 16:42:19 +07:00
admin b6950d6418 fix: MIDI keyboard preview silent after transport STOP — live flag bypass guard (V8) 2026-08-16 15:43:23 +07:00
admin 761b48e41f fix 5.2 audit findings on Windows: F-PROC-1 injection, F-MEM-5 UAF, F-PROC-2 restart race, F-PROC-3, F5, F6 2026-08-16 12:29:42 +07:00
admin 2f7861820e G0.2: openVstGuiRetry toi da 2 lan + backoff 800ms + skip khi PLAY 2026-08-15 18:45:25 +07:00
3dtours 2596372ab1 fix crash bridge khi đổi SF→VSTi đang play: silence same-plugin theo path MỚI trước assign() (createInstance) — track restore giữ cùng DLL process song song audio loop = 2 threads 1 DLL Nexus crash; không tự mở GUI khi đang play (C++ mute channel tới khi đóng GUI → tắt âm) 2026-08-14 17:08:17 +07:00
admin dc54a0c3f3 fix(bridge): loop keeps playing — cancel delayed STOP#2 on PLAY (V10) + epoch-guard stale note timers (V11, crack fix) 2026-08-14 11:24:44 +07:00
admin d42abb2a41 fix(ui): per-track volume/mute/solo now works over bridge — send CC7 via SonicMidiRouter pushEvent instead of local WASM controllerChange 2026-08-14 10:56:24 +07:00
admin 35499b614c fix(bridge): VSTi GUI crash on instrument switch — PostMessage WM_CLOSE instead of cross-thread DestroyWindow
- LOAD job posts WM_CLOSE to window created on main thread (DestroyWindow from worker crashed 0xc000041d, muting all tracks)
- handleOpenGui + attach jobs skip when Vst3Instrument::hasAttachedView() (state_ && guiAttached_)
- attach failure posts WM_CLOSE; post_close_gui erases entry only when it points at the same hwnd
- cap openVstGuiRetry at 5 to stop frontend retry spam
2026-08-14 10:18:22 +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 3f59c2c4c2 fix: SF2 bank select, midi multi-key cut, VSTi reopen hang, multi-track stuck
- NativeInstrumentEngine: track GM bank per channel (CC0/CC32), use bank in programChange
- app.jsx: send CC0/CC32+PROGRAM before notes via __ensureBridgeProgram, dedupe, clear dedupe after async LOAD
- audioRoutingEngine/bridgeAudioNode: idempotent connect (no disconnect-flush on re-connect), fixes note cut & multi-track stuck
- main.cpp: remove 10s poll in OPEN_GUI control job (blocked realtime loop, watchdog race), VstWindowProc stores channel not inst pointer, cleanup gui maps on WM_DESTROY
2026-08-13 12:19:34 +07:00
admin d168328004 Fix AI proxy origin in Tauri, SF2 program_select, VSTi GUI reopen + sample rate bridge
- aiGateway.js: use window.API_BASE_URL (engine port) instead of window.location.origin (tauri://localhost asset protocol returned index.html -> JSON parse error); check content-type before parsing response
- NativeInstrumentEngine.cpp: fluid_synth_program_select for SF2 instrument + program change
- Vst3Instrument.cpp: activate all audio/event buses, channel=0 forced, GUI resize/reopen, kEvent using fix
- main.cpp: VST GUI reopen via WM_DESTROY, OleInitialize, steady_clock loop
- lib.rs: BridgeSampleRate state, restart_bridge_with_sample_rate command, borrow fix
- app.jsx/nativeBridgeService.js: isMidiTrack widening, bridge masterbus connect, held MIDI notes, sample-rate restart, openNativeGUI channel
2026-08-13 11:26:39 +07:00
admin 49549aba2e build: bump asset version to 202608121700 in source index.html 2026-08-13 08:53:13 +07:00
admin f8a981b27f fix: route PR notes through bridge when active (VST3/SF2 playback via Play button)
Two guards: schedulePianoRollMidi skips native SF item scheduling while bridge is active; scheduleMidiNoteDispatch lets notes pass to the MIDI router when a piano-roll sub-tab is playing. Verified on Windows: SF2 peak 0.026, VST3 ACDD native GUI + peak 0.074 via Play button. Docs: TEST_NOTES.md, TASKS.md.
2026-08-13 08:21:37 +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