From 2005cba607270a0e176d739361cb6327fab061f7 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Wed, 26 Jul 2006 17:01:23 +0000 Subject: fixed coordinates for GOP svn path=/trunk/externals/unauthorized/; revision=5416 --- filterbank~/CHANGES.LOG | 2 + filterbank~/Makefile | 2 +- filterbank~/filterbank~.c | 9 +- filterbank~/filterbank~.tk2c | 58 ++++++++++++ filterbank~/help-filterbank~.pd | 199 ++++++++++++++++++++++++++++++++++++++++ filterbank~/tk2c.bash | 24 +++++ 6 files changed, 288 insertions(+), 6 deletions(-) create mode 100755 filterbank~/filterbank~.tk2c create mode 100644 filterbank~/help-filterbank~.pd create mode 100755 filterbank~/tk2c.bash (limited to 'filterbank~') diff --git a/filterbank~/CHANGES.LOG b/filterbank~/CHANGES.LOG index a0b4205..b294e8b 100644 --- a/filterbank~/CHANGES.LOG +++ b/filterbank~/CHANGES.LOG @@ -1,3 +1,5 @@ +0.4 + fixed coordinates for GOP support 0.3 Added GOP support 0.2 diff --git a/filterbank~/Makefile b/filterbank~/Makefile index 121a5c8..731500e 100644 --- a/filterbank~/Makefile +++ b/filterbank~/Makefile @@ -71,7 +71,7 @@ pd_linux: $(NAME).pd_linux LINUXCFLAGS = -DPD -DUNIX -DICECAST -O2 -funroll-loops -fomit-frame-pointer \ -Wall -W -Wno-shadow -Wstrict-prototypes -g \ - -Wno-unused -Wno-parentheses -Wno-switch -Werror + -Wno-unused -Wno-parentheses -Wno-switch LINUXINCLUDE = -I../../src diff --git a/filterbank~/filterbank~.c b/filterbank~/filterbank~.c index 86bf5b9..64cf55c 100644 --- a/filterbank~/filterbank~.c +++ b/filterbank~/filterbank~.c @@ -33,12 +33,11 @@ #include "filterbank~.h" -#ifdef _WIN32 +#ifdef NT #include -#define random rand #else #include -#endif /* _WIN32 */ +#endif #define DEFAULT_FILTERBANK_LOWFREQ 0 #define DEFAULT_FILTERBANK_HIGHFREQ 1600 @@ -46,7 +45,7 @@ #define FILTERBANK_OUTLET_WIDTH 5 #define FILTERBANK_HEIGHT 16 -static char *filterbank_version = "filterbank : responses from a set of band-pass filters, version 0.3 (ydegoyon@free.fr)"; +static char *filterbank_version = "filterbank : responses from a set of band-pass filters, version 0.4 (ydegoyon@free.fr)"; t_widgetbehavior filterbank_widgetbehavior; static t_class *filterbank_class_tilde; @@ -253,7 +252,7 @@ static void filterbank_save(t_gobj *z, t_binbuf *b) t_int ii; binbuf_addv(b, "ssiisiii", gensym("#X"),gensym("obj"), - (t_int)text_xpix(&x->x_obj, x->x_glist), (t_int)text_ypix(&x->x_obj, x->x_glist), + (t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix, gensym("filterbank~"), x->x_lowfreq, x->x_highfreq, x->x_nbfilters ); binbuf_addv(b, ";"); diff --git a/filterbank~/filterbank~.tk2c b/filterbank~/filterbank~.tk2c new file mode 100755 index 0000000..13d8482 --- /dev/null +++ b/filterbank~/filterbank~.tk2c @@ -0,0 +1,58 @@ +// ########### filterbank procedures -- ydegoyon@free.fr ######### +sys_gui("proc filterbank_apply {id} {\n"); +// strip "." from the TK id to make a variable name suffix +sys_gui("set vid [string trimleft $id .]\n"); +// for each variable, make a local variable to hold its name... +sys_gui("set var_graph_lowfreq [concat graph_lowfreq_$vid]\n"); +sys_gui("global $var_graph_lowfreq\n"); +sys_gui("set var_graph_highfreq [concat graph_highfreq_$vid]\n"); +sys_gui("global $var_graph_highfreq\n"); +sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_lowfreq] [eval concat $$var_graph_highfreq] \\;]\n"); +// puts stderr $cmd +sys_gui("pd $cmd\n"); +sys_gui("}\n"); +sys_gui("proc filterbank_cancel {id} {\n"); +sys_gui("set cmd [concat $id cancel \\;]\n"); +// puts stderr $cmd +sys_gui("pd $cmd\n"); +sys_gui("}\n"); +sys_gui("proc filterbank_ok {id} {\n"); +sys_gui("filterbank_apply $id\n"); +sys_gui("filterbank_cancel $id\n"); +sys_gui("}\n"); +sys_gui("proc pdtk_filterbank_dialog {id lowfreq highfreq} {\n"); +sys_gui("set vid [string trimleft $id .]\n"); +sys_gui("set var_graph_lowfreq [concat graph_lowfreq_$vid]\n"); +sys_gui("global $var_graph_lowfreq\n"); +sys_gui("set var_graph_highfreq [concat graph_highfreq_$vid]\n"); +sys_gui("global $var_graph_highfreq\n"); +sys_gui("set $var_graph_lowfreq $lowfreq\n"); +sys_gui("set $var_graph_highfreq $highfreq\n"); +sys_gui("toplevel $id\n"); +sys_gui("wm title $id {filterbank}\n"); +sys_gui("wm protocol $id WM_DELETE_WINDOW [concat filterbank_cancel $id]\n"); +sys_gui("label $id.label -text {FILTERBANK PROPERTIES}\n"); +sys_gui("pack $id.label -side top\n"); +sys_gui("frame $id.buttonframe\n"); +sys_gui("pack $id.buttonframe -side bottom -fill x -pady 2m\n"); +sys_gui("button $id.buttonframe.cancel -text {Cancel} -command \"filterbank_cancel $id\"\n"); +sys_gui("button $id.buttonframe.apply -text {Apply} -command \"filterbank_apply $id\"\n"); +sys_gui("button $id.buttonframe.ok -text {OK} -command \"filterbank_ok $id\"\n"); +sys_gui("pack $id.buttonframe.cancel -side left -expand 1\n"); +sys_gui("pack $id.buttonframe.apply -side left -expand 1\n"); +sys_gui("pack $id.buttonframe.ok -side left -expand 1\n"); +sys_gui("frame $id.1rangef\n"); +sys_gui("pack $id.1rangef -side top\n"); +sys_gui("label $id.1rangef.llowfreq -text \"Lower Frequency :\"\n"); +sys_gui("entry $id.1rangef.lowfreq -textvariable $var_graph_lowfreq -width 7\n"); +sys_gui("pack $id.1rangef.llowfreq $id.1rangef.lowfreq -side left\n"); +sys_gui("frame $id.2rangef\n"); +sys_gui("pack $id.2rangef -side top\n"); +sys_gui("label $id.2rangef.lhighfreq -text \"Higher Frequency :\"\n"); +sys_gui("entry $id.2rangef.highfreq -textvariable $var_graph_highfreq -width 7\n"); +sys_gui("pack $id.2rangef.lhighfreq $id.2rangef.highfreq -side left\n"); +sys_gui("bind $id.1rangef.lowfreq [concat filterbank_ok $id]\n"); +sys_gui("bind $id.2rangef.highfreq [concat filterbank_ok $id]\n"); +sys_gui("focus $id.1rangef.lowfreq\n"); +sys_gui("}\n"); +// ########### filterbank procedures END -- ydegoyon@free.fr ######### diff --git a/filterbank~/help-filterbank~.pd b/filterbank~/help-filterbank~.pd new file mode 100644 index 0000000..855e833 --- /dev/null +++ b/filterbank~/help-filterbank~.pd @@ -0,0 +1,199 @@ +#N canvas 122 3 868 640 10; +#X text 387 606 bugs and comments @ ydegoyon@free.fr [-_-]; +#X text 256 524 (invoke with Properties ); +#X text 256 506 You can set the following properties :; +#X text 321 108 Constructor : filterbank~ + | filterbank~; +#X text 264 543 * Lower Frequency : lower frequency of all filters +; +#X text 264 556 * Higher Frequency : higher frequency of all filters +; +#X text 321 77 filterbank~ outputs the frequency response against a +set of band-pass filters; +#X obj 127 279 filterbank~ 0 2000 30; +#X text 387 588 part of unauthorized PD ( http://ydegoyon.free.fr ) +; +#X msg 31 20 bang; +#X obj 31 41 openpanel; +#X obj 31 62 t s b; +#X obj 77 62 float \$0; +#X text 31 1 Step 1 : Load a sound file; +#X obj 31 83 route float; +#X msg 336 250 bang; +#X obj 32 179 soundfiler; +#X obj 125 250 tabplay~ \$0-filterbank-sample; +#X obj 31 104 makefilename %d-filterbank-sample; +#X obj 32 137 pack s s; +#X msg 32 158 read -resize \$1 \$2; +#X obj 72 599 table \$0-filterbank-sample; +#X text 321 139 Example : filterbank~ 0 3000 30; +#X obj 86 330 env~; +#X obj 122 307 env~; +#X obj 121 329 env~; +#X obj 87 306 env~; +#X obj 101 359 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 113 359 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 125 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 138 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 91 250 dac~; +#X obj 156 331 env~; +#X obj 191 307 env~; +#X obj 191 330 env~; +#X obj 158 307 env~; +#X obj 171 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 183 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 195 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 208 361 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 227 331 env~; +#X obj 262 307 env~; +#X obj 262 330 env~; +#X obj 228 307 env~; +#X obj 242 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 254 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 266 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 279 361 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 297 331 env~; +#X obj 332 307 env~; +#X obj 332 330 env~; +#X obj 298 307 env~; +#X obj 312 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 324 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 336 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 349 361 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 367 331 env~; +#X obj 403 308 env~; +#X obj 402 330 env~; +#X obj 368 307 env~; +#X obj 382 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 394 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 406 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 419 361 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 438 330 env~; +#X obj 473 306 env~; +#X obj 473 329 env~; +#X obj 439 306 env~; +#X obj 453 359 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 465 359 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 477 359 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 490 360 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 513 328 env~; +#X obj 548 304 env~; +#X obj 548 327 env~; +#X obj 514 304 env~; +#X obj 528 357 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 540 357 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 552 357 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 565 358 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 580 328 env~; +#X obj 581 304 env~; +#X obj 595 357 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X obj 607 357 vsl 8 128 0 127 0 0 empty empty empty 20 8 0 8 -262144 +-1 -1 0 1; +#X text 203 228 Step 2 : See the filterbank~ output; +#X text 451 252 Step 3 : shift all the outputs randomly; +#X msg 458 274 randomize 1; +#X msg 547 274 randomize 0; +#X connect 7 0 26 0; +#X connect 7 1 23 0; +#X connect 7 2 24 0; +#X connect 7 3 25 0; +#X connect 7 4 35 0; +#X connect 7 5 32 0; +#X connect 7 6 33 0; +#X connect 7 7 34 0; +#X connect 7 8 43 0; +#X connect 7 9 40 0; +#X connect 7 10 41 0; +#X connect 7 11 42 0; +#X connect 7 12 51 0; +#X connect 7 13 48 0; +#X connect 7 14 49 0; +#X connect 7 15 50 0; +#X connect 7 16 59 0; +#X connect 7 17 56 0; +#X connect 7 18 57 0; +#X connect 7 18 58 0; +#X connect 7 20 67 0; +#X connect 7 21 64 0; +#X connect 7 22 65 0; +#X connect 7 23 66 0; +#X connect 7 24 75 0; +#X connect 7 25 72 0; +#X connect 7 26 73 0; +#X connect 7 27 74 0; +#X connect 7 28 81 0; +#X connect 7 29 80 0; +#X connect 9 0 10 0; +#X connect 10 0 11 0; +#X connect 11 0 19 0; +#X connect 11 1 12 0; +#X connect 12 0 14 0; +#X connect 14 0 18 0; +#X connect 15 0 17 0; +#X connect 17 0 31 0; +#X connect 17 0 7 0; +#X connect 17 0 31 1; +#X connect 18 0 19 1; +#X connect 19 0 20 0; +#X connect 20 0 16 0; +#X connect 23 0 28 0; +#X connect 24 0 29 0; +#X connect 25 0 30 0; +#X connect 26 0 27 0; +#X connect 32 0 37 0; +#X connect 33 0 38 0; +#X connect 34 0 39 0; +#X connect 35 0 36 0; +#X connect 40 0 45 0; +#X connect 41 0 46 0; +#X connect 42 0 47 0; +#X connect 43 0 44 0; +#X connect 48 0 53 0; +#X connect 49 0 54 0; +#X connect 50 0 55 0; +#X connect 51 0 52 0; +#X connect 56 0 61 0; +#X connect 57 0 62 0; +#X connect 58 0 63 0; +#X connect 59 0 60 0; +#X connect 64 0 69 0; +#X connect 65 0 70 0; +#X connect 66 0 71 0; +#X connect 67 0 68 0; +#X connect 72 0 77 0; +#X connect 73 0 78 0; +#X connect 74 0 79 0; +#X connect 75 0 76 0; +#X connect 80 0 83 0; +#X connect 81 0 82 0; +#X connect 86 0 7 0; +#X connect 87 0 7 0; diff --git a/filterbank~/tk2c.bash b/filterbank~/tk2c.bash new file mode 100755 index 0000000..9dfeb03 --- /dev/null +++ b/filterbank~/tk2c.bash @@ -0,0 +1,24 @@ +#!/bin/bash + +#set -x + +while read line +do + for word in $line + do + if [ "X"$word != "X"${word#\#} ] + then + echo // ${line#\#} + break + else + line=${line//\'/\\\'} +#useless, slashes never gets in + line=${line//\\/\\\\} +#this one's dirty, i know + line=${line//;/\\\\;} + line=${line//\"/\\\"} + echo 'sys_gui("'$line'\n");' + break + fi + done +done -- cgit v1.2.1