Package ucar.unidata.util
Class MidiManager
java.lang.Object
ucar.unidata.util.MidiManager
Class MidiManager provides a wrapper around the java sound midi api.
This was originally taken from the javasound demo
- Version:
- $Revision: 1.6 $
- Author:
- IDV Development Team
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new MidiManager with defaultsMidiManager
(MidiProperties props) Construct with the specified properties and open it. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
todostatic Instrument[]
Get the list of instrumentsvoid
open()
Open up the midi systemvoid
play
(int key, long milliseconds) Play.void
setInstrument
(int index) Set the current instrumentvoid
setInstrument
(String instrumentName) Set the current instrumentvoid
setInstrument
(Instrument instrument) Set the instrument to usevoid
turnOffInABit
(int key, MidiChannel channel, int timeStamp, long milliseconds) Turn off in a thread
-
Constructor Details
-
MidiManager
public MidiManager()Create a new MidiManager with defaults -
MidiManager
Construct with the specified properties and open it.- Parameters:
props
- properties
-
-
Method Details
-
close
public void close()todo -
open
public void open()Open up the midi system -
setInstrument
public void setInstrument(int index) Set the current instrument- Parameters:
index
- index into the instruments
-
setInstrument
Set the current instrument- Parameters:
instrumentName
- name of the instrument
-
setInstrument
Set the instrument to use- Parameters:
instrument
- the instrument
-
getInstrumentList
Get the list of instruments- Returns:
- an array of instruments
-
play
public void play(int key, long milliseconds) Play.- Parameters:
key
- key to play inmilliseconds
- length of time
-
turnOffInABit
Turn off in a thread- Parameters:
key
- key to play inchannel
- channel to playtimeStamp
- timestampmilliseconds
- length of time
-