diff options
author | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-06 17:50:18 +0000 |
---|---|---|
committer | Juha Vehviläinen <jusu@users.sourceforge.net> | 2002-07-06 17:50:18 +0000 |
commit | 4d64e4cd434426234a5c313c151cd79b6afc299e (patch) | |
tree | 5c23dd6acc65b869741d3bb9d33912d74bb7407d /Patches |
*** empty log message ***svn2git-root
svn path=/trunk/Framestein/; revision=27
Diffstat (limited to 'Patches')
110 files changed, 3914 insertions, 0 deletions
diff --git a/Patches/00 example-basics.pd b/Patches/00 example-basics.pd new file mode 100644 index 0000000..ca9ab3f --- /dev/null +++ b/Patches/00 example-basics.pd @@ -0,0 +1,38 @@ +#N canvas 228 3 648 661 12; +#X obj 5 31 fs.main; +#X msg 5 7 6001; +#X msg 56 7 reset; +#X text 32 103 fs.main connects pure data and Framestein. Only one +at a time!; +#X text 33 143 1st inlet: re-establish connection to given port number +; +#X text 33 159 2nd inlet: "reset" will re-create all fs.*-objects; +#X obj 36 206 fs.frame; +#X text 119 206 -- load images and video \, perform effects \, run +plugins \, photoshop-filters \, and more ...; +#X text 120 273 some commands are listed here; +#X obj 358 273 fs.fx; +#X text 120 304 1st outlet: fs.frame ID. Connect this to other fs.*-objects +\, like fs.copy \, fs.info \, fs.event etc.; +#X text 120 344 2nd outlet: reports mouse movement in the frame when +mousetrack_1 is set. See example-docking.pd!; +#X text 119 384 3rd outlet: report the window position when docked +\, see example-docking2.pd!; +#X obj 45 442 fs.copy; +#X text 121 442 -- connect two fs.frames to copy pixels by built-in +copy operations \, plugins or photoshop-filters.; +#X text 122 486 1st inlet: connect the first outlet of fs.frame here. +; +#X text 122 505 2nd inlet: name of the copy operation \, or other parameter. +See inside fs.copy for list of built-ins. See example-plugins.pd and +example-photoshopfilters.pd.; +#X text 123 557 1st outlet: connect to the fs.frame to copy to.; +#X text 31 70 The central objects to get started with:; +#X text 49 602 Have fun!; +#X text 119 253 1st inlet: for a list of commands \, look inside the +patch.; +#X obj 344 320 fs.info; +#X obj 416 320 fs.event; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; diff --git a/Patches/01 example-video.pd b/Patches/01 example-video.pd new file mode 100644 index 0000000..3624331 --- /dev/null +++ b/Patches/01 example-video.pd @@ -0,0 +1,30 @@ +#N canvas 243 28 638 555 12; +#X obj 7 34 fs.main; +#X msg 7 8 6001; +#X msg 46 8 reset; +#X obj 300 209 fs.framed video; +#X msg 424 209 82 + 128; +#X text 41 64 drag & drop your favorite .avi here; +#X obj 442 185 init; +#X obj 303 121 hsl 256 15 0 1 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 9200 1; +#X obj 300 272 fs.copy; +#X msg 300 146 seek \$1* \, bang; +#X obj 300 348 fs.framed video; +#X msg 424 348 82 + 330; +#X msg 392 271 source_random \, dest_random; +#X text 314 299 Look inside fs.copy for more commands.; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 0 8 0; +#X connect 3 2 4 0; +#X connect 4 0 3 0; +#X connect 6 0 4 0; +#X connect 6 0 11 0; +#X connect 7 0 9 0; +#X connect 8 0 10 0; +#X connect 9 0 3 0; +#X connect 10 2 11 0; +#X connect 11 0 10 0; +#X connect 12 0 8 1; diff --git a/Patches/02 example-docking.pd b/Patches/02 example-docking.pd new file mode 100644 index 0000000..bf29cc8 --- /dev/null +++ b/Patches/02 example-docking.pd @@ -0,0 +1,88 @@ +#N canvas 385 33 594 516 12; +#X obj 13 33 fs.main; +#X obj 250 231 fs.framed example-docking 27+117; +#X msg 13 6 6001; +#X msg 64 5 reset; +#X floatatom 211 414 4 0 0; +#X floatatom 251 414 4 0 0; +#X floatatom 292 414 4 0 0; +#X obj 211 382 unpack f f f; +#X obj 386 367 fs.info; +#X floatatom 386 402 4 0 0; +#X floatatom 428 402 4 0 0; +#X floatatom 471 402 4 0 0; +#X obj 385 292 unpack f f; +#X floatatom 385 320 4 0 0; +#X floatatom 460 319 4 0 0; +#X msg 233 192 bang; +#X text 87 442 scrub the pict with mouse to get r g b values; +#X text 386 266 mouse x and y; +#X msg 268 322 bang; +#X obj 211 350 fs.rgb; +#N canvas 0 0 296 396 beeper 0; +#X obj 90 56 inlet; +#X obj 91 92 unpack f f f; +#X obj 171 130 *; +#X obj 123 252 osc~; +#X obj 155 170 / 256; +#X obj 86 132 / 256; +#X obj 123 203 *; +#X obj 125 323 dac~; +#X obj 127 284 *~ 0.1; +#X obj 85 161 * 20000; +#X obj 196 243 / 256; +#X obj 200 332 * 0.1; +#X connect 0 0 1 0; +#X connect 1 0 5 0; +#X connect 1 0 10 0; +#X connect 1 1 2 0; +#X connect 1 2 2 1; +#X connect 2 0 4 0; +#X connect 3 0 8 0; +#X connect 4 0 6 0; +#X connect 5 0 9 0; +#X connect 6 0 3 0; +#X connect 8 0 7 0; +#X connect 8 0 7 1; +#X connect 9 0 6 1; +#X connect 10 0 11 0; +#X connect 11 0 8 1; +#X restore 124 398 pd beeper; +#X msg 43 362 \; pd dsp 1; +#X msg 43 402 \; pd dsp 0; +#X msg 284 193 mousetrack_1; +#X obj 297 256 videoscrub; +#X text 264 77 or drop a videofile to the frame ...; +#X obj 206 51 init; +#X floatatom 513 402 5 0 0; +#X msg 250 51 HARMON.JPG; +#X text 42 336 Play the harmon!; +#X connect 1 0 19 0; +#X connect 1 0 8 0; +#X connect 1 0 24 0; +#X connect 1 1 12 0; +#X connect 1 1 19 1; +#X connect 1 1 18 0; +#X connect 1 1 24 1; +#X connect 2 0 0 0; +#X connect 2 0 3 0; +#X connect 3 0 0 1; +#X connect 7 0 4 0; +#X connect 7 1 5 0; +#X connect 7 2 6 0; +#X connect 8 0 9 0; +#X connect 8 1 10 0; +#X connect 8 2 11 0; +#X connect 8 3 27 0; +#X connect 12 0 13 0; +#X connect 12 1 14 0; +#X connect 15 0 1 0; +#X connect 18 0 19 0; +#X connect 19 0 7 0; +#X connect 19 0 20 0; +#X connect 23 0 1 0; +#X connect 24 0 1 0; +#X connect 26 0 28 0; +#X connect 26 0 15 0; +#X connect 26 0 23 0; +#X connect 28 0 1 0; diff --git a/Patches/03 example-docking2.pd b/Patches/03 example-docking2.pd new file mode 100644 index 0000000..f5687e5 --- /dev/null +++ b/Patches/03 example-docking2.pd @@ -0,0 +1,15 @@ +#N canvas 345 114 641 488 12; +#X obj 11 40 fs.main; +#X msg 11 12 6001; +#X msg 62 12 reset; +#X obj 26 133 fs.framed example-docking2; +#X msg 229 161 365 + 203; +#X obj 240 133 init; +#X text 24 78 Used this way the frame position is saved with the patch +automatically. Try moving the frame around!; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 2 4 0; +#X connect 4 0 3 0; +#X connect 5 0 4 0; diff --git a/Patches/04 example-draganddrop.pd b/Patches/04 example-draganddrop.pd new file mode 100644 index 0000000..2c68f99 --- /dev/null +++ b/Patches/04 example-draganddrop.pd @@ -0,0 +1,25 @@ +#N canvas 323 36 587 428 12; +#X obj 15 37 fs.main; +#X msg 66 12 reset; +#X obj 38 185 fs.framed draganddrop; +#X msg 201 212 352 + 233; +#X obj 38 244 fs.event; +#X msg 50 288 set \$1; +#X obj 92 150 init; +#X obj 48 151 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 18 95 Using fs.frame to provide drag & drop:; +#X text 352 180 Drop a file here:; +#X msg 15 12 6001; +#X msg 67 329; +#X connect 1 0 0 1; +#X connect 2 0 4 0; +#X connect 2 2 3 0; +#X connect 3 0 2 0; +#X connect 4 0 5 0; +#X connect 5 0 11 0; +#X connect 6 0 3 0; +#X connect 6 0 2 0; +#X connect 7 0 2 0; +#X connect 10 0 0 0; +#X connect 10 0 1 0; diff --git a/Patches/05 example-plugins.pd b/Patches/05 example-plugins.pd new file mode 100644 index 0000000..f6187a2 --- /dev/null +++ b/Patches/05 example-plugins.pd @@ -0,0 +1,127 @@ +#N canvas 344 18 621 620 12; +#X obj 11 41 fs.main; +#X msg 11 11 6001; +#X msg 62 12 reset; +#X obj 70 216 fs.frame; +#X msg 103 177 noize; +#X text 106 154 send the name of the plugin to fs.frame to execute +; +#X obj 70 466 fs.frame; +#X obj 70 302 fs.copy; +#X msg 141 216 bang; +#X text 161 249 plugins can also be copy operations; +#X msg 153 177 colortv; +#X msg 158 278 colortv; +#X msg 220 177 subtract \$1 \$2 \$3; +#X obj 376 205 pack f f f; +#X floatatom 368 177 4 0 0; +#X floatatom 409 177 4 0 0; +#X floatatom 450 177 4 0 0; +#X msg 460 205 bang; +#X obj 255 355 pack f f; +#X msg 323 355 bang; +#X floatatom 255 331 4 0 0; +#X floatatom 295 331 4 0 0; +#X obj 466 408 int; +#X msg 320 379 \$1 180; +#N canvas 686 105 602 402 funny 0; +#X obj 47 97 random 352; +#X obj 135 97 random 352; +#X obj 73 145 pack f f; +#X obj 80 186 outlet; +#X obj 76 13 inlet; +#X obj 86 56 t b b; +#X connect 0 0 2 0; +#X connect 1 0 2 1; +#X connect 2 0 3 0; +#X connect 4 0 5 0; +#X connect 5 0 0 0; +#X connect 5 1 1 0; +#X restore 255 412 pd funny; +#X msg 324 412 bang; +#X msg 158 331 xbend \$1 \$2; +#N canvas 638 233 375 411 bend 0; +#X obj 18 328 outlet; +#X msg 43 281 bend \$1 \$2 \$3 \$4; +#X obj 55 242 pack f f f f; +#X msg 158 242 bang; +#X floatatom 35 159 4 0 0; +#X floatatom 77 159 4 0 0; +#X floatatom 124 159 4 0 0; +#X floatatom 168 159 4 0 0; +#X msg 200 262 158 161 154 214; +#X text 187 315 oh i'm sorry virve...; +#X msg 209 290 94 95 280 214; +#X msg 187 339 169 144 262 162; +#X text 132 365 but this thing is killing me; +#X text 67 13 bend works in both x and y; +#X connect 1 0 0 0; +#X connect 2 0 1 0; +#X connect 3 0 2 0; +#X connect 4 0 2 0; +#X connect 5 0 2 1; +#X connect 5 0 3 0; +#X connect 6 0 2 2; +#X connect 6 0 3 0; +#X connect 7 0 2 3; +#X connect 7 0 3 0; +#X connect 8 0 1 0; +#X connect 10 0 1 0; +#X connect 11 0 1 0; +#X restore 255 442 pd bend; +#X text 71 503 note: 16 bit display is way faster than 24 or 32 in +my machine \, so i recommend trying out which one performs best.; +#X text 69 555 there are more plugins.. see the Framestein/Plugins-dir. +; +#X msg 70 118 virvezoom.jpg; +#X obj 186 118 init; +#X obj 94 407 init; +#X text 367 412 click here; +#X text 320 442 look here; +#X msg 94 438 291 x 325 \, 0 + 370; +#X obj 466 433 sameonce; +#X obj 466 384 ramp; +#X msg 466 356 220 66 10; +#X msg 466 333 66 220 10; +#X text 467 309 and here ..; +#X text 340 330 try these ..; +#X text 147 42 PLUGINS -- effects and copy operations; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 0 7 0; +#X connect 4 0 3 0; +#X connect 7 0 6 0; +#X connect 8 0 3 0; +#X connect 10 0 3 0; +#X connect 11 0 7 1; +#X connect 11 0 8 0; +#X connect 12 0 3 0; +#X connect 13 0 12 0; +#X connect 14 0 13 0; +#X connect 15 0 13 1; +#X connect 15 0 17 0; +#X connect 16 0 13 2; +#X connect 16 0 17 0; +#X connect 17 0 13 0; +#X connect 18 0 26 0; +#X connect 19 0 18 0; +#X connect 20 0 18 0; +#X connect 21 0 18 1; +#X connect 21 0 19 0; +#X connect 22 0 36 0; +#X connect 23 0 18 0; +#X connect 24 0 26 0; +#X connect 25 0 24 0; +#X connect 26 0 7 1; +#X connect 26 0 8 0; +#X connect 27 0 7 1; +#X connect 27 0 8 0; +#X connect 30 0 3 0; +#X connect 31 0 30 0; +#X connect 32 0 35 0; +#X connect 35 0 6 0; +#X connect 36 0 18 0; +#X connect 37 0 22 0; +#X connect 38 0 37 0; +#X connect 39 0 37 0; diff --git a/Patches/06 example-photoshopfilters.pd b/Patches/06 example-photoshopfilters.pd new file mode 100644 index 0000000..2b7a359 --- /dev/null +++ b/Patches/06 example-photoshopfilters.pd @@ -0,0 +1,105 @@ +#N canvas 221 6 707 598 12; +#X obj 16 54 fs.main; +#X msg 16 27 6001; +#X msg 58 27 reset; +#X obj 460 157 init; +#X msg 434 122 28 + 128; +#X obj 262 398 fs.copy; +#X obj 262 477 fs.framed example-pho; +#X obj 262 122 fs.framed example-pho; +#X msg 434 477 28 + 308; +#X obj 461 447 init; +#X msg 333 252 bosstota; +#X msg 281 157 next \, bang; +#X msg 345 285 bubbspac; +#X msg 357 320 chloemag; +#X msg 370 351 colsteps; +#X text 493 241 without parameters; +#X text 496 266 a dialog will pop; +#N canvas 298 218 624 424 realtime 0; +#X obj 42 347 outlet; +#X floatatom 42 241 5 0 0; +#X floatatom 91 241 5 0 0; +#X floatatom 140 241 5 0 0; +#X floatatom 189 241 5 0 0; +#X floatatom 238 241 5 0 0; +#X floatatom 287 241 5 0 0; +#X floatatom 336 241 5 0 0; +#X floatatom 385 241 5 0 0; +#X obj 88 33 inlet; +#X obj 88 109 fps 0; +#X floatatom 88 79 5 0 0; +#X obj 181 175 random 255; +#X obj 189 199 random 255; +#X obj 267 175 random 255; +#X obj 275 199 random 255; +#X obj 353 175 random 255; +#X obj 361 199 random 255; +#X obj 94 175 random 255; +#X obj 102 199 random 255; +#X obj 42 282 pack f f f f f f f f; +#X msg 42 318 colsteps \$1 \$2 \$3 \$4 \$5 \$6 \$7 \$8; +#X connect 1 0 20 0; +#X connect 2 0 20 1; +#X connect 3 0 20 2; +#X connect 4 0 20 3; +#X connect 5 0 20 4; +#X connect 6 0 20 5; +#X connect 7 0 20 6; +#X connect 8 0 20 7; +#X connect 9 0 11 0; +#X connect 10 0 12 0; +#X connect 10 0 13 0; +#X connect 10 0 14 0; +#X connect 10 0 15 0; +#X connect 10 0 16 0; +#X connect 10 0 17 0; +#X connect 10 0 18 0; +#X connect 10 0 19 0; +#X connect 11 0 10 0; +#X connect 12 0 3 0; +#X connect 13 0 4 0; +#X connect 14 0 5 0; +#X connect 15 0 6 0; +#X connect 16 0 7 0; +#X connect 17 0 8 0; +#X connect 18 0 1 0; +#X connect 19 0 2 0; +#X connect 20 0 21 0; +#X connect 21 0 0 0; +#X restore 520 391 pd realtime; +#X text 472 336 this is the real-time way; +#X floatatom 520 365 5 0 0; +#X msg 572 365 2; +#X obj 520 421 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1 +-1; +#X text 266 535 the example-filters are (C) Andrew Buckle.; +#X text 266 555 see Filters/README.TXT for more info.; +#X msg 262 62 head.avi; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 0 24 0; +#X connect 3 0 4 0; +#X connect 4 0 7 0; +#X connect 5 0 6 0; +#X connect 6 2 8 0; +#X connect 7 0 5 0; +#X connect 7 2 4 0; +#X connect 8 0 6 0; +#X connect 9 0 8 0; +#X connect 10 0 5 1; +#X connect 10 0 11 0; +#X connect 11 0 7 0; +#X connect 12 0 5 1; +#X connect 12 0 11 0; +#X connect 13 0 5 1; +#X connect 13 0 11 0; +#X connect 14 0 5 1; +#X connect 14 0 11 0; +#X connect 17 0 5 1; +#X connect 17 0 21 0; +#X connect 19 0 17 0; +#X connect 20 0 19 0; +#X connect 21 0 11 0; +#X connect 24 0 7 0; diff --git a/Patches/07 example-blending.pd b/Patches/07 example-blending.pd new file mode 100644 index 0000000..d11e887 --- /dev/null +++ b/Patches/07 example-blending.pd @@ -0,0 +1,57 @@ +#N canvas 5 47 1010 514 10; +#X obj 12 52 fs.main; +#X msg 10 23 6001; +#X msg 56 23 reset; +#X msg 210 190 597 + 108; +#X msg 495 188 815 + 109; +#X msg 343 365 696 + 342; +#X floatatom 227 272 4 0 0; +#X obj 150 273 fs.blend; +#X obj 235 38 fps 0; +#X floatatom 193 38 4 0 0; +#X msg 286 96 next \, bang; +#X msg 207 94 next \, bang; +#X obj 220 167 init; +#X obj 503 163 init; +#X obj 353 335 init; +#X text 166 419 note: fs.blend initializes this frame to flip_manual. +; +#X text 174 441 in manual mode \, you need to send "flip" to update +the display after changing the image. the default mode is "flip_auto". +; +#X text 239 246 blend amount \, 0 - 255; +#X text 682 44 drag and drop your videos here; +#X text 748 291 the result; +#X msg 299 290 127; +#X obj 236 65 t b b; +#X text 196 14 frame rate. start with something modest \, like 1; +#X obj 731 257 hsl 128 15 255 0 0 0 empty empty empty -2 -6 0 8 -262144 +-1 -1 0 1; +#X obj 21 189 fs.framed blending; +#X obj 306 187 fs.framed blending; +#X obj 150 363 fs.framed blending; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 0 24 0; +#X connect 4 0 25 0; +#X connect 5 0 26 0; +#X connect 6 0 7 2; +#X connect 7 0 26 0; +#X connect 8 0 21 0; +#X connect 9 0 8 0; +#X connect 10 0 25 0; +#X connect 11 0 24 0; +#X connect 12 0 3 0; +#X connect 13 0 4 0; +#X connect 14 0 5 0; +#X connect 14 0 20 0; +#X connect 20 0 6 0; +#X connect 21 0 11 0; +#X connect 21 1 10 0; +#X connect 23 0 6 0; +#X connect 24 0 7 0; +#X connect 24 2 3 0; +#X connect 25 0 7 1; +#X connect 25 2 4 0; +#X connect 26 2 5 0; diff --git a/Patches/08 example-masking.pd b/Patches/08 example-masking.pd new file mode 100644 index 0000000..8e546a6 --- /dev/null +++ b/Patches/08 example-masking.pd @@ -0,0 +1,66 @@ +#N canvas 50 107 926 549 10; +#X obj 9 33 fs.main; +#X msg 8 8 6001; +#X msg 45 8 reset; +#X msg 115 196 412 + 104; +#X msg 18 122 next \, bang; +#X obj 18 294 fs.mask; +#X msg 248 279 601 + 104; +#X obj 18 99 fps 0; +#X floatatom 18 76 4 0 0; +#X obj 199 332 fs.draw; +#X msg 199 308 rect \$1 \$2 \$3 \$4; +#X msg 211 230 mousetrack_1 \, mouserect_1; +#X msg 219 372 pen 0 0 0 \, brush 0 0 0; +#X obj 130 173 init; +#X msg 219 395 pen 255 255 255 \, brush 255 255 255; +#X obj 18 173 fs.framed masking; +#X obj 151 257 fs.framed masking; +#X obj 18 392 fs.framed masking; +#X obj 130 392 init; +#X obj 259 257 init; +#X obj 235 421 init; +#X text 359 372 click here to draw black to the mask; +#X text 435 394 draw white; +#X text 409 51 1) drag & drop a video here:; +#X text 598 51 2) draw rectanges to this frame:; +#X text 599 262 the result is...; +#X msg 115 417 601 + 313; +#X text 116 47 fs.mask -- copy with mask; +#X text 116 66 1st inlet: fs.frame to copy from; +#X text 116 81 2nd inlet: fs.frame of the mask; +#X text 134 95 outlet: output fs.frame; +#X msg 52 76 2; +#X obj 65 99 init; +#X msg 364 443 invert; +#X text 364 423 try inverting the mask..; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 0 15 0; +#X connect 4 0 15 0; +#X connect 5 0 17 0; +#X connect 6 0 16 0; +#X connect 7 0 4 0; +#X connect 8 0 7 0; +#X connect 9 0 16 0; +#X connect 10 0 9 0; +#X connect 11 0 16 0; +#X connect 12 0 9 0; +#X connect 13 0 3 0; +#X connect 14 0 9 0; +#X connect 15 0 5 0; +#X connect 15 2 3 0; +#X connect 16 0 5 1; +#X connect 16 1 10 0; +#X connect 16 2 6 0; +#X connect 17 2 26 0; +#X connect 18 0 26 0; +#X connect 19 0 6 0; +#X connect 19 0 11 0; +#X connect 19 0 16 0; +#X connect 20 0 14 0; +#X connect 26 0 17 0; +#X connect 31 0 8 0; +#X connect 32 0 31 0; +#X connect 33 0 16 0; diff --git a/Patches/09 example-sonogram.pd b/Patches/09 example-sonogram.pd new file mode 100644 index 0000000..5c99688 --- /dev/null +++ b/Patches/09 example-sonogram.pd @@ -0,0 +1,74 @@ +#N canvas 308 -3 605 676 12; +#X obj 13 40 fs.main; +#X msg 13 13 6001; +#X msg 64 12 reset; +#X obj 330 486 fs.sonogram; +#X msg 488 452 bang; +#X obj 488 419 fps 0; +#X floatatom 488 392 5 0 0; +#X msg 488 364 5; +#N canvas 0 0 608 408 play 0; +#X graph graph2 0 -1 114739 1 70 171 270 31; +#X array music 114740 float 0; +#X pop; +#X msg 341 137 read -resize \$1 music; +#X obj 341 168 soundfiler; +#X obj 333 70 inlet; +#X obj 341 103 symbol; +#X obj 193 242 phasor~ 1; +#X obj 203 290 *~; +#X obj 209 359 outlet~; +#X obj 203 320 tabread4~ music; +#X floatatom 193 213 5 0 0; +#X obj 92 214 osc~ 0.01; +#X obj 92 239 avg~; +#X connect 1 0 2 0; +#X connect 2 0 6 1; +#X connect 3 0 4 0; +#X connect 4 0 1 0; +#X connect 5 0 6 0; +#X connect 6 0 8 0; +#X connect 8 0 7 0; +#X connect 9 0 5 0; +#X connect 10 0 11 0; +#X connect 11 0 9 0; +#X restore 330 349 pd play; +#X msg 248 48 c:/fsrel/framestein/extract.wav; +#X obj 251 480 dac~; +#X msg 364 558 200x128 \, display 200x512; +#X floatatom 355 427 5 0 0; +#X obj 263 450 *~ 0.2; +#X text 348 403 amplify display; +#X obj 295 529 fs.framed example-sonogram 20+120; +#X msg 370 587 setbits 246; +#X msg 358 100 \; pd dsp 1; +#X obj 116 13 loadbang; +#X text 441 110 must be on ..; +#X text 453 332 start drawing; +#X text 242 23 correct path and click ..; +#X text 28 617 NOTE: fs.sonogram writes temporary files to your c:/. +; +#X text 77 636 modify fs.sonogram.pd for a proper temporary path.; +#X obj 330 451 *~ 4; +#X obj 479 592 init; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 0 15 0; +#X connect 4 0 3 1; +#X connect 5 0 4 0; +#X connect 6 0 5 0; +#X connect 7 0 6 0; +#X connect 8 0 13 0; +#X connect 8 0 24 0; +#X connect 9 0 8 0; +#X connect 11 0 15 0; +#X connect 12 0 24 1; +#X connect 13 0 10 0; +#X connect 13 0 10 0; +#X connect 13 0 10 1; +#X connect 16 0 15 0; +#X connect 18 0 2 0; +#X connect 24 0 3 0; +#X connect 25 0 11 0; +#X connect 25 0 16 0; diff --git a/Patches/10 example-waveformdisplay.pd b/Patches/10 example-waveformdisplay.pd new file mode 100644 index 0000000..f44763a --- /dev/null +++ b/Patches/10 example-waveformdisplay.pd @@ -0,0 +1,126 @@ +#N canvas 197 11 743 561 12; +#X obj 5 34 fs.main; +#X msg 5 7 6001; +#X msg 45 7 reset; +#X text 155 394 drag & drop a SOUND FILE to one of the frames above +...; +#X text 234 413 then make a selection with mouse; +#N canvas 0 0 1002 426 implementation 0; +#X obj 26 260 table snd; +#X obj 108 206 fs.event; +#X msg 108 234 read -resize \$1 snd; +#X obj 159 286 soundfiler; +#X obj 125 105 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 206 161 fs.waveform snd 512 256; +#X obj 197 101 fs.waveform snd 512 32; +#X obj 230 134 t b f; +#X floatatom 295 192 8 0 0; +#X floatatom 368 192 8 0 0; +#X text 288 230 selection in samples; +#N canvas 35 295 458 308 init 0; +#X obj 105 91 init; +#X obj 92 209 outlet; +#X obj 145 209 outlet; +#X msg 83 125 dock waveformd \, 118+105 \, bang; +#X msg 74 151 dock waveformd \, 118+138 \, bang; +#X connect 0 0 3 0; +#X connect 0 0 4 0; +#X connect 3 0 2 0; +#X connect 4 0 1 0; +#X restore 146 74 pd init; +#X msg 394 97 118 + 105; +#X msg 406 153 118 + 138; +#X obj 108 260 t b b a; +#X msg 128 286 0; +#X text 499 72 fs.waveform -- array display with range selection; +#X text 513 104 args: <array name> <width> <height>; +#X text 513 130 inlet 1: bang or command to fs.frame; +#X text 513 166 inlet 3: endpoint of display in samples; +#X text 513 148 inlet 2: startpoint of display in samples; +#X text 513 184 inlet 4: display selection in inverse (0 or 1); +#X text 513 217 outlets 1 & 2: first two outlets of the fs.frame inside +; +#X text 513 235 outlets 3 & 4: start and end of selected range in samples +; +#X text 513 254 outlet 5: third outlet of the fs.frame inside; +#N canvas 0 0 481 421 playselection 0; +#X obj 302 117 inlet; +#X obj 348 117 inlet; +#X obj 302 182 -; +#X obj 302 210 abs; +#X obj 94 185 *~; +#X obj 94 214 +~; +#X obj 94 151 phasor~; +#X obj 334 310 /; +#X obj 327 277 samplerate~; +#X obj 302 237 t f b f; +#X obj 94 245 tabread4~ snd; +#X obj 149 283 r vol; +#X obj 94 319 dac~; +#X obj 94 283 *~ 0.1; +#X obj 123 50 inlet; +#X text 74 24 mouseup from fs.event; +#X text 301 94 range; +#X obj 94 127 f; +#X obj 123 185 f; +#X obj 123 214 f; +#X connect 0 0 2 0; +#X connect 0 0 19 1; +#X connect 1 0 2 1; +#X connect 2 0 3 0; +#X connect 3 0 9 0; +#X connect 4 0 5 0; +#X connect 5 0 10 0; +#X connect 6 0 4 0; +#X connect 7 0 17 1; +#X connect 8 0 7 0; +#X connect 9 0 18 1; +#X connect 9 1 8 0; +#X connect 9 2 7 1; +#X connect 10 0 13 0; +#X connect 11 0 13 1; +#X connect 13 0 12 0; +#X connect 13 0 12 1; +#X connect 14 0 17 0; +#X connect 14 0 18 0; +#X connect 14 0 19 0; +#X connect 17 0 6 0; +#X connect 18 0 4 1; +#X connect 19 0 5 1; +#X restore 294 299 pd playselection; +#X text 195 353 Sorry about the mess..; +#X connect 1 0 2 0; +#X connect 1 2 25 0; +#X connect 2 0 14 0; +#X connect 4 0 6 0; +#X connect 5 0 1 0; +#X connect 5 2 8 0; +#X connect 5 2 25 1; +#X connect 5 3 9 0; +#X connect 5 3 25 2; +#X connect 5 4 13 0; +#X connect 6 0 1 0; +#X connect 6 2 7 0; +#X connect 6 3 5 2; +#X connect 6 4 12 0; +#X connect 7 0 5 0; +#X connect 7 1 5 1; +#X connect 11 0 5 0; +#X connect 11 1 6 0; +#X connect 14 0 6 0; +#X connect 14 0 5 0; +#X connect 14 1 15 0; +#X connect 14 2 3 0; +#X connect 15 0 6 1; +#X connect 15 0 6 2; +#X connect 15 0 5 1; +#X connect 15 0 5 2; +#X restore 252 475 pd implementation and docs; +#X obj 32 388 vsl 15 128 0 1 0 0 vol empty volume 0 -8 128 8 -262144 +-1 -1 7800 1; +#X msg 54 497 \; pd dsp 1; +#X text 57 472 play it ...; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; diff --git a/Patches/11 example-browser.pd b/Patches/11 example-browser.pd new file mode 100644 index 0000000..3e68922 --- /dev/null +++ b/Patches/11 example-browser.pd @@ -0,0 +1,30 @@ +#N canvas 335 300 661 349 12; +#X obj 11 37 fs.main; +#X obj 88 185 fs.browser; +#X msg 11 8 6001; +#X msg 62 8 reset; +#X obj 88 255 fs.frame; +#X msg 88 133 bang; +#X msg 190 82 1000x480; +#X obj 88 221 fs.copy; +#X msg 164 282 xbend 110 120; +#X floatatom 287 273 4 0 0; +#X obj 287 299 bangx; +#X msg 287 247 10; +#X text 54 110 click here; +#X obj 181 15 init; +#X msg 181 122 http://pinktwins.com; +#X connect 1 0 7 0; +#X connect 2 0 0 0; +#X connect 2 0 3 0; +#X connect 3 0 0 1; +#X connect 5 0 1 0; +#X connect 6 0 1 0; +#X connect 7 0 4 0; +#X connect 8 0 4 0; +#X connect 9 0 10 0; +#X connect 10 0 8 0; +#X connect 11 0 9 0; +#X connect 13 0 6 0; +#X connect 13 0 14 0; +#X connect 14 0 1 0; diff --git a/Patches/12 example-network.pd b/Patches/12 example-network.pd new file mode 100644 index 0000000..81490d1 --- /dev/null +++ b/Patches/12 example-network.pd @@ -0,0 +1,62 @@ +#N canvas 242 39 740 613 12; +#X obj 15 44 fs.main; +#X msg 15 14 6001; +#X msg 66 14 reset; +#X obj 108 221 fs.frame; +#X msg 143 113 buffer c:/fsrel/Framestein/Reija; +#X msg 207 179 next; +#X obj 82 520 fs.frame; +#X msg 29 481 receive hello; +#X text 162 511 use "receive <nametag>" on the receiving end to control +where your frames go.; +#X text 208 234 send <nametag> <jpeg quality>; +#X text 357 142 connect <address> <port>; +#X text 208 259 use "pure" as jpeg quality to send uncompressed frames. +this will take much more bandwidth but less cpu.; +#X msg 207 209 send hello 33; +#X msg 24 311 disconnect; +#X text 443 328 use send_auto to automate sending (send frame on each +flip); +#X msg 397 303 send_auto hello 33; +#X msg 397 328 next; +#X obj 336 465 fs.copy; +#X msg 347 440 bang; +#X msg 398 378 bang; +#X msg 398 465 source_random \, dest_random \, srcand; +#N canvas 519 266 380 369 test 0; +#X obj 110 209 outlet; +#X obj 113 54 inlet; +#X msg 122 87 bang; +#X obj 115 122 random 20; +#X obj 115 149 bangx; +#X connect 1 0 2 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 0 0; +#X restore 398 402 pd test; +#X msg 172 142 connect localhost 6010; +#X obj 29 454 reset; +#X obj 398 440 init; +#X text 414 112 correct this path; +#X text 139 37 -- Sending frames through network --; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 0 17 0; +#X connect 4 0 3 0; +#X connect 5 0 3 0; +#X connect 5 0 12 0; +#X connect 7 0 6 0; +#X connect 12 0 3 0; +#X connect 13 0 3 0; +#X connect 15 0 3 0; +#X connect 16 0 3 0; +#X connect 17 0 3 0; +#X connect 18 0 3 0; +#X connect 19 0 16 0; +#X connect 19 0 21 0; +#X connect 20 0 17 1; +#X connect 21 0 3 0; +#X connect 22 0 3 0; +#X connect 23 0 7 0; +#X connect 24 0 20 0; diff --git a/Patches/13 example-avioutput.pd b/Patches/13 example-avioutput.pd new file mode 100644 index 0000000..b7fad86 --- /dev/null +++ b/Patches/13 example-avioutput.pd @@ -0,0 +1,61 @@ +#N canvas 252 23 721 631 12; +#X obj 13 39 fs.main; +#X msg 13 12 6001; +#X msg 64 13 reset; +#X obj 247 147 fs.framed aviout; +#X msg 385 147 37 + 127; +#X msg 75 39 path c:/fsrel/framestein; +#X obj 282 204 fs.copy; +#X msg 385 190 source_random; +#X obj 385 59 init; +#X msg 247 102 head.avi \, flip_manual; +#X msg 502 127 next \, bang \, flip; +#X floatatom 521 76 5 0 0; +#X obj 247 178 t s s; +#X obj 502 103 fps 0; +#X msg 484 76 5; +#X obj 269 361 fs.avi; +#X floatatom 269 387 5 0 0; +#X text 326 388 # of frames saved; +#X msg 349 273 fps 10; +#X text 412 273 set frames per second; +#X obj 349 249 init; +#X msg 349 318 write; +#X text 400 318 apply compression and finish; +#X text 482 50 start writing!; +#X text 158 481 Bang fs.frame to fs.avi to save one frame of video +; +#X text 158 508 Finish it off with "write [filename.avi]"; +#X msg 434 220 xbend \$1; +#X floatatom 507 220 5 0 0; +#X msg 507 195 75; +#X msg 550 103 0; +#X text 584 102 stop; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 2 0 5 0; +#X connect 3 0 12 0; +#X connect 3 2 4 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 6 0 3 0; +#X connect 7 0 6 1; +#X connect 8 0 9 0; +#X connect 8 0 4 0; +#X connect 8 0 7 0; +#X connect 9 0 3 0; +#X connect 10 0 3 0; +#X connect 11 0 13 0; +#X connect 12 0 15 0; +#X connect 12 1 6 0; +#X connect 13 0 10 0; +#X connect 14 0 13 0; +#X connect 15 0 16 0; +#X connect 18 0 15 0; +#X connect 20 0 18 0; +#X connect 21 0 15 0; +#X connect 26 0 6 1; +#X connect 27 0 26 0; +#X connect 28 0 27 0; +#X connect 29 0 13 0; diff --git a/Patches/14 example-hist.pd b/Patches/14 example-hist.pd new file mode 100644 index 0000000..e9c378c --- /dev/null +++ b/Patches/14 example-hist.pd @@ -0,0 +1,46 @@ +#N canvas 276 11 723 503 12; +#X obj 243 98 videoscrub; +#X floatatom 230 39 5 0 0; +#X obj 279 40 play 0; +#X msg 332 40 mousetrack_1; +#X graph graph1 0 -1 255 1 498 164 698 24; +#X array red 256 float 0; +#X pop; +#X msg 212 11 bang; +#X obj 9 39 fs.main; +#X msg 9 13 6001; +#X msg 60 13 reset; +#X obj 212 70 fs.framed example-hist 11+97; +#X graph graph2 0 -1 255 1 498 311 698 171; +#X array green 256 float 0; +#X pop; +#X graph graph3 0 -1 255 1 498 459 698 319; +#X array blue 256 float 0; +#X pop; +#X obj 217 183 fs.hist 0 red; +#X obj 230 208 fs.hist 1 green; +#X obj 245 234 fs.hist 2 blue; +#X text 110 13 click reset; +#X text 6 271 drop your favorite videofile to the frame .. then scrub +it!; +#X text 6 442 NOTE: fs.hist writes temporary files to your c:/.; +#X text 55 461 modify fs.hist.pd for a proper temporary path.; +#X obj 332 14 init; +#X msg 243 127 HARMON.JPG; +#X connect 0 0 9 0; +#X connect 1 0 2 0; +#X connect 2 0 9 0; +#X connect 3 0 9 0; +#X connect 5 0 9 0; +#X connect 7 0 6 0; +#X connect 7 0 8 0; +#X connect 8 0 6 1; +#X connect 9 0 0 0; +#X connect 9 0 12 0; +#X connect 9 0 13 0; +#X connect 9 0 14 0; +#X connect 9 1 0 1; +#X connect 9 1 5 0; +#X connect 19 0 3 0; +#X connect 19 0 20 0; +#X connect 20 0 9 0; diff --git a/Patches/15 example-searchpath.pd b/Patches/15 example-searchpath.pd new file mode 100644 index 0000000..ed1bd25 --- /dev/null +++ b/Patches/15 example-searchpath.pd @@ -0,0 +1,28 @@ +#N canvas 309 76 603 483 12; +#X obj 16 42 fs.main; +#X msg 16 16 6001; +#X msg 67 16 reset; +#X obj 270 314 fs.framed searchpath; +#X msg 435 314 35 + 148; +#X msg 163 60 path /framestein \, path /fsrel/framestein; +#X text 162 32 use "path <dir>" to tell where to search for images +; +#X msg 276 186 harmon.jpg; +#X msg 296 216 virvezoom.jpg; +#X msg 311 247 yska320x240.jpg; +#X msg 259 159 head.avi; +#X text 68 380 The dir where Framestein.exe was started from is always +in the search path.; +#X obj 435 290 init; +#X text 260 131 .. to make it easy to load them:; +#X connect 1 0 0 0; +#X connect 1 0 2 0; +#X connect 2 0 0 1; +#X connect 3 2 4 0; +#X connect 4 0 3 0; +#X connect 5 0 0 1; +#X connect 7 0 3 0; +#X connect 8 0 3 0; +#X connect 9 0 3 0; +#X connect 10 0 3 0; +#X connect 12 0 4 0; diff --git a/Patches/README.txt b/Patches/README.txt new file mode 100644 index 0000000..0fa86fe --- /dev/null +++ b/Patches/README.txt @@ -0,0 +1 @@ +See externals-documentation.pd in this folder. diff --git a/Patches/arraysize.c b/Patches/arraysize.c new file mode 100644 index 0000000..3393e8f --- /dev/null +++ b/Patches/arraysize.c @@ -0,0 +1,44 @@ +#include <m_pd.h> + +static t_class *arraysize_class; + +typedef struct _arraysize { + t_object x_obj; + t_symbol *array_name; +} t_arraysize; + +void arraysize_set(t_arraysize *x, t_symbol *s) +{ + x->array_name = s; +} + +void arraysize_bang(t_arraysize *x) +{ + t_garray *garray; + + if(!(garray = (t_garray *)pd_findbyclass(x->array_name,garray_class))) { + pd_error(x, "%s: no such table", x->array_name->s_name); + } else { + outlet_float(x->x_obj.ob_outlet, garray_npoints(garray)); + } +} + +void *arraysize_new(t_symbol *s) +{ + t_arraysize *x = (t_arraysize *)pd_new(arraysize_class); + + outlet_new(&x->x_obj, gensym("float")); + + x->array_name = s; + + return (void *)x; +} + +void arraysize_setup(void) +{ + + arraysize_class = class_new(gensym("arraysize"), (t_newmethod)arraysize_new, 0, sizeof(t_arraysize), CLASS_DEFAULT, A_DEFSYMBOL, 0); + + class_addmethod(arraysize_class,arraysize_set,gensym("set"), A_DEFSYM, 0); + class_addbang(arraysize_class,arraysize_bang); +} diff --git a/Patches/arraysize.dll b/Patches/arraysize.dll Binary files differnew file mode 100644 index 0000000..ffa3c8f --- /dev/null +++ b/Patches/arraysize.dll diff --git a/Patches/arraysize.exp b/Patches/arraysize.exp Binary files differnew file mode 100644 index 0000000..6292542 --- /dev/null +++ b/Patches/arraysize.exp diff --git a/Patches/arraysize.lib b/Patches/arraysize.lib Binary files differnew file mode 100644 index 0000000..c0342cf --- /dev/null +++ b/Patches/arraysize.lib diff --git a/Patches/arraysize.obj b/Patches/arraysize.obj Binary files differnew file mode 100644 index 0000000..8c664e8 --- /dev/null +++ b/Patches/arraysize.obj diff --git a/Patches/bangx.pd b/Patches/bangx.pd new file mode 100644 index 0000000..2bd5f82 --- /dev/null +++ b/Patches/bangx.pd @@ -0,0 +1,10 @@ +#N canvas 286 240 264 239 12; +#X obj 42 89 until; +#X obj 42 61 f 1; +#X obj 42 32 inlet; +#X obj 42 152 outlet; +#X msg 42 118 bang; +#X connect 0 0 4 0; +#X connect 1 0 0 0; +#X connect 2 0 1 0; +#X connect 4 0 3 0; diff --git a/Patches/buildstr.c b/Patches/buildstr.c new file mode 100644 index 0000000..6ba6b15 --- /dev/null +++ b/Patches/buildstr.c @@ -0,0 +1,51 @@ +#include <m_pd.h> + +#define MAXLEN 500 + +static t_class *buildstr_class; + +typedef struct _buildstr { + t_object x_obj; + t_symbol s; + char buf[MAXLEN]; + int pos; +} t_buildstr; + +void buildstr_bang(t_buildstr *x) +{ + x->s.s_name = t_getbytes(strlen(x->buf)+1); + strcpy(x->s.s_name, x->buf); + outlet_symbol(x->x_obj.ob_outlet, &x->s); + t_freebytes(x->s.s_name, strlen(x->buf)+1); +} + +void buildstr_float(t_buildstr *x, t_float f) +{ + x->buf[x->pos] = (char)f; + x->pos++; + + if(f==0) + { + x->pos=0; + buildstr_bang(x); + } +} + +void *buildstr_new(t_symbol *s) +{ + t_buildstr *x = (t_buildstr *)pd_new(buildstr_class); + + x->pos = 0; + + outlet_new(&x->x_obj, gensym("symbol")); + + return (void *)x; +} + +void buildstr_setup(void) +{ + buildstr_class = class_new(gensym("buildstr"), (t_newmethod)buildstr_new, 0, sizeof(t_buildstr), CLASS_DEFAULT, A_DEFSYMBOL, 0); + + class_addbang(buildstr_class, buildstr_bang); + class_addfloat(buildstr_class, buildstr_float); +} diff --git a/Patches/buildstr.dll b/Patches/buildstr.dll Binary files differnew file mode 100644 index 0000000..92de6a3 --- /dev/null +++ b/Patches/buildstr.dll diff --git a/Patches/buildstr.exp b/Patches/buildstr.exp Binary files differnew file mode 100644 index 0000000..38c60e9 --- /dev/null +++ b/Patches/buildstr.exp diff --git a/Patches/buildstr.lib b/Patches/buildstr.lib Binary files differnew file mode 100644 index 0000000..d1aa14c --- /dev/null +++ b/Patches/buildstr.lib diff --git a/Patches/buildstr.obj b/Patches/buildstr.obj Binary files differnew file mode 100644 index 0000000..a916941 --- /dev/null +++ b/Patches/buildstr.obj diff --git a/Patches/count.pd b/Patches/count.pd new file mode 100644 index 0000000..a627e99 --- /dev/null +++ b/Patches/count.pd @@ -0,0 +1,17 @@ +#N canvas 0 0 454 304 10; +#X obj 170 53 inlet; +#X text 177 7 count to n; +#X obj 170 168 f; +#X obj 170 211 outlet; +#X obj 170 85 t f b; +#X obj 145 131 bangx; +#X obj 198 168 + 1; +#X msg 203 116 1; +#X connect 0 0 4 0; +#X connect 2 0 6 0; +#X connect 2 0 3 0; +#X connect 4 0 5 0; +#X connect 4 1 7 0; +#X connect 5 0 2 0; +#X connect 6 0 2 1; +#X connect 7 0 2 1; diff --git a/Patches/displaydepth.h b/Patches/displaydepth.h new file mode 100644 index 0000000..3df0471 --- /dev/null +++ b/Patches/displaydepth.h @@ -0,0 +1,19 @@ +#ifndef __DISPLAYDEPTH_H +#define __DISPLAYDEPTH_H + +#include "windows.h" + +int getdisplaydepth(void) +{ + DEVMODE dm; + + dm.dmSize = sizeof(DEVMODE); + dm.dmDriverExtra = 0; + + if(!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm)) + return(0); + + return(dm.dmBitsPerPel); +} + +#endif diff --git a/Patches/dllcall.h b/Patches/dllcall.h new file mode 100644 index 0000000..ab7b128 --- /dev/null +++ b/Patches/dllcall.h @@ -0,0 +1,46 @@ +#ifndef __DLLCALL_H +#define __DLLCALL_H + +#include "windows.h" + +void loadeffect(HMODULE *lib, FARPROC *proc, char *name) +{ + if(*lib) FreeLibrary(*lib); + + *lib = LoadLibrary(name); + if(!*lib) + { + post("loadeffect: failed to load %s", name); + return; + } + *proc = GetProcAddress(*lib, "perform_effect"); + if(!*proc) + { + post("loadeffect: failed to get perform_effect from %s", name); + FreeLibrary(*lib); + *lib=NULL; + return; + } +} + +void loadcopy(HMODULE *lib, FARPROC *proc, char *name) +{ + if(*lib) FreeLibrary(*lib); + + *lib = LoadLibrary(name); + if(!*lib) + { + post("loadcopy: failed to load %s", name); + return; + } + *proc = GetProcAddress(*lib, "perform_copy"); + if(!*proc) + { + post("loadcopy: failed to get perform_copy from %s", name); + FreeLibrary(*lib); + *lib=NULL; + return; + } +} + +#endif diff --git a/Patches/externals-documentation.pd b/Patches/externals-documentation.pd new file mode 100644 index 0000000..f065834 --- /dev/null +++ b/Patches/externals-documentation.pd @@ -0,0 +1,342 @@ +#N canvas 438 30 545 591 12; +#X text 21 21 Externals for video:; +#N canvas 148 3 734 663 vframe 0; +#X obj 34 275 fs.frame; +#X obj 55 377 vimport; +#X obj 221 427 fs.frame; +#X msg 244 398 320x240; +#X msg 253 178 bang; +#X text 302 176 set vframe to import to; +#X text 26 509 Connect vframe directly to fs.frame to display it with +a bang.; +#X msg 253 206 bang; +#X text 302 198 import image \, and bang vframe again to display it +; +#X obj 150 331 vframe 640 480; +#X msg 34 245 320x240 \, noize \, colortv; +#X text 17 14 vframe holds memory for a single image and is the basis +of Pure Data-externals-based image handling in Framestein.; +#X text 26 553 Here \, vframe is bigger (640x480) than the two fs.frames +(320x240). This is okay - as long as the fs.frames you import from +and to are of the same size \, the image will be right. If you import +to fs.frame of a different size than the fs.frame you imported from +-> garbage.; +#X text 17 109 vframe has no image loading and display functionality. +Images can be imported to and from fs.frame:; +#X msg 349 423 dock vframe \, 330+260; +#X text 16 59 Initialization arguments determine the width and height +of the image \, as in below. Defaults are 176 and 144; +#X obj 34 220 init; +#X obj 244 373 init; +#X connect 0 0 1 0; +#X connect 3 0 2 0; +#X connect 4 0 9 0; +#X connect 7 0 0 0; +#X connect 7 0 9 0; +#X connect 9 0 1 1; +#X connect 9 0 2 0; +#X connect 10 0 0 0; +#X connect 14 0 2 0; +#X connect 16 0 10 0; +#X connect 17 0 3 0; +#X restore 64 216 pd vframe; +#X obj 67 122 fs.main; +#X msg 67 86 6001; +#X text 160 215 basic image container; +#N canvas 256 206 618 418 vplugin 0; +#X obj 94 226 vframe; +#X obj 143 156 vplugin; +#X text 13 10 vframe can execute Framestein-plugins. vplugin has the +path to these plugins - open it up \, correct the path \, and try it. +; +#X msg 161 99 noize; +#X msg 218 99 colortv; +#X obj 94 286 fs.frame; +#X msg 201 240 dock vplugin \, 200+235; +#X connect 0 0 5 0; +#X connect 1 0 0 0; +#X connect 3 0 1 0; +#X connect 4 0 1 0; +#X connect 6 0 5 0; +#X restore 64 262 pd vplugin; +#X text 158 261 execute Framestein-plugins; +#N canvas 187 -3 640 677 vcopy 0; +#X obj 87 204 vcopy; +#X msg 240 145 tile \$1; +#X floatatom 240 116 5 0 0; +#X floatatom 240 176 5 0 0; +#X msg 240 201 xbend \$1; +#X obj 87 341 fs.frame; +#X obj 114 61 r vcopyexample; +#X obj 87 129 vref; +#X msg 87 98 bang; +#X floatatom 97 159 5 0 0; +#X msg 167 341 320x240; +#X obj 87 294 vframe 320 240; +#X msg 240 283 xbend \$1 \$2; +#X obj 240 258 pack f f; +#X floatatom 240 233 5 0 0; +#X floatatom 299 233 5 0 0; +#X msg 311 259 bang; +#X obj 386 201 random 320; +#X obj 386 227 random 320; +#X floatatom 386 113 5 0 0; +#X msg 118 379 dock vcopy \, 90+400; +#X text 17 9 Some plugins operate on two images. This is done with +vcopy:; +#X obj 167 315 init; +#X obj 386 139 fps 0.25; +#X connect 0 0 11 0; +#X connect 1 0 0 1; +#X connect 1 0 8 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 4 0 0 1; +#X connect 4 0 8 0; +#X connect 6 0 7 1; +#X connect 7 0 0 0; +#X connect 7 0 9 0; +#X connect 8 0 7 0; +#X connect 10 0 5 0; +#X connect 11 0 5 0; +#X connect 12 0 0 1; +#X connect 12 0 8 0; +#X connect 13 0 12 0; +#X connect 14 0 13 0; +#X connect 15 0 13 1; +#X connect 15 0 16 0; +#X connect 16 0 13 0; +#X connect 17 0 14 0; +#X connect 18 0 15 0; +#X connect 19 0 23 0; +#X connect 20 0 5 0; +#X connect 22 0 10 0; +#X connect 23 0 17 0; +#X connect 23 0 18 0; +#X restore 64 310 pd vcopy; +#X text 159 309 execute plugins that use two images; +#N canvas 148 7 833 572 vsig~ 0; +#X text 14 9 vsig~: convert image to signal; +#X obj 201 140 vframe; +#X obj 209 182 vsig~; +#X obj 209 446 vsnapshot~; +#X obj 257 185 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1 +-1; +#X obj 201 109 vplugin; +#X obj 284 413 vframe; +#X msg 201 75 noize \, colortv; +#X msg 378 99 \; pd dsp 1; +#X obj 209 485 fs.frame; +#X msg 284 387 bang; +#X text 402 204 - image signal; +#X text 403 228 - sync signal; +#X text 403 253 - bang when bottomright of image is reached; +#X text 383 302 vsnapshot~ inlets:; +#X text 382 180 vsig~ outlets:; +#X text 402 330 - image signal; +#X text 403 354 - sync signal; +#X text 403 380 - vframe to write image to; +#X obj 45 289 dac~; +#X floatatom 89 255 5 0 0; +#X text 83 289 sounds great!; +#X obj 45 255 *~ 0; +#X text 14 25 vsnapshot~: convert signal to image; +#X msg 273 102 black; +#X obj 44 370 osc~ 2; +#X obj 44 397 *~ 0; +#X floatatom 86 397 5 0 0; +#X text 100 372 looks great!; +#X floatatom 44 345 5 0 0; +#X msg 44 485 dock vsig~ \, 12+87; +#X obj 378 72 init; +#X obj 284 361 init; +#X connect 1 0 2 0; +#X connect 2 0 22 0; +#X connect 2 0 3 0; +#X connect 2 1 3 1; +#X connect 2 2 4 0; +#X connect 3 0 9 0; +#X connect 5 0 1 0; +#X connect 6 0 3 2; +#X connect 7 0 5 0; +#X connect 10 0 6 0; +#X connect 20 0 22 1; +#X connect 22 0 19 0; +#X connect 22 0 19 1; +#X connect 24 0 5 0; +#X connect 25 0 26 0; +#X connect 26 0 3 0; +#X connect 27 0 26 1; +#X connect 29 0 25 0; +#X connect 30 0 9 0; +#X connect 31 0 8 0; +#X connect 31 0 7 0; +#X connect 32 0 10 0; +#X restore 64 360 pd vsig~ and vsnapshot~; +#X text 161 392 convert image to signal and back; +#N canvas 239 28 735 584 vrgb~ 0; +#X obj 389 140 vframe 320 240; +#X obj 389 171 vsig~; +#X text 9 7 vrgb~: separate red \, green and blue channels; +#X obj 240 239 vimport; +#X obj 181 188 fs.frame; +#X obj 188 77 reset; +#X obj 188 102 t b b b; +#X msg 234 77 bang; +#X msg 277 77 \; pd dsp 1; +#X obj 435 174 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1 +-1; +#X obj 389 221 vrgb~; +#X obj 389 345 vsnapshot~; +#X obj 482 327 vframe 320 240; +#X obj 482 277 reset; +#X msg 482 302 bang; +#X obj 389 387 fs.frame; +#X msg 482 379 320x240; +#X obj 427 269 *~ 1; +#X obj 571 88 phasor~ 1; +#X obj 571 112 avg~; +#X obj 571 141 < 0.5; +#X obj 571 166 * -1; +#X obj 616 141 >= 0.5; +#X obj 616 166 * 1; +#X obj 571 191 +; +#X floatatom 571 216 5 0 0; +#X floatatom 571 63 5 0 0; +#X msg 367 429 dock vrgb~ \, 25+300; +#X obj 567 360 s vcopyexample; +#X obj 389 304 vcolor~; +#X obj 389 269 *~ 1; +#X text 8 26 vcolor~: merge red \, green and blue channels; +#X msg 41 152 yska320x240.jpg \, bang; +#X connect 0 0 1 0; +#X connect 0 0 3 1; +#X connect 1 0 10 0; +#X connect 1 1 11 1; +#X connect 1 2 9 0; +#X connect 4 0 3 0; +#X connect 5 0 6 0; +#X connect 5 0 7 0; +#X connect 6 0 0 0; +#X connect 6 1 32 0; +#X connect 6 2 0 0; +#X connect 7 0 6 0; +#X connect 7 0 8 0; +#X connect 7 0 6 0; +#X connect 10 0 30 0; +#X connect 10 1 17 0; +#X connect 11 0 15 0; +#X connect 12 0 11 2; +#X connect 12 0 28 0; +#X connect 13 0 14 0; +#X connect 14 0 12 0; +#X connect 14 0 16 0; +#X connect 16 0 15 0; +#X connect 17 0 29 1; +#X connect 18 0 19 0; +#X connect 19 0 22 0; +#X connect 19 0 20 0; +#X connect 20 0 21 0; +#X connect 21 0 24 0; +#X connect 22 0 23 0; +#X connect 23 0 24 1; +#X connect 24 0 25 0; +#X connect 25 0 17 1; +#X connect 25 0 30 1; +#X connect 26 0 18 0; +#X connect 27 0 15 0; +#X connect 29 0 11 0; +#X connect 30 0 29 0; +#X connect 32 0 4 0; +#X restore 64 440 pd vrgb~; +#X text 162 439 separate red \, green and blue channels; +#X text 159 144 ... click on "dock" on subpatches.; +#X msg 118 86 reset; +#X msg 339 82 minimizeall; +#X text 159 122 start by clicking reset... and minimizeall; +#N canvas 233 -13 700 660 vframeread~ 0; +#X text 11 7 vframeread~ uses a sync-signal to read the image:; +#X obj 212 308 vframe; +#X obj 161 337 vimport; +#X obj 71 297 fs.frame; +#X obj 71 326 fs.copy; +#X obj 71 353 fs.frame; +#X msg 212 280 bang; +#X obj 212 251 reset; +#X msg 71 116 dock vframeread~ \, 10+100; +#X text 13 47 drop a movie (.avi) here...; +#X text 82 96 click here; +#X obj 361 92 vframeread~; +#X obj 361 312 vsnapshot~; +#X obj 14 307 fps 5; +#X floatatom 53 427 5 0 0; +#X msg 81 270 next \, bang; +#X obj 361 372 fs.frame; +#X msg 361 469 dock vframeread~ \, 330+440; +#X text 380 445 click here; +#X obj 436 287 vframe; +#X obj 436 237 reset; +#X msg 436 262 bang; +#X obj 361 344 vref; +#X floatatom 482 130 5 0 0; +#X obj 482 159 phasor~ 1; +#X obj 491 259 vplugin; +#X msg 491 235 black; +#X text 107 426 set framerate; +#X msg 482 104 14.9; +#X obj 482 79 reset; +#X text 534 130 see how it's done; +#X text 17 595 This gives a better frame-rate \, compromizing the image +quality..; +#X obj 361 204 *~ 1; +#X floatatom 388 179 5 0 0; +#X msg 87 398 25; +#X msg 524 104 25.19; +#X msg 388 152 1; +#X msg 419 152 -1; +#X msg 53 398 15; +#X connect 1 0 2 1; +#X connect 1 0 11 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 5 0 2 0; +#X connect 6 0 1 0; +#X connect 6 0 5 0; +#X connect 7 0 6 0; +#X connect 8 0 3 0; +#X connect 11 0 32 0; +#X connect 12 0 22 1; +#X connect 13 0 15 0; +#X connect 13 0 5 0; +#X connect 13 0 22 0; +#X connect 14 0 13 0; +#X connect 15 0 3 0; +#X connect 17 0 16 0; +#X connect 19 0 12 2; +#X connect 20 0 21 0; +#X connect 21 0 19 0; +#X connect 22 0 16 0; +#X connect 23 0 24 0; +#X connect 23 0 26 0; +#X connect 24 0 12 1; +#X connect 24 0 11 0; +#X connect 25 0 19 0; +#X connect 26 0 25 0; +#X connect 28 0 23 0; +#X connect 29 0 28 0; +#X connect 32 0 12 0; +#X connect 33 0 32 1; +#X connect 34 0 14 0; +#X connect 35 0 23 0; +#X connect 36 0 33 0; +#X connect 37 0 33 0; +#X connect 38 0 14 0; +#X restore 64 487 pd vframeread~; +#X text 195 486 read image with a sync-signal; +#X obj 339 57 init; +#X text 65 530 vdrawarray is documented on example-vdrawarray.; +#X connect 3 0 2 0; +#X connect 3 0 14 0; +#X connect 14 0 2 1; +#X connect 15 0 2 1; +#X connect 19 0 15 0; diff --git a/Patches/fps.pd b/Patches/fps.pd new file mode 100644 index 0000000..3e61074 --- /dev/null +++ b/Patches/fps.pd @@ -0,0 +1,25 @@ +#N canvas 17 261 466 316 12; +#X obj 307 192 /; +#X obj 319 128 t b f; +#X obj 67 27 inlet; +#X msg 293 157 1000; +#X obj 87 222 outlet; +#X obj 87 112 metro 1000; +#X text 10 -1 sends bangs to make "frames per second"; +#X obj 226 62 float \$1; +#X obj 226 32 loadbang; +#X obj 307 218 abs; +#X obj 344 37 inlet; +#X text 354 61 "cold" inlet; +#X connect 0 0 9 0; +#X connect 1 0 3 0; +#X connect 1 1 0 1; +#X connect 2 0 1 0; +#X connect 2 0 5 0; +#X connect 3 0 0 0; +#X connect 5 0 4 0; +#X connect 7 0 1 0; +#X connect 7 0 5 0; +#X connect 8 0 7 0; +#X connect 9 0 5 1; +#X connect 10 0 1 0; diff --git a/Patches/fs.avi.pd b/Patches/fs.avi.pd new file mode 100644 index 0000000..909e4d9 --- /dev/null +++ b/Patches/fs.avi.pd @@ -0,0 +1,33 @@ +#N canvas 237 45 692 382 12; +#X obj 172 80 loadbang; +#X obj 126 275 fs_sender; +#X obj 51 27 inlet; +#X obj 51 55 l2s; +#X obj 51 102 pack s s; +#X obj 172 203 symbol; +#X obj 189 147 r fs_reset; +#X msg 189 172 bang; +#X text 287 28 commands:; +#X obj 172 110 symbol \$0A; +#X msg 172 228 avi \$1; +#X msg 51 137 \$2 \$1; +#X text 103 28 command; +#X text 318 56 fs.frame id to save one frame of video; +#X obj 59 310 r \$0Apos; +#X obj 59 340 outlet; +#X text 326 96 write <filename.avi> to write it out; +#X text 323 115 (without filename a dialog will pop); +#X text 330 161 "fps 10" to set frames per second.; +#X text 318 182 (only effective before adding frames); +#X connect 0 0 9 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 11 0; +#X connect 5 0 10 0; +#X connect 6 0 7 0; +#X connect 7 0 5 0; +#X connect 9 0 4 1; +#X connect 9 0 5 0; +#X connect 10 0 1 0; +#X connect 11 0 1 0; +#X connect 14 0 15 0; diff --git a/Patches/fs.blend.pd b/Patches/fs.blend.pd new file mode 100644 index 0000000..32ce7e0 --- /dev/null +++ b/Patches/fs.blend.pd @@ -0,0 +1,37 @@ +#N canvas 30 209 749 354 10; +#X obj 55 42 inlet; +#X obj 159 301 outlet; +#X obj 239 43 inlet; +#X obj 90 143 fs.copy; +#X obj 173 146 fs.copy; +#X obj 192 104 symbol; +#X obj 330 44 inlet; +#X msg 329 100 alpha \$1; +#X msg 289 176 127; +#X msg 286 215 flip_manual; +#X obj 346 174 init; +#X obj 63 91 t b s b; +#X msg 24 134 flip; +#X text 47 20 fs.frame; +#X text 229 19 fs.frame; +#X text 152 322 fs.frame; +#X text 314 21 blend amount; +#X text 447 21 fs.blend -- mix two images with parameter; +#X text 447 44 see example-blending.pd!; +#X obj 330 71 int; +#X connect 0 0 11 0; +#X connect 2 0 5 1; +#X connect 3 0 1 0; +#X connect 4 0 1 0; +#X connect 5 0 4 0; +#X connect 6 0 19 0; +#X connect 7 0 3 1; +#X connect 8 0 7 0; +#X connect 9 0 1 0; +#X connect 10 0 8 0; +#X connect 10 0 9 0; +#X connect 11 0 12 0; +#X connect 11 1 3 0; +#X connect 11 2 5 0; +#X connect 12 0 1 0; +#X connect 19 0 7 0; diff --git a/Patches/fs.browser.pd b/Patches/fs.browser.pd new file mode 100644 index 0000000..cac5233 --- /dev/null +++ b/Patches/fs.browser.pd @@ -0,0 +1,48 @@ +#N canvas 43 99 953 532 12; +#X obj 444 24 loadbang; +#X obj 276 380 fs_sender; +#X obj 76 25 inlet; +#X obj 76 55 route bang; +#X obj 76 91 symbol; +#X obj 151 111 route fs_op; +#X obj 151 153 pack s s s; +#X obj 76 125 outlet; +#X obj 276 193 l2s; +#X obj 276 226 pack s s; +#X msg 276 259 \$2 \$1; +#X text 450 149 inlet accepts:; +#X obj 444 91 symbol; +#X obj 538 83 r fs_reset; +#X msg 538 108 bang; +#X obj 444 54 symbol \$0fs.browser; +#X msg 444 119 browser \$1; +#X text 492 181 <url> or "open <url>"; +#X text 491 210 "refresh" "stop"; +#X text 491 240 "640x480" to set display size; +#X obj 461 327 r \$0fs.browserlink; +#X obj 461 380 symbol; +#X obj 461 406 outlet; +#X text 461 304 report clicked links starting with "fs:"; +#X obj 461 353 buildstr; +#X connect 0 0 15 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 3 1 5 0; +#X connect 4 0 7 0; +#X connect 5 0 6 0; +#X connect 5 1 8 0; +#X connect 6 0 1 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 1 0; +#X connect 12 0 16 0; +#X connect 13 0 14 0; +#X connect 14 0 12 0; +#X connect 15 0 4 1; +#X connect 15 0 6 2; +#X connect 15 0 9 1; +#X connect 15 0 12 0; +#X connect 16 0 1 0; +#X connect 20 0 24 0; +#X connect 21 0 22 0; +#X connect 24 0 21 0; diff --git a/Patches/fs.copy.pd b/Patches/fs.copy.pd new file mode 100644 index 0000000..8598ae9 --- /dev/null +++ b/Patches/fs.copy.pd @@ -0,0 +1,51 @@ +#N canvas 205 60 932 444 12; +#X obj 173 21 loadbang; +#X obj 208 271 fs_sender; +#X msg 173 204 copy \$1; +#X obj 352 14 inlet; +#X text 465 118 dest_all; +#X text 465 132 dest_random; +#X text 465 152 copy; +#X text 465 167 alpha <value>; +#X text 466 197 sub <value>; +#X text 465 183 add <value>; +#X text 466 62 source_all; +#X text 466 79 source_random; +#X obj 23 22 inlet; +#X obj 23 155 outlet; +#X obj 23 62 pack s s; +#X msg 23 95 fs_op \$2 \$1; +#X obj 352 156 pack s s; +#X msg 352 185 \$2 \$1; +#X obj 352 127 l2s; +#X text 466 47 source <left> <top> <right> <bottom>; +#X text 465 104 dest <left> <top> <right> <bottom>; +#X text 399 15 for these commands:; +#X obj 173 174 symbol; +#X obj 194 114 r fs_reset; +#X msg 194 140 bang; +#X text 467 267 blackness dstinvert mergecopy mergepaint notsrccopy +notsrcerase patcopy patinvert patpaint srcand srccopy srcerase srcinvert +srcpaint whiteness; +#X text 466 226 try these raster operations: (some of them do nothing) +; +#X text 468 329 transparent_0/1 mirrorleftright_0/1 mirrorupdown_0/1 +; +#X text 467 358 "plugin_name" (see example-plugins.pd); +#X obj 173 51 symbol \$0C; +#X text 467 389 "filter_name" (see example-photoshopfilters.pd); +#X connect 0 0 29 0; +#X connect 2 0 1 0; +#X connect 3 0 18 0; +#X connect 12 0 14 0; +#X connect 14 0 15 0; +#X connect 15 0 13 0; +#X connect 16 0 17 0; +#X connect 17 0 1 0; +#X connect 18 0 16 0; +#X connect 22 0 2 0; +#X connect 23 0 24 0; +#X connect 24 0 29 0; +#X connect 29 0 14 1; +#X connect 29 0 16 1; +#X connect 29 0 22 0; diff --git a/Patches/fs.draw.pd b/Patches/fs.draw.pd new file mode 100644 index 0000000..cc9ea77 --- /dev/null +++ b/Patches/fs.draw.pd @@ -0,0 +1,32 @@ +#N canvas 301 30 843 370 12; +#X obj 172 80 loadbang; +#X obj 126 275 fs_sender; +#X obj 51 27 inlet; +#X obj 51 55 l2s; +#X obj 51 102 pack s s; +#X msg 51 137 fs_op \$2 \$1; +#X obj 172 203 symbol; +#X obj 189 147 r fs_reset; +#X msg 189 172 bang; +#X text 100 28 command; +#X text 344 89 commands:; +#X text 363 123 rect <x1> <y1> <x2> <y2>; +#X msg 172 228 draw \$1; +#X obj 51 176 outlet; +#X text 362 143 line <x1> <y1> <x2> <y2>; +#X text 363 162 plot <x> <y>; +#X text 363 234 mode_solid mode_clear; +#X text 362 196 pen <r> <g> <b> (to set pen color); +#X text 362 215 brush <r> <g> <b> (to set brush color); +#X obj 172 110 symbol \$0D; +#X connect 0 0 19 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 5 0; +#X connect 5 0 13 0; +#X connect 6 0 12 0; +#X connect 7 0 8 0; +#X connect 8 0 6 0; +#X connect 12 0 1 0; +#X connect 19 0 4 1; +#X connect 19 0 6 0; diff --git a/Patches/fs.event.pd b/Patches/fs.event.pd new file mode 100644 index 0000000..fa56b61 --- /dev/null +++ b/Patches/fs.event.pd @@ -0,0 +1,30 @@ +#N canvas 381 52 466 526 12; +#X obj 37 50 inlet; +#X text 86 50 fs.frame 1st outlet; +#X obj 96 107 symbol \$0E; +#X obj 37 132 pack s s; +#X obj 96 83 loadbang; +#X msg 37 166 \; \$1event \$2; +#X obj 323 373 r \$0Emouseup; +#X obj 323 459 outlet; +#X obj 38 460 outlet; +#X text 323 350 report mouseup; +#X obj 169 461 outlet; +#X text 168 350 report mousedown; +#X obj 169 375 r \$0Emousedown; +#X text 16 13 fs.event - events from fs.frame; +#X text 38 334 report drag&drop filename; +#X obj 38 374 r \$0Efile; +#X obj 38 431 symbol; +#X msg 169 430 bang; +#X msg 323 428 bang; +#X connect 0 0 3 0; +#X connect 2 0 3 1; +#X connect 3 0 5 0; +#X connect 4 0 2 0; +#X connect 6 0 18 0; +#X connect 12 0 17 0; +#X connect 15 0 16 0; +#X connect 16 0 8 0; +#X connect 17 0 10 0; +#X connect 18 0 7 0; diff --git a/Patches/fs.film.pd b/Patches/fs.film.pd new file mode 100644 index 0000000..84d64e8 --- /dev/null +++ b/Patches/fs.film.pd @@ -0,0 +1,47 @@ +#N canvas 31 111 536 458 12; +#X obj 121 289 fs.frame; +#X obj 323 218 reset; +#X msg 323 246 hide; +#X obj 28 31 inlet; +#X obj 121 374 outlet; +#X obj 180 374 outlet; +#X obj 25 332 fs.info; +#X msg 247 211 bang; +#X obj 28 68 route open start stop; +#X obj 28 128 openpanel; +#X msg 56 156 bang; +#X msg 221 129 bang; +#X msg 273 128 0; +#X obj 234 182 play 0; +#X msg 209 69 bang; +#X obj 221 154 int; +#X floatatom 42 360 5 0 0; +#X msg 28 103 bang; +#X obj 121 331 symbol; +#X floatatom 318 154 5 0 0; +#X connect 0 0 6 0; +#X connect 0 0 18 1; +#X connect 0 1 5 0; +#X connect 1 0 2 0; +#X connect 2 0 0 0; +#X connect 3 0 8 0; +#X connect 6 3 15 1; +#X connect 6 3 16 0; +#X connect 7 0 18 0; +#X connect 8 0 17 0; +#X connect 8 1 11 0; +#X connect 8 2 12 0; +#X connect 8 3 0 0; +#X connect 8 3 14 0; +#X connect 9 0 0 0; +#X connect 9 0 10 0; +#X connect 10 0 0 0; +#X connect 11 0 15 0; +#X connect 12 0 13 0; +#X connect 13 0 0 0; +#X connect 13 0 7 0; +#X connect 14 0 0 0; +#X connect 15 0 13 0; +#X connect 17 0 9 0; +#X connect 18 0 4 0; +#X connect 19 0 13 0; diff --git a/Patches/fs.frame.pd b/Patches/fs.frame.pd new file mode 100644 index 0000000..bac2004 --- /dev/null +++ b/Patches/fs.frame.pd @@ -0,0 +1,137 @@ +#N canvas 19 -3 1010 686 12; +#X msg 444 119 frame \$1; +#X obj 276 355 fs_sender; +#X obj 76 25 inlet; +#X obj 76 145 symbol; +#X obj 151 126 route fs_op; +#X obj 151 168 pack s s s; +#X obj 76 192 outlet; +#X obj 276 193 l2s; +#X obj 276 226 pack s s; +#X msg 276 259 \$2 \$1; +#X text 468 227 "next" "prev" "random" "seek <number>" to show frames +in video or buffered images.; +#X text 469 264 "clear" to flush buffered images.; +#X text 468 300 "flip_auto" "flip_manual" "flip" controls how the display +should reflect changes in the image.; +#X text 468 343 "320x240" to set image size "100+100" to set frame +position "display 600x450" to set display size; +#X text 469 382 "borders_0" "borders_1" "stayontop_0"/1 "mute_0"/1 +\, also right-click the image for display options.; +#X text 450 149 inlet accepts:; +#X obj 444 91 symbol; +#X text 469 428 "save <directory> <"bmp" or number for jpeg quality>" +save image in directory under name fs000001 \, fs000002 ...; +#X text 467 470 "plugin_name" (see example-plugins.pd); +#X text 471 494 mousetrack_1 and mousetrack_0 to report mouse x \, +y thru second outlet; +#X msg 19 295 bang; +#X text 27 244 drag&drop will bang; +#X obj 275 482 outlet; +#X text 471 530 mouserect_1 and mouserect_0 to report dragged rectangle +; +#X obj 444 24 reset; +#X obj 76 55 route bang float; +#X msg 137 98 vf2fs \$1; +#N canvas 0 0 646 581 report 0; +#X obj 54 94 pack f f; +#X obj 88 248 pack f f f f; +#X text 58 17 report mouse x \, y; +#X text 88 130 report mouse rect; +#X text 115 297 report moving the window; +#X obj 15 522 outlet; +#X obj 126 382 pack f f; +#X msg 126 411 set \$1 + \$2; +#X obj 54 39 r \$0Fx; +#X obj 61 63 r \$0Fy; +#X obj 84 151 r \$0Fx1; +#X obj 84 175 r \$0Fy1; +#X obj 84 198 r \$0Fx2; +#X obj 85 222 r \$0Fy2; +#X obj 142 324 r \$0Fwinx; +#X obj 142 348 r \$0Fwiny; +#X obj 68 522 outlet; +#X obj 383 101 pack f s; +#X obj 497 57 r \$0Fevent; +#X obj 453 101 symbol; +#X text 383 164 report mouseup; +#X obj 383 187 r \$0Fmouseup; +#X obj 383 248 pack f s; +#X obj 497 204 r \$0Fevent; +#X msg 383 275 \; \$2mouseup \$1; +#X obj 453 248 symbol; +#X text 383 17 report mousedown; +#X msg 383 128 \; \$2mousedown \$1; +#X obj 383 40 r \$0Fmousedown; +#X text 384 341 report drag&drop filename; +#X obj 384 366 r \$0Ffile; +#X obj 384 419 buildstr; +#X obj 384 456 pack s s; +#X obj 493 412 r \$0Fevent; +#X obj 454 456 symbol; +#X msg 384 487 \; \$2file \$1; +#X obj 384 392 f; +#X connect 0 0 5 0; +#X connect 1 0 5 0; +#X connect 6 0 7 0; +#X connect 7 0 16 0; +#X connect 8 0 0 0; +#X connect 9 0 0 1; +#X connect 10 0 1 0; +#X connect 11 0 1 1; +#X connect 12 0 1 2; +#X connect 13 0 1 3; +#X connect 14 0 6 0; +#X connect 15 0 6 1; +#X connect 17 0 27 0; +#X connect 18 0 19 0; +#X connect 19 0 17 1; +#X connect 21 0 22 0; +#X connect 22 0 24 0; +#X connect 23 0 25 0; +#X connect 25 0 22 1; +#X connect 28 0 17 0; +#X connect 30 0 36 0; +#X connect 31 0 32 0; +#X connect 32 0 35 0; +#X connect 33 0 34 0; +#X connect 34 0 32 1; +#X connect 36 0 31 0; +#X restore 275 440 pd report; +#X obj 444 54 symbol \$0F; +#X obj 140 25 r \$0Finlet; +#X obj 19 269 r \$0Fbang; +#X obj 327 482 outlet; +#X text 472 575 minimize \, maximize \, bringtofront; +#X text 471 553 bufferize will copy the current image to image buffer +; +#X text 471 600 hidecursor_1 \, hidecursor_0; +#X text 470 622 use "directory" - like buffer \, without buffering +(load on demand); +#X text 468 190 "buffer <filename(.bmp .jpg)>" to load to memory; +#X text 469 171 filename to load and display (.avi .bmp .jpg); +#X text 468 208 "buffer <directory>" to load all images in dir; +#X connect 0 0 1 0; +#X connect 2 0 25 0; +#X connect 3 0 6 0; +#X connect 4 0 5 0; +#X connect 4 1 7 0; +#X connect 5 0 1 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 1 0; +#X connect 16 0 0 0; +#X connect 20 0 3 0; +#X connect 24 0 28 0; +#X connect 25 0 3 0; +#X connect 25 1 26 0; +#X connect 25 2 4 0; +#X connect 26 0 4 0; +#X connect 27 0 22 0; +#X connect 27 1 31 0; +#X connect 28 0 3 1; +#X connect 28 0 5 2; +#X connect 28 0 8 1; +#X connect 28 0 16 0; +#X connect 29 0 25 0; +#X connect 30 0 20 0; diff --git a/Patches/fs.framed.pd b/Patches/fs.framed.pd new file mode 100644 index 0000000..14c4fb4 --- /dev/null +++ b/Patches/fs.framed.pd @@ -0,0 +1,24 @@ +#N canvas 61 76 511 375 12; +#X obj 92 199 fs.frame; +#X obj 263 129 symbol \$1; +#X obj 92 91 inlet; +#X obj 92 291 outlet; +#X msg 263 155 dock \$1; +#X text 9 5 fs.framed - docked fs.frame; +#X obj 151 291 outlet; +#X obj 186 129 symbol \$2; +#X obj 186 93 t b b; +#X obj 209 291 outlet; +#X obj 186 68 reset; +#X text 35 30 usage: fs.framed <substring of windowtitle> <position> +; +#X connect 0 0 3 0; +#X connect 0 1 6 0; +#X connect 0 2 9 0; +#X connect 1 0 4 0; +#X connect 2 0 0 0; +#X connect 4 0 0 0; +#X connect 7 0 0 0; +#X connect 8 0 7 0; +#X connect 8 1 1 0; +#X connect 10 0 8 0; diff --git a/Patches/fs.fx.pd b/Patches/fs.fx.pd new file mode 100644 index 0000000..f6bedc2 --- /dev/null +++ b/Patches/fs.fx.pd @@ -0,0 +1,21 @@ +#N canvas 275 32 645 476 12; +#X obj 22 171 outlet; +#X obj 22 138 inlet; +#X text 114 91 - effects:; +#X text 130 115 mosaic <value>; +#X text 129 265 saturation <value>; +#X text 129 290 addition <r> <g> <b>; +#X text 130 313 gamma <r> <g> <b>; +#X text 130 337 contrast <r> <g> <b>; +#X text 130 361 lightness <r> <g> <b>; +#X text 130 235 without parameters: invert \, soft \, sharp \, emboss +; +#X text 129 139 rotate <degrees counterwise>; +#X text 130 163 rotozoom <degrees counterwise> <zoom val (65536=none)> +; +#X text 130 190 "smooth_1" and "smooth_0" sets smoothing on/off for +rotate and rotozoom (default is on).; +#X text 9 34 (you can send these commands directly to fs.frame \, but +using fs.fx might make your patches more clear); +#X text 10 6 Yeah \, quite an abstraction!; +#X connect 1 0 0 0; diff --git a/Patches/fs.hist.pd b/Patches/fs.hist.pd new file mode 100644 index 0000000..93f875f --- /dev/null +++ b/Patches/fs.hist.pd @@ -0,0 +1,39 @@ +#N canvas 283 252 725 432 12; +#X text 13 9 fs.hist - an array of 256 elements \, where x = intensity +and y = number of colors with that intensity; +#X obj 40 70 inlet; +#X obj 40 148 pack s f s s; +#X obj 252 135 reset; +#X obj 252 161 symbol \$0hist; +#X obj 227 69 inlet; +#X text 277 70 0=red 1=green 2=blue; +#X text 94 70 fs.frame; +#X obj 252 193 makefilename c:/%s; +#X text 249 223 if you run pd and fs on separate machines \, you need +a mapped network drive to pass the data. sorry.; +#X obj 111 248 r \$0histbang; +#X msg 111 273 bang; +#X obj 40 209 fs_sender; +#X msg 40 180 \$1 hist \$2 \$3 \$4bang; +#X obj 227 96 float \$1; +#X obj 213 298 symbol \$2; +#X obj 111 304 pack f s s; +#X msg 111 348 \; \$2 read16 \$3; +#X text 220 357 2nd arg must be name of table with 256 elements.; +#X text 383 170 change c:/ to some temp-directory..; +#X connect 1 0 2 0; +#X connect 2 0 13 0; +#X connect 3 0 4 0; +#X connect 3 0 14 0; +#X connect 3 0 15 0; +#X connect 4 0 2 3; +#X connect 4 0 8 0; +#X connect 5 0 2 1; +#X connect 8 0 2 2; +#X connect 8 0 16 2; +#X connect 10 0 11 0; +#X connect 11 0 16 0; +#X connect 13 0 12 0; +#X connect 14 0 2 1; +#X connect 15 0 16 1; +#X connect 16 0 17 0; diff --git a/Patches/fs.info.pd b/Patches/fs.info.pd new file mode 100644 index 0000000..0eeb1e1 --- /dev/null +++ b/Patches/fs.info.pd @@ -0,0 +1,33 @@ +#N canvas 19 200 713 421 12; +#X obj 49 37 inlet; +#X obj 46 348 outlet; +#X obj 256 114 symbol; +#X msg 256 142 info \$1; +#X obj 49 124 pack s s; +#X text 14 7 connection from fs.frame; +#X obj 49 219 fs_sender; +#X obj 181 344 outlet; +#X obj 324 340 outlet; +#X msg 49 190 \$2 \$1 \$2width \$2height \$2framecount \$2framerate +; +#X obj 499 339 outlet; +#X obj 256 69 symbol \$0I; +#X obj 46 283 r \$0Iwidth; +#X obj 181 283 r \$0Iheight; +#X obj 324 283 r \$0Iframecount; +#X obj 499 283 r \$0Iframerate; +#X obj 256 39 reset; +#X text 47 258 report frame width \, height \, video framecount and +framerate:; +#X connect 0 0 4 0; +#X connect 2 0 3 0; +#X connect 3 0 6 0; +#X connect 4 0 9 0; +#X connect 9 0 6 0; +#X connect 11 0 2 0; +#X connect 11 0 4 1; +#X connect 12 0 1 0; +#X connect 13 0 7 0; +#X connect 14 0 8 0; +#X connect 15 0 10 0; +#X connect 16 0 11 0; diff --git a/Patches/fs.main.pd b/Patches/fs.main.pd new file mode 100644 index 0000000..845121d --- /dev/null +++ b/Patches/fs.main.pd @@ -0,0 +1,52 @@ +#N canvas 278 0 700 494 12; +#X obj 27 293 netsend; +#X floatatom 27 322 4 0 0; +#X obj 207 160 loadbang; +#X msg 206 254 disconnect; +#X msg 27 253 send \$1; +#X obj 27 203 r fs_main; +#X msg 207 185 6001; +#X obj 127 128 inlet; +#X text 175 126 port; +#X obj 127 170 t f b; +#X text 9 30 only one fs.main at a time \,; +#X text 9 46 or your commands will be doubled.; +#X obj 393 42 inlet; +#X text 439 42 reset; +#X obj 393 132 t b b; +#X msg 428 158 send reset; +#X obj 157 382 pack s f; +#X floatatom 272 378 4 0 0; +#X text 10 7 fs.main - handles communication with Framestein.; +#X msg 157 411 \; \$1 \$2; +#X text 149 291 you can run framestein and the control-patches on separate +machines by changing "localhost" to "your.windows.slave" above and +configuring fs likewise (right-click fs).; +#X msg 393 199 \; fs_reset bang; +#X obj 393 78 route reset; +#X obj 476 114 fs_sender; +#X obj 157 353 netreceive 6002; +#X msg 207 225 connect localhost \$1; +#X obj 408 385 r symbolmousedown; +#X obj 408 408 r symbolmouseup; +#X text 404 364 ignore some errors; +#X obj 408 431 r symbolfile; +#X connect 0 0 1 0; +#X connect 2 0 6 0; +#X connect 3 0 0 0; +#X connect 4 0 0 0; +#X connect 5 0 4 0; +#X connect 6 0 25 0; +#X connect 7 0 9 0; +#X connect 9 0 25 0; +#X connect 9 1 3 0; +#X connect 12 0 22 0; +#X connect 14 0 21 0; +#X connect 14 1 15 0; +#X connect 15 0 0 0; +#X connect 16 0 19 0; +#X connect 22 0 14 0; +#X connect 22 1 23 0; +#X connect 24 0 16 0; +#X connect 24 1 17 0; +#X connect 25 0 0 0; diff --git a/Patches/fs.mask.pd b/Patches/fs.mask.pd new file mode 100644 index 0000000..b17dee9 --- /dev/null +++ b/Patches/fs.mask.pd @@ -0,0 +1,39 @@ +#N canvas 484 206 513 402 10; +#X obj 33 22 inlet; +#X obj 51 200 fs.copy; +#X obj 51 351 outlet; +#X obj 115 22 inlet; +#X msg 142 166 srcand; +#X obj 51 249 fs.frame; +#X obj 51 158 symbol; +#X obj 73 116 fs.copy; +#X obj 51 287 fs.copy; +#X obj 33 79 t b b s; +#X obj 180 132 init; +#X msg 157 190 transparent_1; +#X msg 168 218 mute_1 \, hide; +#X msg 168 244 mute_0 \, show; +#X text 223 42 fs.mask -- copy with mask; +#X text 223 61 1st inlet: fs.frame to copy from; +#X text 223 76 2nd inlet: fs.frame of the mask; +#X text 241 106 outlet: output fs.frame; +#X obj 165 22 inlet; +#X text 223 91 3rd inlet: commands to the internal fs.frame; +#X connect 0 0 9 0; +#X connect 1 0 5 0; +#X connect 3 0 6 1; +#X connect 4 0 1 1; +#X connect 5 0 8 0; +#X connect 6 0 1 0; +#X connect 7 0 5 0; +#X connect 8 0 2 0; +#X connect 9 0 5 0; +#X connect 9 1 6 0; +#X connect 9 2 7 0; +#X connect 10 0 4 0; +#X connect 10 0 11 0; +#X connect 10 0 12 0; +#X connect 11 0 8 1; +#X connect 12 0 5 0; +#X connect 13 0 5 0; +#X connect 18 0 5 0; diff --git a/Patches/fs.rgb.pd b/Patches/fs.rgb.pd new file mode 100644 index 0000000..164085c --- /dev/null +++ b/Patches/fs.rgb.pd @@ -0,0 +1,31 @@ +#N canvas 46 193 827 465 12; +#X obj 53 97 inlet; +#X obj 54 386 outlet; +#X text 26 414 outputs red \, green and blue; +#X text 21 61 connection from fs.frame | x and y packed; +#X obj 244 95 inlet; +#X obj 53 241 fs_sender; +#X text 159 187 tell plugin where to send results!; +#X obj 77 343 pack f f f; +#X obj 339 150 symbol \$0rgb; +#X obj 77 310 r \$0rgbred; +#X obj 162 310 r \$0rgbgreen; +#X obj 263 310 r \$0rgbblue; +#X obj 53 164 pack s f f s; +#X msg 53 209 \$1 rgb \$2 \$3 \$4red \$4green \$4blue; +#X obj 122 132 unpack f f; +#X obj 339 126 reset; +#X text 23 16 fs.rgb -- output red \, green and blue from a given position. +; +#X connect 0 0 12 0; +#X connect 4 0 14 0; +#X connect 7 0 1 0; +#X connect 8 0 12 3; +#X connect 9 0 7 0; +#X connect 10 0 7 1; +#X connect 11 0 7 2; +#X connect 12 0 13 0; +#X connect 13 0 5 0; +#X connect 14 0 12 1; +#X connect 14 1 12 2; +#X connect 15 0 8 0; diff --git a/Patches/fs.sonogram.pd b/Patches/fs.sonogram.pd new file mode 100644 index 0000000..543e91e --- /dev/null +++ b/Patches/fs.sonogram.pd @@ -0,0 +1,63 @@ +#N canvas 143 280 484 334 12; +#X msg 188 80 bang; +#X obj 28 47 inlet~; +#X text 86 48 sound data; +#X obj 188 48 inlet; +#X text 243 49 bang to get sonogram; +#X obj 70 225 outlet; +#X text 134 224 to fs.frame; +#N canvas 211 133 544 441 writesono 0; +#X obj 46 48 inlet~; +#X obj 144 50 inlet; +#X obj 46 78 rfft~; +#X obj 46 111 *~; +#X obj 77 111 *~; +#X obj 46 141 sqrt~; +#X obj 382 17 block~ 1024 1; +#X obj 218 309 table \$0spectrum; +#X obj 46 187 tabwrite~ \$0spectrum; +#X obj 67 359 outlet; +#X obj 144 92 t b b b; +#X msg 99 308 sonogram \$1; +#X obj 218 241 symbol; +#X msg 301 51 bang; +#X obj 301 24 reset; +#X obj 99 241 symbol; +#X obj 301 106 makefilename c:/%s; +#X obj 301 77 symbol \$0sono; +#X msg 317 363 resize 128; +#X obj 366 333 reset; +#X msg 317 389 bounds 0 0 128 500; +#X msg 218 276 write \$1; +#X text 365 130 maybe c:/temp/?; +#X obj 291 276 s \$0spectrum; +#X connect 0 0 2 0; +#X connect 1 0 10 0; +#X connect 2 0 3 0; +#X connect 2 0 3 1; +#X connect 2 1 4 0; +#X connect 2 1 4 1; +#X connect 3 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 10 0 15 0; +#X connect 10 1 12 0; +#X connect 10 2 8 0; +#X connect 11 0 9 0; +#X connect 12 0 21 0; +#X connect 13 0 17 0; +#X connect 14 0 13 0; +#X connect 15 0 11 0; +#X connect 16 0 12 1; +#X connect 16 0 15 1; +#X connect 17 0 16 0; +#X connect 18 0 23 0; +#X connect 19 0 18 0; +#X connect 19 0 20 0; +#X connect 20 0 23 0; +#X connect 21 0 23 0; +#X restore 78 151 pd writesono; +#X connect 0 0 7 1; +#X connect 1 0 7 0; +#X connect 3 0 0 0; +#X connect 7 0 5 0; diff --git a/Patches/fs.text.pd b/Patches/fs.text.pd new file mode 100644 index 0000000..d666c99 --- /dev/null +++ b/Patches/fs.text.pd @@ -0,0 +1,29 @@ +#N canvas 90 92 825 352 12; +#X obj 172 80 loadbang; +#X obj 126 275 fs_sender; +#X obj 51 27 inlet; +#X msg 172 228 text \$1; +#X obj 172 110 symbol \$0fs.text; +#X obj 51 55 l2s; +#X obj 51 102 pack s s; +#X msg 51 137 fs_op \$2 \$1; +#X obj 51 175 outlet; +#X obj 172 203 symbol; +#X obj 189 147 r fs_reset; +#X msg 189 172 bang; +#X text 100 28 text to write \, or one of these commands:; +#X text 430 95 size <number>; +#X text 430 117 font <font name> (look in your /winnt/fonts-dir); +#X text 429 141 pos <x> <y>; +#X text 430 73 color <r> <g> <b>; +#X connect 0 0 4 0; +#X connect 2 0 5 0; +#X connect 3 0 1 0; +#X connect 4 0 6 1; +#X connect 4 0 9 0; +#X connect 5 0 6 0; +#X connect 6 0 7 0; +#X connect 7 0 8 0; +#X connect 9 0 3 0; +#X connect 10 0 11 0; +#X connect 11 0 9 0; diff --git a/Patches/fs.waveform.pd b/Patches/fs.waveform.pd new file mode 100644 index 0000000..1b6d39a --- /dev/null +++ b/Patches/fs.waveform.pd @@ -0,0 +1,146 @@ +#N canvas 107 0 702 664 12; +#X obj 75 360 fs.frame; +#X obj 40 130 inlet; +#X obj 27 588 outlet; +#X obj 215 587 outlet; +#X obj 126 129 inlet; +#X obj 270 283 init; +#X obj 408 586 outlet; +#X obj 107 326 vdrawarray \$1; +#X obj 107 295 vframe \$2 \$3; +#X text 10 50 args: <array name> <width> <height>; +#X obj 270 340 f \$2; +#X obj 306 340 f \$3; +#X obj 270 368 pack f f; +#X obj 270 310 t b b b; +#X obj 40 174 route bang; +#X obj 110 395 fs.waveselection; +#X obj 171 370 spigot; +#X obj 330 161 loadbang; +#X msg 330 186 1; +#X obj 310 128 inlet; +#X text 309 105 show selection (0 / 1); +#X text 215 612 selection in samples; +#X text 410 610 fs.frame position; +#X msg 270 395 \$1 x \$2 \, mousetrack_1 \, mouserect_1 \, flip_manual +; +#X msg 33 360 flip; +#X text 11 69 note that the fs.frame here is in flip_manual-mode; +#X text 9 5 fs.waveform - wrapper to display array in fs.frame with +selection features; +#X text 39 104 bang; +#N canvas 147 197 699 425 samples 0; +#X obj 120 50 inlet; +#X obj 172 50 inlet; +#X obj 148 324 outlet; +#X obj 202 324 outlet; +#X obj 102 153 fs.info; +#X obj 172 216 /; +#X obj 172 123 unpack f f f f; +#X obj 202 216 /; +#X obj 202 244 *; +#X obj 172 244 *; +#X obj 256 194 arraysize \$1; +#X obj 302 139 init; +#X msg 302 164 bang; +#X obj 270 52 inlet; +#X text 120 24 fs.frame; +#X text 268 24 reset to arraysize; +#X text 447 24 offsets in samples; +#X obj 452 50 inlet; +#X obj 500 50 inlet; +#X obj 481 124 -; +#X obj 481 149 abs; +#X obj 172 273 + 0; +#X obj 202 273 + 0; +#X obj 339 80 f; +#X obj 500 85 t f f; +#X obj 430 85 t b f f; +#X obj 339 108 sel 0; +#X msg 302 236 0; +#X connect 0 0 4 0; +#X connect 1 0 6 0; +#X connect 4 0 5 1; +#X connect 4 0 7 1; +#X connect 5 0 9 0; +#X connect 6 0 5 0; +#X connect 6 2 7 0; +#X connect 7 0 8 0; +#X connect 8 0 22 0; +#X connect 9 0 21 0; +#X connect 10 0 8 1; +#X connect 10 0 9 1; +#X connect 10 0 27 0; +#X connect 11 0 12 0; +#X connect 12 0 10 0; +#X connect 12 0 27 0; +#X connect 13 0 12 0; +#X connect 17 0 25 0; +#X connect 18 0 24 0; +#X connect 19 0 20 0; +#X connect 20 0 8 1; +#X connect 20 0 9 1; +#X connect 21 0 2 0; +#X connect 22 0 3 0; +#X connect 23 0 26 0; +#X connect 24 0 19 1; +#X connect 24 1 23 1; +#X connect 25 0 23 0; +#X connect 25 1 22 1; +#X connect 25 1 21 1; +#X connect 25 2 19 0; +#X connect 26 0 12 0; +#X connect 27 0 22 1; +#X connect 27 0 21 1; +#X restore 143 520 pd samples; +#X obj 123 267 vplugin; +#X msg 123 244 black; +#X obj 40 201 t b b b b b; +#X obj 184 489 minmax; +#X obj 184 463 pack f f; +#X obj 173 129 inlet; +#X text 123 104 offsets in samples; +#X obj 273 587 outlet; +#X obj 85 588 outlet; +#X text 25 613 fs.frame outlets 1&2; +#X connect 0 0 2 0; +#X connect 0 0 15 0; +#X connect 0 0 28 0; +#X connect 0 1 16 0; +#X connect 0 1 28 1; +#X connect 0 1 37 0; +#X connect 0 2 6 0; +#X connect 1 0 14 0; +#X connect 4 0 7 1; +#X connect 4 0 33 0; +#X connect 5 0 13 0; +#X connect 7 0 0 0; +#X connect 8 0 7 0; +#X connect 10 0 12 0; +#X connect 11 0 12 1; +#X connect 12 0 23 0; +#X connect 13 0 31 0; +#X connect 13 1 10 0; +#X connect 13 2 11 0; +#X connect 14 0 31 0; +#X connect 14 1 0 0; +#X connect 15 0 0 0; +#X connect 16 0 15 1; +#X connect 17 0 18 0; +#X connect 18 0 16 1; +#X connect 19 0 16 1; +#X connect 23 0 0 0; +#X connect 24 0 0 0; +#X connect 28 0 3 0; +#X connect 28 1 36 0; +#X connect 29 0 8 0; +#X connect 30 0 29 0; +#X connect 31 0 15 2; +#X connect 31 1 0 0; +#X connect 31 2 24 0; +#X connect 31 3 30 0; +#X connect 32 0 28 3; +#X connect 32 1 28 4; +#X connect 33 0 32 0; +#X connect 34 0 7 2; +#X connect 34 0 33 1; diff --git a/Patches/fs.waveselection.pd b/Patches/fs.waveselection.pd new file mode 100644 index 0000000..440e500 --- /dev/null +++ b/Patches/fs.waveselection.pd @@ -0,0 +1,47 @@ +#N canvas 0 0 626 444 12; +#X obj 188 80 inlet; +#X obj 223 279 fs.copy; +#X msg 328 296 dstinvert; +#X obj 363 324 init; +#X obj 223 376 outlet; +#X obj 21 80 inlet; +#X obj 223 219 symbol; +#X obj 188 112 t l b; +#X obj 358 79 inlet; +#X text 12 8 fs.waveselection - show fs.waveform selection by inverting +the selected area; +#X text 71 81 fs.frame 1st; +#X text 241 80 fs.frame 2nd; +#X text 410 78 reset; +#X text 280 377 to fs.frame 1st inlet; +#X obj 185 155 t b b l l; +#X msg 185 312 flip; +#X msg 289 247 source \$1 0 \$3 \$5; +#X msg 432 247 dest \$1 0 \$3 \$5; +#X obj 289 219 pack f f f f f; +#X obj 442 150 fs.info; +#X msg 358 106 0 0 0 0 0; +#X obj 432 217 pack f f f f f; +#X connect 0 0 7 0; +#X connect 1 0 4 0; +#X connect 2 0 1 1; +#X connect 3 0 2 0; +#X connect 5 0 6 1; +#X connect 5 0 19 0; +#X connect 6 0 1 0; +#X connect 7 0 14 0; +#X connect 7 1 6 0; +#X connect 8 0 20 0; +#X connect 14 0 15 0; +#X connect 14 1 6 0; +#X connect 14 2 21 0; +#X connect 14 3 18 0; +#X connect 15 0 4 0; +#X connect 16 0 1 1; +#X connect 17 0 1 1; +#X connect 18 0 16 0; +#X connect 19 1 18 4; +#X connect 19 1 21 4; +#X connect 20 0 18 0; +#X connect 20 0 21 0; +#X connect 21 0 17 0; diff --git a/Patches/fs_sender.pd b/Patches/fs_sender.pd new file mode 100644 index 0000000..e53a3b6 --- /dev/null +++ b/Patches/fs_sender.pd @@ -0,0 +1,7 @@ +#N canvas 595 435 271 174 12; +#X obj 37 13 inlet; +#X obj 37 77 s fs_main; +#X obj 93 42 print sender; +#X obj 37 43 l2s; +#X connect 0 0 3 0; +#X connect 3 0 1 0; diff --git a/Patches/init.pd b/Patches/init.pd new file mode 100644 index 0000000..7a1b9d8 --- /dev/null +++ b/Patches/init.pd @@ -0,0 +1,9 @@ +#N canvas 361 230 591 286 12; +#X obj 44 177 outlet; +#X obj 44 81 reset; +#X text 14 10 use init to set parameters at load time; +#X msg 44 152 bang; +#X obj 44 126 pipe 1000; +#X connect 1 0 4 0; +#X connect 3 0 0 0; +#X connect 4 0 3 0; diff --git a/Patches/l2s.c b/Patches/l2s.c new file mode 100644 index 0000000..b8a7701 --- /dev/null +++ b/Patches/l2s.c @@ -0,0 +1,89 @@ +/* + l2s is from ZEXY, the excellent pure data library by Johannes Zmoelnig. + Get it from ftp://iem.kug.ac.at/pd/Externals/ZEXY/ +*/ + +/* not needed #include "zexy.h" */ +#include "m_pd.h" +#include <stdlib.h> + +#ifdef NT +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#define sqrtf sqrt +#endif + +/* ------------------------- list2symbol ------------------------------- */ + +/* compare 2 lists ( == for lists) */ + +static t_class *list2symbol_class; + +typedef struct _list2symbol +{ + t_object x_obj; + + t_binbuf *bbuf; +} t_list2symbol; + +static void list2symbol_bang(t_list2symbol *x) +{ + char *str=0, *s2; + int n=0; + + binbuf_gettext(x->bbuf, &str, &n); + /* memory bug ! detected and fixed by Jusu */ + s2 = copybytes(str, n+1); + s2[n]=0; + + outlet_symbol(x->x_obj.ob_outlet, gensym(s2)); + freebytes(str, n); + freebytes(s2,n+1); +} + +static void list2symbol_list(t_list2symbol *x, t_symbol *s, int argc, t_atom *argv) +{ + binbuf_clear(x->bbuf); + binbuf_add(x->bbuf, argc, argv); + + list2symbol_bang(x); +} +static void list2symbol_anything(t_list2symbol *x, t_symbol *s, int argc, t_atom *argv) +{ + t_atom ap; + binbuf_clear(x->bbuf); + SETSYMBOL(&ap, s); + binbuf_add(x->bbuf, 1, &ap); + binbuf_add(x->bbuf, argc, argv); + + list2symbol_bang(x); +} + +static void *list2symbol_new(t_symbol *s, int argc, t_atom *argv) +{ + t_list2symbol *x = (t_list2symbol *)pd_new(list2symbol_class); + + outlet_new(&x->x_obj, 0); + x->bbuf = binbuf_new(); + binbuf_add(x->bbuf, argc, argv); + + return (x); +} + +static void list2symbol_free(t_list2symbol *x) +{ + binbuf_free(x->bbuf); +} + +void l2s_setup(void) +{ + list2symbol_class = class_new(gensym("l2s"), (t_newmethod)list2symbol_new, + (t_method)list2symbol_free, sizeof(t_list2symbol), 0, A_GIMME, 0); + + class_addcreator((t_newmethod)list2symbol_new, gensym("list2symbol"), A_GIMME, 0); + class_addbang (list2symbol_class, list2symbol_bang); + class_addlist (list2symbol_class, list2symbol_list); + class_addanything(list2symbol_class, list2symbol_anything); + + class_sethelpsymbol(list2symbol_class, gensym("zexy/list2symbol")); +} diff --git a/Patches/l2s.dll b/Patches/l2s.dll Binary files differnew file mode 100644 index 0000000..c46d150 --- /dev/null +++ b/Patches/l2s.dll diff --git a/Patches/l2s.exp b/Patches/l2s.exp Binary files differnew file mode 100644 index 0000000..18ec776 --- /dev/null +++ b/Patches/l2s.exp diff --git a/Patches/l2s.lib b/Patches/l2s.lib Binary files differnew file mode 100644 index 0000000..b875e0b --- /dev/null +++ b/Patches/l2s.lib diff --git a/Patches/l2s.obj b/Patches/l2s.obj Binary files differnew file mode 100644 index 0000000..c4e67b2 --- /dev/null +++ b/Patches/l2s.obj diff --git a/Patches/makefile b/Patches/makefile new file mode 100644 index 0000000..55d610f --- /dev/null +++ b/Patches/makefile @@ -0,0 +1,38 @@ +all: vframe vsig vsnapshot vrgb vcolor vframeread vdrawarray arraysize buildstr l2s + +# FLAGS: +# +# note: maximum optimization (/Ox) causes crashes with plugins.. + +F = /DNT /DPD /LD /Gd /GD /Ogitb1 /Gs /I\system\pd\src /I..\Plugins +L = \system\pdt17\bin\pd.lib + +vframe: + cl vframe.c $(F) /link /export:vframe_setup $(L) user32.lib + +vsig: + cl vsig~.c $(F) /link /export:vsig_tilde_setup $(L) + +vsnapshot: + cl vsnapshot~.c $(F) /link /export:vsnapshot_tilde_setup $(L) + +vrgb: + cl vrgb~.c $(F) /link /export:vrgb_tilde_setup $(L) user32.lib + +vcolor: + cl vcolor~.c $(F) /link /export:vcolor_tilde_setup $(L) user32.lib + +vframeread: + cl vframeread~.c $(F) /link /export:vframeread_tilde_setup $(L) + +vdrawarray: + cl vdrawarray.c $(F) /link /export:vdrawarray_setup $(L) + +arraysize: + cl arraysize.c $(F) /link /export:arraysize_setup $(L) + +buildstr: + cl buildstr.c $(F) /link /export:buildstr_setup $(L) + +l2s: + cl l2s.c $(F) /link /export:l2s_setup $(L) diff --git a/Patches/noize.dll b/Patches/noize.dll Binary files differnew file mode 100644 index 0000000..cdd4326 --- /dev/null +++ b/Patches/noize.dll diff --git a/Patches/ooo.pd b/Patches/ooo.pd new file mode 100644 index 0000000..a10612b --- /dev/null +++ b/Patches/ooo.pd @@ -0,0 +1,19 @@ +#N canvas 483 310 458 308 12; +#X obj 167 136 random 10; +#X obj 199 66 inlet; +#X obj 134 68 inlet; +#X obj 167 176 sel 0; +#X obj 167 216 outlet; +#X text 14 8 ooo - one out of ...; +#X obj 290 58 float \$1; +#X obj 302 32 loadbang; +#X obj 216 103 - 1; +#X msg 148 103 bang; +#X connect 0 0 3 0; +#X connect 1 0 8 0; +#X connect 2 0 9 0; +#X connect 3 0 4 0; +#X connect 6 0 8 0; +#X connect 7 0 6 0; +#X connect 8 0 0 1; +#X connect 9 0 0 0; diff --git a/Patches/play.pd b/Patches/play.pd new file mode 100644 index 0000000..053c019 --- /dev/null +++ b/Patches/play.pd @@ -0,0 +1,8 @@ +#N canvas 290 207 206 201 12; +#X obj 35 60 fps \$1; +#X msg 35 90 next; +#X obj 35 119 outlet; +#X obj 35 30 inlet; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 3 0 0 0; diff --git a/Patches/ramp.pd b/Patches/ramp.pd new file mode 100644 index 0000000..5f84056 --- /dev/null +++ b/Patches/ramp.pd @@ -0,0 +1,35 @@ +#N canvas 60 34 505 412 10; +#X obj 60 40 inlet; +#X text 106 40 from \, to \, steps; +#X obj 54 372 outlet; +#X text 108 373 float; +#X obj 68 77 unpack f f f; +#X obj 277 177 f; +#X obj 277 201 bangx; +#X obj 144 131 f; +#X obj 144 177 -; +#X text 175 178 to - from; +#X obj 144 204 /; +#X text 174 205 div steps; +#X obj 128 254 +; +#X obj 68 124 t b b f f; +#X obj 101 254 f; +#X obj 101 277 t f f; +#X connect 0 0 4 0; +#X connect 4 0 13 0; +#X connect 4 1 7 1; +#X connect 4 2 5 1; +#X connect 4 2 10 1; +#X connect 5 0 6 0; +#X connect 6 0 14 0; +#X connect 7 0 8 0; +#X connect 8 0 10 0; +#X connect 10 0 12 1; +#X connect 12 0 14 1; +#X connect 13 0 5 0; +#X connect 13 1 7 0; +#X connect 13 2 8 1; +#X connect 13 3 14 1; +#X connect 14 0 15 0; +#X connect 15 0 2 0; +#X connect 15 1 12 0; diff --git a/Patches/randombox.pd b/Patches/randombox.pd new file mode 100644 index 0000000..b7de22b --- /dev/null +++ b/Patches/randombox.pd @@ -0,0 +1,19 @@ +#N canvas 261 155 452 302 12; +#X obj 128 198 pack f f f f; +#X obj 128 102 random \$1; +#X obj 158 125 random \$2; +#X obj 188 148 random \$1; +#X obj 219 171 random \$2; +#X obj 128 31 inlet; +#X obj 128 67 t b b b b; +#X obj 128 235 outlet; +#X connect 0 0 7 0; +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 0 2; +#X connect 4 0 0 3; +#X connect 5 0 6 0; +#X connect 6 0 1 0; +#X connect 6 1 2 0; +#X connect 6 2 3 0; +#X connect 6 3 4 0; diff --git a/Patches/reset.pd b/Patches/reset.pd new file mode 100644 index 0000000..0a33ffc --- /dev/null +++ b/Patches/reset.pd @@ -0,0 +1,8 @@ +#N canvas 365 282 350 242 12; +#X obj 44 34 loadbang; +#X obj 130 34 r fs_reset; +#X obj 60 100 outlet; +#X msg 130 60 bang; +#X connect 0 0 2 0; +#X connect 1 0 3 0; +#X connect 3 0 2 0; diff --git a/Patches/sameonce.pd b/Patches/sameonce.pd new file mode 100644 index 0000000..0d8d1f6 --- /dev/null +++ b/Patches/sameonce.pd @@ -0,0 +1,15 @@ +#N canvas 115 170 321 367 12; +#X obj 71 73 inlet; +#X obj 147 322 outlet; +#X obj 147 142 float; +#X msg 204 178 bang; +#X obj 71 200 moses 1; +#X obj 71 142 != -1; +#X text 8 6 pass float if different from previous; +#X connect 0 0 2 1; +#X connect 0 0 5 0; +#X connect 2 0 5 1; +#X connect 2 0 1 0; +#X connect 3 0 2 0; +#X connect 4 1 3 0; +#X connect 5 0 4 0; diff --git a/Patches/snapOut~.pd b/Patches/snapOut~.pd new file mode 100644 index 0000000..2712c45 --- /dev/null +++ b/Patches/snapOut~.pd @@ -0,0 +1,45 @@ +#N canvas 620 1 504 354 10; +#X obj 39 16 inlet~; +#X msg 128 134 1; +#X msg 159 134 0; +#X obj 128 162 metro 100; +#X obj 119 16 inlet; +#X text 160 15 snapout size in seconds; +#X floatatom 260 48 4 0 0; +#X obj 211 82 * 1000; +#X floatatom 209 134 4 0 0; +#X msg 54 134 bang; +#X obj 39 188 tabwrite~ \$1; +#X obj 303 132 symbol \$1; +#X obj 303 109 loadbang; +#X msg 260 186 \; \$2 resize \$1; +#X obj 260 156 pack f s; +#X obj 260 219 print; +#X obj 367 15 loadbang; +#X obj 367 37 samplerate~; +#X obj 260 82 *; +#X obj 341 69 / 100; +#X obj 260 109 -; +#X obj 119 55 switch~; +#X connect 0 0 10 0; +#X connect 1 0 3 0; +#X connect 2 0 3 0; +#X connect 3 0 10 0; +#X connect 4 0 6 0; +#X connect 4 0 21 0; +#X connect 6 0 7 0; +#X connect 6 0 18 0; +#X connect 7 0 8 0; +#X connect 8 0 3 1; +#X connect 8 0 3 0; +#X connect 9 0 10 0; +#X connect 11 0 14 1; +#X connect 12 0 11 0; +#X connect 13 0 15 0; +#X connect 14 0 13 0; +#X connect 16 0 17 0; +#X connect 17 0 18 1; +#X connect 17 0 19 0; +#X connect 18 0 20 0; +#X connect 19 0 20 1; +#X connect 20 0 14 0; diff --git a/Patches/vcolor~.c b/Patches/vcolor~.c new file mode 100644 index 0000000..0de7fe6 --- /dev/null +++ b/Patches/vcolor~.c @@ -0,0 +1,96 @@ +#include "m_pd.h" +#include "math.h" +#include "sharemem.h" +#include "vframe.h" +#include "plugin.h" +#include "displaydepth.h" + +/* -------------------------- vcolor~ ------------------------------ */ +static t_class *vcolor_class; + +typedef struct _vcolor +{ + t_object x_obj; + float x_r; + float x_g; + float x_b; + int depth; +} t_vcolor; + +static t_int *vcolor_perform(t_int *w) +{ + t_float *in_r = (t_float *)(w[1]); + t_float *in_g = (t_float *)(w[2]); + t_float *in_b = (t_float *)(w[3]); + t_float *out = (t_float *)(w[4]); + int n = (int)(w[5]); + t_vcolor *x = (t_vcolor *)(w[6]); + + switch(x->depth) + { + case 16: + while (n--) + { + *out++ = colortosample16(rgbtocolor16( + (byte)(*in_r++*255.0), + (byte)(*in_g++*255.0), + (byte)(*in_b++*255.0) + )); + } + break; + case 32: + while (n--) + { + *out++ = colortosample32(rgbtocolor32( + (byte)(*in_r++*255.0), + (byte)(*in_g++*255.0), + (byte)(*in_b++*255.0))); + } + break; + } + return (w+7); +} + +static void vcolor_dsp(t_vcolor *x, t_signal **sp) +{ + dsp_add(vcolor_perform, 6, + sp[0]->s_vec, + sp[1]->s_vec, + sp[2]->s_vec, + sp[3]->s_vec, + sp[0]->s_n, + x); +} + +static void vcolor_float(t_vcolor *x, t_float f) +{ +} + +static void *vcolor_new(t_floatarg f) +{ + t_vcolor *x = (t_vcolor *)pd_new(vcolor_class); + x->depth = getdisplaydepth(); + if(!x->depth) + { + post("vcolor~: getdisplaydepth() failed, defaulting to 16."); + x->depth = 16; + } + inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); + inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); + outlet_new(&x->x_obj, gensym("signal")); + return (x); +} + +static void vcolor_destroy(t_vcolor *x) +{ +} + +void vcolor_tilde_setup(void) +{ + vcolor_class = class_new(gensym("vcolor~"), + (t_newmethod)vcolor_new, (t_method)vcolor_destroy, + sizeof(t_vcolor), 0, A_DEFFLOAT, 0); + CLASS_MAINSIGNALIN(vcolor_class, t_vcolor, x_r); + class_addfloat(vcolor_class, (t_method)vcolor_float); + class_addmethod(vcolor_class, (t_method)vcolor_dsp, gensym("dsp"), 0); +} diff --git a/Patches/vcolor~.dll b/Patches/vcolor~.dll Binary files differnew file mode 100644 index 0000000..ba9ff30 --- /dev/null +++ b/Patches/vcolor~.dll diff --git a/Patches/vcolor~.exp b/Patches/vcolor~.exp Binary files differnew file mode 100644 index 0000000..f07ba8c --- /dev/null +++ b/Patches/vcolor~.exp diff --git a/Patches/vcolor~.lib b/Patches/vcolor~.lib Binary files differnew file mode 100644 index 0000000..6092fa3 --- /dev/null +++ b/Patches/vcolor~.lib diff --git a/Patches/vcolor~.obj b/Patches/vcolor~.obj Binary files differnew file mode 100644 index 0000000..80e68ad --- /dev/null +++ b/Patches/vcolor~.obj diff --git a/Patches/vcopy.pd b/Patches/vcopy.pd new file mode 100644 index 0000000..00e109d --- /dev/null +++ b/Patches/vcopy.pd @@ -0,0 +1,16 @@ +#N canvas 471 263 464 314 12; +#X obj 46 27 inlet; +#X obj 97 211 outlet; +#X obj 235 27 inlet; +#X obj 235 57 l2s; +#X obj 196 91 vplugin; +#X obj 97 125 pack f s; +#X obj 324 32 reset; +#X msg 324 58 black; +#X connect 0 0 5 0; +#X connect 2 0 3 0; +#X connect 3 0 4 0; +#X connect 4 0 5 1; +#X connect 5 0 1 0; +#X connect 6 0 7 0; +#X connect 7 0 4 0; diff --git a/Patches/vdrawarray.c b/Patches/vdrawarray.c new file mode 100644 index 0000000..fa8fab7 --- /dev/null +++ b/Patches/vdrawarray.c @@ -0,0 +1,131 @@ +#include "m_pd.h" +#include "math.h" +#include "sharemem.h" +#include "vframe.h" + +/* -------------------------- vdrawarray ------------------------------ */ +static t_class *vdrawarray_class; + +typedef struct _vdrawarray +{ + t_object x_obj; + t_symbol *array_name; + t_float startpos, endpos; + int id; + HANDLE hvf, hbits; + LPVOID memvf, membits; + struct vframeimage *vfp; +} t_vdrawarray; + +void vdrawarray_set(t_vdrawarray *x, t_symbol *s) +{ + x->array_name = s; +} + +static void vdrawarray_bang(t_vdrawarray *x) +{ + int i, o, h, y, bytesize, gsize, pos, len; + t_float *gdata, tmpf; + byte *p; + t_garray *g; + + if(!x->id) + { + post("vdrawarray: connect vframe first"); + return; + } + + if(!(g = (t_garray *)pd_findbyclass(x->array_name, garray_class))) + { + pd_error(x, "vdrawarray: %s: no such table", x->array_name->s_name); + return; + } + + garray_getfloatarray(g, &gsize, &gdata); + + h = x->vfp->f.height; + p = (byte*)x->membits; + bytesize = x->vfp->f.pixelformat/8; + + if(x->startpos==0 && x->endpos==0) + x->endpos=gsize; + + if(x->startpos<0) x->startpos=0; + if(x->startpos>gsize) x->startpos=gsize; + if(x->endpos<0) x->endpos=0; + if(x->endpos>gsize) x->endpos=gsize; + + if(x->endpos<x->startpos) + { + tmpf = x->endpos; + x->endpos = x->startpos; + x->startpos = tmpf; + } + + for(i=0; i<x->vfp->f.width; i++) + { + pos = (int)((i / (float)x->vfp->f.width) * (x->endpos-x->startpos) + x->startpos ); + len = (int)((fabs(gdata[pos]) * (float)x->vfp->f.height)); + + o = (x->vfp->f.height - len) / 2; + for(y=o; y<o+len && y<x->vfp->f.height; y++) + memset(&p[y*x->vfp->f.lpitch+i*bytesize], 253, bytesize); + } +} + +static void vdrawarray_float(t_vdrawarray *x, t_float f) +{ + if(x->id==f && x->membits!=NULL) + { + outlet_float(x->x_obj.ob_outlet, x->id); + vdrawarray_bang(x); + return; + } + + x->id = f; + + openframedatabyid(x->id, + &x->hvf, &x->hbits, &x->memvf, &x->membits, &x->vfp); + if(!x->membits) + { + post("vdrawarray: no memory at %d", x->id); + return; + } else + { + outlet_float(x->x_obj.ob_outlet, x->id); + vdrawarray_bang(x); + } +} + +static void *vdrawarray_new(t_symbol *s) +{ + t_vdrawarray *x = (t_vdrawarray *)pd_new(vdrawarray_class); + + x->array_name = s; + x->id=0; + x->hvf=NULL; + x->memvf=NULL; + x->hbits=NULL; + x->membits=NULL; + x->startpos=x->endpos=0; + outlet_new(&x->x_obj, gensym("float")); + floatinlet_new(&x->x_obj, &x->startpos); + floatinlet_new(&x->x_obj, &x->endpos); + return (x); +} + +static void vdrawarray_destroy(t_vdrawarray *x) +{ + if(x->membits!=NULL) smfree(&x->hbits, x->membits); + if(x->memvf!=NULL) smfree(&x->hvf, x->memvf); +} + +void vdrawarray_setup(void) +{ + vdrawarray_class = class_new(gensym("vdrawarray"), + (t_newmethod)vdrawarray_new, (t_method)vdrawarray_destroy, + sizeof(t_vdrawarray), 0, A_DEFSYM, 0); + class_addfloat(vdrawarray_class, (t_method)vdrawarray_float); + class_addbang(vdrawarray_class, (t_method)vdrawarray_bang); + class_addmethod(vdrawarray_class, (t_method)vdrawarray_set, gensym("set"), A_DEFSYM, 0); +} diff --git a/Patches/vdrawarray.dll b/Patches/vdrawarray.dll Binary files differnew file mode 100644 index 0000000..f14883b --- /dev/null +++ b/Patches/vdrawarray.dll diff --git a/Patches/vdrawarray.exp b/Patches/vdrawarray.exp Binary files differnew file mode 100644 index 0000000..00b8adf --- /dev/null +++ b/Patches/vdrawarray.exp diff --git a/Patches/vdrawarray.lib b/Patches/vdrawarray.lib Binary files differnew file mode 100644 index 0000000..53139da --- /dev/null +++ b/Patches/vdrawarray.lib diff --git a/Patches/vdrawarray.obj b/Patches/vdrawarray.obj Binary files differnew file mode 100644 index 0000000..bf12d3c --- /dev/null +++ b/Patches/vdrawarray.obj diff --git a/Patches/vframe.c b/Patches/vframe.c new file mode 100644 index 0000000..ee1bf37 --- /dev/null +++ b/Patches/vframe.c @@ -0,0 +1,262 @@ +#include <stdlib.h> +#include <stdio.h> +#include "m_pd.h" +#include "sharemem.h" +#include "vframe.h" +#include "dllcall.h" +#include "displaydepth.h" + +/* vframe */ + +static t_class *vframe_class; + +typedef struct _vframe +{ + t_object x_obj; + + int id; + HANDLE hlvframe, hlbits; + LPVOID memvframe, membits; + + HMODULE effectlib, copylib; + cdecl FARPROC effectproc, copyproc; + char effectplugin[80], effectloaded[80], + copyplugin[80], copyloaded[80]; + char effectparams[256]; +} t_vframe; + +static void vframe_effect(t_vframe *x) +{ + struct vframeimage *vfp; + byte *bp; + int i1, i2, i3, i4; + char *s1=0, s2[256]; + + if(!x->membits) + { + post("vframe: init has failed."); + return; + } + if(!x->effectplugin) return; + if(strcmp(x->effectloaded, x->effectplugin)) + { + loadeffect(&x->effectlib, &x->effectproc, x->effectplugin); + if(!x->effectlib || !x->effectproc) + { + post("vframe: failed to load effect from %s", x->effectplugin); + strcpy(x->effectloaded, "-"); + return; + } + strcpy(x->effectloaded, x->effectplugin); + } + vfp = x->memvframe; + bp = x->membits; + i1 = vfp->f.lpitch; + i2 = vfp->f.width; + i3 = vfp->f.height; + i4 = vfp->f.pixelformat; + + (*x->effectproc)(bp, i1, i2, i3, i4, &x->effectparams, &s2); + outlet_float(x->x_obj.ob_outlet, x->id); +} + +static void vframe_copy(t_vframe *x, float source, char *cmd) +{ + char *t, *args=0; + HANDLE h1, h2; + LPVOID p1=NULL, p2=NULL; + struct vframeimage *vfp1=NULL, *vfp2=NULL; + byte *b1, *b2; + int i1, i2, i3, i4, i5, i6, i7, i8; + char returnbuf[256]; + + if(!x->membits) + { + post("vframe: init has failed."); + return; + } + strcpy(x->copyplugin, cmd); + t = strstr(x->copyplugin, " "); + if(t) + { + t[0]=0; + args=t+1; + } + + if(!x->copyplugin) return; + if(strcmp(x->copyloaded, x->copyplugin)) + { + loadcopy(&x->copylib, &x->copyproc, x->copyplugin); + if(!x->copylib || !x->copyproc) + { + post("vframe: failed to load copy from %s", x->copyplugin); + strcpy(x->copyloaded, "-"); + return; + } + strcpy(x->copyloaded, x->copyplugin); + } + + p2 = openframedatabyid((int)source, &h1, &h2, &p1, &p2, &vfp1); + if(!p2) + { + if(source) post("vframe: no memory at %f", source); + return; + } + + vfp2 = (struct vframeimage *)x->memvframe; + + b1 = p2; + i1 = vfp1->f.lpitch; + i2 = vfp1->f.width; + i3 = vfp1->f.height; + i4 = vfp1->f.pixelformat; + + b2 = x->membits; + i5 = vfp2->f.lpitch; + i6 = vfp2->f.width; + i7 = vfp2->f.height; + i8 = vfp2->f.pixelformat; + + (*x->copyproc)( + b1, i1, i2, i3, i4, + b2, i5, i6, i7, i8, + args, &returnbuf + ); + + outlet_float(x->x_obj.ob_outlet, x->id); +} + +static void vframe_float(t_vframe *x, t_float f) +{ + post("float %f", f); +} + +static void vframe_symbol(t_vframe *x, t_symbol *s) +{ + char *t; + + strcpy(x->effectplugin, s->s_name); + x->effectparams[0]=0; + + t = strstr(x->effectplugin, " "); + if(t) + { + strcpy(x->effectparams, t+1); + t[0]=0; + } + vframe_effect(x); +} + +static void vframe_list(t_vframe *x, t_symbol *s, int ac, t_atom *av) +{ + float f; + char *s2; + if (!ac || ac!=2) return; + + f = atom_getfloatarg(0, ac, av); + s2 = atom_getsymbolarg(1, ac, av)->s_name; + vframe_copy(x, f, s2); +} + +static void vframe_anything(t_vframe *x, t_symbol *s, int argc, t_atom *argv) +{ + char *t; + + strcpy(x->effectplugin, s->s_name); + x->effectparams[0]=0; + + t = strstr(x->effectplugin, " "); + if(t) + { + strcpy(x->effectparams, t+1); + t[0]=0; + } + vframe_effect(x); +} + +static void vframe_bang(t_vframe *x, t_floatarg fa) +{ + if(x->membits!=NULL) + outlet_float(x->x_obj.ob_outlet, x->id); +} + +static void *vframe_new(t_symbol *sym, int argc, t_atom *argv) +{ + t_vframe *x = (t_vframe *)pd_new(vframe_class); + + struct vframeimage vf; + int width=176, height=144, pixelformat=16; + char s[20]; + + if(argc>=2) + { + width = atom_getfloat(argv); + height = atom_getfloat(argv+1); + } + pixelformat = getdisplaydepth(); + if(pixelformat!=16 && pixelformat!=24 && pixelformat!=32) + { + post("vframe: bad display depth, should be 16, 24 or 32. defaulting to 16."); + pixelformat = 16; + } + + // allocate shared memory for bits and struct frameimage + x->id = rand(); + itoa(x->id, s, 10); + + x->membits = smalloc(&x->hlbits, s, width*height*(pixelformat/8)); + if(x->membits==NULL) + { + post("vframe: membits smalloc() failed."); + } else + { + strcpy(vf.bitsname, s); + vf.f.width = width; + vf.f.height = height; + vf.f.pixelformat = pixelformat; + vf.f.lpitch = vf.f.width*(pixelformat/8); /* + some more for directx-crap??? */ + vf.f.bits=NULL; + + x->id = rand(); + itoa(x->id, s, 10); + + x->memvframe = smalloc(&x->hlvframe, s, + sizeof(struct vframeimage)); + + if(x->memvframe==NULL) + { + post("vframeimage smalloc() failed."); + } else + { + memcpy(x->memvframe, &vf, sizeof(struct vframeimage)); + } + } + + x->effectlib=NULL; + strcpy(x->effectloaded, "n o t h i n g"); + x->copylib=NULL; + strcpy(x->copyloaded, "n o t h i n g"); + + outlet_new(&x->x_obj, gensym("float")); + return((void *)x); +} + +static void vframe_destroy(t_vframe *x) +{ + if(x->membits!=NULL) smfree(&x->hlbits, x->membits); + if(x->memvframe!=NULL) smfree(&x->hlvframe, x->memvframe); + if(x->effectlib) FreeLibrary(x->effectlib); + if(x->copylib) FreeLibrary(x->copylib); +} + +void vframe_setup(void) +{ + vframe_class = class_new(gensym("vframe"), + (t_newmethod)vframe_new, (t_method)vframe_destroy, + sizeof(t_vframe), CLASS_DEFAULT, A_GIMME, 0); + class_addfloat(vframe_class, vframe_float); + class_addbang(vframe_class, vframe_bang); + class_addsymbol(vframe_class, vframe_symbol); + class_addanything(vframe_class, vframe_anything); + class_addlist(vframe_class, vframe_list); +} diff --git a/Patches/vframe.dll b/Patches/vframe.dll Binary files differnew file mode 100644 index 0000000..677c448 --- /dev/null +++ b/Patches/vframe.dll diff --git a/Patches/vframe.exp b/Patches/vframe.exp Binary files differnew file mode 100644 index 0000000..de5412f --- /dev/null +++ b/Patches/vframe.exp diff --git a/Patches/vframe.h b/Patches/vframe.h new file mode 100644 index 0000000..232b166 --- /dev/null +++ b/Patches/vframe.h @@ -0,0 +1,66 @@ +#ifndef __VFRAME_H +#define __VFRAME_H + +#include "plugin.h" + +struct vframeimage +{ + char bitsname[40]; // name of shared memory to image data + // use this, not f.bits! + _frame f; // image header, see Plugins\plugin.h +}; + +LPVOID openframedatabyid( int id, + HANDLE *hvf, HANDLE *hbits, + LPVOID *memvf, LPVOID *membits, + struct vframeimage **vfp ) +{ + char s[80]; + + if(*membits!=NULL) smfree(hbits, *membits); + if(*memvf!=NULL) smfree(hvf, *memvf); + + *membits=NULL; + + itoa(id, s, 10); + + *memvf = smopen(hvf, s); + if(*memvf!=NULL) + { + *vfp = *memvf; + + *membits = smopen(hbits, ((struct vframeimage *)*vfp)->bitsname); + if(*membits==NULL) + { + printf("membits open error.\n"); + smfree(hvf, *memvf); + } else { + } + } + return(*membits); +} + +float max16 = 2<<14; +float max32 = 2<<23; + +__inline float colortosample16(short c) +{ + return(c / max16); +} + +__inline float colortosample32(long c) +{ + return(c / max32); +} + +__inline short sampletocolor16(float s) +{ + return(s * max16); +} + +__inline long sampletocolor32(float s) +{ + return(s * max32); +} + +#endif diff --git a/Patches/vframe.lib b/Patches/vframe.lib Binary files differnew file mode 100644 index 0000000..f03cc5a --- /dev/null +++ b/Patches/vframe.lib diff --git a/Patches/vframe.obj b/Patches/vframe.obj Binary files differnew file mode 100644 index 0000000..9f6f8cc --- /dev/null +++ b/Patches/vframe.obj diff --git a/Patches/vframeread~.c b/Patches/vframeread~.c new file mode 100644 index 0000000..fe61836 --- /dev/null +++ b/Patches/vframeread~.c @@ -0,0 +1,123 @@ +#include "m_pd.h" +#include "math.h" +#include "sharemem.h" +#include "vframe.h" + +/* -------------------------- vframeread~ ------------------------------ */ +static t_class *vframeread_class; + +typedef struct _vframeread +{ + t_object x_obj; + float x_f; + float x_sigf; + int id; + HANDLE hvf, hbits; + LPVOID memvf, membits; + unsigned long pos, size; +} t_vframeread; + +static t_int *vframeread_perform(t_int *w) +{ + t_vframeread *x = (t_vframeread *)(w[1]); + t_float *in_sync = (t_float *)(w[2]); + t_float *out = (t_float *)(w[3]); + int n = (int)(w[4]); + short *p16; + long *p32; + struct vframeimage *vfp=x->memvf; + unsigned long bytespp; + + if(!vfp || !x->membits) return(w+5); + + bytespp = vfp->f.pixelformat / 8; + + switch(vfp->f.pixelformat) + { + case 16: + p16 = (short *)x->membits; + while (n--) + { + if(*in_sync>=0 && *in_sync<=1) + x->pos = *in_sync * (float)(x->size / bytespp); + in_sync++; + *out++ = colortosample16(p16[x->pos++]); + if(x->pos*bytespp >= x->size) + x->pos=0; + } + break; + case 32: + p32 = (long *)x->membits; + while (n--) + { + if(*in_sync>=0 && *in_sync<1) + x->pos = *in_sync * (float)(x->size / bytespp); + in_sync++; + *out++ = colortosample32(p32[x->pos++]); + if(x->pos*bytespp >= x->size) + x->pos=0; + } + break; + } + return (w+5); +} + +static void vframeread_dsp(t_vframeread *x, t_signal **sp) +{ + dsp_add(vframeread_perform, 4, + x, + sp[0]->s_vec, + sp[1]->s_vec, + sp[0]->s_n); +} + +static void vframeread_float(t_vframeread *x, t_float f) +{ + struct vframeimage *vfp; + + if(x->id==f && x->membits) return; + + x->id = x->x_f = f; + + openframedatabyid(x->id, + &x->hvf, &x->hbits, &x->memvf, &x->membits, &vfp); + if(!x->membits) + { + post("vframeread~: no memory at %d", x->id); + return; + } else + { + x->size = vfp->f.height*vfp->f.lpitch; + x->pos = 0; + } +} + +static void *vframeread_new(t_floatarg f) +{ + t_vframeread *x = (t_vframeread *)pd_new(vframeread_class); + x->id = -1; + x->x_f = f; + x->x_sigf = 0; + x->hvf=NULL; + x->memvf=NULL; + x->hbits=NULL; + x->membits=NULL; + outlet_new(&x->x_obj, gensym("signal")); + return (x); +} + +static void vframeread_destroy(t_vframeread *x) +{ + if(x->membits!=NULL) smfree(&x->hbits, x->membits); + if(x->memvf!=NULL) smfree(&x->hvf, x->memvf); +} + +void vframeread_tilde_setup(void) +{ + vframeread_class = class_new(gensym("vframeread~"), + (t_newmethod)vframeread_new, (t_method)vframeread_destroy, + sizeof(t_vframeread), 0, A_DEFFLOAT, 0); + CLASS_MAINSIGNALIN(vframeread_class, t_vframeread, x_sigf); + class_addfloat(vframeread_class, (t_method)vframeread_float); + class_addmethod(vframeread_class, (t_method)vframeread_dsp, gensym("dsp"), 0); +} diff --git a/Patches/vframeread~.dll b/Patches/vframeread~.dll Binary files differnew file mode 100644 index 0000000..c433e65 --- /dev/null +++ b/Patches/vframeread~.dll diff --git a/Patches/vframeread~.exp b/Patches/vframeread~.exp Binary files differnew file mode 100644 index 0000000..ca173e8 --- /dev/null +++ b/Patches/vframeread~.exp diff --git a/Patches/vframeread~.lib b/Patches/vframeread~.lib Binary files differnew file mode 100644 index 0000000..c5e2974 --- /dev/null +++ b/Patches/vframeread~.lib diff --git a/Patches/vframeread~.obj b/Patches/vframeread~.obj Binary files differnew file mode 100644 index 0000000..72813aa --- /dev/null +++ b/Patches/vframeread~.obj diff --git a/Patches/videoscrub.pd b/Patches/videoscrub.pd new file mode 100644 index 0000000..00c304b --- /dev/null +++ b/Patches/videoscrub.pd @@ -0,0 +1,29 @@ +#N canvas 306 359 496 310 12; +#X obj 43 24 inlet; +#X text 97 25 fs.frame; +#X obj 55 67 fs.info; +#X obj 36 231 outlet; +#X text 100 231 fs.frame (same as inlet!); +#X msg 204 193 mousetrack_1; +#X obj 213 26 inlet; +#X text 268 26 second outlet of fs.frame; +#X obj 213 66 unpack f f; +#X obj 36 118 /; +#X obj 36 151 *; +#X msg 36 181 seek \$1; +#X obj 188 159 init; +#X floatatom 102 121 5 0 0; +#X floatatom 151 121 5 0 0; +#X connect 0 0 2 0; +#X connect 2 0 9 1; +#X connect 2 0 13 0; +#X connect 2 2 10 1; +#X connect 2 2 14 0; +#X connect 5 0 3 0; +#X connect 6 0 8 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X connect 10 0 11 0; +#X connect 11 0 3 0; +#X connect 12 0 3 0; +#X connect 12 0 5 0; diff --git a/Patches/vimport.pd b/Patches/vimport.pd new file mode 100644 index 0000000..08433db --- /dev/null +++ b/Patches/vimport.pd @@ -0,0 +1,11 @@ +#N canvas 257 346 509 298 12; +#X obj 46 39 inlet; +#X obj 313 41 inlet; +#X text 21 12 fs.frame to import from; +#X text 292 14 vframe to import to; +#X obj 179 122 pack s f; +#X text 329 192 import plugin; +#X msg 179 182 \; \$1inlet fs2vf \$2; +#X connect 0 0 4 0; +#X connect 1 0 4 1; +#X connect 4 0 6 0; diff --git a/Patches/vplugin.pd b/Patches/vplugin.pd new file mode 100644 index 0000000..1639dfa --- /dev/null +++ b/Patches/vplugin.pd @@ -0,0 +1,9 @@ +#N canvas 0 0 464 314 12; +#X obj 70 26 inlet; +#X obj 70 172 makefilename c:/lab/framestein/plugins/%s; +#X obj 70 272 outlet; +#X text 125 200 correct this path to your installation; +#X obj 70 142 l2s; +#X connect 0 0 4 0; +#X connect 1 0 2 0; +#X connect 4 0 1 0; diff --git a/Patches/vref.pd b/Patches/vref.pd new file mode 100644 index 0000000..452d36a --- /dev/null +++ b/Patches/vref.pd @@ -0,0 +1,10 @@ +#N canvas 529 226 471 302 12; +#X obj 61 95 inlet; +#X obj 133 95 inlet; +#X obj 101 151 f; +#X obj 101 203 outlet; +#X text 10 5 vref: reference to vframe. use this to make your patches +more clear.; +#X connect 0 0 2 0; +#X connect 1 0 2 1; +#X connect 2 0 3 0; diff --git a/Patches/vrgb~.c b/Patches/vrgb~.c new file mode 100644 index 0000000..d4e2cec --- /dev/null +++ b/Patches/vrgb~.c @@ -0,0 +1,117 @@ +#include "m_pd.h" +#include "math.h" +#include "sharemem.h" +#include "vframe.h" +#include "plugin.h" +#include "displaydepth.h" + +/* -------------------------- vrgb~ ------------------------------ */ +static t_class *vrgb_class; + +typedef struct _vrgb +{ + t_object x_obj; + float x_f; + float mode; /* 0=rgb 1=r ... */ + int depth; +} t_vrgb; + +static t_int *vrgb_perform(t_int *w) +{ + t_float *in = (t_float *)(w[1]); + t_float *r = (t_float *)(w[2]); + t_float *g = (t_float *)(w[3]); + t_float *b = (t_float *)(w[4]); + int n = (int)(w[5]); + t_vrgb *x = (t_vrgb *)(w[6]); + byte cr, cg, cb; + short c16; + long c32; + + // support "x->mode" later.... + + switch(x->depth) + { + case 16: + while (n--) + { + c16 = sampletocolor16(*in++); + cr = r16(c16); + cg = g16(c16); + cb = b16(c16); + *r++ = cr / 255.0; + *g++ = cg / 255.0; + *b++ = cb / 255.0; + +/* *r++ = colortosample16(rgbtocolor16(cr, 0, 0)); + *g++ = colortosample16(rgbtocolor16(0, cg, 0)); + *b++ = colortosample16(rgbtocolor16(0, 0, cb)); +*/ } + break; + case 32: + while (n--) + { + c32 = sampletocolor32(*in++); + cr = r32(c32); + cg = g32(c32); + cb = b32(c32); + *r++ = cr / 255.0; + *g++ = cg / 255.0; + *b++ = cb / 255.0; + +/* *b++ = colortosample32(rgbtocolor32(cr, 0, 0)); + *g++ = colortosample32(rgbtocolor32(0, cg, 0)); + *r++ = colortosample32(rgbtocolor32(0, 0, cb)); +*/ } + break; + } + return (w+7); +} + +static void vrgb_dsp(t_vrgb *x, t_signal **sp) +{ + dsp_add(vrgb_perform, 6, + sp[0]->s_vec, + sp[1]->s_vec, + sp[2]->s_vec, + sp[3]->s_vec, + sp[0]->s_n, + x); +} + +static void vrgb_float(t_vrgb *x, t_float f) +{ + x->mode = f; +post("mode %f", f); +} + +static void *vrgb_new(t_floatarg f) +{ + t_vrgb *x = (t_vrgb *)pd_new(vrgb_class); + x->x_f = f; + x->mode=0; + x->depth = getdisplaydepth(); + if(!x->depth) + { + post("vrgb~: getdisplaydepth() failed, defaulting to 16."); + x->depth = 16; + } + outlet_new(&x->x_obj, gensym("signal")); + outlet_new(&x->x_obj, gensym("signal")); + outlet_new(&x->x_obj, gensym("signal")); + return (x); +} + +static void vrgb_destroy(t_vrgb *x) +{ +} + +void vrgb_tilde_setup(void) +{ + vrgb_class = class_new(gensym("vrgb~"), + (t_newmethod)vrgb_new, (t_method)vrgb_destroy, + sizeof(t_vrgb), 0, A_DEFFLOAT, 0); + CLASS_MAINSIGNALIN(vrgb_class, t_vrgb, x_f); + class_addfloat(vrgb_class, (t_method)vrgb_float); + class_addmethod(vrgb_class, (t_method)vrgb_dsp, gensym("dsp"), 0); +} diff --git a/Patches/vrgb~.dll b/Patches/vrgb~.dll Binary files differnew file mode 100644 index 0000000..dba660b --- /dev/null +++ b/Patches/vrgb~.dll diff --git a/Patches/vrgb~.exp b/Patches/vrgb~.exp Binary files differnew file mode 100644 index 0000000..431dc6d --- /dev/null +++ b/Patches/vrgb~.exp diff --git a/Patches/vrgb~.lib b/Patches/vrgb~.lib Binary files differnew file mode 100644 index 0000000..49d8fdb --- /dev/null +++ b/Patches/vrgb~.lib diff --git a/Patches/vrgb~.obj b/Patches/vrgb~.obj Binary files differnew file mode 100644 index 0000000..a49f96d --- /dev/null +++ b/Patches/vrgb~.obj diff --git a/Patches/vsig~.c b/Patches/vsig~.c new file mode 100644 index 0000000..f177723 --- /dev/null +++ b/Patches/vsig~.c @@ -0,0 +1,123 @@ +#include "m_pd.h" +#include "math.h" +#include "sharemem.h" +#include "vframe.h" + +/* -------------------------- vsig~ ------------------------------ */ +static t_class *vsig_class; + +typedef struct _vsig +{ + t_object x_obj; + float x_f; + t_outlet *x_bang; + int id; + HANDLE hvf, hbits; + LPVOID memvf, membits; + unsigned long pos, size; +} t_vsig; + +static t_int *vsig_perform(t_int *w) +{ + t_vsig *x = (t_vsig *)(w[1]); + t_float *out = (t_float *)(w[2]); + t_float *sync = (t_float *)(w[3]); + int n = (int)(w[4]); + short *p16; + long *p32; + struct vframeimage *vfp=x->memvf; + int bitspp; + + if(!vfp || !x->membits) return(w+5); + + bitspp = vfp->f.pixelformat / 8; + + switch(vfp->f.pixelformat) + { + case 16: + p16 = (short *)x->membits; + while (n--) + { + *out++ = colortosample16(p16[x->pos++]); + if(x->pos*bitspp >= x->size) + { + x->pos=0; + *sync = 1; // moveto topleft + outlet_bang(x->x_bang); + } else *sync = -1; // continue from whereever you are + sync++; + } + break; + case 32: + p32 = (long *)x->membits; + while (n--) + { + *out++ = colortosample32(p32[x->pos++]); + if(x->pos*bitspp >= x->size) + { + x->pos=0; + *sync = 1; + outlet_bang(x->x_bang); + } else *sync = -1; + sync++; + } + break; + } + return (w+5); +} + +static void vsig_dsp(t_vsig *x, t_signal **sp) +{ + dsp_add(vsig_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); +} + +static void vsig_float(t_vsig *x, t_float f) +{ + struct vframeimage *vfp; + + if(x->id==f && x->membits!=NULL) return; + + x->id = x->x_f = f; + + openframedatabyid(x->id, + &x->hvf, &x->hbits, &x->memvf, &x->membits, &vfp); + if(!x->membits) + { + post("vsig~: no memory at %d", x->id); + return; + } else + { + x->size = vfp->f.height*vfp->f.lpitch; + x->pos = 0; + } +} + +static void *vsig_new(t_floatarg f) +{ + t_vsig *x = (t_vsig *)pd_new(vsig_class); + x->id = -1; + x->x_f = f; + x->hvf=NULL; + x->memvf=NULL; + x->hbits=NULL; + x->membits=NULL; + outlet_new(&x->x_obj, gensym("signal")); + outlet_new(&x->x_obj, gensym("signal")); + x->x_bang = outlet_new(&x->x_obj, gensym("bang")); + return (x); +} + +static void vsig_destroy(t_vsig *x) +{ + if(x->membits!=NULL) smfree(&x->hbits, x->membits); + if(x->memvf!=NULL) smfree(&x->hvf, x->memvf); +} + +void vsig_tilde_setup(void) +{ + vsig_class = class_new(gensym("vsig~"), + (t_newmethod)vsig_new, (t_method)vsig_destroy, + sizeof(t_vsig), 0, A_DEFFLOAT, 0); + class_addfloat(vsig_class, (t_method)vsig_float); + class_addmethod(vsig_class, (t_method)vsig_dsp, gensym("dsp"), 0); +} diff --git a/Patches/vsig~.dll b/Patches/vsig~.dll Binary files differnew file mode 100644 index 0000000..554cdfe --- /dev/null +++ b/Patches/vsig~.dll diff --git a/Patches/vsig~.exp b/Patches/vsig~.exp Binary files differnew file mode 100644 index 0000000..26db989 --- /dev/null +++ b/Patches/vsig~.exp diff --git a/Patches/vsig~.lib b/Patches/vsig~.lib Binary files differnew file mode 100644 index 0000000..fa4c919 --- /dev/null +++ b/Patches/vsig~.lib diff --git a/Patches/vsig~.obj b/Patches/vsig~.obj Binary files differnew file mode 100644 index 0000000..ba38233 --- /dev/null +++ b/Patches/vsig~.obj diff --git a/Patches/vsnapshot~.c b/Patches/vsnapshot~.c new file mode 100644 index 0000000..ba5e980 --- /dev/null +++ b/Patches/vsnapshot~.c @@ -0,0 +1,139 @@ +#include "m_pd.h" +#include "math.h" +#include "sharemem.h" +#include "vframe.h" + +/* -------------------------- vsnapshot~ ------------------------------ */ +static t_class *vsnapshot_class; + +typedef struct _vsnapshot +{ + t_object x_obj; + float x_f; + int id; + HANDLE hvf, hbits; + LPVOID memvf, membits; + unsigned long pos, size; +} t_vsnapshot; + +static t_int *vsnapshot_perform(t_int *w) +{ + t_vsnapshot *x = (t_vsnapshot *)(w[1]); + t_float *in = (t_sample *)(w[2]); + t_float *sync = (t_sample *)(w[3]); + int n = (int)(w[4]); + short *p16; + long *p32; + struct vframeimage *vfp=x->memvf; + unsigned long bytespp; + + if(!vfp || !x->membits) return(w+5); + + bytespp = vfp->f.pixelformat / 8; + + switch(vfp->f.pixelformat) + { + case 16: + p16 = x->membits; + while (n--) + { + if(*sync>0 && *sync<1) + x->pos=*sync * (float)(x->size / bytespp); + else + if(*sync==1) x->pos=(x->size / bytespp)-1; + + p16[x->pos++] = sampletocolor16(*in); + in++; + sync++; + if(x->pos*bytespp >= x->size) + { + x->pos=0; + outlet_float(x->x_obj.ob_outlet, x->id); + } + } + break; + case 32: + p32 = x->membits; + while (n--) + { + if(*sync>0 && *sync<1) + x->pos=*sync * (float)(x->size / bytespp); + else + if(*sync==1) x->pos=(x->size / bytespp)-1; + + p32[x->pos++] = sampletocolor32(*in); + in++; + sync++; + if(x->pos*bytespp >= x->size) + { + x->pos=0; + outlet_float(x->x_obj.ob_outlet, x->id); + } + } + break; + } + return(w+5); +} + +static void vsnapshot_dsp(t_vsnapshot *x, t_signal **sp) +{ + dsp_add(vsnapshot_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n); +} + +static void vsnapshot_float(t_vsnapshot *x, t_float f) +{ + struct vframeimage *vfp; + + if(x->id==f && x->membits!=NULL) + { + outlet_float(x->x_obj.ob_outlet, x->id); + return; + } + + x->id = x->x_f = f; + + openframedatabyid(x->id, + &x->hvf, &x->hbits, &x->memvf, &x->membits, &vfp); + if(!x->membits) + { + post("vsnapshot~: no memory at %d", x->id); + return; + } else + { + x->size = vfp->f.height*vfp->f.lpitch; + x->pos = 0; + outlet_float(x->x_obj.ob_outlet, x->id); + } +} + +static void *vsnapshot_new(t_floatarg f) +{ + t_vsnapshot *x = (t_vsnapshot *)pd_new(vsnapshot_class); + x->x_f = f; + x->pos=0; + x->hvf=NULL; + x->memvf=NULL; + x->hbits=NULL; + x->membits=NULL; + inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("signal"), gensym("signal")); + inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("ft1")); + outlet_new(&x->x_obj, gensym("float")); + return (x); +} + +static void vsnapshot_destroy(t_vsnapshot *x) +{ + if(x->membits!=NULL) smfree(&x->hbits, x->membits); + if(x->memvf!=NULL) smfree(&x->hvf, x->memvf); +} + +void vsnapshot_tilde_setup(void) +{ + vsnapshot_class = class_new(gensym("vsnapshot~"), + (t_newmethod)vsnapshot_new, (t_method)vsnapshot_destroy, + sizeof(t_vsnapshot), 0, A_DEFFLOAT, 0); + CLASS_MAINSIGNALIN(vsnapshot_class, t_vsnapshot, x_f); + class_addmethod(vsnapshot_class, (t_method)vsnapshot_float, + gensym("ft1"), A_FLOAT, 0); + class_addmethod(vsnapshot_class, (t_method)vsnapshot_dsp, gensym("dsp"), 0); +} diff --git a/Patches/vsnapshot~.dll b/Patches/vsnapshot~.dll Binary files differnew file mode 100644 index 0000000..bc3187a --- /dev/null +++ b/Patches/vsnapshot~.dll diff --git a/Patches/vsnapshot~.exp b/Patches/vsnapshot~.exp Binary files differnew file mode 100644 index 0000000..2d397e5 --- /dev/null +++ b/Patches/vsnapshot~.exp diff --git a/Patches/vsnapshot~.lib b/Patches/vsnapshot~.lib Binary files differnew file mode 100644 index 0000000..b6ac3d4 --- /dev/null +++ b/Patches/vsnapshot~.lib diff --git a/Patches/vsnapshot~.obj b/Patches/vsnapshot~.obj Binary files differnew file mode 100644 index 0000000..a199364 --- /dev/null +++ b/Patches/vsnapshot~.obj diff --git a/Patches/vsnap~.pd b/Patches/vsnap~.pd new file mode 100644 index 0000000..241e8ba --- /dev/null +++ b/Patches/vsnap~.pd @@ -0,0 +1,18 @@ +#N canvas 86 302 458 308 12; +#X obj 164 170 vsnapshot~; +#X obj 239 80 reset; +#X obj 239 131 vframe \$1 \$2; +#X obj 164 211 outlet; +#X obj 120 80 inlet~; +#X obj 179 80 inlet~; +#X text 13 6 wrapper for vsnapshot~; +#X text 67 45 video signal | sync signal; +#X text 170 242 outlet to fs.frame; +#X obj 253 108 bng 15 250 50 0 empty empty empty 20 8 0 8 -262144 -1 +-1; +#X connect 0 0 3 0; +#X connect 1 0 2 0; +#X connect 2 0 0 2; +#X connect 4 0 0 0; +#X connect 5 0 0 1; +#X connect 9 0 2 0; |