Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

notepat-remote: RTT probe (ping\u2192Max sprintf\u2192jweb acMaxPong) for real pipeline latency

+38 -4
+18 -4
ac-m4l/AC-NotepatRemote.amxd.json
··· 25 25 "presentation": 1, 26 26 "presentation_rect": [0, 0, 360, 169], 27 27 "rendermode": 1, 28 - "url": "https://aesthetic.computer/notepat-remote?daw=1&density=1&nogap&v=10" 28 + "url": "https://aesthetic.computer/notepat-remote?daw=1&density=1&nogap&v=11" 29 29 } 30 30 }, 31 31 { ··· 34 34 "id": "obj-route", 35 35 "maxclass": "newobj", 36 36 "numinlets": 1, 37 - "numoutlets": 6, 38 - "outlettype": ["", "", "", "", "", ""], 37 + "numoutlets": 7, 38 + "outlettype": ["", "", "", "", "", "", ""], 39 39 "patching_rect": [10, 250, 560, 22], 40 - "text": "route note channel notedown noteup octave focus" 40 + "text": "route note channel notedown noteup octave focus ping" 41 41 } 42 42 }, 43 43 { ··· 154 154 }, 155 155 { 156 156 "box": { 157 + "comment": "RTT: echo the ping back into jweb as a script call → window.acMaxPong(t0)", 158 + "id": "obj-sprintf-pong", 159 + "maxclass": "newobj", 160 + "numinlets": 1, 161 + "numoutlets": 1, 162 + "outlettype": [""], 163 + "patching_rect": [10, 290, 320, 22], 164 + "text": "sprintf script window.acMaxPong(%ld)" 165 + } 166 + }, 167 + { 168 + "box": { 157 169 "id": "obj-thisdevice", 158 170 "maxclass": "newobj", 159 171 "numinlets": 1, ··· 199 211 { "patchline": { "source": ["obj-route", 3], "destination": ["obj-print-keyup", 0] } }, 200 212 { "patchline": { "source": ["obj-route", 4], "destination": ["obj-print-octave", 0] } }, 201 213 { "patchline": { "source": ["obj-route", 5], "destination": ["obj-print-focus", 0] } }, 214 + { "patchline": { "source": ["obj-route", 6], "destination": ["obj-sprintf-pong", 0] } }, 215 + { "patchline": { "source": ["obj-sprintf-pong", 0], "destination": ["obj-jweb", 0] } }, 202 216 { "patchline": { "source": ["obj-pack-on", 0], "destination": ["obj-noteout", 0] } }, 203 217 { "patchline": { "source": ["obj-pack-off", 0], "destination": ["obj-noteout", 0] } }, 204 218 { "patchline": { "source": ["obj-thisdevice", 0], "destination": ["obj-routeready", 0] } },
+20
system/public/aesthetic.computer/bios.mjs
··· 4530 4530 let _dawBaseOctave = 4; 4531 4531 const _dawHeldPitch = {}; // keyLower → emitted pitch (for correct note-off across octave shifts) 4532 4532 4533 + // Round-trip latency probe. BIOS emits a "ping" with a monotonic 4534 + // timestamp alongside each notedown; the Max patcher echoes it back 4535 + // via `script window.acMaxPong(...)` and we log the delta. This captures 4536 + // the full iframe → Max → iframe hop — the real pipeline cost. 4537 + const _dawRttSamples = []; // rolling buffer of recent RTTs (ms) 4538 + window.acMaxPong = function (t0) { 4539 + if (typeof t0 !== "number" || !Number.isFinite(t0)) return; 4540 + const rtt = performance.now() - t0; 4541 + _dawRttSamples.push(rtt); 4542 + if (_dawRttSamples.length > 20) _dawRttSamples.shift(); 4543 + const avg = 4544 + _dawRttSamples.reduce((s, v) => s + v, 0) / _dawRttSamples.length; 4545 + console.log( 4546 + `🎹 rtt ${rtt.toFixed(2)}ms (avg of ${_dawRttSamples.length}: ${avg.toFixed(2)}ms)`, 4547 + ); 4548 + }; 4549 + 4533 4550 function _dawEmitMax(sym, value) { 4534 4551 if ( 4535 4552 typeof window !== "undefined" && ··· 4560 4577 if (pitch === null) return; 4561 4578 _dawHeldPitch[low] = pitch; 4562 4579 _dawEmitMax("notedown", pitch); 4580 + // RTT ping: use Math.round so the int fits %ld in Max's [sprintf] 4581 + // round-trip path. Delta is logged in window.acMaxPong above. 4582 + _dawEmitMax("ping", Math.round(performance.now())); 4563 4583 }, true); 4564 4584 4565 4585 window.addEventListener("keyup", (e) => {
system/public/m4l/notepat-remote.amxd

This is a binary file and will not be displayed.