Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jmms
Class MSCycle  view MSCycle download MSCycle.java

java.lang.Object
  extended byjava.lang.Thread
      extended byjmms.MSCycle
All Implemented Interfaces:
java.lang.Runnable

public class MSCycle
extends java.lang.Thread

MSCycle.java This class is for making it easy to play looped music via MIDI in realtime. You just give it a score and it keeps on looping. If you want it to change the looped music, then you give it a different score. The tempo can be changed independently of the score. Created on 11 March 2003, 14:17


Nested Class Summary
 
Nested classes inherited from class java.lang.Thread
java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  boolean playing
           
private  jm.music.data.Score score
           
private  Sequencer seq
           
private  double tempo
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MSCycle()
          to create an MSCycle with the default score of a one beat long note
MSCycle(jm.music.data.Score scoreToSet)
          Creates a new instance of MSCycle, with a specific score for it to play.
MSCycle(jm.music.data.Score scoreToSet, boolean playing)
          Creates a new instance of MSCycle, with a specific score for it to play.
 
Method Summary
 void run()
          To run the thread.
 void setScore(jm.music.data.Score toSet)
          Use this to set the new score.
 void setTempo(double newTempo)
          Use this to set the tempo.
 void startPlayback()
          Start or Restart the score looping.
 void stopPlayback()
          Halt the score looping.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tempo

private double tempo

score

private jm.music.data.Score score

seq

private Sequencer seq

playing

private boolean playing
Constructor Detail

MSCycle

public MSCycle()
to create an MSCycle with the default score of a one beat long note


MSCycle

public MSCycle(jm.music.data.Score scoreToSet)
Creates a new instance of MSCycle, with a specific score for it to play.


MSCycle

public MSCycle(jm.music.data.Score scoreToSet,
               boolean playing)
Creates a new instance of MSCycle, with a specific score for it to play.

Method Detail

run

public void run()
To run the thread.


setScore

public void setScore(jm.music.data.Score toSet)
Use this to set the new score.


setTempo

public void setTempo(double newTempo)
Use this to set the tempo.


stopPlayback

public void stopPlayback()
Halt the score looping.


startPlayback

public void startPlayback()
Start or Restart the score looping.