Hi, I'm somewhat new to Pd.
I got myself in a list on a subpatch thru creating an object using list append 1 2.
The output data prints o.k.
But I need to get the data back out into a message. I understand about data structures and traversing using a pointer, but that leads back to the same problem of eventually getting the data into a message.
Brute force, I think what I'm after is something like a message with set $1 $2 $3 $4 $5 etc., etc. up to hundreds of data points, but I can't figure out how to elegantly step thru the data coming from a list append obj, to place it in a message.
I need to send the data as a message to a library object which requires the message for data input.
I was hoping someone could help send me in the right direction.
Thanks.
Hallo, James Hearon hat gesagt: // James Hearon wrote:
I'm somewhat new to Pd.
I got myself in a list on a subpatch thru creating an object using list append 1 2.
The output data prints o.k.
But I need to get the data back out into a message. I understand about data structures and traversing using a pointer, but that leads back to the same problem of eventually getting the data into a message.
Brute force, I think what I'm after is something like a message with set $1 $2 $3 $4 $5 etc., etc. up to hundreds of data points, but I can't figure out how to elegantly step thru the data coming from a list append obj, to place it in a message.
You don't need to serialize the list for this: a message box has a "set" method, as you know. You can construct a list starting with "set" by prepending "set" in front of any list using [list prepend set]. Now as (almost) all [list] objects generate proper list messages, whose first word, the selector, always is "list" unless the list-message starts with a number, you need to strip this "list"-selector first. For that, [list trim] was made. It will make something like "list set a b c d ..." into just "set a b c d ...". Put all this together and you get this:
"anything and more" | [list prepend set] | [list trim] | [anything and more(
Frank Barknecht _ ______footils.org_ __goto10.org__