-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Animation that renders a music visualizer-like output to the Section. This doesn't do any direct audio processing, but instead takes output from a process such as a fast Fourier transform and converts it into a byte array.
Variables:
samples: double array containing output from FFT functionsample_size: the number of samples in the FFT arrayout: byte array for output of conversion fromsamples
When calling the set_input() function, the out array is initialized to the number of samples (only if it's uninitialized or different from the size of the samples array). It then converts the values from samples into bytes, which it stores in out.
When map() is called, the contents of out are scaled and set in map_. map() is called whenever set_input() is called or the grid resizes.
Users are expected to run set_input() as often as their FFT function can generate output. Users can also use any input values they want - it doesn't have to be output from an FFT function or even related to audio.