public class DefaultInstrument extends java.lang.Object implements Instrument
Constructor and Description |
---|
DefaultInstrument(float frequency,
AudioOutput output)
Construct a default instrument that will play a note at the given frequency on the given output.
|
Modifier and Type | Method and Description |
---|---|
void |
noteOff()
Turn off the default instrument.
|
void |
noteOn(float dur)
Turn on the default instrument
|
public DefaultInstrument(float frequency, AudioOutput output)
frequency
- the frequency of the noteoutput
- the output to play the note on when noteOn is calledpublic void noteOn(float dur)
noteOn
in interface Instrument
dur
- The duration of the note.public void noteOff()
noteOff
in interface Instrument