[PD] soundfiler

Frank Barknecht fbar at footils.org
Mon Dec 25 15:47:58 CET 2006


Hallo,
europa989 at aol.com hat gesagt: // europa989 at aol.com wrote:

> Hi, like sent a message to soundfiler: [read -resize C:\Documents
> and Settings\myname\folder\folder\filename.aif tablename]. I forgot
> which way slashes go after C: and stuff. This is on PC, windows. K.
> then there's a table object. I think that's what they're called,
> like where there is a table in the subpatch of the object. I think i
> called the table [table tablename 2040]. There's an error that I
> believe "Documents and Settings" causes. Windows produces a "don't
> change this foldername" alert if you try to change it to
> "Documents_and_Settings". With a different soundfiler object and
> messages to open up browsers to get the "filename.aif", the
> "filename.aif" successfully loads to the "tablename" table. A
> solution without opening browser window is preferable. Over and out

The most simple solution is to move the soundfiles to a directory
without spaces in its path name.

If this isn't possible, you need to get the space back into the list
message that is coming from the message box which stores your
space-polluted filename. Attached patch shows one possible way to
achieve this using the [list-l2s] abstraction from the [list]-abs
collection (also attached). The trick is to use [makefilename %c] to
generate symbols from their ASCII values. Sending a "32" into this
will let [makefilename] send a symbol-message whose data is the "
"-SPACE symbol.

[list-l2s] then concatenates every element in an incoming list using
this SPACE-symbol into a single symbol. So the three-element message: 

 1.           2.  3.
"C:/Documents and Settings/myname/folder/folder/filename.aif" 

will become a one-element symbol:

        1.
"symbol C:/Documents\ and\ Settings/myname/folder/folder/filename.aif"

Here "\ " is meant to indicate the SPACE-symbol. You need to do this
*before* you build the final "read -resize ..." message of course, so
you use [read -resize $1 TABLENAME( afterwards.

As you see this is slightly complicated so again I'd suggest to just
move your files areound and avoid spaces in filenames generally like
the elders did.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 632 324 537 480 10;
#X obj 128 318 list-l2s;
#X obj 266 269 makefilename %c;
#X symbolatom 180 360 25 0 0 0 - - -;
#X obj 148 418 soundfiler;
#X msg 68 47 bang;
#X obj 437 274 table x;
#X obj 68 70 openpanel;
#X msg 128 387 read -resize \$1 x;
#X msg 128 132 set \$1;
#X msg 128 161 /tmp/with space/loop1.wav;
#X msg 438 220 const 0;
#X obj 438 252 s x;
#X msg 266 247 32;
#X text 302 248 SPACE as ascii;
#X obj 266 223 loadbang;
#X text 209 316 concatenate list with "SPACE";
#X text 250 140 click me;
#X connect 0 0 2 0;
#X connect 0 0 7 0;
#X connect 1 0 0 1;
#X connect 4 0 6 0;
#X connect 6 0 7 0;
#X connect 6 0 8 0;
#X connect 7 0 3 0;
#X connect 8 0 9 0;
#X connect 9 0 0 0;
#X connect 10 0 11 0;
#X connect 12 0 1 0;
#X connect 14 0 12 0;
-------------- next part --------------
#N canvas 424 382 729 381 10;
#X msg 327 196 set %s;
#X obj 235 244 t a;
#X obj 118 252 makefilename %s;
#X obj 96 62 t b a b;
#X obj 96 283 symbol;
#X msg 142 22 a b c d 1 2;
#X obj 118 158 route symbol float;
#X obj 118 186 symbol;
#X obj 178 190 makefilename %d;
#X obj 96 21 inlet;
#X obj 96 313 outlet;
#X obj 395 192 makefilename 1%s%%s;
#X obj 395 165 symbol \$1;
#X msg 405 123 bang;
#X obj 395 89 loadbang;
#X msg 395 228 set set \, adddollsym \$1;
#X msg 235 265 set \$1%s;
#N canvas 0 0 533 407 drip 0;
#X obj 64 206 list split 1;
#X obj 64 123 until;
#X obj 64 181 list append;
#X obj 194 206 bang;
#X text 146 90 First store list \, then start the loop;
#X text 163 118 "until" bangs its output until told to stop by a "bang"
to its right inlet.;
#X text 182 160 Store the remaining list.;
#X text 239 205 third outlet of "split" tells us to stop.;
#X obj 64 243 outlet;
#X obj 64 57 inlet;
#X text 237 44 From list-help.pd;
#X obj 143 243 outlet;
#X obj 64 86 t b a;
#X connect 0 0 8 0;
#X connect 0 1 2 1;
#X connect 0 2 3 0;
#X connect 0 2 11 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 1 1;
#X connect 9 0 12 0;
#X connect 12 0 1 0;
#X connect 12 1 2 1;
#X restore 118 123 pd drip;
#X obj 447 124 inlet;
#X connect 0 0 2 0;
#X connect 1 0 16 0;
#X connect 2 0 1 0;
#X connect 2 0 4 1;
#X connect 3 0 4 0;
#X connect 3 1 17 0;
#X connect 3 2 0 0;
#X connect 4 0 10 0;
#X connect 5 0 3 0;
#X connect 6 0 7 0;
#X connect 6 1 8 0;
#X connect 7 0 2 0;
#X connect 8 0 2 0;
#X connect 9 0 3 0;
#X connect 11 0 15 0;
#X connect 12 0 11 0;
#X connect 13 0 12 0;
#X connect 14 0 12 0;
#X connect 15 0 16 0;
#X connect 16 0 2 0;
#X connect 17 0 6 0;
#X connect 18 0 12 0;


More information about the Pd-list mailing list