petoral@optonline.net wrote:
i remember, hardoff has a very nice tutorial example & discussion
about using $- dollar sign which is a very good reference.
http://puredata.hurleur.com/index.php, hardoff might have a direct
link or just search in the forum.
Thanks, I found it here:
http://puredata.hurleur.com/sujet-1187-abstraction-why-use-etc
With help from that I managed to work out the attached patch (supposed
to play a sample at a give rate, 1 being original speed). Now I face
another problem: freq seems to be 0 :-( I guess it has to do with
$0-file_samples being available after $0-load, so the division on the
left gets 44100/0. I even think this way of doing the division is quite
clumsy. How can I do it correctly?
--
peace, love & harmony
Atte
http://atte.dk |
http://myspace.com/attejensen
http://anagrammer.dk |
http://modlys.dk
#N canvas 354 223 640 428 10;
#X obj 93 20 loadbang;
#X obj 305 268 soundfiler;
#X msg 59 20 bang;
#X msg 204 42 ; pd dsp 1;
#X obj 42 249 *~ 100000;
#X obj 461 394 print nb_samples;
#X obj 42 225 phasor~ 0.5;
#X obj 42 170 44100;
#X obj 42 202 /;
#X obj 380 76 wavinfo;
#X obj 93 63 s $0-load;
#X obj 204 20 r $0-load;
#X obj 380 32 r $0-load;
#X obj 380 54 symbol $1;
#X obj 380 202 f $0;
#X obj 305 202 symbol $1;
#X obj 219 273 print pack;
#X obj 305 224 pack symbol f;
#X obj 507 25 table $0-sample;
#X obj 42 273 tabread4~ $0-sample;
#X obj 42 148 r $0-load;
#X obj 345 163 r $0-load;
#X msg 305 246 read -resize $1 $2-sample;
#X obj 18 321 outlet~;
#X obj 77 321 outlet~;
#X obj 272 36 inlet;
#X text 18 339 left;
#X text 77 339 right;
#X text 320 6 rate;
#X obj 445 119 s $0-file_samples;
#X obj 445 141 s $0-file_channels;
#X obj 445 163 s $0-file_bitsize;
#X obj 445 185 s $0-file_rate;
#X obj 461 372 r $0-file_samples;
#X obj 138 198 r $0-file_samples;
#X obj 270 87 s $0-rate;
#X obj 332 395 print rate;
#X obj 332 374 r $0-rate;
#X obj 312 36 r $0-load;
#X obj 315 64 f $2;
#X obj 180 245 print freq;
#X connect 0 0 10 0;
#X connect 2 0 10 0;
#X connect 4 0 19 0;
#X connect 6 0 4 0;
#X connect 7 0 8 0;
#X connect 8 0 6 0;
#X connect 8 0 40 0;
#X connect 9 0 29 0;
#X connect 9 1 30 0;
#X connect 9 2 31 0;
#X connect 9 3 32 0;
#X connect 11 0 3 0;
#X connect 12 0 13 0;
#X connect 13 0 9 0;
#X connect 14 0 17 1;
#X connect 15 0 17 0;
#X connect 17 0 22 0;
#X connect 17 0 16 0;
#X connect 19 0 23 0;
#X connect 19 0 24 0;
#X connect 20 0 7 0;
#X connect 21 0 14 0;
#X connect 21 0 15 0;
#X connect 22 0 1 0;
#X connect 25 0 35 0;
#X connect 33 0 5 0;
#X connect 34 0 4 1;
#X connect 34 0 8 1;
#X connect 37 0 36 0;
#X connect 38 0 39 0;
#X connect 39 0 35 0;