I'm currently trying to use JFugue 5.0.9 successfully in my project and was going to use the delayed play feature to render a progress bar and the position of the notes. I've wrote my own parser and generated a pattern to play. The track uses chords (like "C4+B5q"). Whenever notes of a chord were coming up, a note event was triggered instead a chord event and the output of the DiagnosticParserListener was going out of sync. The player was fine and sounded right. Did I do something wrong with the chords notation?
The example and track I used:
import org.jfugue.player.Player;
import org.jfugue.temporal.TemporalPLP;
import org.staccato.StaccatoParser;
public class TemporalExample {
private static final String MUSIC = "TIME:3/4 T108 B4h D5q A4h G4i A4i B4h D5q A4h. B4h D5q A5h G5q D5h C5i B4i A4h G4i A4i B4h D5q A4h Rq B4h D5q A4h. B4h D5q A5h G5q D6h. D6q Rq G5s A5s B5s C6s D5+D6h C5+C6i B4+B5i C5+C6i B4+B5i G4+G5h C5+C6h B4+B5i A4+A5i B4+B5i A4+A5i E4+E5h D5+D6h C5+C6i B4+B5i T96 C5+C6i B4+B5i G4+G5q C5+C6q T86 G5+G6h. A5i C6i F6i A6i D6i B6i G7h.";
private static final long TEMPORAL_DELAY = 0;
public static void main(String[] args) {
// Part 1. Parse the original music
StaccatoParser parser = new StaccatoParser();
TemporalPLP plp = new TemporalPLP();
parser.addParserListener(plp);
parser.parse(MUSIC);
// Part 2. Send the events from Part 1, and play the original music with a delay
DiagnosticParserListener dpl = new DiagnosticParserListener(); // Or your AnimationParserListener!
plp.addParserListener(dpl);
new Player().delayPlay(TEMPORAL_DELAY, MUSIC);
plp.parse();
}
}