Manual: AudioEffect

[ javadoc | examples ]

The AudioEffect interface is used by the Effectable interface and defines only two methods. These methods are:

[snip java]
void process(float[] samples)
void process(float[] samplesLeft, float[] samplesRight)
[/snip]

One of these methods will be called repeatedly by the Effectable object that an AudioEffect has been added to, depending upon whether the audio being effected is mono or stereo. The effect is expected to modify these arrays in such a way that the values remain in the range [-1, 1]. All of the effects included with Minim implement this interface and all you need to do to write your own effects is to create a class that implements this interface and then add an instance of it to an anything that is Effectable, such as an AudioOutput.

Code Sample (online sample)

[snip code_sample]http://code.compartmental.net/minim/examples/AudioEffect/UserDefinedEffect/ReverseEffect.pde[/snip]
[snip code_sample]http://code.compartmental.net/minim/examples/AudioEffect/UserDefinedEffect/UserDefinedEffect.pde[/snip]

5 thoughts on “Manual: AudioEffect

  1. I congratulate for your work. I have only one question:

    How is it possible to add an echo effect in the process method without changing the length of float[] samp?

    Thanks in advance.

  2. @carlos The new Beta release has a Delay UGen you should check out!

    @Juan The short answer: by writing a delay effect. You don’t need to change the length of float[] samp to accomplish that.

    @liz Not easliy. A blog comment is not a good place for me to try to answer that question.

    Please direct further questions to the Processing forum! http://forum.processing.org