//finalSong.add(rhythm);
player.play(finalSong);
}
public static void playRhythm(String[] instruments, final String[] rhythms) {
Rhythm rhythm = new Rhythm();
int layer = 1;
for (int i = 0; i < instruments.length && i < rhythms.length; i++) {
String instrumID = getInstrumentRealName(instruments[i]);
char caracter = caracteres[i];
String aux = rhythms[i].replace("*", caracter + "");
rhythm.setLayer(layer, aux);
rhythm.addSubstitution('.', "Ri");
rhythm.addSubstitution(caracter, "[" + instrumID + "]i");
layer++;
}
final Rhythm final_rhythm = rhythm;
Thread bateria = new Thread() {
@Override
public void run() {
Pattern pattern = final_rhythm.getPattern();
pattern.repeat(3);
Player player = new Player();
player.play(pattern);
System.out.println("Fin de reproducción de ritmo");
}