ddf.minim.ugens
Interface Instrument

All Known Implementing Classes:
DefaultInstrument

public interface Instrument

The Instrument interface is expected by AudioOutput.playNote. You can create your own instruments by implementing this interface in one of your classes. Typically, you will create a class that constructs a UGen chain: an Oscil patched to a filter patched to an ADSR. When noteOn is called you will patch the end of your chain to the AudioOutput you are using and when noteOff is called you will unpatch.

Author:
Damien Di Fede

Method Summary
 void noteOff()
          Stop playing a note.
 void noteOn(float duration)
          Start playing a note.
 

Method Detail

noteOn

void noteOn(float duration)
Start playing a note. Typically you will patch your UGen chain to your AudioOutput here.

Parameters:
duration - how long the note should last (i.e. noteOff will be called after this many seconds)

noteOff

void noteOff()
Stop playing a note. Typically you will unpatch your UGen chain from your AudioOutput here.