[ javadoc ]
The AudioSignal interface is used by the Polyphonic interface and defines only two methods. These methods are:
[snip java]
void generate(float[] samples)
void generate(float[] samplesLeft, float[] samplesRight)
[/snip]
One of these methods will be called repeatedly by the Polyphonic object that an AudioSignal has been added to, depending upon whether the audio being generated is mono or stereo. The signal is expected to add itself to the signal that may or may not already be present in the arrays. It is not required that the values in the arrays remain in the range [-1, 1]. All of the signals included with Minim implement this interface and all you need to do to write your own signals is to create a class that implements this interface and then add an instance of it to an anything that is Polyphonic, such as an AudioOutput.
Code Sample (online example)
[snip code_sample]http://code.compartmental.net/minim/examples/AudioOutput/UserDefinedSignal/MouseSaw.pde[/snip]
[snip code_sample]http://code.compartmental.net/minim/examples/AudioOutput/UserDefinedSignal/UserDefinedSignal.pde[/snip]