[PD] current sample that is played in an array

Frank Barknecht fbar at footils.org
Fri Aug 18 21:12:20 CEST 2006


Hallo,
Gerda Strobl hat gesagt: // Gerda Strobl wrote:

> Padawan12 was so kind to send me an exemple patch, using audio rate 
> comparision.
> 
> [phasor~ 0.1]
> |
> |
> [*~1000]
> |
> |
> [>~750]
> But I still dont get how to do this with normal audiofile where 
> amplitude is not sawtooth like.

As Georg mentioned it depends on how you play the file. If you load it
into a table with soundfiler and play it with [tabread4~] from there,
you already have the index where to stop from the signal feeding the
[tabread4~]. 

If you're playing with [readsf~] it's a bit harder. But you know when
you start the file because you did bang [readsf~] at that time. So
what I would do is to also bang a [vline~] at that point and let it go
for a long time at the speed of your sample rate. See attached patch
for the principle in action.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
#N canvas 104 45 732 546 10;
#X obj 239 246 * 1e+08;
#X obj 292 245 * 1e+08;
#X floatatom 160 276 10 0 0 0 - - -;
#X floatatom 309 273 10 0 0 0 - - -;
#X msg 292 222 1000;
#X obj 239 295 pack 0 0;
#X obj 239 156 samplerate~;
#X obj 239 125 select 1;
#X msg 596 243 stop;
#X obj 239 351 vline~;
#X msg 239 317 0 \, \$1 \$2;
#X obj 208 57 tgl 15 0 empty empty play/stop 0 -6 0 8 -262144 -1 -1
0 1;
#X obj 95 252 dac~;
#X obj 239 420 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 239 394 > 237283;
#X obj 239 371 snapshot~;
#X text 265 420 stop here!;
#X obj 105 376 bang~;
#X obj 96 222 readsf~ 2;
#X msg 96 191 open \$1;
#X obj 96 106 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 96 138 openpanel;
#X obj 96 165 symbol;
#X msg 43 117 bang;
#X obj 239 183 t a b a;
#X floatatom 338 194 5 0 0 0 - - -;
#X msg 310 124 bang;
#X obj 106 316 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 1
1;
#X obj 208 83 t a a;
#X floatatom 339 398 20 0 0 0 - - -;
#X text 304 349 vline~ now will advance exactly by one every sample.
;
#X text 356 246 times a big multiple of 10;
#X text 39 375 or use:;
#X floatatom 157 319 5 0 0 0 - - -;
#X obj 106 342 metro 50;
#X connect 0 0 2 0;
#X connect 0 0 5 0;
#X connect 1 0 3 0;
#X connect 1 0 5 1;
#X connect 4 0 1 0;
#X connect 5 0 10 0;
#X connect 6 0 24 0;
#X connect 6 0 25 0;
#X connect 7 0 6 0;
#X connect 7 0 22 0;
#X connect 7 1 8 0;
#X connect 8 0 9 0;
#X connect 9 0 15 0;
#X connect 10 0 9 0;
#X connect 11 0 28 0;
#X connect 14 0 13 0;
#X connect 15 0 14 0;
#X connect 15 0 29 0;
#X connect 18 0 12 0;
#X connect 18 1 12 1;
#X connect 19 0 18 0;
#X connect 20 0 21 0;
#X connect 21 0 22 0;
#X connect 22 0 19 0;
#X connect 23 0 22 0;
#X connect 24 0 0 0;
#X connect 24 1 4 0;
#X connect 26 0 6 0;
#X connect 27 0 34 0;
#X connect 28 0 18 0;
#X connect 28 1 7 0;
#X connect 33 0 34 1;
#X connect 34 0 15 0;


More information about the Pd-list mailing list