Files
SonicForgeStudio/plans/patch_attack.py
admin 10997a65b9 fix(fx-rt): het crackle master FX - limiter attack smooth + crossfade khi bat/tat chain
- NativeInstrumentEngine: kAttack 0.9->0.1 (het zipper khi sum nhieu track)
- app.jsx: crossfade masterFxDryGain/masterFxGain thay hard-rewire graph luc
  activation/deactivation master chain FX; worklet bao 'started' -> ramp dung
  luc; PDC tre sau khi dry silent (tranh gap 80ms)
- sf-fx-realtime.js: fade-in 512 mau luc FILL xong / resume sau underrun
- index.html + addModule: cache-buster v=202608241200
- rebuild app.precompiled.js, copy bundle vao dist/ + src-tauri/resources/
- keo dai fix cac round truoc: FILL 16, FXRT_BURST_MS, REBUFFER, pacing,
  VST GUI click/focus, solo crackle
- them harness + plans/patch scripts
2026-08-24 07:46:09 +07:00

23 lines
936 B
Python

import io
p = r"C:/Users/locpham/SonicForgeStudio/native_bridge/src/NativeInstrumentEngine.cpp"
with io.open(p, "r", encoding="utf-8-sig", newline="") as f:
s = f.read()
old = """ const float kCeilingPeak = 0.7071f; // -3 dBFS
const float kAttack = 0.9f; // chặt: sample dau keo ve tran ~90% (tran 0.4 de lo qua -3 dBFS)
const float kRelease = 0.0006f;"""
new = """ const float kCeilingPeak = 0.7071f; // -3 dBFS
// Attack 0.9 (near-instant) caused zipper crackle: nhieu track sum ~2.0,
// target 0.35 -> gain 1.0->0.42 trong 1 sample = step -7.6 dB moi transient.
// 0.1 = ~10 samples (0.2ms @48k) ve tran: smooth, van giu ceiling -3 dBFS.
const float kAttack = 0.1f;
const float kRelease = 0.0006f;"""
assert s.count(old) == 1, "pattern not found: %d" % s.count(old)
s = s.replace(old, new)
with io.open(p, "w", encoding="utf-8-sig", newline="") as f:
f.write(s)
print("patched OK")