This sketch demonstrates how to use a TriangleWave with an AudioOutput.
Move the mouse up and down to change the frequency, left and right to change the panning.
TriangleWave is a subclass of Oscillator, which is an abstract class that implements the interface AudioSignal.
This means that it can be added to an AudioOutput and the AudioOutput will call one of the two
generate functions, depending on whether the AudioOutput is STEREO or MONO. Since it is an
abstract class, it can't be directly instantiated, it merely provides the functionality of
smoothly changing frequency, amplitude and pan. In order to have an Oscillator that actually
produces sound, you have to extend Oscillator and define the value function. This function
takes a step value and returns a sample value between -1 and 1.
Source code: TriangleWaveSignal
Built with Processing