Hallo, Rua Haszard Morris hat gesagt: // Rua Haszard Morris wrote:
I am having fun making an abstraction. I want it to be able to respond to "messages"/commands in a similar way to externals. For example, imagine an abstraction that has 1 inlet, and if it gets (from the parent patch) "file filename.mid" then it reads that file, or if it gets "bpm 120" it sets the bpm to 120, or if it gets "loop 0" it turns off looping, or if it gets "bang" or "play" it starts playing. What object(s) do I use to set up something like this?
How do I set this up? I've mucked around with pack/unpack but it seems i'm totally barking up the wrong tree. I'm sure if I had a look at a simple example abstraction I'd figure it out but I'm still at the flailing about blindly stage!
You generally use [route] for that, but maybe you also like the [dispatcher] abstraction, which automates some things when dealing with inlet-methods: http://lists.puredata.info/pipermail/pd-list/2007-03/048303.html
Frank