diff --git a/fxrt_ws_probe.py b/fxrt_ws_probe.py index a309b13..afe1fb5 100644 --- a/fxrt_ws_probe.py +++ b/fxrt_ws_probe.py @@ -254,6 +254,22 @@ async def run_ws_probe(port, chain, secs, stall): stall_state = {"until": 0.0} + async def param_burst(): + # Mô phỏng fxRtPushAllParams (app gửi loạt set_param ngay sau WS open): + # numeric ParamID 0..3 → VST3 setParamNormalized THẬT trên bridge. + # Fix: setParam defer worker → audio loop không block → send interval ổn. + if not os.environ.get("FXRT_PROBE_PARAMS"): + return + await asyncio.sleep(0.8) + nslots = len(chain) + ids = [s.strip() for s in os.environ.get("FXRT_PROBE_PARAM_IDS", "0,1,2,3").split(",")] + for rep in range(4): + for slot in range(nslots): + for i, pid in enumerate(ids): + await ws.send(json.dumps({"cmd": "set_param", "slot": slot, + "key": pid, "value": 0.3 + 0.1 * i})) + await asyncio.sleep(0.4) + async def consumer(): while not stop.is_set(): if os.environ.get("FXRT_PROBE_CONSUMER_STALL") and \ @@ -280,7 +296,8 @@ async def run_ws_probe(port, chain, secs, stall): async with websockets.connect(ws_url) as ws: t0 = time.perf_counter() tasks = [asyncio.create_task(producer()), asyncio.create_task(pump()), - asyncio.create_task(stall_scheduler()), asyncio.create_task(consumer())] + asyncio.create_task(stall_scheduler()), asyncio.create_task(param_burst()), + asyncio.create_task(consumer())] if os.environ.get("FXRT_PROBE_NO_CONSUMER"): for t in tasks: t.cancel()