Hi,
I'm trying to read text from textfiles in pd and display sentences with the text object in gem. However, I am having a few problems.
I'm reading sentences with textefile, which works well. I read lines in the textfile one by one, which I want to send as lists to the text3d object. What comes out of the textfile object is something like:
"list the dog is asleep"
which I need to convert to:
"text the dog is asleep"
How do I do that in pd?
Two corollary questions:
is there an escape character that can be used in the message object, or otherwise a way to store the "space" character in a text object as a list element?
is there a way to count the number of elements in a list?
Thanks!
Martin Dupras wrote:
Hi,
I'm trying to read text from textfiles in pd and display sentences with the text object in gem. However, I am having a few problems.
probably i should change the behaviour, so that lists would be interpreted as text too...
I'm reading sentences with textefile, which works well. I read lines in the textfile one by one, which I want to send as lists to the text3d object. What comes out of the textfile object is something like:
"list the dog is asleep"
which I need to convert to:
"text the dog is asleep"
How do I do that in pd?
Two corollary questions:
- is there an escape character that can be used in the message object,
or otherwise a way to store the "space" character in a text object as a list element?
no escaping (yet?) but you can use [l2s] from zexy. i hate to keep pointing at zexy, but (for obvious reasons) it has everything i need and what is missing in pd.
- is there a way to count the number of elements in a list?
[length] from (guess) zexy
mfg.as.dr IOhannes
IOhannes zmoelnig wrote:
Martin Dupras wrote:
Hi,
I'm trying to read text from textfiles in pd and display sentences with the text object in gem. However, I am having a few problems.
probably i should change the behaviour, so that lists would be interpreted as text too...
i just noticed, that someone has already done this (at least in the cvs) but my research wasn't for nothing: i have removed a constraint which denied the rendering of lists that started with a number. don't know why it was there.
mfg.asd.r IOhannes
Quoting Martin Dupras martin.dupras@uwe.ac.uk:
Hi,
I'm trying to read text from textfiles in pd and display sentences with the text object in gem. However, I am having a few problems.
I'm reading sentences with textefile, which works well. I read lines in the textfile one by one, which I want to send as lists to the text3d object. What comes out of the textfile object is something like:
"list the dog is asleep"
which I need to convert to:
"text the dog is asleep"
How do I do that in pd?
You can try the IEMlib prepend object and do a [prepend text]. There are Linux source and binaries on the iem site. Also, there is an OSX binary from Adam Lindsay (sorry I don't have the link handy), and there may be a Win32 binary floating out there somewhere... Now you have to remove the first 'list' part, which might be possible to do using the select object.
Hope this helps a bit.
cgc
Two corollary questions:
- is there an escape character that can be used in the message object,
or otherwise a way to store the "space" character in a text object as a list element?
- is there a way to count the number of elements in a list?
Thanks!
- martin