[PD] what do you use to format text (instead of sprintf)?

oliver oliver at klingt.org
Sun Sep 3 22:22:31 CEST 2017


Ali Momeni wrote:
> Hello all,
>
> What is everyone's favorite way to format text in simple ways, a la
> something like sprintf?
>

actually PD's message box can be manipulated in pretty powerful ways, 
more than MAX's message box can do. see the subpatch "pd 
changing-messages" in the message-help.pd file !


that combined with [makefilename] does pretty much everything i need for 
text formatting.



[makefilename] also has an undocumented padding method.

f.e.: sending the float number 13 to

|makefilename %05d|

will output the symbol "00013"




you can even create $0-messages with this little trick:

|list $ 0 somename(
|
|$1$2-$3-rrr(
|
|print TRYIT|
-------------- next part --------------
#N canvas 0 50 450 300 10;
#X floatatom 61 88 5 0 0 0 - - -, f 5;
#X symbolatom 61 138 10 0 0 0 - - -, f 10;
#X obj 61 111 makefilename %05d;
#X msg 203 80 list $ 0 sendname;
#X msg 203 110 \$1\$2-\$3-r;
#X obj 203 140 print BETTER THAN MAKEFILENAME;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;


More information about the Pd-list mailing list