This sketch demonstrates how to use the disableEffect(int) method of an Effectable class.
The class used here is AudioPlayer, but you can also disable effects on AudioInput,
AudioOutput, and AudioSample objects. Effects added to an Effectable are
stored in the order they are added. They are indexed starting from zero. So if you want to disable the third
effect in the chain you'd call disableEffect(2). This sketch adds four low pass filters to
the player which you can then disable in any order by pressing '1', '2', '3', and '4'. If you want to hear the
sound change with each disabling, then disable them in reverse order, 4 - 1.
Disabling an effect means that it stays attached to the Effectable you added it to and it
retains its position in the chain of effects. So you can renable it later without having to add it again
or insert it in the same position.
Source code: disableEffectByIndex waveform
Built with Processing