How to Use
Upload an audio file or click "Activate Microphone" to visualize audio data in real-time. Adjust the sliders to map audio frequency and volume data to HSL color values for custom visual effects.
- Hue Multiplier: Adjusts how much average frequency influences color hue.
- Saturation Multiplier: Adjusts how much volume impacts color saturation.
- Lightness: Sets a fixed brightness for the color.
Understanding FFT and HSL Conversion
Fast Fourier Transform (FFT):
The FFT is used to convert a signal from its original time domain into a frequency domain. The formula for the discrete Fourier transform is:
\[ X_k = \sum_{n=0}^{N-1} x_n \cdot e^{-i \frac{2\pi}{N} kn} \]
where \(X_k\) is the output complex number representing amplitude and phase at frequency \(k\), \(x_n\) is the input time-domain signal, \(N\) is the number of samples, and \(i\) is the imaginary unit.
HSL Conversion:
- Hue (\(H\)): Calculated from the average frequency:
\[ H = \left(\frac{\text{Average Frequency}}{\text{Max Frequency}}\right) \times 360 \]
- Saturation (\(S\)): Based on volume:
\[ S = \left(\frac{\text{Volume}}{\text{Max Volume}}\right) \times 100 \]
- Lightness (\(L\)): Set at a constant value of \(50\%\).