[PD] message-creation and parsing questions

Alex alex at idoia.com
Wed Jun 11 01:28:53 CEST 2003


Hi,

> - how can I build up a message from parts?  for instance, the 
> [writesf~] object responds to an "open" message with a single 
> argument, like:
> "open /tmp/output1.wav"
Have you tried "open $1" where $1 can be a dynamic value ?
if receiving a list you can also try "open $n" where n is the n element 
of the list.
Does that answer some of your questions ?

Alex

On Tuesday, June 10, 2003, at 11:03  pm, David Merrill wrote:

> Hello pd-ers,
> I'm still getting the hang of pd, and I'm currently using it to build 
> the mechanism to run a perceptual experiment.  For each condition I 
> want to read in values from a text file, play a tone, and record the 
> result. The parts I'm having trouble with are:
>
> - how can I build up a message from parts?  for instance, the 
> [writesf~] object responds to an "open" message with a single 
> argument, like:
> "open /tmp/output1.wav"
> but I want to be able to iterate, and supply "output2.wav", 
> "output3.wav" etc..  I have looked at the docs for the [pack] object, 
> but I'm not sure that it can receive messages as input and pack them, 
> or output it's result as a message - is that correct?  am I thinking 
> about this in a wrong way?
>
> - how can I parse a line of text such as: "output1.wav 440 500 1500" 
> that I get from a [textfile] [bang] into its constituent parts 
> (preserving the appropriate types)?
>
> - (related to the above) is parsing a string different from parsing a 
> list?
>
> much appreciated!
> -David Merrill
>
>
> _______________________________________________
> PD-list mailing list
> PD-list at iem.kug.ac.at
> http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
>





More information about the Pd-list mailing list