| From | Sent On | Attachments |
|---|---|---|
| robcanning | Jan 18, 2008 3:57 am | |
| Frank Barknecht | Jan 18, 2008 9:09 am | |
| robcanning | Jan 19, 2008 1:22 am | |
| IOhannes m zmoelnig | Jan 19, 2008 1:45 am | |
| Frank Barknecht | Jan 19, 2008 3:18 am | .pd, .lua |
| robcanning | Jan 19, 2008 5:20 am | |
| robcanning | Jan 19, 2008 5:24 am | |
| robcanning | Jan 22, 2008 5:52 am | |
| robcanning | Jan 22, 2008 8:32 am | .lua |
| robcanning | Jan 23, 2008 6:40 am | |
| Frank Barknecht | Jan 23, 2008 1:30 pm | .lua |
| robcanning | Jan 30, 2008 7:23 am | |
| Claude Heiland-Allen | Jan 30, 2008 7:53 am | |
| Frank Barknecht | Jan 30, 2008 8:30 am | |
| Frank Barknecht | Jan 30, 2008 10:03 am | |
| Frank Barknecht | Jan 30, 2008 12:43 pm | |
| Claude Heiland-Allen | Jan 30, 2008 1:40 pm | |
| Frank Barknecht | Jan 30, 2008 11:09 pm | |
| Claude Heiland-Allen | Jan 31, 2008 6:36 am | |
| Frank Barknecht | Jan 31, 2008 7:32 am |
| Subject: | Re: [PD] pdlua output | |
|---|---|---|
| From: | Claude Heiland-Allen (clau...@goto10.org) | |
| Date: | Jan 30, 2008 7:53:31 am | |
| List: | at.iem.pd-list | |
robcanning wrote:
now i want to be able to send the message [greaterthan score 3(
so in the code where it says "score=(%d+)")) - i need "score" to be variable from second part of the message the ">1" needs to be a variable from the 3rd part of the message
The Lua operator .. is string concatenation, so you can do:
"foo" .. "bar"
to get:
"foobar"
i know its somewhere within the () below but i cant seem to get it right function M:in_1_greaterthan()
thanks,
rob c
Something like:
-- called when "greaterthan" message is received at first inlet -- atoms is a table of the atoms in the message following the selector function M:in_1_greaterthan(atoms) local name = atoms[1] -- could be: "score" local value = atoms[2] -- could be: 3 if name ~= nil and value ~= nil then -- could check types too.. -- do your stuff here end end
If you have a range of possible selectors, and don't want to have to write a method for all of them, you can use:
function M:in_1(selector, atoms) ... end
Then selector will be "greaterthan" (or whatever) and atoms will be as above.
More specific methods are called before less specific methods, read pd.lua to see how that works (it's in the dispatcher function(s)).
Hope this helps,
Claude






.pd, .lua