[PD-cvs] externals/unauthorized/probalizer help-probalizer.pd, 1.2, 1.3 probalizer.tk2c, NONE, 1.1 tk2c.bash, NONE, 1.1 CHANGES.LOG, 1.2, 1.3 probalizer.c, 1.8, 1.9

Yves Degoyon sevyves at users.sourceforge.net
Wed Jul 26 18:54:26 CEST 2006


Update of /cvsroot/pure-data/externals/unauthorized/probalizer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7577

Modified Files:
	CHANGES.LOG probalizer.c 
Added Files:
	help-probalizer.pd probalizer.tk2c tk2c.bash 
Log Message:
fixed coordinates for GOP

Index: CHANGES.LOG
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/probalizer/CHANGES.LOG,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CHANGES.LOG	2 Mar 2005 02:47:29 -0000	1.2
--- CHANGES.LOG	26 Jul 2006 16:54:24 -0000	1.3
***************
*** 1,2 ****
--- 1,4 ----
+ 0.4
+   fixed coordinates for GOP support
  0.3
    added GOP support

--- NEW FILE: probalizer.tk2c ---
// ########### probalizer procedures -- ydegoyon at free.fr #########
sys_gui("proc probalizer_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_nvalues [concat graph_nvalues_$vid]\n");
sys_gui("global $var_graph_nvalues\n");
sys_gui("set var_graph_noccurrences [concat graph_noccurrences_$vid]\n");
sys_gui("global $var_graph_noccurrences\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_nvalues] [eval concat $$var_graph_noccurrences] [eval concat $$var_graph_save] \\;]\n");
// puts stderr $cmd
sys_gui("pd $cmd\n");
sys_gui("}\n");
sys_gui("proc probalizer_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 probalizer_ok {id} {\n");
sys_gui("probalizer_apply $id\n");
sys_gui("probalizer_cancel $id\n");
sys_gui("}\n");
sys_gui("proc pdtk_probalizer_dialog {id width height nvalues noccurrences 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_nvalues [concat graph_nvalues_$vid]\n");
sys_gui("global $var_graph_nvalues\n");
sys_gui("set var_graph_noccurrences [concat graph_noccurrences_$vid]\n");
sys_gui("global $var_graph_noccurrences\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_nvalues $nvalues\n");
sys_gui("set $var_graph_noccurrences $noccurrences\n");
sys_gui("set $var_graph_save $save\n");
sys_gui("toplevel $id\n");
sys_gui("wm title $id {probalizer}\n");
sys_gui("wm protocol $id WM_DELETE_WINDOW [concat probalizer_cancel $id]\n");
sys_gui("label $id.label -text {PROBALIZER 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 \"probalizer_cancel $id\"\n");
sys_gui("button $id.buttonframe.apply -text {Apply} -command \"probalizer_apply $id\"\n");
sys_gui("button $id.buttonframe.ok -text {OK} -command \"probalizer_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.lnvalues -text \"Values :\"\n");
sys_gui("entry $id.3rangef.nvalues -textvariable $var_graph_nvalues -width 7\n");
sys_gui("pack $id.3rangef.lnvalues $id.3rangef.nvalues -side left\n");
sys_gui("frame $id.4rangef\n");
sys_gui("pack $id.4rangef -side top\n");
sys_gui("label $id.4rangef.lnoccurrences -text \"Max Occurrences :\"\n");
sys_gui("entry $id.4rangef.noccurrences -textvariable $var_graph_noccurrences -width 7\n");
sys_gui("pack $id.4rangef.lnoccurrences $id.4rangef.noccurrences -side left\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 <KeyPress-Return> [concat probalizer_ok $id]\n");
sys_gui("bind $id.2rangef.height <KeyPress-Return> [concat probalizer_ok $id]\n");
sys_gui("bind $id.3rangef.nvalues <KeyPress-Return> [concat probalizer_ok $id]\n");
sys_gui("bind $id.4rangef.noccurrences <KeyPress-Return> [concat probalizer_ok $id]\n");
sys_gui("focus $id.1rangef.width\n");
sys_gui("}\n");
// ########### probalizer procedures END -- ydegoyon at free.fr #########

Index: probalizer.c
===================================================================
RCS file: /cvsroot/pure-data/externals/unauthorized/probalizer/probalizer.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** probalizer.c	18 Dec 2005 18:55:09 -0000	1.8
--- probalizer.c	26 Jul 2006 16:54:24 -0000	1.9
***************
*** 43,52 ****
  #include "probalizer.h"
  
! #ifdef _WIN32
  #include <io.h>
- #define random rand
  #else
  #include <unistd.h>
! #endif /* _WIN32 */
  
  #define DEFAULT_PROBALIZER_WIDTH 200
--- 43,51 ----
  #include "probalizer.h"
  
! #ifdef NT
  #include <io.h>
  #else
  #include <unistd.h>
! #endif
  
  #define DEFAULT_PROBALIZER_WIDTH 200
***************
*** 56,60 ****
  #define DEFAULT_PROB_VALUE 10
  
! static char   *probalizer_version = "probalizer : outputs integer values according to a drawn probability curve , version 0.3 (ydegoyon at free.fr)"; 
  
  t_widgetbehavior probalizer_widgetbehavior;
--- 55,59 ----
  #define DEFAULT_PROB_VALUE 10
  
! static char   *probalizer_version = "probalizer : outputs integer values according to a drawn probability curve , version 0.4 (ydegoyon at free.fr)"; 
  
  t_widgetbehavior probalizer_widgetbehavior;
***************
*** 277,281 ****
  
     binbuf_addv(b, "ssiisiiiii", gensym("#X"),gensym("obj"),
! 		(t_int)text_xpix(&x->x_obj, x->x_glist), (t_int)text_ypix(&x->x_obj, x->x_glist),
  		gensym("probalizer"), x->x_width, x->x_height,
  		x->x_nvalues, x->x_noccurrences, x->x_save );
--- 276,280 ----
  
     binbuf_addv(b, "ssiisiiiii", gensym("#X"),gensym("obj"),
! 		(t_int)x->x_obj.te_xpix, (t_int)x->x_obj.te_ypix,
  		gensym("probalizer"), x->x_width, x->x_height,
  		x->x_nvalues, x->x_noccurrences, x->x_save );

--- NEW FILE: help-probalizer.pd ---
#N canvas 191 -6 970 685 10;
#X text 374 167 (invoke with <right mouse>Properties );
#X text 375 156 You can set the following properties :;
#X text 395 188 * Width : graphical x size;
#X text 395 200 * Height : graphical y size;
#X text 442 506 bugs and comments @ ydegoyon at free.fr;
#X msg 404 603 \; pd dsp 0;
#X msg 470 603 \; pd dsp 1;
#X text 376 110 Probalizer output serial of integers according to the
probability curve;
#X obj 470 581 loadbang;
#X obj 64 92 probalizer 200 200 10 100 1 0 53 1 61 2 8 3 39 4 9 5 40
6 6 7 6 8 14 9 24;
#X text 395 213 * Values : number of values ( range is [ 1 \, nvalues
] );
#X msg 93 54 bang;
#X msg 93 4 bang;
#X text 389 458 but without repetitions;
#X msg 295 16 zero;
#X msg 294 40 equi;
#X text 389 433 Note = If the probabilities are all equal to 1 \,;
#X msg 293 64 reset;
#X text 338 63 Reset output;
#X text 396 227 * Max Occurrences : max number of occurences in a serial
;
#X obj 68 358 probalizer 200 200 10 100 1 0 19 1 15 2 4 3 17 4 5 5
14 6 1 7 0 8 4 9 7;
#X obj 193 331 loadbang;
#X msg 145 331 zero;
#X text 306 345 The output of first probalizer;
#X text 306 357 is stored in the second one;
#X floatatom 187 30 5 0 0;
#X msg 187 5 bang;
#X text 276 281 End of the serial;
#X text 390 445 probalizer behaves as a random object;
#X obj 276 308 print probalizer::end;
#X text 47 6 Start;
#X text 332 42 Set equal probabilities;
#X obj 93 29 metro 10;
#X connect 8 0 6 0;
#X connect 9 0 20 0;
#X connect 9 1 22 0;
#X connect 9 1 29 0;
#X connect 11 0 9 0;
#X connect 12 0 32 0;
#X connect 14 0 9 0;
#X connect 15 0 9 0;
#X connect 17 0 9 0;
#X connect 21 0 22 0;
#X connect 22 0 20 0;
#X connect 25 0 9 0;
#X connect 26 0 25 0;
#X connect 32 0 11 0;

--- NEW FILE: tk2c.bash ---
#!/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





More information about the Pd-cvs mailing list