I was just talking to a friend who uses MAX, and he mentioned a function that I am wondering if is in PD. basically, I want to be able to initiate variables inside a patch by writing them after the patch name(like you do with a lot of allready existing PD objects). So, if I had a patch I made called [fornicate], and there were 3 variables inside it, I could just write [fornicate 2 5 3] when creating it and hencely get them set like that. I guess I can just use inlets and $1's and such, but it would indeed be more elegant if i did not need to do this. Anyone know if this can be done, and how?
-
Assigning variables to (selfmade) objects (behind the object name)
-
Yeah, use $1 etc, inside of object boxes, like so:
[inlet]
|
[+ $1]
|
[outlet]and save it addtest.pd (I'm in ur path!). then, initiate the patch [addtest 6].
wee!
any technology distinguishable from magic
is insufficiently advanced. -
Just to clarify what Sunji is saying (because the [inlets] and [outlets] in the ASCII art could be interpreted as what you're already doing), the arguments in your abstraction will automatically fill in those $1's, $2's, etc. So if you have [fornicate 2 5 3], [+ $1] will become [+ 2], [f $2] will become [f 5], and [r $3-MIDInote] will become [r 3-MIDInote].
By the way, Sunji, I think you should end all of you posts with and emphatic "wee!"
-
done.
any technology distinguishable from magic
is insufficiently advanced.