I did something really ugly and stupid... I set the output buffer to 20
msec so
that Pd could do long-lasting control operations without interrupting audio.
Then I set a metronome to go off at exactly 2048-sample intervals, at
each of
which I filled an array progressively from a file and started a tabplay~
object at
the same instant. This works only with short files since the SD card
filesystem
"seeks" by reading through the entire file every time - but you can
still play long
sounds in principle by splitting them up into many short ones, each one
an exact
multiple of 2048 samples long.
Here's my patch, enjoy :)
#N canvas 207 195 905 534 12;
#X obj 257 421 soundfiler;
#X obj 53 351 dac~ 1;
#X obj 47 165 r a;
#X obj 52 326 *~;
#X obj 232 13 loadbang;
#X obj 72 295 tabplay~ sample0;
#X msg 336 333 symbol /sdcard;
#X obj 232 38 t b b;
#X obj 532 82 r p;
#X obj 532 109 unpack 0 0 0;
#X msg 290 135 tempo 1 samp;
#X obj 306 211 + 1;
#X obj 277 211 f 0;
#X obj 266 237 moses;
#X msg 356 177 0;
#X obj 470 110 t b b f;
#X msg 160 127 50;
#X msg 391 135 1;
#X obj 258 307 +;
#X obj 266 262 t b f;
#X obj 257 368 pack 0 0 s;
#X obj 52 213 line~;
#X obj 52 238 *~;
#X obj 52 263 *~ 0.0001;
#X obj 554 366 s pd;
#X msg 495 256 0;
#X msg 554 342 dsp \$1;
#X msg 524 256 1;
#X msg 257 395 read -skip \$1 \$3/\$2-foo.wav sample0;
#X obj 277 177 metro 2048;
#X obj 424 27 array define sample0 2048;
#X obj 258 333 * 2048;
#X connect 2 0 21 0;
#X connect 3 0 1 0;
#X connect 4 0 7 0;
#X connect 5 0 3 1;
#X connect 6 0 20 2;
#X connect 7 1 16 0;
#X connect 7 1 10 0;
#X connect 7 1 6 0;
#X connect 7 1 29 0;
#X connect 8 0 9 0;
#X connect 9 0 15 0;
#X connect 9 1 18 1;
#X connect 9 2 13 1;
#X connect 10 0 29 0;
#X connect 11 0 12 1;
#X connect 12 0 11 0;
#X connect 12 0 13 0;
#X connect 13 0 19 0;
#X connect 13 1 25 0;
#X connect 14 0 12 1;
#X connect 15 0 17 0;
#X connect 15 0 27 0;
#X connect 15 1 14 0;
#X connect 15 2 20 1;
#X connect 16 0 21 0;
#X connect 17 0 29 0;
#X connect 18 0 31 0;
#X connect 19 0 5 0;
#X connect 19 1 18 0;
#X connect 20 0 28 0;
#X connect 21 0 22 0;
#X connect 21 0 22 1;
#X connect 22 0 23 0;
#X connect 23 0 3 0;
#X connect 25 0 26 0;
#X connect 26 0 24 0;
#X connect 27 0 26 0;
#X connect 28 0 0 0;
#X connect 29 0 12 0;
#X connect 31 0 20 0;
On 11/25/23 12:35, Yogi data wrote:
Hello,
after watching a video of a talk given by Mille Puckette at
"laboratoire STMS"
about "espd" ,which is an adaptation of pd for esp32, I decided to
give it a try.
I already have a set of 10 esp32 playing sounds from sdcard, using the
"arduino-audio-tools library", I monitor esp32's states and trigger
samples from my
computer using pure data, via wifi. But I would prefer to be able to
prototype using
pd.
The "espd" project compiled nicely, I can upload patches through wifi
to my esp32
and all works just fine.
But, I couldn't find a way of playing samples, like Miller used it to
make did in an
art installation so I guess it is possible.
My question is : has anyone who has used espd a clue or an example
patch showing
the usage ?
( I only tried using readsf~ )
Cheers
Yog
_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management ->
https://urldefense.com/v3/__https://lists.puredata.info/listinfo/pd-list__;!!Mih3wA!BPmV0g_uj1BPRMbBAeax8yxa87wyairOnJCHPgU4vEgAkMb3oPXQqJgx7XyC_mEScEAS7kNZQT3YIvO7$
_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list