PD symbols with funny characters

Johannes M Zmoelnig zmoelnig at iem.kug.ac.at
Mon Dec 4 19:24:44 CET 2000



On Sun, 3 Dec 2000, Andrew Archibald wrote:

> Hi,
Hi too

> Can I, in PD, construct symbols that have spaces in them?  For
> example, can I construct a message whose fields are "control",
> "Frequency (Hz)", and "7"?

it is possible (but almost impossible) to make symbols with spaces in
them.
If you make a message-list (create a message-box and type in "this is a
list") then spaces are dealt as separators between the list-items (so you
get "this"+"is"+"a"+"list".
the only way now (that i have found, and since the computer i'm sitting at
has no pd, so i can't verify what i'm talking about but) to generate
symbols with spaces in real-pd (without much workaround), would be by
using the "makefilename" object.
"makefilename" accepts C-strings as arguments and produces symbols out of
that C-string.
So "makefilename Frequency%c(Hz)" will enable you to put any character
between "Frequency" and "(Hz)", even if it were spaces. The ASCII-code for
SPC is 32, so you will have to send the integer "32" into the
makefilename...

thus, your patch would look something like that

 =---\
 |7  |
 =----
 |
 =--------
 | t b f |
 =-------=
 |       |
 |       |__________________________
 |                                 |
 =-------                          |
 | f 32 |                          |
 =-------                          |
 |                                 |
 =-------------------------------  |
 | makefilename Frequency%c(Hz) |  |
 =-------------------------------  |
 |                                 |
 |          -----------------------|
 |          |
 =----------=
 | pack s 0 |
 =-----------
 |
 =-----------------
 | control $1 $2 (
 =-----------------
 |
 |

> 
> Further details: plugin~ does a case-insensitive comparison, and it
> only compares as many letters as the minimum of the lengths, so I can
> specify "frequency" and it finds something; but I can't specify both
> "fequency ratio" and "frequency (hz)". 

See above....

mfg.sdaf.re
IOhannes




More information about the Pd-list mailing list