Public Member Functions | |
Rainbow () | |
void | process () throws PAVException |
void | setRange (float min, float max) |
void | setAutoRange () |
void | setMode (int mode) |
String | toString () |
void | dispose () |
Static Public Attributes | |
static final int | MODE_FREQUENCY = 1 |
static final int | MODE_INTENSITY = 2 |
Draws colored stripes based on the frequency or the intenstiy of the playing music. In frequency mode (MODE_FREQUENCY) the colors are chosen based on the frequency distribution of the sound (spectral centroid). In intensity mode (MODE_INTENSITY) the colors are based on the sound intensity (rms).
pav::lib::visualizer::Rainbow::Rainbow | ( | ) | [inline] |
Ctor.
void pav::lib::visualizer::Rainbow::dispose | ( | ) | [inline] |
Disposes this visualizer, releasing all resources that were used exclusively by this visualiter. Subsequent calls to any methods of the visualizer might cause exceptions.
Implements pav::lib::visualizer::Visualizer.
void pav::lib::visualizer::Rainbow::process | ( | ) | throws PAVException [inline] |
Draws to the PApplet specified by drawTo.
PAVException | If an error occures while drawing |
Implements pav::lib::visualizer::Visualizer.
void pav::lib::visualizer::Rainbow::setAutoRange | ( | ) | [inline] |
Tells the visualizer not to use a static range (see setRange()), but to calculate the range automatically.
void pav::lib::visualizer::Rainbow::setMode | ( | int | mode | ) | [inline] |
Sets the color mode. Must be a valid mode according to the MODE_ constants of this class. This will automatically set the range to values that make sense for the chosen mode (see setRange()).
mode | The mode to use. Must be valid (see MODE_ constants) |
void pav::lib::visualizer::Rainbow::setRange | ( | float | min, | |
float | max | |||
) | [inline] |
Sets the range to map colors to. For instance, if set to 500, 5000 (the default) the color mapping will be done based on values between these values, any values lower than 500 will be mapped to 500, and higher than 5000 to 5000. In intensity mode values are between 0 and 1.
min | The min value to use for color mapping. Must be >= 0 | |
max | The max value to use for color mapping. Must be > min |
String pav::lib::visualizer::Rainbow::toString | ( | ) | [inline] |
Returns a short string representation of this visualizer.
Implements pav::lib::visualizer::Visualizer.
final int pav::lib::visualizer::Rainbow::MODE_FREQUENCY = 1 [static] |
Choose colors based on the frequency distribution.
final int pav::lib::visualizer::Rainbow::MODE_INTENSITY = 2 [static] |
Choose colors based on the sound intensity.