Update of /cvsroot/pure-data/externals/frankenstein In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21172
Modified Files: common.c rhythms_memory.c test-rhythms_memory.pd Log Message: fixed a bug in duration2int, now rhythms_memory working
Index: test-rhythms_memory.pd =================================================================== RCS file: /cvsroot/pure-data/externals/frankenstein/test-rhythms_memory.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test-rhythms_memory.pd 7 Dec 2005 00:20:01 -0000 1.1 --- test-rhythms_memory.pd 22 Dec 2005 23:21:04 -0000 1.2 *************** *** 1,15 **** ! #N canvas 0 0 641 458 12; #X obj 134 262 rhythms_memory; #X msg 126 212 measure; #X msg 317 224 0; ! #X obj 168 69 metro 500; ! #X obj 130 107 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; ! #X obj 168 46 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; ! #X obj 169 92 int 0; ! #X obj 220 93 + 1; ! #X obj 169 115 % 4; ! #X floatatom 196 152 5 0 0 0 - - -; #X obj 127 155 sel 0; #X obj 125 185 bang; --- 1,14 ---- ! #N canvas 224 39 661 478 12; #X obj 134 262 rhythms_memory; #X msg 126 212 measure; #X msg 317 224 0; ! #X obj 168 46 metro 500; ! #X obj 130 84 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; ! #X obj 168 23 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; ! #X obj 169 69 int 0; ! #X obj 220 70 + 1; ! #X obj 169 92 % 4; #X obj 127 155 sel 0; #X obj 125 185 bang; *************** *** 22,26 **** #X floatatom 225 368 5 0 0 1 root_closeness - -; #X floatatom 257 391 5 0 0 1 sub_closeness - -; ! #X connect 0 0 13 0; #X connect 1 0 0 0; #X connect 2 0 0 0; --- 21,52 ---- #X floatatom 225 368 5 0 0 1 root_closeness - -; #X floatatom 257 391 5 0 0 1 sub_closeness - -; ! #X text 344 314 (0=known , 1=new root , 2=new sub); ! #X obj 169 115 t f f; ! #X msg 444 194 crash; ! #N canvas 0 0 454 304 drum 0; ! #X obj 108 27 inlet; ! #X obj 108 212 outlet~; ! #X obj 139 93 noise~; ! #X obj 122 159 *~; ! #X obj 207 155 line; ! #X msg 224 101 1 10; ! #X obj 311 89 delay 50; ! #X msg 314 112 0 100; ! #X obj 245 56 t b b; ! #X connect 0 0 8 0; ! #X connect 2 0 3 0; ! #X connect 3 0 1 0; ! #X connect 4 0 3 1; ! #X connect 5 0 4 0; ! #X connect 6 0 7 0; ! #X connect 7 0 4 0; ! #X connect 8 0 6 0; ! #X connect 8 1 5 0; ! #X restore 429 115 pd drum; ! #X obj 429 82 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 ! -1; ! #X obj 423 147 dac~; ! #X floatatom 192 152 5 0 0 0 - - -; ! #X connect 0 0 12 0; #X connect 1 0 0 0; #X connect 2 0 0 0; *************** *** 31,42 **** #X connect 6 0 8 0; #X connect 7 0 6 1; ! #X connect 8 0 9 0; ! #X connect 8 0 10 0; ! #X connect 10 0 11 0; ! #X connect 11 0 1 0; ! #X connect 12 0 2 0; ! #X connect 13 0 14 0; ! #X connect 13 1 15 0; ! #X connect 13 2 16 0; ! #X connect 13 3 17 0; ! #X connect 13 4 18 0; --- 57,75 ---- #X connect 6 0 8 0; #X connect 7 0 6 1; ! #X connect 8 0 19 0; ! #X connect 9 0 10 0; ! #X connect 10 0 1 0; ! #X connect 11 0 2 0; ! #X connect 12 0 13 0; ! #X connect 12 1 14 0; ! #X connect 12 2 15 0; ! #X connect 12 3 16 0; ! #X connect 12 4 17 0; ! #X connect 19 0 21 0; ! #X connect 19 0 24 0; ! #X connect 19 1 9 0; ! #X connect 20 0 0 0; ! #X connect 21 0 23 0; ! #X connect 21 0 23 1; ! #X connect 22 0 21 0; ! #X connect 22 0 11 0;
Index: rhythms_memory.c =================================================================== RCS file: /cvsroot/pure-data/externals/frankenstein/rhythms_memory.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rhythms_memory.c 22 Dec 2005 00:58:39 -0000 1.5 --- rhythms_memory.c 22 Dec 2005 23:21:04 -0000 1.6 *************** *** 196,199 **** --- 196,207 ---- }
+ // debugging function + void crash(t_rhythms_memory *x) + { + int *a; + a = malloc(sizeof(int)); + a[9999999999999999999] = 1; + } + void rhythms_memory_setup(void) { *************** *** 204,206 **** --- 212,218 ---- class_doaddfloat(rhythms_memory_class, (t_method)add_event);
+ class_addmethod(rhythms_memory_class, (t_method)crash, gensym("crash"), 0); + } + +
Index: common.c =================================================================== RCS file: /cvsroot/pure-data/externals/frankenstein/common.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** common.c 22 Dec 2005 00:58:38 -0000 1.15 --- common.c 22 Dec 2005 23:21:04 -0000 1.16 *************** *** 47,51 **** for (j=0; j<i; j++) { ! if ((dur.numerator==j) && (dur.denominator==i)) { return curr; --- 47,51 ---- for (j=0; j<i; j++) { ! if ((dur.numerator==j) && (dur.denominator==possible_denominators[i])) { return curr; *************** *** 613,617 **** // decide if add to the memory or if return the closest
! if (root_closeness_found>=min_to_be_same_rhythm) { // is close enough to be considered a rhythm --- 613,617 ---- // decide if add to the memory or if return the closest
! if (root_closeness_found >= (float)min_to_be_same_rhythm) { // is close enough to be considered a rhythm *************** *** 620,624 **** *id = id_found; *root_closeness = root_closeness_found; ! if (sub_closeness_found>=min_to_be_same_subrhythm) { // this is a known subrhythm --- 620,624 ---- *id = id_found; *root_closeness = root_closeness_found; ! if (sub_closeness_found >= (float)min_to_be_same_subrhythm) { // this is a known subrhythm