From a4429967730170ffff216dd556396f8a4627abc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juha=20Vehvil=C3=A4inen?= Date: Tue, 3 Jun 2003 21:09:13 +0000 Subject: *** empty log message *** svn path=/trunk/Framestein/; revision=676 --- Patches/fs.sonogram.pd | 138 +++++++++++++++++++++++++++---------------------- Patches/fs.vis.pd | 19 +++++++ Plugins/merge_mod.cpp | 66 +++++++++++------------ 3 files changed, 127 insertions(+), 96 deletions(-) create mode 100644 Patches/fs.vis.pd diff --git a/Patches/fs.sonogram.pd b/Patches/fs.sonogram.pd index 543e91e..b65a05a 100644 --- a/Patches/fs.sonogram.pd +++ b/Patches/fs.sonogram.pd @@ -1,63 +1,75 @@ -#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; +#N canvas 367 289 494 344 12; +#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 174 123 548 445 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 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 obj 383 35 switch~ 1024 1; +#X obj 383 10 inlet; +#X connect 0 0 2 0; +#X connect 1 0 9 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 7 0; +#X connect 9 0 14 0; +#X connect 9 1 11 0; +#X connect 9 2 7 0; +#X connect 10 0 8 0; +#X connect 11 0 20 0; +#X connect 12 0 16 0; +#X connect 13 0 12 0; +#X connect 14 0 10 0; +#X connect 15 0 11 1; +#X connect 15 0 14 1; +#X connect 16 0 15 0; +#X connect 17 0 22 0; +#X connect 18 0 17 0; +#X connect 18 0 19 0; +#X connect 19 0 22 0; +#X connect 20 0 22 0; +#X connect 24 0 23 0; +#X restore 78 151 pd writesono; +#X obj 253 123 loadbang; +#X msg 197 162 0; +#X msg 197 187 1; +#X obj 188 89 t b b b; +#X obj 231 162 delay 100; +#X connect 0 0 6 0; +#X connect 2 0 10 0; +#X connect 6 0 4 0; +#X connect 7 0 8 0; +#X connect 8 0 6 2; +#X connect 9 0 6 2; +#X connect 10 0 6 1; +#X connect 10 1 11 0; +#X connect 10 2 9 0; +#X connect 11 0 8 0; diff --git a/Patches/fs.vis.pd b/Patches/fs.vis.pd new file mode 100644 index 0000000..e6aa969 --- /dev/null +++ b/Patches/fs.vis.pd @@ -0,0 +1,19 @@ +#N canvas 81 22 821 315 12; +#X obj 55 80 inlet; +#X text 8 7 fs.vis -- make patch visible \, attempt to redock fs.frames +; +#X msg 65 114 bang; +#X obj 84 165 symbol \$1; +#X msg 106 233 \; \$1 vis 1; +#X text 8 31 args: \$1 patch name to make visible; +#X obj 252 164 delay 200; +#X obj 252 216 s fs_main; +#X obj 89 190 makefilename pd-%s; +#X msg 252 190 symbol redock; +#X connect 0 0 2 0; +#X connect 2 0 3 0; +#X connect 2 0 6 0; +#X connect 3 0 8 0; +#X connect 6 0 9 0; +#X connect 8 0 4 0; +#X connect 9 0 7 0; diff --git a/Plugins/merge_mod.cpp b/Plugins/merge_mod.cpp index 1aa9f16..b6bd214 100644 --- a/Plugins/merge_mod.cpp +++ b/Plugins/merge_mod.cpp @@ -1,33 +1,33 @@ -// -// merge_additive - add color components of two images, mod 255 -// - -#include "plugin.h" -#include "pixels.h" - -INFO("add color components of two images, modulus 255"); - -void perform_copy(_frame f1, _frame f2, _args a) -{ - arguments ar(a.s); - pixels p1(f1), p2(f2); - int r, g, b; - - float f = ar.count()>=1 ? atof(ar[0]) : 1; - - while(!p1.eof() && !p2.eof()) - { - r = (f * p1.red() + p2.red()); - g = (f * p1.green() + p2.green()); - b = (f * p1.blue() + p2.blue()); - - r = r % 255; - g = g % 255; - b = b % 255; - - p2.putrgb(r, g, b); - - p1.next(); - p2.next(); - } -} +// +// merge_mod - add color components of two images, mod 255 +// + +#include "plugin.h" +#include "pixels.h" + +INFO("add color components of two images, modulus 255"); + +void perform_copy(_frame f1, _frame f2, _args a) +{ + arguments ar(a.s); + pixels p1(f1), p2(f2); + int r, g, b; + + float f = ar.count()>=1 ? atof(ar[0]) : 1; + + while(!p1.eof() && !p2.eof()) + { + r = (f * p1.red() + p2.red()); + g = (f * p1.green() + p2.green()); + b = (f * p1.blue() + p2.blue()); + + r = r % 255; + g = g % 255; + b = b % 255; + + p2.putrgb(r, g, b); + + p1.next(); + p2.next(); + } +} -- cgit v1.2.1