From 5bd2d306455cede7dc0f27f87286e3ac67150987 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 19 Nov 2009 23:55:56 +0000 Subject: built a convenience object for directly loading a wav file then using fstablooper~ svn path=/trunk/externals/framesync/; revision=12801 --- README.txt | 12 ++++ fsfilelooper~-help.pd | 52 +++++---------- fsfilelooper~.pd | 171 ++++++++++++++------------------------------------ 3 files changed, 74 insertions(+), 161 deletions(-) create mode 100644 README.txt diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..a3e9f80 --- /dev/null +++ b/README.txt @@ -0,0 +1,12 @@ + +framesync + +framesync is a library for syncing sounds to video using frame numbers as the +unit of time. It was developed as part of the sound design for the Cartier +Foundation's Terre Natale project. There are a couple of concepts in this +library necessary to understand in order to use it: + +- the FPS (Frames-Per-Second) is a global value set everywhere in Pd +- the frameclock is global, and each framesync object receives it automatically +- the frameclock starts at 0 and flows linearly + diff --git a/fsfilelooper~-help.pd b/fsfilelooper~-help.pd index 36d0166..d4ca603 100644 --- a/fsfilelooper~-help.pd +++ b/fsfilelooper~-help.pd @@ -1,38 +1,16 @@ -#N canvas 463 304 574 472 10; -#X text 30 7 loops a sound file between a startframe and endframe; -#X text 138 179 start; -#X text 139 191 frame; -#X text 223 191 frame; -#X text 223 181 end; -#X text 34 230 audio out; -#X text 56 189 filename; -#X obj 177 49 frameclock 400; -#X obj 61 407 output~; -#X text 318 206 args: filename startframe# endframe#; -#X text 33 138 This will loop the voice.wav sound file starting at +#N canvas 256 119 556 379 10; +#X text 23 15 loops a sound file between a startframe and endframe +; +#X text 163 188 start; +#X text 164 200 frame; +#X text 288 199 frame; +#X text 288 189 end; +#X text 27 238 audio out; +#X text 49 197 filename; +#X obj 170 57 frameclock 400; +#X obj 54 285 output~; +#X text 311 214 args: filename startframe# endframe#; +#X text 26 146 This will loop the voice.wav sound file starting at frame 50 and ending at frame 200:; -#X obj 313 281 hsl 128 15 0 1 0 0 empty empty empty -2 -8 0 10 -262144 --1 -1 12700 1; -#X floatatom 310 300 5 0 0 0 - - -; -#X obj 61 208 fsfilelooper~ ../../sound/voice.wav 50 200; -#X obj 310 260 line; -#X text 204 227 right outlet outputs a message to send to a line which -will generate a line with 0 at the start and 1 at the end; -#X obj 139 382 *~; -#X obj 154 362 line~; -#X obj 139 306 osc~ 333; -#X msg 231 333 0; -#X obj 139 327 *~ 0.3; -#X obj 231 312 select 1; -#X connect 11 0 12 0; -#X connect 13 0 8 0; -#X connect 13 1 14 0; -#X connect 13 1 17 0; -#X connect 14 0 11 0; -#X connect 14 0 21 0; -#X connect 16 0 8 1; -#X connect 17 0 16 1; -#X connect 18 0 20 0; -#X connect 19 0 17 0; -#X connect 20 0 16 0; -#X connect 21 0 19 0; +#X obj 54 216 fsfilelooper~ ../../sound/voice.wav 15 111; +#X connect 11 0 8 0; diff --git a/fsfilelooper~.pd b/fsfilelooper~.pd index d9d254a..19721cc 100644 --- a/fsfilelooper~.pd +++ b/fsfilelooper~.pd @@ -1,126 +1,49 @@ -#N canvas 771 553 605 420 10; -#X obj 280 21 inlet; -#X obj 195 42 loadbang; -#X obj 440 21 inlet; -#X obj 144 383 outlet~; -#N canvas 679 332 352 429 play 0; -#X obj 35 13 inlet; -#X obj 90 375 outlet~; -#X obj 90 306 readsf~; -#X msg 79 271 1; -#X msg 50 271 0; -#X obj 79 116 trigger bang bang; -#X obj 79 95 spigot; -#X obj 35 70 select 0; -#X obj 35 47 trigger float float; -#X msg 178 263 open \$1; -#X obj 178 207 pack symbol symbol; -#X obj 178 230 zexy/makesymbol %s/%s; -#X obj 178 184 ggee/getdir 2; -#X obj 178 160 trigger bang anything; -#X obj 211 13 inlet; -#X obj 178 138 symbol; -#X connect 0 0 8 0; -#X connect 2 0 1 0; -#X connect 2 1 6 0; -#X connect 3 0 2 0; -#X connect 4 0 2 0; -#X connect 5 0 3 0; -#X connect 5 1 15 0; -#X connect 6 0 5 0; -#X connect 7 0 4 0; -#X connect 7 1 6 0; -#X connect 8 0 7 0; -#X connect 8 1 6 1; -#X connect 9 0 2 0; -#X connect 10 0 11 0; -#X connect 11 0 9 0; -#X connect 12 0 10 0; -#X connect 13 0 12 0; -#X connect 13 1 10 1; -#X connect 14 0 15 1; -#X connect 15 0 13 0; -#X restore 144 341 pd play sample; -#X obj 144 318 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 -1; -#X obj 177 198 select; -#X msg 177 221 1; -#X obj 337 198 select; -#X msg 337 221 0; -#X text 334 23 start frame; -#X text 485 19 end frame; -#X msg 253 340 0 \, 1 \$1; -#X obj 211 220 float; -#X obj 253 383 outlet; -#N canvas 258 306 450 300 calc 0; -#X obj 89 12 inlet; -#X obj 228 11 inlet; -#X obj 152 273 outlet; -#X obj 152 73 pack 0 0; -#X msg 152 93 \$2 \$1; -#X obj 152 115 -; -#X floatatom 159 211 5 0 0 0 - - -; -#X obj 167 164 framesync/fps_ms; -#X obj 152 185 *; -#X obj 167 144 loadbang; -#X connect 0 0 3 0; -#X connect 1 0 3 1; -#X connect 3 0 4 0; -#X connect 4 0 5 0; -#X connect 5 0 8 0; -#X connect 7 0 8 1; -#X connect 8 0 2 0; -#X connect 8 0 6 0; -#X connect 9 0 7 0; -#X restore 238 198 pd calc time; -#X msg 32 281 0; -#X obj 280 96 purepd/float_argument \$2; -#X obj 440 96 purepd/float_argument \$3; -#X text 141 22 first arg is filename; -#X obj 431 223 bang; -#X msg 431 245 0; -#X obj 32 176 bang; -#X obj 32 139 receive framesync/frameclock; -#X text 32 122 current frame #; -#X obj 80 21 inlet; -#X obj 80 96 purepd/symbol_argument \$1; -#X obj 195 65 trigger bang bang bang; -#X obj 431 203 receive framesync/reset; -#X obj 59 219 framesync/fps_ms; -#X obj 32 260 delay; -#X obj 59 198 loadbang; -#X obj 59 240 * 2; -#X connect 0 0 17 0; -#X connect 1 0 27 0; -#X connect 2 0 18 0; +#N canvas 318 426 573 321 10; +#X obj 240 21 inlet; +#X obj 155 42 loadbang; +#X obj 400 21 inlet; +#X obj 146 264 outlet~; +#X text 294 23 start frame; +#X text 445 19 end frame; +#X obj 240 96 purepd/float_argument \$2; +#X obj 400 96 purepd/float_argument \$3; +#X text 101 22 first arg is filename; +#X obj 40 21 inlet; +#X obj 40 96 purepd/symbol_argument \$1; +#X obj 155 65 trigger bang bang bang; +#X obj 40 146 table \$0-sample; +#X obj 146 167 framesync/fstablooper~ \$0-sample; +#N canvas 206 494 450 300 load 0; +#X obj 162 113 pack symbol symbol; +#X obj 162 136 zexy/makesymbol %s/%s; +#X obj 162 90 ggee/getdir 2; +#X obj 162 44 symbol; +#X obj 162 10 inlet; +#X obj 162 188 pack symbol symbol; +#X obj 267 164 symbol \$0-sample; +#X obj 162 66 trigger bang anything bang; +#X msg 162 209 read -resize \$1 \$2; +#X obj 162 232 soundfiler; +#X connect 0 0 1 0; +#X connect 1 0 5 0; +#X connect 2 0 0 0; +#X connect 3 0 7 0; #X connect 4 0 3 0; -#X connect 5 0 4 0; -#X connect 6 0 7 0; -#X connect 6 0 13 0; -#X connect 7 0 5 0; +#X connect 5 0 8 0; +#X connect 6 0 5 1; +#X connect 7 0 2 0; +#X connect 7 1 0 1; +#X connect 7 2 6 0; #X connect 8 0 9 0; -#X connect 9 0 5 0; -#X connect 12 0 14 0; -#X connect 13 0 12 0; -#X connect 15 0 13 1; -#X connect 16 0 5 0; -#X connect 17 0 6 1; -#X connect 17 0 15 0; -#X connect 18 0 8 1; -#X connect 18 0 15 1; -#X connect 20 0 21 0; -#X connect 21 0 5 0; -#X connect 22 0 30 0; -#X connect 23 0 6 0; -#X connect 23 0 8 0; -#X connect 23 0 22 0; -#X connect 25 0 26 0; -#X connect 26 0 4 1; -#X connect 27 0 26 0; -#X connect 27 1 17 0; -#X connect 27 2 18 0; -#X connect 28 0 20 0; -#X connect 29 0 32 0; -#X connect 30 0 16 0; -#X connect 31 0 29 0; -#X connect 32 0 30 1; +#X restore 40 125 pd load \$0-sample; +#X connect 0 0 6 0; +#X connect 1 0 11 0; +#X connect 2 0 7 0; +#X connect 6 0 13 1; +#X connect 7 0 13 2; +#X connect 9 0 10 0; +#X connect 10 0 14 0; +#X connect 11 0 10 0; +#X connect 11 1 6 0; +#X connect 11 2 7 0; +#X connect 13 0 3 0; -- cgit v1.2.1