public class VoiceAllocator extends java.lang.Object implements Instrument
| Constructor and Description |
|---|
VoiceAllocator(UnitVoice[] voices)
Create an allocator for the array of UnitVoices.
|
| Modifier and Type | Method and Description |
|---|---|
void |
allNotesOff(TimeStamp timeStamp)
Turn off all the note currently on.
|
Synthesizer |
getSynthesizer() |
int |
getVoiceCount() |
void |
noteOff(int tag,
TimeStamp timeStamp)
Turn off the voice associated with the given tag if allocated.
|
void |
noteOn(int tag,
double frequency,
double amplitude,
TimeStamp timeStamp)
Play a note on the voice and associate it with the given tag.
|
void |
setPort(int tag,
java.lang.String portName,
double value,
TimeStamp timeStamp)
Set a port on the voice associated with the given tag if allocated.
|
void |
usePreset(int presetIndex,
TimeStamp timeStamp) |
public VoiceAllocator(UnitVoice[] voices)
voices - public Synthesizer getSynthesizer()
public int getVoiceCount()
public void allNotesOff(TimeStamp timeStamp)
allNotesOff in interface Instrumentpublic void noteOn(int tag,
double frequency,
double amplitude,
TimeStamp timeStamp)
noteOn in interface Instrumentpublic void noteOff(int tag,
TimeStamp timeStamp)
noteOff in interface Instrumentpublic void setPort(int tag,
java.lang.String portName,
double value,
TimeStamp timeStamp)
setPort in interface Instrumentpublic void usePreset(int presetIndex,
TimeStamp timeStamp)
usePreset in interface Instrument