#!/usr/bin/env python3 # SFZ: load ch=1, note_on, poll peak for 3s — see if any audio comes out. import ctypes, os, struct, subprocess, sys, time BRIDGE = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "build", "Release", "daw_vst_bridge.exe")) SFZ = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "sfizz-src", "tests", "TestFiles", "g2_test.sfz")) SHM_NAME = "SonicForge_DAW_IPC" SIZE = 11160 ML, MR = 8, 1032 MIDI_Q, MIDI_Q_COUNT = 2064, 2832 CTRL_Q, CTRL_Q_COUNT = 2836, 11156 kern = ctypes.windll.kernel32 PAGE_READWRITE, FILE_MAP_ALL_ACCESS = 0x04, 0xF001F kern.CreateFileMappingW.restype = ctypes.c_void_p kern.CreateFileMappingW.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_wchar_p] kern.MapViewOfFile.restype = ctypes.c_void_p kern.MapViewOfFile.argtypes = [ctypes.c_void_p, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_uint32, ctypes.c_size_t] kern.UnmapViewOfFile.restype = ctypes.c_int kern.UnmapViewOfFile.argtypes = [ctypes.c_void_p] kern.CloseHandle.restype = ctypes.c_int kern.CloseHandle.argtypes = [ctypes.c_void_p] h = kern.CreateFileMappingW(None, None, PAGE_READWRITE, 0, SIZE, SHM_NAME) if not h: sys.exit("CreateFileMappingW failed") v = kern.MapViewOfFile(h, FILE_MAP_ALL_ACCESS, 0, 0, 0) if not v: sys.exit("MapViewOfFile failed") buf = (ctypes.c_ubyte * SIZE).from_address(v) def w32(o, x): struct.pack_into("