hi jfm3...
The "$1" in the patch is filled in when you instantiate it as an abstraction... so, for example, name the patch "z.pd", and then read it into another patch called "x.pd" as follows:
#N canvas 66 383 450 300 10; #X obj 65 59 z xx; #X msg 64 33 bang; #X msg 110 30 write xx.wav xx-tableL xx-tableR; #X obj 110 57 soundfiler; #X connect 1 0 0 0; #X connect 2 0 3 0;
which sets $1 to "xx". Then it should work (note also the botton in the "x" patch which makes a nice stereo soundfile to test it on.)
cheers Miller
On Sun, Jul 15, 2001 at 12:22:53AM -0400, jfm3 wrote:
I too am trying to write a generic sampler object, and I too am having the "local arrays" problem. I tried Uta's solution from May:
#N canvas 230 467 439 289 10; #X obj 17 40 openpanel; #X obj 17 155 soundfiler; #X floatatom 16 186; #X msg 17 13 bang; #X text 59 12 read file; #X obj 143 5 inlet; #X obj 19 66 t s b; #X obj 18 99 pack s s; #X obj 77 78 symbol $1-table; #X obj -85 95 s $1-filename; #X obj 17 209 s $1-siz; #X obj 198 120 table $1-tableL; #X obj 198 146 table $1-tableR; #X msg 17 126 read -resize $1 $2L $2R; #X obj 17 -13 r $1-open; #X obj 121 41 r $1-read; #X obj -44 158 outlet; #X connect 0 0 6 0; #X connect 0 0 9 0; #X connect 0 0 16 0; #X connect 1 0 2 0; #X connect 2 0 10 0; #X connect 3 0 0 0; #X connect 5 0 0 0; #X connect 6 0 7 0; #X connect 6 1 8 0; #X connect 7 0 13 0; #X connect 8 0 7 1; #X connect 13 0 1 0; #X connect 14 0 3 0; #X connect 15 0 6 0;
But this does not work. When I bang it, I get:
error: $1-tableL: no such table
Similarly, when I try to use |table $0-samp| and |read -resize sample.wav $0-samp< into |soundfiler|, I get errors on the name "0-samp".
I am using PD 33 on Linux. Am I missing a patch or something?
Thanks very much in advance.
(jfm3)