Update of /cvsroot/pure-data/externals/frankenstein In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21829
Modified Files: GArhythm.c Log Message: fixed a never-ending while in fitness4
Index: GArhythm.c =================================================================== RCS file: /cvsroot/pure-data/externals/frankenstein/GArhythm.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GArhythm.c 14 Dec 2005 11:48:47 -0000 1.3 --- GArhythm.c 15 Dec 2005 12:03:36 -0000 1.4 *************** *** 173,176 **** --- 173,178 ---- int max = BUFFER_LENGHT*2; int i; + /* + // commenting here I allow beat swapped rhythms to be considered as identical for (i=0; i<BUFFER_LENGHT; i++) { *************** *** 178,181 **** --- 180,184 ---- res++; } + */ for (i=0; i<BUFFER_LENGHT; i++) { *************** *** 209,212 **** --- 212,216 ---- static double GArhythm_evaluate_fitness3(char *woman, char *man) { + // TODO: DUMMY, not working! int i; short int global1[BUFFER_LENGHT]; *************** *** 228,232 **** }
! // svaforisce troppi colpi consecutivi static double GArhythm_evaluate_fitness4(char *woman, char *man) { --- 232,236 ---- }
! // penalyze too many consecutive beats static double GArhythm_evaluate_fitness4(char *woman, char *man) { *************** *** 241,245 **** while(i<BUFFER_LENGHT) { ! if (man[i] & (0x01<<j)) { // here is an event --- 245,249 ---- while(i<BUFFER_LENGHT) { ! if ((man[i] & (0x01<<j)) && (man[i-1] & (0x01<<j))) { // here is an event *************** *** 253,256 **** --- 257,261 ---- curr_consecutivi = 0; } + i++; } }