Serialosc.maxpat focus and blur

I’m trying to wrap my head around how to do autofocus in Max without prefixes.

If I have 2 instances of serialosc.maxpat (1 in patch A, another in patch B), selecting my grid in sosc A, and then selecting the same grid in sosc B deselects the grid in sosc A and mutes its first output. That’s great, cause now patch A is no longer receiving any commands from my grid. I can also use the 1 generated by the 2nd outlet when I get focus to turn on drawing for patch B.

However, sosc A’s input 1 is still receiving osc at this point, which is still drawing to my grid. The docs in the serialosc dev tools patch suggest I should be gating those messages when sosc A loses focus, but it’s not clear to me how I detect that event. Should I be creating some kind of larger communication between my patches that sends out the currently active port? Am I missing something about how serialosc.maxpat is supposed to work?

I’m barely literate in Max, but looking at the Terms devices, it seemed like they were doing their thing by changing the sys prefix. That’s not the suggested architecture moving forward right? In practical terms, I’m just trying to make small Max 4 Live devices that play nice with everybody else when it comes to autofocus without having to prefix each one differently. Thanks!

the 2nd outlet outputs focus state (0/1). i think this is what devtools is suggesting

That works if I’m manually selecting “none” from serialosc.maxpat, but if the grid is unselected by selecting it on another instance of serialosc.maxpat, the 2nd outlet of the first instance of serialosc.maxpat does not send out a 0. See below:


----------begin_max5_patcher----------
504.3oc4UEraaCCC8r8WggN6UXqj3LrS6+XXXPVl0VsJRARxtInn+6ShxN0Y
oovsHnW1gHAQRK9dORw7bZBoVe.rjrej8qrjjmSSRPSACIimSH6XG3RlECiT
um43cfgjGcNHfmFDVQsPJbGCgTN5Qe+8VvEu6h6JxCKY+dzoTyeDZZLrVK2n
kxPXEi93RA+QWmQ221M2NnX0Rn6xOH5X3RG0s6zMvYVzlFO3mYA4iP09GCvG
QKsnJfWJcKtUPwspYvW0uS26jfCEk0iVEMnDoqe3aamzGEaGB.hELBlTa424
0SeRmBHdOti6gXxIj7LhP4Ba3u4IUnlxIMX6kzzvR9BqcJ3IO1lRrCNf7kzx
b.4cTipUA9WtBEkUqiRyUEixKEipqy0SWh0cTFEJxsht08NmVs.lsMxoSqKm
YatJypYp1EytxaWwbG3LZeOaQ1OYbmX.xJeGEXMcSfzUXosjV9wqszaiB7op
u++LJpZ8mdRT4W4jHLBhTn92+TAoVv940Sqt2vmR2HZyJOkmFv5DJlS3eF+Z
L9wIYuJ.chlFPMWFaD1PQ.kfh2ruZon47L81nYyWFZnK.MUmoeKGMwBGa+9A
vXGuRDH9mbOnwtzs43QgJdjhGMP3EWLdr4ivL9dXmuAt2Da2N7837eR3AfQ0
KFm34y7Ko+0rFx+i
-----------end_max5_patcher-----------

Still struggling with this, does anybody have Max performance patches they wouldn’t mind sharing? Would love to see how you’ve handled switching between various Monome apps. Think I’m missing something fundamental here.

This all started off with me trying to use the v2 of Meadowphysics in M4L with autofocus. I don’t really want to mess with the internals of the Meadowphysics patch too much, so I was hoping to pull off autofocus without modifying the prefix from ‘monome’ to something else. For the life of me, I can’t figure out how to do this without writing something that’s communicating between devices, which feels like I’m making life hard for myself and missing something stupid.

1 Like

I tested the code above and see your problem. it appears to be a bug with the current version serialosc.maxpat. I use the older one in all my M4L patches and I’ve never experienced this issue. try this-


----------begin_max5_patcher----------
526.3oc6U0zaiBCD8L7q.4yzJLjPp1S6+ippUFXJ3Vicjsglnp9eesGS9ZSx
JRUzdZODa4YF77duY7jOiiHUpMfgj7ijmShh9LNJBM4MDMcNhzy1TKXFLLR0
ZlstCzjzfyQlVx5AzmAzblPYpePIZdl9x9X3vGibCuhK31s9PoSdTu9pArg7
m8XVpeI4kImBU86PSil0Zp0JgvGV1juZAu9camVMz1crcPxpDP24ePvw34Np
Z6UMvIVT5FGAOxhZvJ.qc6ZH.UBIMgvkV+F9aOlQ0gKa+kFpm3Es.YVd9R+V
As.O8zQDUNzyktDfJb9jQdCpopp2dX0Ng7xJ8itBjKujC2V.u30sva7q3X+R
5LqwR3CWZ2ceVXCxDRKyB6LZraEAnPtpF82Dk7RTFnEknnrHnP2flTdY5R+F
zsZvZUxafYULY6rX2p.u1udY1QOmcKuer6JEydvpUI4YYI+jUa4iPB8tp.qd
BUfrbbKmdyE376XAdtyr9+.KbfUINoJzCOMupfdCkN5cZdElPhfK+y+hBAs2
9oEciZPWuiwS.IgtG1MfwxkLK28X+PLtAIIGnVGuoAjGKkMbiuPfrK6hMeyE
M4mjoqiF5+DzTNCzr7apMgBGa85QPaltRDHt2kuovN0Uo3QtLbD6hHZv+pKD
eAZgoccmVWq4fNzIsobAI7otGAZ4.eZnfKyeE+a.3VxD1A
-----------end_max5_patcher-----------

Wow, thank you, that is immensely helpful.