|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rubato.audio.midi.MidiPlayer
public class MidiPlayer
This class provides various methods for playing denotators representing scores to MIDI output. Presently the MIDI device used is the Java software synthesizer. There are also methods for writing a score to a MIDI file.
Constructor Summary | |
---|---|
MidiPlayer()
Creates a new MIDI player. |
Method Summary | |
---|---|
void |
addReceiver(javax.sound.midi.Receiver r)
|
void |
close()
Closes the MIDI player. |
static java.lang.String[] |
getInstruments()
Returns the names of the instruments provided by the synthesizer. |
double |
getLatency()
|
double |
getPosition()
Returns the current position of the playing sequence. |
int |
getResolution()
Returns the resolution in ticks per quarter note. |
int |
getTempo()
Returns the default tempo in microseconds per quarter note. |
long |
getTickPosition()
Returns the current tick position of the playing sequence. |
boolean |
isOpen()
Returns true iff the sequencer is open and ready to play. |
boolean |
isRunning()
Returns true iff the sequencer is playing. |
void |
meta(javax.sound.midi.MetaMessage event)
|
void |
newSequence()
Creates a new sequence that can be filled with tracks. |
void |
open()
Opens the MIDI player. |
void |
pause()
Pause the currently playing sequence. |
void |
play()
Plays the current sequence. |
void |
resume()
Resumes the currently playing sequence. |
void |
setPlayTempoFactor(float f)
Sets the tempo scale. |
void |
setPosition(double pos)
Sets the current position of the playing sequence. |
void |
setProgram(int channel,
int program)
Sets the initial program for a channel. |
void |
setPrograms(int[] voices)
Sets the initial programs for the channels given by the array voices. |
void |
setResolution(int resolution)
Sets the resolution in ticks per quarter note. |
void |
setScore(Denotator score)
Sets the Score denotator that is to be played by MidiPlayer. |
void |
setStopListener(java.awt.event.ActionListener stopListener)
|
void |
setTempo(int mspq)
Sets the default tempo in microseconds per quarter note. |
void |
setTickPosition(long tick)
Sets the current tick position of the playing sequence. |
void |
writeSequence(java.io.OutputStream out)
Writes the sequence created by newSequence to an output stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MidiPlayer()
Method Detail |
---|
public static java.lang.String[] getInstruments()
public void open() throws javax.sound.midi.MidiUnavailableException
javax.sound.midi.MidiUnavailableException
public void close()
public void setResolution(int resolution)
public int getResolution()
public void setTempo(int mspq)
public int getTempo()
public void setPrograms(int[] voices)
voices.
- Parameters:
voices
- the program of channel i
is
voices[i]
public void setProgram(int channel, int program)
public void setScore(Denotator score)
public void newSequence()
public void play()
public void pause()
public void resume()
public void setPlayTempoFactor(float f)
public long getTickPosition()
public void setTickPosition(long tick)
public double getPosition()
public void setPosition(double pos)
public double getLatency()
public void addReceiver(javax.sound.midi.Receiver r)
public boolean isOpen()
public boolean isRunning()
public void setStopListener(java.awt.event.ActionListener stopListener)
public void writeSequence(java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public void meta(javax.sound.midi.MetaMessage event)
meta
in interface javax.sound.midi.MetaEventListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |