From 94c0bf22453ce44ea85afa8b2b498df9c35bb454 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 17 Nov 2009 06:58:19 +0000 Subject: switched it so that tabplay~ uses its own internal clock and fstablooper~ just sends it places to start and then tells it when to stop. This made jumping to arbitrary frames tricky, so now it sends a reset whenever you send it an arbitrary frame to jump to svn path=/trunk/externals/framesync/; revision=12790 --- frameclock.pd | 28 +++++++- fstablooper~-help.pd | 16 ++--- fstablooper~.pd | 179 +++++++++++++++++++++------------------------------ 3 files changed, 108 insertions(+), 115 deletions(-) diff --git a/frameclock.pd b/frameclock.pd index 0c6b71e..7cf60b8 100644 --- a/frameclock.pd +++ b/frameclock.pd @@ -32,7 +32,7 @@ empty 0 -8 0 16 -233017 -33289 -33289 0 256; #X obj 433 19 loadbang; #X obj 433 39 trigger bang bang; #X obj 155 217 metro; -#X obj 123 139 hsl 154 8 0 1000 0 0 \$0-hsl \$0-hsl-receive empty -2 +#X obj 123 139 hsl 154 8 0 400 0 0 \$0-hsl \$0-hsl-receive empty -2 -8 0 10 -262130 -1 -1 0 1; #X msg 371 88 range 0 \$1; #X obj 435 337 bang; @@ -52,6 +52,28 @@ empty 0 -8 0 16 -233017 -33289 -33289 0 256; #X obj 555 64 framesync/fps_ms; #X obj 24 14 inlet; #X text 65 13 set frame position; +#N canvas 0 22 450 300 delay 0; +#X obj 48 11 inlet; +#X obj 48 265 outlet; +#X obj 48 229 float; +#X obj 48 143 framesync/fps_ms; +#X obj 48 165 * 2; +#X obj 48 186 delay; +#X text 78 42 in the tabplay~-based objects \, the re-triggering is +based on a delay that resets if it doesn't receive the next frame on +time. So to jump to a frame \, stop the clock \, wait a bit \, then +hard set \, and restart; +#X obj 48 102 trigger bang float bang; +#X obj 183 264 outlet; +#X connect 0 0 7 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 5 0 2 0; +#X connect 7 0 3 0; +#X connect 7 1 2 1; +#X connect 7 2 8 0; +#X restore 28 49 pd delay set; #X connect 0 0 14 0; #X connect 1 1 10 0; #X connect 2 0 1 0; @@ -85,5 +107,7 @@ empty 0 -8 0 16 -233017 -33289 -33289 0 256; #X connect 25 0 21 0; #X connect 28 0 15 0; #X connect 31 0 14 1; -#X connect 32 0 15 0; +#X connect 32 0 34 0; +#X connect 34 0 15 0; +#X connect 34 1 29 0; #X coords 0 -1 1 1 159 62 1 120 120; diff --git a/fstablooper~-help.pd b/fstablooper~-help.pd index 6246ccf..b188849 100644 --- a/fstablooper~-help.pd +++ b/fstablooper~-help.pd @@ -1,11 +1,11 @@ -#N canvas 50 421 594 533 10; +#N canvas 636 436 594 533 10; #X text 30 7 loops a sound file between a startframe and endframe; #X text 133 227 start; #X text 134 239 frame; #X text 216 239 frame; #X text 215 229 end; #X text 29 278 audio out; -#X obj 90 68 frameclock 400; +#X obj 90 69 frameclock 400; #X obj 56 455 output~; #X text 31 187 This will loop the voice.wav sound file starting at frame 50 and ending at frame 200:; @@ -33,10 +33,10 @@ will generate a line with 0 at the start and 1 at the end; #X obj 177 361 select 1; #X msg 90 42 33; #X msg 123 42 53; -#X msg 152 40 54; -#X msg 402 142 read ../../sound/bell.aiff \$1; -#X obj 62 256 fstablooper~ \$0-array 10 155; -#X connect 10 0 29 0; +#X msg 402 142 read ../../sound/voice.wav \$1; +#X msg 152 40 111; +#X obj 62 256 fstablooper~ \$0-array 0 126; +#X connect 10 0 28 0; #X connect 12 0 10 0; #X connect 13 0 10 0; #X connect 16 0 17 0; @@ -50,8 +50,8 @@ will generate a line with 0 at the start and 1 at the end; #X connect 25 0 23 0; #X connect 26 0 6 0; #X connect 27 0 6 0; -#X connect 28 0 6 0; -#X connect 29 0 11 0; +#X connect 28 0 11 0; +#X connect 29 0 6 0; #X connect 30 0 7 0; #X connect 30 1 18 0; #X connect 30 1 21 0; diff --git a/fstablooper~.pd b/fstablooper~.pd index 22ff01e..982a21c 100644 --- a/fstablooper~.pd +++ b/fstablooper~.pd @@ -1,9 +1,6 @@ -#N canvas 742 370 858 542 10; +#N canvas 487 226 858 542 10; #X obj 301 4 inlet; #X obj 131 508 outlet~; -#X obj 169 100 trigger bang float; -#X obj 131 335 *; -#X obj 131 437 pack float float; #X obj 301 83 purepd/symbol_argument \$1; #X obj 224 26 loadbang; #X obj 504 11 inlet; @@ -11,114 +8,86 @@ #X obj 504 82 purepd/float_argument \$2; #X obj 104 190 moses; #X obj 131 210 moses; -#X obj 131 241 -; -#X obj 314 508 outlet; -#X text 360 508 bang when done; +#X obj 131 361 -; +#X obj 273 508 outlet; +#X text 319 508 bang when done; #X obj 131 481 tabplay~ \$1; #X msg 301 436 set \$1; -#X obj 169 78 framesync/fps_ms; -#X obj 22 48 receive framesync/frameclock; -#X text 19 31 current frame #; +#X obj 32 101 receive framesync/frameclock; +#X text 29 84 current frame #; #X text 342 3 array to play; #X obj 674 11 inlet; #X obj 674 82 purepd/float_argument \$3; #X text 714 8 frame # when to stop; #X floatatom 517 105 5 0 0 0 - - -; #X floatatom 683 107 5 0 0 0 - - -; -#N canvas 425 103 450 300 repeat 0; -#X obj 39 7 inlet; -#X obj 39 259 outlet; -#X obj 72 156 flatspace/arraysize; -#X obj 183 7 inlet; -#X obj 39 68 trigger bang bang; -#X obj 39 197 *; -#X msg 98 47 0; -#X obj 98 7 inlet; -#X obj 98 27 bang; -#X text 128 28 reset; -#X floatatom 50 221 0 0 0 0 - - -; -#X msg 117 132 bang; -#X floatatom 81 182 0 0 0 0 - - -; -#X obj 39 110 +; -#X obj 68 110 float; -#X msg 39 89 1; -#X floatatom 48 135 5 0 0 0 - - -; -#X connect 0 0 4 0; -#X connect 2 0 5 1; -#X connect 2 0 12 0; -#X connect 3 0 2 1; -#X connect 4 0 15 0; -#X connect 4 1 2 0; -#X connect 5 0 1 0; -#X connect 5 0 10 0; -#X connect 6 0 14 0; -#X connect 6 0 5 0; -#X connect 7 0 8 0; -#X connect 8 0 6 0; -#X connect 11 0 2 0; -#X connect 13 0 5 0; -#X connect 13 0 14 0; -#X connect 13 0 16 0; -#X connect 14 0 13 1; -#X connect 15 0 13 0; -#X restore 146 377 pd repeat logic; -#X obj 224 293 *; -#X obj 224 252 samplerate~; #X obj 224 46 trigger bang bang bang bang bang; #X msg 285 26 bang; -#X obj 158 294 bang; -#X obj 239 273 / 1000; -#X text 264 397 this is the margin of error...; -#X obj 131 397 -; -#X obj 232 479 bang; -#X obj 232 501 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 --1 -1; -#X msg 41 361 bang; -#X obj 34 509 print; -#X floatatom 237 437 5 0 0 0 - - -; -#X obj 224 398 + 222; -#X obj 131 417 int; -#X connect 0 0 5 0; -#X connect 2 1 32 0; -#X connect 3 0 34 0; -#X connect 4 0 15 0; -#X connect 4 0 38 0; -#X connect 5 0 16 0; -#X connect 5 0 26 2; -#X connect 6 0 29 0; -#X connect 7 0 9 0; -#X connect 9 0 12 1; -#X connect 9 0 10 1; -#X connect 9 0 24 0; -#X connect 10 0 26 1; -#X connect 10 1 11 0; -#X connect 11 0 12 0; -#X connect 11 1 31 0; -#X connect 12 0 3 0; -#X connect 15 0 1 0; -#X connect 15 1 35 0; -#X connect 16 0 15 0; -#X connect 17 0 2 0; -#X connect 18 0 10 0; -#X connect 21 0 22 0; -#X connect 22 0 25 0; -#X connect 22 0 11 1; -#X connect 26 0 34 1; -#X connect 27 0 3 1; -#X connect 27 0 40 0; -#X connect 28 0 27 0; -#X connect 29 0 28 0; -#X connect 29 1 17 0; -#X connect 29 2 5 0; -#X connect 29 3 9 0; -#X connect 29 4 22 0; -#X connect 30 0 29 0; -#X connect 31 0 26 1; -#X connect 32 0 27 1; -#X connect 34 0 41 0; -#X connect 35 0 26 0; -#X connect 35 0 36 0; -#X connect 37 0 26 0; -#X connect 40 0 4 1; -#X connect 40 0 39 0; -#X connect 41 0 4 0; +#X obj 208 481 bang; +#X obj 252 238 framesync/fps_ms; +#X obj 237 317 samplerate~; +#X obj 237 359 *; +#X obj 252 338 / 1000; +#X obj 131 397 *; +#X obj 131 420 %; +#X obj 224 396 flatspace/arraysize; +#X msg 212 430 stop; +#N canvas 0 22 450 300 reset 0; +#X obj 191 140 delay; +#X obj 191 119 bang; +#X obj 128 210 purepd/once; +#X obj 221 119 + 1; +#X obj 222 172 receive framesync/reset; +#X obj 128 51 inlet; +#X obj 221 51 inlet; +#X obj 128 250 outlet; +#X obj 242 250 outlet; +#X connect 0 0 2 1; +#X connect 0 0 8 0; +#X connect 1 0 0 0; +#X connect 2 0 7 0; +#X connect 3 0 0 1; +#X connect 4 0 2 1; +#X connect 4 0 8 0; +#X connect 5 0 2 0; +#X connect 5 0 1 0; +#X connect 6 0 3 0; +#X restore 131 262 pd reset delay; +#X connect 0 0 2 0; +#X connect 2 0 13 0; +#X connect 2 0 31 1; +#X connect 3 0 22 0; +#X connect 4 0 6 0; +#X connect 6 0 9 1; +#X connect 6 0 7 1; +#X connect 6 0 20 0; +#X connect 7 1 8 0; +#X connect 8 0 33 0; +#X connect 9 0 29 0; +#X connect 12 0 1 0; +#X connect 12 1 24 0; +#X connect 13 0 12 0; +#X connect 14 0 7 0; +#X connect 17 0 18 0; +#X connect 18 0 21 0; +#X connect 18 0 8 1; +#X connect 22 0 26 0; +#X connect 22 0 31 0; +#X connect 22 1 25 0; +#X connect 22 2 2 0; +#X connect 22 3 6 0; +#X connect 22 4 18 0; +#X connect 23 0 22 0; +#X connect 24 0 12 0; +#X connect 25 0 28 0; +#X connect 25 0 33 1; +#X connect 26 0 27 0; +#X connect 27 0 29 1; +#X connect 28 0 27 1; +#X connect 29 0 30 0; +#X connect 30 0 12 0; +#X connect 31 0 30 1; +#X connect 32 0 12 0; +#X connect 32 0 10 0; +#X connect 33 0 9 0; +#X connect 33 1 32 0; -- cgit v1.2.1