[PD] message-creation and parsing questions

Matthew Allen matthew at lith.com
Wed Jun 11 01:23:16 CEST 2003


 - For the first part you will want to look at the object [makefilename] to
build the variable name. To create the the list "open [filename]" you would
want to run the output of [makefilename] to a msg box using the command "set
print $1" this will output the list "open [filename]":

#N canvas 0 0 680 460 10;
#X obj 218 141 makefilename /tmp/output%d.wav;
#X floatatom 218 122 5 0 0 0 - - -;
#X msg 218 164 set open \$1;
#X msg 218 188 print /tmp/output13.wav;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 2 0 3 0;

- to seperate your list (if you know ahead of time what the sequence is
going to be) use [unpack]. If you dont know it becomes much more difficult

- there is no native 'parsing' of symbols in pd. I believe someone wrote a
regex module for the py/pyext external, but I haven't used it yet.

m.



-----Original Message-----
From: David Merrill
To: pd-list at iem.kug.ac.at
Sent: 6/10/2003 3:03 PM
Subject: [PD] message-creation and parsing questions


- 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..  

- 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?




More information about the Pd-list mailing list