It took me quiet a long time to figure out how to send message to instance of my abstraction individually in PD. I knew how to create a subpatch. Now I knew how to create abstraction. I knew that every time an instance of an abstraction is created, PD will give it a number started from 1000. The problem is I don't know how to get that number. I couldn't hard coded it because PD will randomly generated the number the first time the patch is run. So my only option is to name the instance and send message to the named-variable.
After a long time searching for discussion forum, example, and trial. I finally knew the trick: instead of using $0 for the receiver in the abstraction, use $1 and add the subpatch with name! This name is the $1 message of the abstraction. And $0 is the random index PD gave to the instance. With that, now I can add as many as instance of our sfxWav abstraction which load the external WAV sound effect and control it manually with the name-theVariableName.
No comments:
Post a Comment