Define command and bpatchers
I've been using the definesubstitution
command extensively since I first discovered it, and I'm really happy to see the improved define
command, which makes passing args/attributes to stereotyped objects way easier!
Although... is there a chance that we'll get a proper way to use this in combination with bpatchers in the future? At the moment, it's (afaik) only possible to pass arguments, not attributes, to a bpatcher upon creation due to how @args
is parsed by the bpatcher. The only way to pass attributes to the contained object is by editing the @args
attribute in the inspector.
At the moment, we can do something like
max define mybp bpatcher @name somebpatcherobject @args 123 456
but the only way for a user to override the default arguments (123 and 456) here is to override the @args
attribute in its entirety (e.g. if you want to override the first argument:[mybp @args 999 456]
, instead of [mybp 999]
), and there's no way to pass attributes to the contained abstraction ([somebpatcherobject]
) at all.
It would be pretty nifty if we could use define
to wrap an abstraction in a bpatcher so that others could use it in the same way as they would use any native/external GUI object.
Also, so happy to see that bpatcher windows now are initialized to the size of the content rather than a fixed 128x128 window!!
Bump!
Any chance that we could get a better way to pass attributes (not arguments) to bpatchers on creation? As far as I know, the only way to do it right now is to:
Create the object, e.g.
[bpatcher mybpatcher]
Edit the Arguments attribute in the inspector window (e.g.
@myattr 123
)Close and reopen your entire project for the bpatcher args to reload
Just for recap, the reason why it's not possible at all right now to pass attributes on creation is that [bpatcher mybpatcher @args @myattr 123]
will treat @myattr 1
as an attribute of the bpatcher, not the contained object, while @args myattr 123
would be treated as two arguments: "myattr"
and 123
.