diff --git a/.gitignore b/.gitignore index d48c397..fa7a23a 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ !**/*.hpp !**/*.c !**/*.h +!**/*.lua !**/roadmap.md !.gitignore diff --git a/handoff/NOTES_CAPTURE.md b/handoff/NOTES_CAPTURE.md index acec47e..02698af 100644 --- a/handoff/NOTES_CAPTURE.md +++ b/handoff/NOTES_CAPTURE.md @@ -94,3 +94,33 @@ 0x54087c = raw band/mix). Two unknown constants remain from the (lost) binary: 0x24c4348, 0x24c44a4. - => P1.5 "live capture" is a dead end; scalars must be derived statically or the two missing constants recovered from the original soothing_mem.bin (not currently present in workspace). + +## 2026-08-20b (P1.5 SOLVED: live ctx + level-tracker A[] captured via realtime playback) +The dead end above was wrong — the missing piece was REALTIME audio playback, not more scanning. +`-renderproject` uses the OFFLINE audio engine (fields live "only during audio", per earlier note); +the ctx object only materializes during a realtime transport play. + +### Method (works) +- play.lua (repo): `reaper.Main_OnCommand(1007)` (Transport:Play) + hold ~300s. +- rtctx_rt.py (repo): `reaper render_long.rpp play.lua` → find yabridge-host → chunked snapshot + (~796MB, 1056 regs) DURING playback → scan heap for the ctx. +- ctx marker that WORKS live: **+0x24 == 48000.0f (0x473b8000)**, NOT 40000.0f (40000 was the + static ctor rodata value; live it is the internal SR = 48000, confirming NOTES_CAPTURE SR=48000). + +### Result (captured live, saved handoff/rtctx_live.json) +- **ctx = 0x2370040** (region 0x2022000). Field pointers (all point at registry tables): + 0x540688=identity([00] 0x2962580), 0x540698=window([01] 0x14b4240), 0x5406a8=levels([02]), + 0x5406b8=WA([03]), 0x5406c8=WB([04]), 0x5406d8=WC([05]), 0x5406e8=WD([06]), + 0x540748=warp([12] 0x14bc280), 0x540768=LUT-knee([14]). (NOTE: offsets +0x40 from the + earlier static table — window is 0x540698 live, not 0x540658 as in the f_52b570 disasm label.) +- **Mask scalars (float)**: 0x540870=440.955 (sens), 0x540874=1.0, 0x540878=1.0, 0x54087c=1.0, + 0x540880=25.0, 0x540884=10.0, 0x540888=1.0 (attack=10^0), 0x54088c=1.0 (release=10^0), + 0x540890=0, 0x540894=1200.0. +- **level-tracker A[] (341 double each, per-bin IIR attack/release coeffs)**: + - 0x4c0528 (attack): 0 → 0.340, 0.348, ... monotonic rising, plateau 0.6921 @bin>=319. + - 0x3c0510 == 0x2c04f8 (release): 0 → 0.000753, 0.000885, ... slow small rise. + Full arrays in handoff/rtctx_live.json (keys A_4c0528, A_3c0510, A_2c04f8). +- BandConfig @ctx+0x188 is NOT populated here (zeros) — it lives at a different offset or only + during band processing; still TBD (but LUT curve params A/B/γ are RPP-derived per roadmap). +- Two more ctx-like bases found (0x2120040, 0x1780040) also have +0x24==48000; 0x2370040 is the + populated one (0x2120040 has 0x540658..698 = 1.0 fill pattern — likely a second/free instance). diff --git a/handoff/rtctx_live.json b/handoff/rtctx_live.json new file mode 100644 index 0000000..621263e --- /dev/null +++ b/handoff/rtctx_live.json @@ -0,0 +1,1093 @@ +{ + "ctx": "0x2370040", + "scalars": { + "0x40870": 440.9548645019531, + "0x40874": 1.0, + "0x40878": 1.0, + "0x4087c": 1.0, + "0x40880": 25.000001907348633, + "0x40884": 10.0, + "0x40888": 1.0, + "0x4088c": 1.0, + "0x40890": 0.0, + "0x40894": 1200.0001220703125, + "0x408ac": 9.183549615799121e-41 + }, + "ptrs": { + "0x40628": "0x2b64f80", + "0x40648": "0x2ac0b80", + "0x40658": "0x2ac8bc0", + "0x40668": "0x14a41c0", + "0x40678": "0x290a400", + "0x40688": "0x2962580", + "0x40698": "0x14b4240", + "0x406a8": "0x28e2240", + "0x406b8": "0x28ea280", + "0x406c8": "0x28f2300", + "0x406d8": "0x28fa340", + "0x406e8": "0x29023c0", + "0x406f8": "0x29ba700", + "0x40748": "0x14bc280", + "0x40768": "0x2bcd080", + "0x407c8": "0x295a540" + }, + "A_4c0528": [ + 0.0, + 0.3400513827800751, + 0.3483593761920929, + 0.35649341344833374, + 0.3644568920135498, + 0.3722531497478485, + 0.379885733127594, + 0.3873581886291504, + 0.39467430114746094, + 0.40183743834495544, + 0.4088513255119324, + 0.4157196283340454, + 0.4224458634853363, + 0.4290335178375244, + 0.4354860484600067, + 0.44180700182914734, + 0.4479995667934418, + 0.45406708121299744, + 0.46001288294792175, + 0.4658399820327759, + 0.47155144810676575, + 0.4771502912044525, + 0.48263949155807495, + 0.4880218803882599, + 0.49330011010169983, + 0.4984769821166992, + 0.5035551190376282, + 0.5085369944572449, + 0.5134251713752747, + 0.5182220339775085, + 0.5229297876358032, + 0.5275508165359497, + 0.5320873856544495, + 0.5365415811538696, + 0.540915310382843, + 0.5452108979225159, + 0.5494299530982971, + 0.5535746812820435, + 0.5576467514038086, + 0.5616479516029358, + 0.5655800700187683, + 0.5694447159767151, + 0.5732436180114746, + 0.5769782662391663, + 0.5806503295898438, + 0.5842611789703369, + 0.5878123044967651, + 0.5913050770759583, + 0.5947408676147461, + 0.5981211066246033, + 0.6014469861984253, + 0.6047197580337524, + 0.6079406142234802, + 0.6111108064651489, + 0.6142314076423645, + 0.6173036098480225, + 0.620328426361084, + 0.6233069896697998, + 0.6262402534484863, + 0.6291291117668152, + 0.6319747567176819, + 0.6347779631614685, + 0.6375397443771362, + 0.6402608752250671, + 0.6429423093795776, + 0.6455848813056946, + 0.6481894254684448, + 0.6507566571235657, + 0.653287410736084, + 0.6557823419570923, + 0.658242404460907, + 0.6606680750846863, + 0.663060188293457, + 0.6654193997383118, + 0.6677463054656982, + 0.6700416207313538, + 0.6723059415817261, + 0.6745399236679077, + 0.6767441034317017, + 0.6789190769195557, + 0.6810653805732727, + 0.6831836700439453, + 0.6852743625640869, + 0.6873380541801453, + 0.6893752217292786, + 0.6913864016532898, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627, + 0.6921339631080627 + ], + "A_3c0510": [ + 0.0, + 0.0007532930467277765, + 0.0008848102879710495, + 0.0010319935390725732, + 0.0011957522947341204, + 0.0013769635697826743, + 0.0015764719573780894, + 0.0017950870096683502, + 0.0020335691515356302, + 0.0022926407400518656, + 0.002572979312390089, + 0.002875214209780097, + 0.0031999291386455297, + 0.003547657048329711, + 0.003918880131095648, + 0.004314036574214697, + 0.004733515903353691, + 0.005177660845220089, + 0.005646767094731331, + 0.0061410837806761265, + 0.006660810671746731, + 0.007206114940345287, + 0.007777124643325806, + 0.00837391521781683, + 0.008996522054076195, + 0.009644965641200542, + 0.010319218970835209, + 0.011019209399819374, + 0.01174485869705677, + 0.012496041133999825, + 0.013272601179778576, + 0.01407436840236187, + 0.01490115001797676, + 0.015752725303173065, + 0.016628840938210487, + 0.01752924546599388, + 0.018453648313879967, + 0.01940176449716091, + 0.020373275503516197, + 0.021367868408560753, + 0.02238517813384533, + 0.023424861952662468, + 0.024486592039465904, + 0.025569943711161613, + 0.026674600318074226, + 0.027800126001238823, + 0.0289461687207222, + 0.030112311244010925, + 0.031298160552978516, + 0.03250330686569214, + 0.033727359026670456, + 0.03496988117694855, + 0.03623051196336746, + 0.03750880807638168, + 0.03880433365702629, + 0.040116727352142334, + 0.041445545852184296, + 0.04279042035341263, + 0.04415092244744301, + 0.045526620000600815, + 0.0469171479344368, + 0.04832209646701813, + 0.04974105581641197, + 0.05117366462945938, + 0.05261952430009842, + 0.05407821759581566, + 0.055549412965774536, + 0.05703270807862282, + 0.05852774903178215, + 0.060034122318029404, + 0.061551533639431, + 0.0630795806646347, + 0.06461790949106216, + 0.0661662295460701, + 0.06772409379482269, + 0.06929127126932144, + 0.0708673745393753, + 0.0724521055817604, + 0.07404513657093048, + 0.07564612478017807, + 0.0772547796368599, + 0.07887082546949387, + 0.08049395680427551, + 0.08212385326623917, + 0.08376021683216095, + 0.08540281653404236, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481 + ], + "A_2c04f8": [ + 0.0, + 0.0007532930467277765, + 0.0008848102879710495, + 0.0010319935390725732, + 0.0011957522947341204, + 0.0013769635697826743, + 0.0015764719573780894, + 0.0017950870096683502, + 0.0020335691515356302, + 0.0022926407400518656, + 0.002572979312390089, + 0.002875214209780097, + 0.0031999291386455297, + 0.003547657048329711, + 0.003918880131095648, + 0.004314036574214697, + 0.004733515903353691, + 0.005177660845220089, + 0.005646767094731331, + 0.0061410837806761265, + 0.006660810671746731, + 0.007206114940345287, + 0.007777124643325806, + 0.00837391521781683, + 0.008996522054076195, + 0.009644965641200542, + 0.010319218970835209, + 0.011019209399819374, + 0.01174485869705677, + 0.012496041133999825, + 0.013272601179778576, + 0.01407436840236187, + 0.01490115001797676, + 0.015752725303173065, + 0.016628840938210487, + 0.01752924546599388, + 0.018453648313879967, + 0.01940176449716091, + 0.020373275503516197, + 0.021367868408560753, + 0.02238517813384533, + 0.023424861952662468, + 0.024486592039465904, + 0.025569943711161613, + 0.026674600318074226, + 0.027800126001238823, + 0.0289461687207222, + 0.030112311244010925, + 0.031298160552978516, + 0.03250330686569214, + 0.033727359026670456, + 0.03496988117694855, + 0.03623051196336746, + 0.03750880807638168, + 0.03880433365702629, + 0.040116727352142334, + 0.041445545852184296, + 0.04279042035341263, + 0.04415092244744301, + 0.045526620000600815, + 0.0469171479344368, + 0.04832209646701813, + 0.04974105581641197, + 0.05117366462945938, + 0.05261952430009842, + 0.05407821759581566, + 0.055549412965774536, + 0.05703270807862282, + 0.05852774903178215, + 0.060034122318029404, + 0.061551533639431, + 0.0630795806646347, + 0.06461790949106216, + 0.0661662295460701, + 0.06772409379482269, + 0.06929127126932144, + 0.0708673745393753, + 0.0724521055817604, + 0.07404513657093048, + 0.07564612478017807, + 0.0772547796368599, + 0.07887082546949387, + 0.08049395680427551, + 0.08212385326623917, + 0.08376021683216095, + 0.08540281653404236, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481, + 0.08602031320333481 + ], + "state_0x28": [ + 0.007812500000000002, + 1e-323, + 0.0, + 1.390671161567e-309, + 1.55497715e-316, + 1.390671162052727e-309, + 5.263544247e-315, + 8.6916947597947e-311 + ], + "state_0x40": [ + 1.390671161567e-309, + 1.55497715e-316, + 1.390671162052727e-309, + 5.263544247e-315, + 8.6916947597947e-311, + 8.095e-320, + 5.432309224876e-312, + 2.11112274e-316 + ], + "state_0x58": [ + 5.263544247e-315, + 8.6916947597947e-311, + 8.095e-320, + 5.432309224876e-312, + 2.11112274e-316, + 0.0, + 0.0, + 0.0 + ] +} \ No newline at end of file diff --git a/play.lua b/play.lua new file mode 100644 index 0000000..74cf8d6 --- /dev/null +++ b/play.lua @@ -0,0 +1,10 @@ +-- play.lua : realtime transport playback to keep the DSP host's audio callback +-- alive, so an external script can snapshot memory while ctx fields are live. +local keep_secs = 300 + +reaper.Main_OnCommand(1007, 0) -- Transport: Play (realtime audio) +local t0 = reaper.time_precise() +while reaper.time_precise() - t0 < keep_secs do + reaper.Sleep(200) +end +reaper.OnStopButton() diff --git a/rtctx_rt.py b/rtctx_rt.py new file mode 100644 index 0000000..0f38062 --- /dev/null +++ b/rtctx_rt.py @@ -0,0 +1,193 @@ +#!/usr/bin/env python3 +"""rtctx_rt.py — P1.5: find live ctx via REAPER realtime transport playback. + +Launches REAPER with render_long.rpp + play.lua (realtime audio playback, host +audio callback alive), then snapshots the yabridge-host memory during playback +and searches for the DSP ctx by FUN_180535ae0 constructor markers. + +Usage: rtctx_rt.py +""" +import subprocess, os, glob, time, struct, sys, json + +SNAP = '/tmp/snap_rt.bin' + + +def mem_open(pid): + return os.open(f'/proc/{pid}/mem', os.O_RDONLY) + + +def find_host(): + for p in glob.glob('/proc/[0-9]*'): + pid = int(os.path.basename(p)) + try: + cmd = open(f'/proc/{pid}/cmdline', 'rb').read().replace(b'\0', b' ').decode('utf8', 'replace') + maps = open(f'/proc/{pid}/maps').read() + except Exception: + continue + if 'soothe2' in maps and 'reaper' not in cmd: + return pid + return None + + +def snapshot(host): + fd = mem_open(host) + out = open(SNAP, 'wb') + nreg = 0; nbytes = 0; t0 = time.time() + for line in open(f'/proc/{host}/maps').read().splitlines(): + p = line.split() + if len(p) < 2: continue + lo, hi = (int(x, 16) for x in p[0].split('-')) + if 'r' not in p[1]: continue + a = lo + while a < hi: + n = min(hi - a, 8 * 1024 * 1024) + try: + d = os.pread(fd, n, a) + except Exception: + a += n; continue + if not d: + a += n; continue + out.write(struct.pack(' len(body): good = False; break + c = struct.unpack_from(' 0x40: + dedup.append(h) + return dedup + + +def dump_targets(regs, ctx): + out = {} + def f32(addr): + b = readabs(regs, addr, 4) + return struct.unpack('= 8 * n else None + out['scalars'] = { + '0x24': f32(ctx + 0x24), + '0x540870': f32(ctx + 0x540870), + '0x540874': f32(ctx + 0x540874), + '0x54087c': f32(ctx + 0x54087c), + '0x540888': f32(ctx + 0x540888), + '0x54088c': f32(ctx + 0x54088c), + } + out['bandconfig0'] = { + 'A': f32(ctx + 0x188), + 'B': f32(ctx + 0x188 + 0x04), + 'gamma': f32(ctx + 0x188 + 0x0c), + 'flag': readabs(regs, ctx + 0x188 + 0x10, 1), + } + for name, off, cnt in [('0x4c0528', 0x4c0528, 32), + ('0x3c0510', 0x3c0510, 32), + ('0x2c04f8', 0x2c04f8, 32)]: + a = f64arr(ctx + off, cnt) + if a is not None: + out[name] = a + return out + + +def main(): + os.system("pkill -9 -x reaper 2>/dev/null; pkill -9 -f '[y]abridge' 2>/dev/null; sleep 1") + proc = subprocess.Popen( + ['/usr/bin/reaper', '-nosplash', '-ignoreerrors', + '/home/m/soothe-bt/render_long.rpp', '/home/m/re-tools/play.lua'], + stdout=open('/dev/null', 'w'), stderr=subprocess.STDOUT) + t0 = time.time(); host = None + while time.time() - t0 < 60 and not host: + host = find_host(); time.sleep(0.2) + if not host: + print('NO HOST'); return 1 + print('host', host, 'at %.1fs' % (time.time() - t0)) + time.sleep(8) + for attempt in range(3): + nreg, nbytes = snapshot(host) + print('snapshot #%d: %d regs %.1f MB' % (attempt, nreg, nbytes / 1e6)) + if nbytes > 50e6: + break + time.sleep(3) + if proc.poll() is None: + proc.kill() + regs = parse_snap() + hits = find_registry(regs) + rb = None + for h in hits: + b = readabs(regs, h, 8) + if b and struct.unpack('