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!
Note I think I have a good understanding of $1 etc, creation args, and $0, per-instance variable thingy, which are documented well... I don't think they'd do what I'm after.
Thanks in advance, Rua HM.
i think the object you are looking for is [route]
ie:
[route file bpm loop .....]
aha, yes, i had seen it but clearly did't 'get' it. Thanks :)
From: hard off hard.off@gmail.com To: Rua Haszard Morris ruahm@yahoo.com Cc: PD list pd-list@iem.at Sent: Sunday, 23 November, 2008 10:07:56 PM Subject: Re: [PD] how to send named commands/arguments to an abstraction?
i think the object you are looking for is [route]
ie:
[route file bpm loop .....]
Easy recipes for Christmas entertaining on Yahoo!Xtra Lifestyle- http://nz.lifestyle.yahoo.com/food-recipes
Also [sel].
Best,
Chris.
On Sun, Nov 23, 2008 at 02:36:35AM -0800, Rua Haszard Morris wrote:
aha, yes, i had seen it but clearly did't 'get' it. Thanks :)
From: hard off hard.off@gmail.com To: Rua Haszard Morris ruahm@yahoo.com Cc: PD list pd-list@iem.at Sent: Sunday, 23 November, 2008 10:07:56 PM Subject: Re: [PD] how to send named commands/arguments to an abstraction?
i think the object you are looking for is [route]
ie:
[route file bpm loop .....]
Easy recipes for Christmas entertaining on Yahoo!Xtra Lifestyle- http://nz.lifestyle.yahoo.com/food-recipes-------------------
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