// Disables input to volatile components
// gui.disable();
- // Creates the visualization thread and starts it.
+ System.out.println("Ticks/16: " + seq.getResolution()/4);
+
+ // Creates the visualisation thread and starts it.
player = new Thread () {
public void run() {
+ long position = sequencer.getTickPosition();
while(sequencer.isRunning()) {
+ long pos = sequencer.getTickPosition();
+ System.out.print(" ... " + (pos - position));
+ position = pos;
+
// Updates the GUI with the current tick position.
gui.update(sequencer.getTickPosition());
// Puts the thread to sleep for as long as it takes
// the sequencer to reach the next sixteenth.
try {
- sleep((long)((1000 * 60 * 1) / (getTempo() * 4)));
+ sleep((long)(15000 / getTempo()));
} catch (InterruptedException e) {
Moosique.stop();
}
* Returns the current editing position of the sequencer.
* @return the tick position
*/
- public static long getPosition() {
+ public static long getEditPosition() {
return editPosition;
}
* Sets the current editing position of the sequencer.
* @param ticks the tick position
*/
- public static void setPosition(long ticks) {
+ public static void setEditPosition(long ticks) {
editPosition = ticks;
}