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.
|
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