Package org.scijava.util
Class TunePlayer
- java.lang.Object
-
- org.scijava.util.TunePlayer
-
public class TunePlayer extends Object
Any QBasic fans out there? ;-)- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description TunePlayer()TunePlayer(int sampleRate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseLine(SourceDataLine line)voiddownOctave()intgetMillis()Gets the current note length in milliseconds, by the current tempo.intgetNoteLength()intgetOctave()intgetSampleRate()intgetTempo()intgetTone(int step, char mod)Gets the value of the given tone for the current octave.SourceDataLineopenLine()booleanplay(String commandString)voidsetNoteLength(int noteLength)voidsetOctave(int octave)voidsetTempo(int tempo)inttoMillis(int noteLen)Converts the given note length to milliseconds, by the current tempo.voidupOctave()
-
-
-
Method Detail
-
getSampleRate
public int getSampleRate()
-
getNoteLength
public int getNoteLength()
-
getTempo
public int getTempo()
-
getOctave
public int getOctave()
-
getTone
public int getTone(int step, char mod)Gets the value of the given tone for the current octave.
-
getMillis
public int getMillis()
Gets the current note length in milliseconds, by the current tempo.
-
toMillis
public int toMillis(int noteLen)
Converts the given note length to milliseconds, by the current tempo.
-
setNoteLength
public void setNoteLength(int noteLength)
-
setTempo
public void setTempo(int tempo)
-
setOctave
public void setOctave(int octave)
-
downOctave
public void downOctave()
-
upOctave
public void upOctave()
-
openLine
public SourceDataLine openLine() throws LineUnavailableException
- Throws:
LineUnavailableException
-
closeLine
public void closeLine(SourceDataLine line)
-
play
public boolean play(String commandString)
-
-