Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

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

notepat-remote: re-request focus on boot + always-log pushes

[active]'s initial fire can happen before jweb navigates to the live
URL, so the value is lost by the time the piece mounts. Adds an [i]
int-storage between [active] and the sprintf so \`requestFocus\` from
the piece can bang it to re-emit the current state post-boot. Also
routes the new requestFocus outlet on route-top.

window.acSetLiveFocus now logs \`[focus] max.active received N\` on
every call (not just transitions) so the Max Console shows whether
the Max → jweb push pipe is reaching the piece at all — previously
only transitions were logged, which hid the "pushed but no-op"
case that happens at boot when the state matches.

+28 -16
+21 -15
oven/bundler.mjs
··· 1080 1080 // jweb~'s URL to the live piece and skip chunk reassembly entirely. 1081 1081 // `requestTrackColor` is emitted by the piece post-boot to pull the 1082 1082 // current Live track color (observer's initial fire happens before 1083 - // the piece has mounted its handler). 1084 - { box: { id: "obj-route-top", maxclass: "newobj", numinlets: 1, numoutlets: 7, outlettype: ["","","","","","",""], patching_rect: [10,200,500,22], text: "route ready goonline requestTrackColor log error warn" } }, 1083 + // the piece has mounted its handler). `requestFocus` does the same 1084 + // for the [active] focus signal. 1085 + { box: { id: "obj-route-top", maxclass: "newobj", numinlets: 1, numoutlets: 8, outlettype: ["","","","","","","",""], patching_rect: [10,200,560,22], text: "route ready goonline requestTrackColor requestFocus log error warn" } }, 1085 1086 { box: { id: "obj-goonline-msg", maxclass: "message", numinlets: 2, numoutlets: 1, outlettype: [""], patching_rect: [10,160,560,22], text: "url " + liveUrl } }, 1086 1087 { box: { id: "obj-print-log", maxclass: "newobj", numinlets: 1, numoutlets: 0, patching_rect: [100,230,200,22], text: "print [AC-LOG]" } }, 1087 1088 { box: { id: "obj-print-error", maxclass: "newobj", numinlets: 1, numoutlets: 0, patching_rect: [200,230,200,22], text: "print [AC-ERROR]" } }, ··· 1098 1099 { box: { id: "obj-sprintf-track-color", maxclass: "newobj", numinlets: 1, numoutlets: 1, outlettype: [""], patching_rect: [10,660,480,22], text: "sprintf executejavascript window.acSetLiveTrackColor(%ld)" } }, 1099 1100 // ── Host-window focus detection ───────────────────────────────── 1100 1101 // [active] fires 1 when Live's window becomes the foreground window 1101 - // and 0 when it loses focus. The DOM-level blur/focus listeners 1102 - // inside jweb don't see Live's OS focus transitions, so we push the 1103 - // state in from Max via window.acSetLiveFocus(N). 1102 + // and 0 when it loses focus. Stashed in an [i] so requestFocus can 1103 + // bang it to re-emit the current state (the initial fire can 1104 + // happen before jweb navigates to the live URL, losing the push). 1104 1105 { box: { id: "obj-active", maxclass: "newobj", numinlets: 1, numoutlets: 1, outlettype: ["int"], patching_rect: [10,700,60,22], text: "active" } }, 1105 - { box: { id: "obj-sprintf-focus", maxclass: "newobj", numinlets: 1, numoutlets: 1, outlettype: [""], patching_rect: [10,730,440,22], text: "sprintf executejavascript window.acSetLiveFocus(%ld)" } }, 1106 + { box: { id: "obj-focus-i", maxclass: "newobj", numinlets: 2, numoutlets: 1, outlettype: ["int"], patching_rect: [10,725,40,22], text: "i" } }, 1107 + { box: { id: "obj-sprintf-focus", maxclass: "newobj", numinlets: 1, numoutlets: 1, outlettype: [""], patching_rect: [10,755,440,22], text: "sprintf executejavascript window.acSetLiveFocus(%ld)" } }, 1106 1108 // MIDI routing (downstream of the unmatched outlet). 1107 1109 { box: { id: "obj-route", maxclass: "newobj", numinlets: 1, numoutlets: 7, outlettype: ["","","","","","",""], patching_rect: [10,300,560,22], text: "route note channel notedown noteup octave focus ping" } }, 1108 1110 { box: { id: "obj-noteout", maxclass: "newobj", numinlets: 2, numoutlets: 0, patching_rect: [10,450,60,22], text: "noteout" } }, ··· 1117 1119 // the live piece and abandons the bootstrap (chunks never fire). 1118 1120 { patchline: { source: ["obj-route-top", 1], destination: ["obj-goonline-msg", 0] } }, 1119 1121 { patchline: { source: ["obj-goonline-msg", 0], destination: ["obj-jweb", 0] } }, 1120 - // `requestTrackColor` from piece: bang the observer so it re-emits 1121 - // the current value to jweb (the initial fire happens before the 1122 - // piece is mounted, so without this the color never lands). 1122 + // `requestTrackColor` / `requestFocus` from piece: bang the source 1123 + // so it re-emits the current value to jweb (the initial fire can 1124 + // happen before the piece is mounted, so without these the state 1125 + // never lands in the new document). 1123 1126 { patchline: { source: ["obj-route-top", 2], destination: ["obj-live-observe-color", 0] } }, 1124 - { patchline: { source: ["obj-route-top", 3], destination: ["obj-print-log", 0] } }, 1125 - { patchline: { source: ["obj-route-top", 4], destination: ["obj-print-error", 0] } }, 1126 - { patchline: { source: ["obj-route-top", 5], destination: ["obj-print-warn", 0] } }, 1127 + { patchline: { source: ["obj-route-top", 3], destination: ["obj-focus-i", 0] } }, 1128 + { patchline: { source: ["obj-route-top", 4], destination: ["obj-print-log", 0] } }, 1129 + { patchline: { source: ["obj-route-top", 5], destination: ["obj-print-error", 0] } }, 1130 + { patchline: { source: ["obj-route-top", 6], destination: ["obj-print-warn", 0] } }, 1127 1131 // Unmatched messages (notedown/noteup/octave/focus/ping) → MIDI router. 1128 - { patchline: { source: ["obj-route-top", 6], destination: ["obj-route", 0] } }, 1132 + { patchline: { source: ["obj-route-top", 7], destination: ["obj-route", 0] } }, 1129 1133 // Live track color chain: 1130 1134 { patchline: { source: ["obj-live-thisdevice", 0], destination: ["obj-live-path-parent", 0] } }, 1131 1135 { patchline: { source: ["obj-live-path-parent", 0], destination: ["obj-live-observe-color", 0] } }, 1132 1136 { patchline: { source: ["obj-live-observe-color", 0], destination: ["obj-route-track-color", 0] } }, 1133 1137 { patchline: { source: ["obj-route-track-color", 0], destination: ["obj-sprintf-track-color", 0] } }, 1134 1138 { patchline: { source: ["obj-sprintf-track-color", 0], destination: ["obj-jweb", 0] } }, 1135 - // Host-window focus chain: [active] → sprintf → jweb: 1136 - { patchline: { source: ["obj-active", 0], destination: ["obj-sprintf-focus", 0] } }, 1139 + // Host-window focus chain: [active] → [i] (storage) → sprintf → jweb. 1140 + // requestFocus bangs [i]'s left inlet to re-emit the stored value. 1141 + { patchline: { source: ["obj-active", 0], destination: ["obj-focus-i", 0] } }, 1142 + { patchline: { source: ["obj-focus-i", 0], destination: ["obj-sprintf-focus", 0] } }, 1137 1143 { patchline: { source: ["obj-sprintf-focus", 0], destination: ["obj-jweb", 0] } }, 1138 1144 { patchline: { source: ["obj-route", 0], destination: ["obj-noteout", 0] } }, 1139 1145 { patchline: { source: ["obj-route", 1], destination: ["obj-noteout", 1] } },
+7 -1
system/public/aesthetic.computer/disks/notepat-remote.mjs
··· 234 234 } catch {} 235 235 // Max side pushes focus + theme state via these globals. Defining 236 236 // them unconditionally lets the patcher call them whenever it likes. 237 - window.acSetLiveFocus = (f) => setFocus(!!f, "max.active"); 237 + window.acSetLiveFocus = (f) => { 238 + try { console.log(`[focus] max.active received ${f}`); } catch {} 239 + setFocus(!!f, "max.active"); 240 + }; 238 241 window.acSetLiveTrackColor = (colorInt) => { 239 242 const n = Number(colorInt) >>> 0; 240 243 if (!Number.isFinite(n)) return; ··· 244 247 // `live.observer` fires once on device load (before this boot 245 248 // runs), so without an explicit re-request we'd never see it. 246 249 try { window.max?.outlet?.("requestTrackColor", 1); } catch {} 250 + // Same story for the [active] focus signal — the initial fire 251 + // can happen before jweb navigates to the live URL. 252 + try { window.max?.outlet?.("requestFocus", 1); } catch {} 247 253 } 248 254 // Also open AC's session-scoped socket + udp purely so the transport 249 255 // status indicator can show UDP connectivity. Callbacks are no-ops —
system/public/m4l/notepat.com.amxd

This is a binary file and will not be displayed.