FastLED 3.9.15
Loading...
Searching...
No Matches
advanced.h File Reference
#include <Arduino.h>
#include <FastLED.h>
#include "fl/ui/ui.h"
#include "fl/audio/audio.h"
#include "fl/fft.h"
#include "fl/math/xymap.h"
#include "fl/math/math.h"
#include "fl/stl/compiler_control.h"
+ Include dependency graph for advanced.h:

Go to the source code of this file.

Macros

#define COLOR_ORDER   GRB
 
#define FFT_SIZE   512
 
#define HEIGHT   64
 
#define LED_PIN   3
 
#define LED_TYPE   WS2812B
 
#define NUM_LEDS   (WIDTH * HEIGHT)
 
#define SAMPLE_RATE   44100
 
#define WIDTH   64
 

Functions

fl::UIAudio audio ("Audio Input")
 
fl::UISlider audioGain ("Audio Gain", 1.0f, 0.1f, 5.0f, 0.1f)
 
fl::UICheckbox autoGain ("Auto Gain", true)
 
fl::UICheckbox beatDetect ("Beat Detection", true)
 
fl::UICheckbox beatFlash ("Beat Flash", true)
 
fl::UISlider beatSensitivity ("Beat Sensitivity", 1.5f, 0.5f, 3.0f, 0.1f)
 
fl::UISlider brightness ("Brightness", 128, 0, 255, 1)
 
void clearDisplay ()
 
fl::UIDropdown colorPalette ("Color Palette", {"Rainbow", "Heat", "Ocean", "Forest", "Party", "Lava", "Cloud"})
 
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING(float-conversion) FL_DISABLE_WARNING(sign-conversion) fl fl::UIDescription description ("Real-time audio visualizations with beat detection and multiple modes")
 
bool detectBeat (float energy)
 
void drawFireEffect (float peak)
 
void drawMatrixRain (float peak)
 
void drawPlasmaWave (float peak)
 
void drawRadialSpectrum (fl::audio::fft::Bins *fft, float)
 
void drawSpectrumBars (fl::audio::fft::Bins *fft, float)
 
void drawVUMeter (float rms, float peak)
 
void drawWaveform (const fl::span< const int16_t > &pcm, float)
 
fl::UICheckbox enableAudio ("Enable Audio", true)
 
fl::UISlider fadeSpeed ("Fade Speed", 20, 0, 255, 1)
 
fl::CRGBPalette16 getCurrentPalette ()
 
void loop ()
 
fl::UICheckbox mirrorMode ("Mirror Mode", false)
 
fl::UISlider noiseFloor ("Noise Floor", 0.1f, 0.0f, 1.0f, 0.01f)
 
fl::UICheckbox pitchDetectEnable ("Pitch Detection", false)
 
fl::UICheckbox pitchVisualizer ("Show Pitch Visualizer", false)
 
void setup ()
 
fl::audio::SoundLevelMeter soundMeter (0.0, 0.0)
 
void updateAutoGain (float level)
 
fl::UIDropdown visualMode ("Visualization Mode", {"Spectrum Bars", "Radial Spectrum", "Waveform", "VU Meter", "Matrix Rain", "Fire Effect", "Plasma Wave"})
 
fl::XYMap xyMap (WIDTH, HEIGHT, false)
 

Variables

float autoGainValue = 1.0f
 
float beatAverage = 0
 
float beatHistory [20] = {0}
 
int beatHistoryIndex = 0
 
float beatVariance = 0
 
uint8_t currentMIDINote = 0
 
uint8_t currentVelocity = 0
 
float fftSmooth [NUM_BANDS] = {0}
 
uint8_t fireBuffer [WIDTH][HEIGHT] = {{0}}
 
uint8_t hue = 0
 
bool isBeat = false
 
uint32_t lastBeatTime = 0
 
fl::CRGB leds [NUM_LEDS]
 
bool noteIsOn = false
 
static const int NUM_BANDS = 16
 
float peakLevel = 0
 
fl::SoundToMIDI pitchConfig
 
fl::SoundToMIDIEngine * pitchEngine = nullptr
 
float plasma [WIDTH][HEIGHT] = {{0}}