Commit Graph

906 Commits

Author SHA1 Message Date
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 fb63f06292 plan: note phase2 velocity fix, bank/program parity, golden RMS test 2026-08-17 11:04:10 +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 bbb11f8066 Phase 1: import .vstpreset in offline render (loadSerializedState)
daw_vst_bridge --render now applies a VST3 preset when job has 'preset'
(base64 of a .vstpreset file). Parse the SDK binary chunk format with
PresetFile (vst3sdk), rewrap component/controller state into the bridge
blob [4B BE compLen][comp][4B BE ctrlLen][ctrl] and apply via
loadSerializedState before rendering. SF2/SFZ ignore preset (warning).
Bad base64/magic/chunks fail the job with rc 1 and no partial clip.

Tests: golden Nexus .vstpreset fixture; VST3 with/without preset,
bad preset -> rc 1, non-VST3 preset ignored. 20/20 pass.
2026-08-17 10:44:13 +07:00
admin 4d1a2ed54a docs(plan): mark Phase 0 done (bridge --render CLI verified) 2026-08-17 08:04:53 +07:00
admin 0cca84c5f9 feat(bridge): add --render offline CLI (Phase 0 of pedalboard replacement)
daw_vst_bridge --render <job.json> --out <clip.wav> renders MIDI notes
through the same instrument engines as realtime (SF2/SFZ/VST3/VST2) to a
16-bit stereo WAV, headless, no SHM. Mirrors plugins.py/vst_engine.py
note semantics (velocity int(vel*127), bank CC0 + program at t=0, beatSec
60/max(30,bpm), totalNeeded max(1024,endSample), no tail). Chunk clamped
to 256 to match VST3 host prepared buffers. Uses vendored sheredom json.h
(gated on HAVE_VST3SDK); rc: 0 ok, 1 arg/job error, 2 load fail, 3 crash.
Partial output removed on failure. Verified: SF2, SFZ, Nexus VST3 render
non-silent at exact duration; 9/9 tests pass.
2026-08-17 08:04:25 +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 9d9b4b3686 Merge remote-tracking branch 'origin/standalone-shm-bridge' into standalone-shm-bridge 2026-08-16 21:27:50 +07:00
3dtours 353244708f docs: plan replace pedalboard (GPL-3.0) with native_bridge offline render 2026-08-16 21:25:20 +07:00
admin 98574aa0ea fix: ensure all daw_engine exit on app close (abrupt kill + LAN client open)
- desktop_engine: watchdog parent check via WaitForSingleObject(SYNCHRONIZE)
  instead of OpenProcess — killed parents linger as zombie objects, OpenProcess
  succeeds forever and watchdog never fires; hard-exit after 5s if graceful
  shutdown hangs (open LAN connection)
- lib.rs: Destroyed handler sweeps any orphan daw_engine/daw_vst_bridge by
  image name before exit(0), covering manual-launch and stale engines
2026-08-16 21:18:21 +07:00
3dtours e2c0564982 docs(license): add LICENSE.md, audit third-party licenses (Python/native/tauri), flag pedalboard GPL-3.0 2026-08-16 21:08:13 +07:00
3dtours 4f6e2bc049 docs: design VST2 backward compatibility for standalone-shm-bridge 2026-08-16 21: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
3dtours cc0a573ca9 docs: phân tích + hướng fix VSTi play crackle/noise (Linux review) 2026-08-16 18:54:56 +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 e541d16132 merge: docs docker play VSTi (70da711) 2026-08-16 17:28:30 +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
3dtours 70da711520 docs: thiết kế kiến trúc docker play VSTi ở client — giữ luồng cũ (VSTi→SF2/SF3 asset) 2026-08-16 17:08:19 +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 56d8c577aa deploy: sonicforge-daw.exe V10 (drag-drop fix build) 2026-08-16 16:23:37 +07:00
admin 045d84bde0 fix: drag-drop MIDI from Explorer on Windows — disable Tauri drag_drop_handler so WebView2 gets HTML5 DnD (Phương án A, FIX_DRAG_DROP_WINDOWS.md) (V10) 2026-08-16 16:20:48 +07:00
admin c29e024372 fix: stale-reload watchdog — force-unmute channel stuck in reloading >20s (60s if close/attach in flight) (V9) 2026-08-16 16:15:41 +07:00
3dtours 4c8677699c docs: đề xuất fix drag-drop MIDI file trên Windows/Tauri 2026-08-16 16:08:07 +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 2d63774474 rebuild clean from scratch: native bridge + tauri + engine bundle (F6 Cap 2 in deployed engine) 2026-08-16 15:11:10 +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
3dtours 54b7a7a6ac 5.2: audit security/memory/child-process conflict — F-MEM-5 UAF, F-MEM-8, F-PROC-1 injection, F-PROC-2 restart race, F-PROC-3, F5, F6 (Linux review only) 2026-08-16 12:12:29 +07:00
3dtours 07f0569d81 G2: Linux review + verify — code G2 consistent, no product bugs (F1 double flush minor, F2 SF_STATE_FILE Linux fallback note, F3 cosmetic); StateStore round-trip PASS on Linux g++; report section 5.1 + journal updated 2026-08-16 11:48:51 +07:00
admin 6c19f17b61 deploy: plugin_host.exe idle-skip build 2026-08-16 11:45:02 +07:00
admin 9fa3076359 G4.3 idle-skip + no fixed-tick render: idle CPU ~0, latency 9.8ms 2026-08-16 11:44:56 +07:00
admin 9436e66835 G4.3: double-buffer sandbox SHM - SandboxHostIPC writeSlot+2x256 double audio, latency 15.6ms, multi-instance no-xrun verified 2026-08-16 11:35:31 +07:00
admin 462a5104d2 G4.2: bridge-side plugin process pool — SandboxVst3Host spawns/respawns plugin_host.exe per channel, MIDI forward + audio snapshot + watchdog mute/respawn, crash isolation verified 2026-08-16 10:52:04 +07:00
admin 7de00955d8 G4.1: sandbox plugin host (plugin_host.exe) PoC — Nexus runs in child process, GUI + audio via SHM, crash isolation verified 2026-08-16 10:36:01 +07:00
admin 700f612674 chore: commit G3.2+G3.3 deploy binaries + debug scripts; ignore debug run artifacts 2026-08-16 10:27:36 +07:00
admin d0da12f42b G3: journal — note test helper committed 85273a6 2026-08-16 10:25:19 +07:00
admin 85273a6a7f debug: fix G1.5 stress test wait_log to read log file once per poll (avoids false timeouts on 140k-line log) 2026-08-16 10:23:55 +07:00
admin 40ee80ad60 G3: update task tracking — G3.2/G3.3 done (classify stall + SEH per-channel) 2026-08-16 10:23:46 +07:00
admin 0b8e80fe2c G3.2+G3.3: classify hang/crash vs audio stall + SEH per-channel plugin crash isolation (mute channel) 2026-08-16 10:23:08 +07:00
admin 30fa98a441 G3.1: dedicated bridge heartbeat — watchdog liveness independent of audio loop 2026-08-16 10:04:16 +07:00
admin b59e416566 G2.5+G2.6: stress driver for persistence restart (N loop + kill/respawn) + verify — regression G1.5 5/5, G2.5 5+10 PASS, G0.4 probe PASS 2026-08-16 08:37:27 +07:00