Forums > MaxMSP

saving abstraction positions

Jul 01 2013 | 7:51 am

i’ve got an abstraction that i use multiple times in a patch. i’d like to open it in a semi-organized fashion. as opposed to patchers, i can’t easily save their positions on the screen.
i’m assuming i need to learn some sort of scripting method to send values to the abstraction – but i think i’m missing it in the tutorials and help files. any suggestions?

Jul 01 2013 | 8:40 am

[thispatcher] is probably what you need ; with messages like
(window size 100 100 650 500, window exec)

Jul 01 2013 | 11:18 am

abstractions will remember the position of the original file, whereas subpatchers remember where they were (size and position) when the parent patch was saved. So, yes, you need to use [thispatcher] just as vichug described: the main abstraction file has a [thispatcher] object inside, and you need to send it the various values you want for the window size and placement for each instance separately. Look to "arguments in abstractions/bpatchers" in the docs where you can use the value #1 to manage send/receive commands.

So if one abstraction has an argument of 1, you can have this in your main patch:

window size 100 100 650 500, window exec (this is a message box, and this is the size you want for abstraction 1)
[prepend 1]
[send messages_to_abstractions]

Inside the abstraction, which has an argument of 1:

[receive messages_to_abstractions]
[route #1]

note the #1, which will be replaced by the argument 1. The second abstraction has an argument of 2, etc. So from the main patch, you send the window size commands to each abstraction you want to control, and prepend it with the argument: 1, 2, 3, etc. Note also that nothing changes in the abstraction except the argument…which is the only thing that CAN actually be different between instances, at least initially. However, once you use [route #1] or other methods with the #1 (like loading a [preset] slot), you can change all kinds of things on a per-instance basis…very flexible and powerful. One easy example? Change the background color of each instance by using

[loadmess #1]
[sel 1 2 3 4 5]
(various background color commands)

Now, your 5 abstractions have 5 different background colors.

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > MaxMSP