void interprete (int tempo, int repeticiones, int feel) { // feel es: 2 (semis) o 3 (ternario) // y ahora, ya tenemos suficientes datos, a generar el ritmo real-time... /* los datos son: num_grupet - nĂºmero de grupettos; grupeto[] - longitud de cada grupetto estruct - encabezado de cada grupetto */ char note; int vel; String play = ""; byte counter; for (i = 0; i < repeticiones; i++) { // repite n veces el mismo pattern counter = 0; for (f = 0; f < num_grupet; f++) { // calcula el grupetto play = ""; play += estruct.charAt(f); if (f==num_grupet-1) {note = estruct.charAt(0);} else {note = estruct.charAt(f+1);} vel = grupetto[f] - 2; switch (note) { case 'O': play = play + (relleno[vel][afir[vel][log_random(3, 3.5)]]); break; case 'B': switch (estruct.charAt(f)) { case 'O': play = play + (relleno[vel][antiB[vel][log_random(5, 3.5)]]); break; case 'B': play = play + (relleno[vel][antiB2[vel][log_random(3, 3.5)]]); break; case 'T': play = play + (relleno[vel][ambosB[vel][log_random(6, 3.5)]]); break; } break; case 'T': switch (estruct.charAt(f)) { case 'O': play = play + (relleno[vel][antiT[vel][log_random(8, 3.5)]]); break; case 'B': play = play + (relleno[vel][ambosT[vel][log_random(9, 3.5)]]); break; case 'T': play = play + (relleno[vel][antiT2[vel][log_random(6, 3.5)]]); break; } break; } for (h = 0; h < grupetto[f]; h++) { // toca el grupetto if (h==0) {vel = 80 + log_random (40, .2); } else {vel = 30 + log_random (60, 5);} note = play.charAt(h); if (counter == 0 && i == 0) {notte (53f, 120f);} float velBase; if (feel==2) {velBase = 20;} else {velBase = 0;} if (counter % unidad != 0) {notte (42f, velBase + (55 * ((counter-1)%feel)) + log_random (30, 1));} else {if (note=='O' && random(2) > 1.7) {note = 'C';}} switch (note) { case 'O': delay (tempo); break; case 'B': notte (36, vel); delay (tempo); break; case 'T': notte (38, vel); delay (tempo); break; case 'C': notte (42, vel); delay (tempo); break; case '!': notte (53, vel); delay (tempo); break; case 'b': notte (36, vel); delay (tempo/2); notte (35, vel-10); delay (tempo/2); break; case 't': notte (38, vel-10); delay (tempo/2); notte (40, vel); delay (tempo/2); break; } counter ++; } } } }