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 --- exciter/CHANGE.LOG | 5 --- exciter/CHANGES.LOG | 11 ++++++ exciter/exciter.c | 10 +++--- exciter/exciter.tk2c | 94 +++++++++++++++++++++++++++++++++++++++++++++++++ exciter/help-exciter.pd | 71 +++++++++++++++++++++++++++++++++++++ exciter/tk2c.bash | 24 +++++++++++++ 6 files changed, 204 insertions(+), 11 deletions(-) delete mode 100644 exciter/CHANGE.LOG create mode 100755 exciter/CHANGES.LOG create mode 100755 exciter/exciter.tk2c create mode 100644 exciter/help-exciter.pd create mode 100755 exciter/tk2c.bash (limited to 'exciter') diff --git a/exciter/CHANGE.LOG b/exciter/CHANGE.LOG deleted file mode 100644 index 358d509..0000000 --- a/exciter/CHANGE.LOG +++ /dev/null @@ -1,5 +0,0 @@ -0.2 - fixed : could set event nnumber to one - do not set "started" at initialization -0.1 - basic bang-events sequencer diff --git a/exciter/CHANGES.LOG b/exciter/CHANGES.LOG new file mode 100755 index 0000000..676922d --- /dev/null +++ b/exciter/CHANGES.LOG @@ -0,0 +1,11 @@ +0.5 + fixed coordinates for GOP support +0.4 + added GOP support +0.3 + adapted for pd 0.37 +0.2 + fixed : could set event nnumber to one + do not set "started" at initialization +0.1 + basic bang-events sequencer diff --git a/exciter/exciter.c b/exciter/exciter.c index a8fdeda..798f372 100644 --- a/exciter/exciter.c +++ b/exciter/exciter.c @@ -44,9 +44,8 @@ #include "t_tk.h" #include "exciter.h" -#ifdef _WIN32 +#ifdef NT #include -#include "timeval.h" #else #include #endif @@ -63,7 +62,7 @@ void canvas_startmotion(t_canvas *x); #define EXCITER_PIXEL_GRAIN 5 -static char *exciter_version = "exciter: a bang-events sequencer, version 0.4 (ydegoyon@free.fr)"; +static char *exciter_version = "exciter: a bang-events sequencer, version 0.5 (ydegoyon@free.fr)"; t_widgetbehavior exciter_widgetbehavior; static t_class *exciter_class; @@ -322,7 +321,7 @@ static void exciter_save(t_gobj *z, t_binbuf *b) int ei,gi; binbuf_addv(b, "ssiisiiifii", 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("exciter"), x->x_width, x->x_height, x->x_nbevents, x->x_timegrain, x->x_loop, x->x_save @@ -350,8 +349,7 @@ static void exciter_properties(t_gobj *z, t_glist *owner) t_exciter *x=(t_exciter *)z; sprintf(buf, "pdtk_exciter_dialog %%s %d %d %d %.2f %d %d\n", - (int)x->x_width, (int)x->x_height, (int)x->x_nbevents, - x->x_timegrain, x->x_loop, x->x_save ); + x->x_width, x->x_height, x->x_nbevents, x->x_timegrain, x->x_loop, x->x_save ); // post("exciter_properties : %s", buf ); gfxstub_new(&x->x_obj.ob_pd, x, buf); } diff --git a/exciter/exciter.tk2c b/exciter/exciter.tk2c new file mode 100755 index 0000000..e201737 --- /dev/null +++ b/exciter/exciter.tk2c @@ -0,0 +1,94 @@ +// ########### exciter procedures -- ydegoyon@free.fr ######### +sys_gui("proc exciter_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_width [concat graph_width_$vid]\n"); +sys_gui("global $var_graph_width\n"); +sys_gui("set var_graph_height [concat graph_height_$vid]\n"); +sys_gui("global $var_graph_height\n"); +sys_gui("set var_graph_nbevents [concat graph_nbevents_$vid]\n"); +sys_gui("global $var_graph_nbevents\n"); +sys_gui("set var_graph_timegrain [concat graph_timegrain_$vid]\n"); +sys_gui("global $var_graph_timegrain\n"); +sys_gui("set var_graph_loop [concat graph_loop_$vid]\n"); +sys_gui("global $var_graph_loop\n"); +sys_gui("set var_graph_save [concat graph_save_$vid]\n"); +sys_gui("global $var_graph_save\n"); +sys_gui("set cmd [concat $id dialog [eval concat $$var_graph_width] [eval concat $$var_graph_height] [eval concat $$var_graph_nbevents] [eval concat $$var_graph_timegrain] [eval concat $$var_graph_loop] [eval concat $$var_graph_save] \\;]\n"); +// puts stderr $cmd +sys_gui("pd $cmd\n"); +sys_gui("}\n"); +sys_gui("proc exciter_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 exciter_ok {id} {\n"); +sys_gui("exciter_apply $id\n"); +sys_gui("exciter_cancel $id\n"); +sys_gui("}\n"); +sys_gui("proc pdtk_exciter_dialog {id width height nbevents timegrain loop save } {\n"); +sys_gui("set vid [string trimleft $id .]\n"); +sys_gui("set var_graph_width [concat graph_width_$vid]\n"); +sys_gui("global $var_graph_width\n"); +sys_gui("set var_graph_height [concat graph_height_$vid]\n"); +sys_gui("global $var_graph_height\n"); +sys_gui("set var_graph_nbevents [concat graph_nbevents_$vid]\n"); +sys_gui("global $var_graph_nbevents\n"); +sys_gui("set var_graph_timegrain [concat graph_timegrain_$vid]\n"); +sys_gui("global $var_graph_timegrain\n"); +sys_gui("set var_graph_loop [concat graph_loop_$vid]\n"); +sys_gui("global $var_graph_loop\n"); +sys_gui("set var_graph_save [concat graph_save_$vid]\n"); +sys_gui("global $var_graph_save\n"); +sys_gui("set $var_graph_width $width\n"); +sys_gui("set $var_graph_height $height\n"); +sys_gui("set $var_graph_nbevents $nbevents\n"); +sys_gui("set $var_graph_timegrain $timegrain\n"); +sys_gui("set $var_graph_loop $loop\n"); +sys_gui("set $var_graph_save $save\n"); +sys_gui("toplevel $id\n"); +sys_gui("wm title $id {exciter}\n"); +sys_gui("wm protocol $id WM_DELETE_WINDOW [concat exciter_cancel $id]\n"); +sys_gui("label $id.label -text {EXCITER 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 \"exciter_cancel $id\"\n"); +sys_gui("button $id.buttonframe.apply -text {Apply} -command \"exciter_apply $id\"\n"); +sys_gui("button $id.buttonframe.ok -text {OK} -command \"exciter_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.lwidth -text \"Width :\"\n"); +sys_gui("entry $id.1rangef.width -textvariable $var_graph_width -width 7\n"); +sys_gui("pack $id.1rangef.lwidth $id.1rangef.width -side left\n"); +sys_gui("frame $id.2rangef\n"); +sys_gui("pack $id.2rangef -side top\n"); +sys_gui("label $id.2rangef.lheight -text \"Height :\"\n"); +sys_gui("entry $id.2rangef.height -textvariable $var_graph_height -width 7\n"); +sys_gui("pack $id.2rangef.lheight $id.2rangef.height -side left\n"); +sys_gui("frame $id.3rangef\n"); +sys_gui("pack $id.3rangef -side top\n"); +sys_gui("label $id.3rangef.lnbevents -text \"Nb Events :\"\n"); +sys_gui("entry $id.3rangef.nbevents -textvariable $var_graph_nbevents -width 7\n"); +sys_gui("pack $id.3rangef.lnbevents $id.3rangef.nbevents -side left\n"); +sys_gui("frame $id.4rangef\n"); +sys_gui("pack $id.4rangef -side top\n"); +sys_gui("label $id.4rangef.ltimegrain -text \"Time Grain (seconds) :\"\n"); +sys_gui("entry $id.4rangef.timegrain -textvariable $var_graph_timegrain -width 7\n"); +sys_gui("pack $id.4rangef.ltimegrain $id.4rangef.timegrain -side left\n"); +sys_gui("checkbutton $id.loop -text {Loop} -variable $var_graph_loop -anchor w\n"); +sys_gui("pack $id.loop -side top\n"); +sys_gui("checkbutton $id.save -text {Save contents} -variable $var_graph_save -anchor w\n"); +sys_gui("pack $id.save -side top\n"); +sys_gui("bind $id.1rangef.width [concat exciter_ok $id]\n"); +sys_gui("bind $id.2rangef.height [concat exciter_ok $id]\n"); +sys_gui("bind $id.3rangef.nbevents [concat exciter_ok $id]\n"); +sys_gui("bind $id.4rangef.timegrain [concat exciter_ok $id]\n"); +sys_gui("focus $id.1rangef.width\n"); +sys_gui("}\n"); +// ########### exciter procedures END -- ydegoyon@free.fr ######### diff --git a/exciter/help-exciter.pd b/exciter/help-exciter.pd new file mode 100644 index 0000000..ab60831 --- /dev/null +++ b/exciter/help-exciter.pd @@ -0,0 +1,71 @@ +#N canvas 103 12 970 685 10; +#X text 457 89 (invoke with Properties ); +#X text 458 78 You can set the following properties :; +#X text 478 110 * Width : graphical x size; +#X text 478 121 * Height : graphical y size; +#X text 612 498 bugs and comments @ ydegoyon@free.fr; +#X msg 587 271 \; pd dsp 0; +#X msg 653 271 \; pd dsp 1; +#X obj 32 56 exciter 400 200 16 0.1 1 1 1 14 1 15 3 52 5 30 5 69 6 +8 8 20 9 32 9 74 10 79 11 14 11 74 12 79 13 40 13 79 15 78; +#X text 456 50 Exciter controls a list of bang-events scheduled in +time; +#X obj 22 282 print e1; +#X text 478 132 * Number of events : number of simultaneous events +; +#X text 477 155 * Loop : looping flag; +#X msg 193 29 reset; +#X msg 103 29 pause; +#X msg 31 29 start; +#X msg 145 29 resume; +#X msg 70 29 stop; +#X text 44 363 so that events are triggered; +#X obj 653 249 loadbang; +#X msg 239 30 clear; +#X text 102 389 Note 2 : the event happens in the center (?) of the +polygon; +#X msg 286 30 dump; +#X text 478 144 * Time Grain : time grain betweeen each event; +#X obj 80 283 print e3; +#X obj 137 284 print e5; +#X obj 194 283 print e7; +#X obj 252 284 print e9; +#X obj 308 284 print e11; +#X obj 366 284 print e13; +#X obj 429 285 print e15; +#X obj 45 307 print e2; +#X obj 103 308 print e4; +#X obj 217 308 print e8; +#X obj 275 309 print e10; +#X obj 335 310 print e12; +#X obj 396 309 print e14; +#X obj 457 309 print e16; +#X obj 160 309 print e6; +#X text 523 411 ( 10 ms ) \, it won't be processed properly; +#X text 523 399 WARNING : you can't set time grain below 1 clock tick +; +#X text 46 352 Note 1 : the dsp has to be on; +#X connect 7 0 9 0; +#X connect 7 1 30 0; +#X connect 7 2 23 0; +#X connect 7 3 31 0; +#X connect 7 4 24 0; +#X connect 7 5 37 0; +#X connect 7 6 25 0; +#X connect 7 7 32 0; +#X connect 7 8 26 0; +#X connect 7 9 33 0; +#X connect 7 10 27 0; +#X connect 7 11 34 0; +#X connect 7 12 28 0; +#X connect 7 13 35 0; +#X connect 7 14 29 0; +#X connect 7 15 36 0; +#X connect 12 0 7 0; +#X connect 13 0 7 0; +#X connect 14 0 7 0; +#X connect 15 0 7 0; +#X connect 16 0 7 0; +#X connect 18 0 6 0; +#X connect 19 0 7 0; +#X connect 21 0 7 0; diff --git a/exciter/tk2c.bash b/exciter/tk2c.bash new file mode 100755 index 0000000..9dfeb03 --- /dev/null +++ b/exciter/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