UI Swapper (solved brilliantly by pid)

Learn about building and using Max for Live devices.
Post Reply
kgmonarch
Posts: 75
Joined: Thu Aug 07, 2003 4:24 pm
Location: under a mountain of unwashed coffee cups
Contact:

UI Swapper (solved brilliantly by pid)

Post by kgmonarch » Wed Jun 15, 2011 4:40 am

I've always been fighting with ways to make the best use of whatever little space I can get out of the effects bar at the bottom of the screen. So I made a cyclic UI swapper thingy that lets you turn on and off the presentation flag (dynamically) for 3 objects.

This example uses multisliders.

It's probably not the cleanest code in the world, so if you manage to make it better, post it here. Let's help each other out.

Code: Select all

----------begin_max5_patcher----------
1340.3oc6ZszbihCD9rmpl+CTbNSJPhWdus6s87V6oTobI.ErlAKQAxNI6T6
+8UHAXjMxF+X8iL4PvJ5QyW+0cqWz+7qeYhcL6Mbks0uY8j0jI+TTyDYc00L
oshI1KPukjipjczlhekE+c6GZZiieiKquv5u+y+5UTQAtrqQ5xEDZNlKGoau
ZYK4sUCaq9EFkWQ9GrrufGcZqu.wSlSnYyJwIbEVcANh1sBq6kUjrbcMVO2N
Fk74uWfUCv19gl+V2m52GEsP1C6eujfx6vMIUVoPO+FbpsFPDZmhbZYGgfH4
3U3xJBi1WOmXuFvRHBipe5BT.dZPeDKn8rbVxOvx2rSWso3WNHovJvzMFf1i
M5JgVThqvTNh2fdsWMZYNelA6hdGdAkfMO7go4I1YkjTFsFH5ist91W4SVRE
NRC6xNPQECMXNikGiJWQpHw4XcKhv2FQIKPbLmnfDvY8HIKJJITtt3vTjPLy
qRJY445RS0zpgZJEuhjfekjxmKEWOZSKlquijVrmdC6LFTONLmgRiQzLsVGL
PbffQslLY3MDT54DHCJkOC1Nnb3.SIT06yN7X1L3zytqg+8qeosrn3CGM2t.
WUgxvCSt8iVDjkU++WREVPGmGElaKfm3gHJ8Qy1AvwXGb1qcHzAn3dO4OdR6
gavdsD60JX8Gr7TilB3mlhsWmxO5ZXJ.eZJ1d1InyUvT3F5bMsENmYZd+KBD
Dp1dhZ2IQgp+4zYYSDL.9qE+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
-----------end_max5_patcher-----------
Last edited by kgmonarch on Wed Jun 15, 2011 6:14 pm, edited 1 time in total.

pid
Posts: 354
Joined: Thu Nov 05, 2009 9:51 am

Re: UI Swapper

Post by pid » Wed Jun 15, 2011 10:13 am

avoid calling presentation mode and box positions dynamically - not a good idea.

<pre><code>
----------begin_max5_patcher----------
2731.3oc6cs0aiiaE94jeEDdQw1V3IfWzM29T6a8kBTTzmFLMP1hwQcjkLjT
xLYWr+2KuHYSFqKzxlNz6XLXTL0Epy4imCo347Qoe896lsr36zpYf+B3yf6t
6Wu+t6D6hui6ZJe2rMweeUVbk3zls4kr5zprzDZ4r4xi+ZbYd7F59CWRSZO1
p37jT1FJVdSfO.my1DNW9KzCPvWZN0pzeQTGnflcrMtd0yo4qerjtpVd4DLl
eYj.O9evdxJAGoTMKKJYx1ikoqeVbQv1ZqjVQyqiqSKxE2ll8m+xlz7LZck5
NqRWmyTBk8T+b5pulSqzOMZM6hY3iT59DBKkGEwgU8EuT2V+XEX4MNrv2oWa
sIP0UEYEkZfUfu.nzQqc.qm145GzAxtpHuNItNVUzafo5hspfjTTqeaKUVqy
lMm8+cUTp.RlUr7+8IzL8JZYQccwF05hANU0ukQUuqpMBJMqdQBYFGDzay5N
8kniMdcnuKWqAhjEXjuvhCEh88Vn9KMCv8ZNTW4xnOIsk3682t+d9l4mQGlk
YuPsqGClCl27X9H8X7td7XvdDDQXwgiBvg97e4gI9XGxiId0WsqKyB7MOlOV
OFxUjGieTDVbdG9K66wjS+FCuZQqZ52E0zrsf+y+3e+s3saok6fxNr2ChDlT
ABcLJT.OPEY9IVS6N+F9oNfQstoHp2l7tZtilobC24t+2JSiylMbaaPDZuFz
tY2sPnxzxF7qA.Y2kzL5qzxJce06loXxDJAFoiwBweHgA6qZtYPVwpuJcigs
6Lg9zQUIEao46u.MkPSSjmYZ966lQ8FGy5c7wtawzO9Swqn8dwch92MacYZR
QNWHztR9tauceFHdPiHUoVb773scbo0EEYKiKeMsh0kNUqcfYxGmmt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H0dFJ0DhyI1ljJZB9pTrwjqRiDr6g1Fk9XzUoXKBBiCI2FSmB2x3
lXJd6X8kXrbiuRwaGq2DhouAaIQtkbis7a2UaI21cc8aKNXckZkfM1Jwwvaz
0o0cWCdeA.7aDj57+oBSd3Oi+hk9bgII5ysOIke7etvNqeSJIvgeQK866uHk
MNMH65zLgOwd27MlluAbR9FWseQ7NBabhcswmxWd0aF4SxHOJ5haj+g9gRcT
5giV3NrCGOF6vk4sF8dYcB3RaVQdOws+uf5mofkrGiG7s32lCpJ1PAIEf7hZ
PV5WofzZvejcJuAhKofuUVju9O0VIRFl+hLWK39g7vlWoOdR2NIcT4o76Lv7
aXGuV9Cl7GMyPjL+TgHcRTeVA7XFbWyyx9d.uEo4sCCX6Rjulx7kuaOPKNmu
w75BH8mLPRjFsMRpk.RtM55hhDPcAXUbVF3mUklMEIzeFv5GCvpev1hpT9dq
.z5Ufj2XZSJ+Zd6AP7qEoIOzoQMYfkYhVSQyKNtHq0T3MPSgBnJt65I1Thwu
ex9MH8vKfZiVM3GN09tmV+AM6lJRKLPjhtnRTfARj+EUhzV2tlD0QqKQ7EWy
nhTTzkWlviHSDzkWlFyXhbY83vlHRKNAQhU32t++Clmm8UC
-----------end_max5_patcher-----------
</code></pre>
3dot... wrote: in short.. we live in disappointing times..

kgmonarch
Posts: 75
Joined: Thu Aug 07, 2003 4:24 pm
Location: under a mountain of unwashed coffee cups
Contact:

Re: UI Swapper

Post by kgmonarch » Wed Jun 15, 2011 6:02 pm

pid wrote:avoid calling presentation mode and box positions dynamically - not a good idea.
Yeah! The problem with my method is that the box positions have to be hardcoded which introduces chances for failure.

But this other method is much simpler! I never considered shifting the offset in a bpatcher. Very nice. :D

But now I'm curious -- I've been making bpatchers by creating new patches and then saving them, and then loading them into the bpatcher, and turning on the embed flag.

Is there a shortcut to make a bpatcher without having to create/save a new patch first?

pid
Posts: 354
Joined: Thu Nov 05, 2009 9:51 am

Re: UI Swapper (solved brilliantly by pid)

Post by pid » Wed Jun 15, 2011 6:38 pm

i must admit, i never use embed. i always create patches and use them as abstractions in bpatcher.

however, to do it more simply and treat the bpatcher as a subpatch, all you have to do is make a new bpatcher, go straight to the inspector and tick "Embed Patcher in Parent". then, when you right-click the actual bpatcher you can choose 'object' > new view of..., and it just opens up its empty subpatch.

the inspector is really the key to everything. i often have it permanently open to the side so it fills with each object i click, much like the old days of reaktor used to allow one to do.

by the way, it is hard to understate how useful helpfiles and reference files are. the max documentation method is one of the many reasons it is the best damn software on the planet. the bpatcher trick is something that has been sitting in the bpatcher helpfile since about 1998 / 1999 as far as i can recall. at least since max4 / 2002 anyway. everyone should read these things! but i am just mentioning as an aside. i apreciate your enthusiasm for the patch i sent very much, but nothing i have ever done in max can be considered remotely original!!! i am a copyer/hacker.
3dot... wrote: in short.. we live in disappointing times..

kgmonarch
Posts: 75
Joined: Thu Aug 07, 2003 4:24 pm
Location: under a mountain of unwashed coffee cups
Contact:

Re: UI Swapper (solved brilliantly by pid)

Post by kgmonarch » Wed Jun 15, 2011 7:45 pm

pid wrote:however, to do it more simply and treat the bpatcher as a subpatch, all you have to do is make a new bpatcher, go straight to the inspector and tick "Embed Patcher in Parent". then, when you right-click the actual bpatcher you can choose 'object' > new view of..., and it just opens up its empty subpatch.
AH! This was the key I was looking for!
pid wrote:the inspector is really the key to everything. i often have it permanently open to the side so it fills with each object i click, much like the old days of reaktor used to allow one to do.
Yes, I've got it on a secondary monitor for just that purpose too! That, and the Clue Window. My problem is I didn't know that simply checking the box for the embed meant that you didn't have to create and save a patcher.
pid wrote:by the way, it is hard to understate how useful helpfiles and reference files are. the max documentation method is one of the many reasons it is the best damn software on the planet. the bpatcher trick is something that has been sitting in the bpatcher helpfile since about 1998 / 1999 as far as i can recall. at least since max4 / 2002 anyway. everyone should read these things! but i am just mentioning as an aside.
Oh man, I am going through the docs as fast as I can, and as often as possible, I have only just started using Max a couple of weeks ago. But I really really appreciate the help from someone who's got years of experience.
pid wrote:i apreciate your enthusiasm for the patch i sent very much, but nothing i have ever done in max can be considered remotely original!!! i am a copyer/hacker.
Same with me! :D

kgmonarch
Posts: 75
Joined: Thu Aug 07, 2003 4:24 pm
Location: under a mountain of unwashed coffee cups
Contact:

Re: UI Swapper (solved brilliantly by pid)

Post by kgmonarch » Wed Jun 15, 2011 8:16 pm

Noticed a tiny 'gotcha/bug' with the bpatcher.

When you create a new bpatcher and set the "open in presentation" flag, it may not seem to take effect until you save, close and reopen the patch.

Post Reply