//set score tempo
double score_ratio = 60.0 / score.getTempo();
int partCounter = 0;
/* Enumerate through all parts */
while (enum1.hasMoreElements()) {
Part part = (Part) enum1.nextElement();
//set part tempo
double part_ratio = score_ratio;
if (part.getTempo() > 0.0)
part_ratio = 60.0 / part.getTempo();
/* Get the instrument being used for this part */
if (part.getInstrument() != NO_INSTRUMENT) {
try {
inst.push(instList[part.getInstrument()]);
} catch (ArrayIndexOutOfBoundsException npe) {
System.out.println("jMusic Audio warning: Can't find the instrument number " +
part.getInstrument() + " that you have specified for " +
"the part named " + part.getTitle() + ".");
}
}
System.out.println("Part " + partCounter++ + " '" + part.getTitle() + "'. ");
/* Enumerate through all phrases */
Enumeration enum2 = part.getPhraseList().elements();
int phraseCounter = 0;
while (enum2.hasMoreElements()) {
Phrase phr = (Phrase) enum2.nextElement();
//get phrase tempo
double phrase_ratio = part_ratio;