FastLED 3.9.15
Loading...
Searching...
No Matches
audio_processor.h
Go to the documentation of this file.
1#pragma once
2
3#ifndef FL_AUDIO_AUDIO_PROCESSOR_H
4#define FL_AUDIO_AUDIO_PROCESSOR_H
5
6#include "fl/audio/audio.h" // IWYU pragma: keep
7#include "fl/audio/audio_context.h" // IWYU pragma: keep
8#include "fl/audio/audio_detector.h" // IWYU pragma: keep
9#include "fl/audio/detector/vibe.h" // IWYU pragma: keep - detector::VibeLevels used in public callback API
13#include "fl/stl/shared_ptr.h"
14#include "fl/stl/function.h" // IWYU pragma: keep
15#include "fl/stl/vector.h"
16#include "fl/task/task.h"
17#include "fl/stl/noexcept.h"
18
19namespace fl {
20namespace audio {
21
22class AudioManager;
23class IInput;
24
25// Forward declarations of detector types (defined in fl::audio::detector)
26namespace detector {
27class Beat;
28class FrequencyBands;
29class EnergyAnalyzer;
30class TempoAnalyzer;
31class Transient;
32class Silence;
34class Pitch;
35class Note;
36class Downbeat;
37class Backbeat;
38class Vocal;
39class Percussion;
40enum class PercussionType : u8;
41class ChordDetector;
42struct Chord;
43class KeyDetector;
44struct Key;
45class MoodAnalyzer;
46struct Mood;
47class BuildupDetector;
48struct Buildup;
49class DropDetector;
50struct Drop;
52struct Equalizer;
53struct EqualizerConfig;
54class Vibe;
55} // namespace detector
56
57class Processor {
58public:
61
62 // ----- Main Update -----
63 void update(const Sample& sample) FL_NOEXCEPT;
64
65 // Update detectors using an externally-provided Context (FFT already cached).
66 // Skips signal conditioning and setSample — caller is responsible for those.
67 void updateFromContext(shared_ptr<Context> externalContext) FL_NOEXCEPT;
68
69 // ----- Beat Detection Events -----
70 void onBeat(function<void()> callback) FL_NOEXCEPT;
71 void onBeatPhase(function<void(float phase)> callback) FL_NOEXCEPT;
72 void onOnset(function<void(float strength)> callback) FL_NOEXCEPT;
73 void onTempoChange(function<void(float bpm, float confidence)> callback) FL_NOEXCEPT;
74
75 // ----- Tempo Analysis Events -----
76 void onTempo(function<void(float bpm)> callback) FL_NOEXCEPT;
77 void onTempoWithConfidence(function<void(float bpm, float confidence)> callback) FL_NOEXCEPT;
78 void onTempoStable(function<void()> callback) FL_NOEXCEPT;
79 void onTempoUnstable(function<void()> callback) FL_NOEXCEPT;
80
81 // ----- Frequency Band Events -----
82 void onBass(function<void(float level)> callback) FL_NOEXCEPT;
83 void onMid(function<void(float level)> callback) FL_NOEXCEPT;
84 void onTreble(function<void(float level)> callback) FL_NOEXCEPT;
85 void onFrequencyBands(function<void(float bass, float mid, float treble)> callback) FL_NOEXCEPT;
86
87 // ----- detector::Equalizer Events (WLED-style, all 0.0-1.0) -----
88 void onEqualizer(function<void(const detector::Equalizer&)> callback) FL_NOEXCEPT;
89
90 // ----- Energy/Level Events -----
91 void onEnergy(function<void(float rms)> callback) FL_NOEXCEPT;
92 void onNormalizedEnergy(function<void(float normalizedRms)> callback) FL_NOEXCEPT;
93 void onPeak(function<void(float peak)> callback) FL_NOEXCEPT;
94 void onAverageEnergy(function<void(float avgEnergy)> callback) FL_NOEXCEPT;
95
96 // ----- Transient Detection Events -----
97 void onTransient(function<void()> callback) FL_NOEXCEPT;
98 void onTransientWithStrength(function<void(float strength)> callback) FL_NOEXCEPT;
99 void onAttack(function<void(float strength)> callback) FL_NOEXCEPT;
100
101 // ----- Silence Detection Events -----
102 void onSilence(function<void(u8 silent)> callback) FL_NOEXCEPT;
103 void onSilenceStart(function<void()> callback) FL_NOEXCEPT;
104 void onSilenceEnd(function<void()> callback) FL_NOEXCEPT;
105 void onSilenceDuration(function<void(u32 durationMs)> callback) FL_NOEXCEPT;
106
107 // ----- Dynamics Analysis Events -----
108 void onCrescendo(function<void()> callback) FL_NOEXCEPT;
109 void onDiminuendo(function<void()> callback) FL_NOEXCEPT;
110 void onDynamicTrend(function<void(float trend)> callback) FL_NOEXCEPT;
111 void onCompressionRatio(function<void(float compression)> callback) FL_NOEXCEPT;
112
113 // ----- Pitch Detection Events -----
114 void onPitch(function<void(float hz)> callback) FL_NOEXCEPT;
115 void onPitchWithConfidence(function<void(float hz, float confidence)> callback) FL_NOEXCEPT;
116 void onPitchChange(function<void(float hz)> callback) FL_NOEXCEPT;
117 void onVoiced(function<void(u8 voiced)> callback) FL_NOEXCEPT;
118
119 // ----- Note Detection Events -----
120 void onNoteOn(function<void(u8 note, u8 velocity)> callback) FL_NOEXCEPT;
121 void onNoteOff(function<void(u8 note)> callback) FL_NOEXCEPT;
122 void onNoteChange(function<void(u8 note, u8 velocity)> callback) FL_NOEXCEPT;
123
124 // ----- Downbeat Detection Events -----
125 void onDownbeat(function<void()> callback) FL_NOEXCEPT;
126 void onMeasureBeat(function<void(u8 beatNumber)> callback) FL_NOEXCEPT;
127 void onMeterChange(function<void(u8 beatsPerMeasure)> callback) FL_NOEXCEPT;
128 void onMeasurePhase(function<void(float phase)> callback) FL_NOEXCEPT;
129
130 // ----- Backbeat Detection Events -----
131 void onBackbeat(function<void(u8 beatNumber, float confidence, float strength)> callback) FL_NOEXCEPT;
132
133 // ----- Vocal Detection Events -----
134 void onVocal(function<void(u8 active)> callback) FL_NOEXCEPT;
135 void onVocalStart(function<void()> callback) FL_NOEXCEPT;
136 void onVocalEnd(function<void()> callback) FL_NOEXCEPT;
137 void onVocalConfidence(function<void(float confidence)> callback) FL_NOEXCEPT;
138
139 // ----- Percussion Detection Events -----
140 void onPercussion(function<void(detector::PercussionType type)> callback) FL_NOEXCEPT;
141 void onKick(function<void()> callback) FL_NOEXCEPT;
142 void onSnare(function<void()> callback) FL_NOEXCEPT;
143 void onHiHat(function<void()> callback) FL_NOEXCEPT;
144 void onTom(function<void()> callback) FL_NOEXCEPT;
145
146 // ----- detector::Chord Detection Events -----
147 void onChord(function<void(const detector::Chord& chord)> callback) FL_NOEXCEPT;
148 void onChordChange(function<void(const detector::Chord& chord)> callback) FL_NOEXCEPT;
149 void onChordEnd(function<void()> callback) FL_NOEXCEPT;
150
151 // ----- detector::Key Detection Events -----
152 void onKey(function<void(const detector::Key& key)> callback) FL_NOEXCEPT;
153 void onKeyChange(function<void(const detector::Key& key)> callback) FL_NOEXCEPT;
154 void onKeyEnd(function<void()> callback) FL_NOEXCEPT;
155
156 // ----- detector::Mood Analysis Events -----
157 void onMood(function<void(const detector::Mood& mood)> callback) FL_NOEXCEPT;
158 void onMoodChange(function<void(const detector::Mood& mood)> callback) FL_NOEXCEPT;
159 void onValenceArousal(function<void(float valence, float arousal)> callback) FL_NOEXCEPT;
160
161 // ----- detector::Buildup Detection Events -----
162 void onBuildupStart(function<void()> callback) FL_NOEXCEPT;
163 void onBuildupProgress(function<void(float progress)> callback) FL_NOEXCEPT;
164 void onBuildupPeak(function<void()> callback) FL_NOEXCEPT;
165 void onBuildupEnd(function<void()> callback) FL_NOEXCEPT;
166 void onBuildup(function<void(const detector::Buildup&)> callback) FL_NOEXCEPT;
167
168 // ----- detector::Drop Detection Events -----
169 void onDrop(function<void()> callback) FL_NOEXCEPT;
170 void onDropEvent(function<void(const detector::Drop&)> callback) FL_NOEXCEPT;
171 void onDropImpact(function<void(float impact)> callback) FL_NOEXCEPT;
172
173 // ----- Vibe Audio-Reactive Events -----
174 // Comprehensive self-normalizing levels, spikes, and raw values
175 void onVibeLevels(function<void(const detector::VibeLevels&)> callback) FL_NOEXCEPT;
176 void onVibeBassSpike(function<void()> callback) FL_NOEXCEPT;
177 void onVibeMidSpike(function<void()> callback) FL_NOEXCEPT;
178 void onVibeTrebSpike(function<void()> callback) FL_NOEXCEPT;
179
180 // ----- Polling Getters (float 0.0-1.0, bool, or integer) -----
181
182 // Vocal Detection
184
185 // Beat Detection
187 float getBPM() FL_NOEXCEPT;
188
189 // Energy Analysis
190 float getEnergy() FL_NOEXCEPT;
192
193 // Frequency Bands (normalized 0-1, per-band self-referential)
195 float getMidLevel() FL_NOEXCEPT;
197
198 // Frequency Bands (raw unnormalized energy)
199 float getBassRaw() FL_NOEXCEPT;
200 float getMidRaw() FL_NOEXCEPT;
202
203 // Silence Detection
204 bool isSilent() FL_NOEXCEPT;
206
207 // Transient Detection
209
210 // Dynamics Analysis
211 float getDynamicTrend() FL_NOEXCEPT; // -1.0 to 1.0
214
215 // Pitch Detection
217 float getPitch() FL_NOEXCEPT;
218
219 // Tempo Analysis
221 float getTempoBPM() FL_NOEXCEPT;
222
223 // detector::Buildup Detection
226
227 // detector::Drop Detection
229
230 // Percussion Detection
231 bool isKick() FL_NOEXCEPT;
232 bool isSnare() FL_NOEXCEPT;
233 bool isHiHat() FL_NOEXCEPT;
234 bool isTom() FL_NOEXCEPT;
235
236 // Note Detection
240
241 // Downbeat Detection
245
246 // Backbeat Detection
249
250 // detector::Chord Detection
252
253 // detector::Key Detection
255
256 // detector::Mood Analysis
258 float getMoodValence() FL_NOEXCEPT; // -1.0 to 1.0
259
260 // Vibe Audio-Reactive (self-normalizing, ~1.0 = average)
261 float getVibeBass() FL_NOEXCEPT; // Immediate relative bass level
262 float getVibeMid() FL_NOEXCEPT; // Immediate relative mid level
263 float getVibeTreb() FL_NOEXCEPT; // Immediate relative treble level
264 float getVibeVol() FL_NOEXCEPT; // Average of bass/mid/treb
265 float getVibeBassAtt() FL_NOEXCEPT; // Smoothed relative bass level
266 float getVibeMidAtt() FL_NOEXCEPT; // Smoothed relative mid level
267 float getVibeTrebAtt() FL_NOEXCEPT; // Smoothed relative treble level
268 float getVibeVolAtt() FL_NOEXCEPT; // Average of smoothed bands
269 bool isVibeBassSpike() FL_NOEXCEPT; // True when bass > bass_att (beat)
270 bool isVibeMidSpike() FL_NOEXCEPT; // True when mid > mid_att
271 bool isVibeTrebSpike() FL_NOEXCEPT; // True when treb > treb_att
272
273 // detector::Equalizer (WLED-style, all 0.0-1.0)
274 float getEqBass() FL_NOEXCEPT;
275 float getEqMid() FL_NOEXCEPT;
276 float getEqTreble() FL_NOEXCEPT;
277 float getEqVolume() FL_NOEXCEPT;
279 float getEqZcf() FL_NOEXCEPT;
280 float getEqBin(int index) FL_NOEXCEPT;
283
284 // detector::Equalizer P2: peak detection and dB mapping
287 float getEqVolumeDb() FL_NOEXCEPT;
288
289 // ----- Configuration -----
293 void setSampleRate(int sampleRate) FL_NOEXCEPT;
294 int getSampleRate() const FL_NOEXCEPT;
295
296 // ----- Gain Control -----
299 void setGain(float gain) FL_NOEXCEPT;
300 float getGain() const FL_NOEXCEPT;
301
302 // ----- Signal Conditioning -----
304 void setSignalConditioningEnabled(bool enabled) FL_NOEXCEPT;
306 void setNoiseFloorTrackingEnabled(bool enabled) FL_NOEXCEPT;
307
308 // ----- Microphone Profile -----
314
321
325
326 // ----- State Access -----
328 const Sample& getSample() const FL_NOEXCEPT;
329 void reset() FL_NOEXCEPT;
330
331private:
332 int mSampleRate = 44100;
333 float mGain = 1.0f;
340
341 // Active detector registry for two-phase update loop
344
345 // Lazy detector storage
366
367 // Lazy creation helpers
388
389 // Auto-pump support (used by CFastLED::add(Config))
390 fl::task::Handle mAutoTask;
392
395 friend class AudioManager;
396};
397
398} // namespace audio
399} // namespace fl
400
401#endif // FL_AUDIO_AUDIO_PROCESSOR_H
fl::UIAudio audio("Audio Input")
float rms(fl::span< const int16_t > data)
Definition simple.h:104
void bpm()
NoiseFloorTracker maintains an adaptive estimate of the background noise floor for audio signals,...
Get current statistics (for monitoring/debugging)
void onBuildupProgress(function< void(float progress)> callback) FL_NOEXCEPT
void onBuildupPeak(function< void()> callback) FL_NOEXCEPT
void onTempoUnstable(function< void()> callback) FL_NOEXCEPT
void onKeyChange(function< void(const detector::Key &key)> callback) FL_NOEXCEPT
float getEqDominantFreqHz() FL_NOEXCEPT
Frequency of strongest bin (Hz)
void onBuildup(function< void(const detector::Buildup &)> callback) FL_NOEXCEPT
float getMoodArousal() FL_NOEXCEPT
shared_ptr< detector::Vocal > mVocalDetector
float getVibeVol() FL_NOEXCEPT
void onVibeBassSpike(function< void()> callback) FL_NOEXCEPT
float getMidLevel() FL_NOEXCEPT
shared_ptr< detector::Percussion > getPercussionDetector() FL_NOEXCEPT
static fl::shared_ptr< Processor > createWithAutoInput(fl::shared_ptr< IInput > input) FL_NOEXCEPT
bool isSilent() FL_NOEXCEPT
shared_ptr< detector::DropDetector > getDropDetector() FL_NOEXCEPT
float getVibeBassAtt() FL_NOEXCEPT
shared_ptr< detector::DynamicsAnalyzer > mDynamicsAnalyzer
void onAverageEnergy(function< void(float avgEnergy)> callback) FL_NOEXCEPT
void onSnare(function< void()> callback) FL_NOEXCEPT
shared_ptr< detector::FrequencyBands > getFrequencyBands() FL_NOEXCEPT
void onVocalEnd(function< void()> callback) FL_NOEXCEPT
int getSampleRate() const FL_NOEXCEPT
shared_ptr< detector::BuildupDetector > getBuildupDetector() FL_NOEXCEPT
shared_ptr< detector::TempoAnalyzer > mTempoAnalyzer
u32 getSilenceDuration() FL_NOEXCEPT
void onTransientWithStrength(function< void(float strength)> callback) FL_NOEXCEPT
void onTreble(function< void(float level)> callback) FL_NOEXCEPT
fl::shared_ptr< IInput > mAudioInput
float getNoteVelocity() FL_NOEXCEPT
void onNoteChange(function< void(u8 note, u8 velocity)> callback) FL_NOEXCEPT
void onPitch(function< void(float hz)> callback) FL_NOEXCEPT
float getEqTreble() FL_NOEXCEPT
void onKick(function< void()> callback) FL_NOEXCEPT
void onChordChange(function< void(const detector::Chord &chord)> callback) FL_NOEXCEPT
float getEqBass() FL_NOEXCEPT
void updateFromContext(shared_ptr< Context > externalContext) FL_NOEXCEPT
float getEqVolumeNormFactor() FL_NOEXCEPT
void onMid(function< void(float level)> callback) FL_NOEXCEPT
float getBassRaw() FL_NOEXCEPT
bool isVibeBassSpike() FL_NOEXCEPT
SignalConditioner mSignalConditioner
void onMeterChange(function< void(u8 beatsPerMeasure)> callback) FL_NOEXCEPT
shared_ptr< detector::Downbeat > mDownbeatDetector
shared_ptr< detector::Percussion > mPercussionDetector
shared_ptr< detector::Note > getNoteDetector() FL_NOEXCEPT
void onChordEnd(function< void()> callback) FL_NOEXCEPT
shared_ptr< detector::EqualizerDetector > getEqualizerDetector() FL_NOEXCEPT
bool isVibeTrebSpike() FL_NOEXCEPT
float getEnergy() FL_NOEXCEPT
fl::task::Handle mAutoTask
float getDownbeatConfidence() FL_NOEXCEPT
float getTrebleRaw() FL_NOEXCEPT
shared_ptr< detector::ChordDetector > mChordDetector
float getChordConfidence() FL_NOEXCEPT
void onMoodChange(function< void(const detector::Mood &mood)> callback) FL_NOEXCEPT
void onDropImpact(function< void(float impact)> callback) FL_NOEXCEPT
const NoiseFloorTracker::Stats & getNoiseFloorStats() const FL_NOEXCEPT
shared_ptr< detector::Note > mNoteDetector
void onBass(function< void(float level)> callback) FL_NOEXCEPT
void onSilenceDuration(function< void(u32 durationMs)> callback) FL_NOEXCEPT
void onBackbeat(function< void(u8 beatNumber, float confidence, float strength)> callback) FL_NOEXCEPT
void onEqualizer(function< void(const detector::Equalizer &)> callback) FL_NOEXCEPT
void onTempoWithConfidence(function< void(float bpm, float confidence)> callback) FL_NOEXCEPT
void onBuildupStart(function< void()> callback) FL_NOEXCEPT
void onVocal(function< void(u8 active)> callback) FL_NOEXCEPT
void onDropEvent(function< void(const detector::Drop &)> callback) FL_NOEXCEPT
shared_ptr< detector::Vibe > getVibeDetector() FL_NOEXCEPT
shared_ptr< detector::EnergyAnalyzer > getEnergyAnalyzer() FL_NOEXCEPT
float getEqBin(int index) FL_NOEXCEPT
void onPeak(function< void(float peak)> callback) FL_NOEXCEPT
void onSilenceStart(function< void()> callback) FL_NOEXCEPT
void onBeat(function< void()> callback) FL_NOEXCEPT
u8 getCurrentNote() FL_NOEXCEPT
void setNoiseFloorTrackingEnabled(bool enabled) FL_NOEXCEPT
Enable/disable noise floor tracking.
shared_ptr< detector::EqualizerDetector > mEqualizerDetector
shared_ptr< detector::Beat > mBeatDetector
float getNoteConfidence() FL_NOEXCEPT
float getEqZcf() FL_NOEXCEPT
u8 getCurrentBeatNumber() FL_NOEXCEPT
float getBackbeatStrength() FL_NOEXCEPT
shared_ptr< Context > mContext
shared_ptr< detector::Backbeat > mBackbeatDetector
bool getEqIsSilence() FL_NOEXCEPT
void onAttack(function< void(float strength)> callback) FL_NOEXCEPT
bool isCrescendo() FL_NOEXCEPT
void onVibeTrebSpike(function< void()> callback) FL_NOEXCEPT
void onTempo(function< void(float bpm)> callback) FL_NOEXCEPT
shared_ptr< detector::Silence > getSilenceDetector() FL_NOEXCEPT
void onTempoStable(function< void()> callback) FL_NOEXCEPT
void onDiminuendo(function< void()> callback) FL_NOEXCEPT
float getVibeMid() FL_NOEXCEPT
float getBassLevel() FL_NOEXCEPT
float getMoodValence() FL_NOEXCEPT
void onFrequencyBands(function< void(float bass, float mid, float treble)> callback) FL_NOEXCEPT
shared_ptr< detector::KeyDetector > mKeyDetector
float getDropImpact() FL_NOEXCEPT
bool isDiminuendo() FL_NOEXCEPT
float getTrebleLevel() FL_NOEXCEPT
void onDrop(function< void()> callback) FL_NOEXCEPT
void onCrescendo(function< void()> callback) FL_NOEXCEPT
const SignalConditioner::Stats & getSignalConditionerStats() const FL_NOEXCEPT
Access signal conditioning statistics.
void setMicProfile(MicProfile profile) FL_NOEXCEPT
Set microphone correction profile for frequency response compensation.
void setGain(float gain) FL_NOEXCEPT
Set a simple digital gain multiplier applied to each sample before detector.
void onEnergy(function< void(float rms)> callback) FL_NOEXCEPT
float getEqMid() FL_NOEXCEPT
float getEqVolume() FL_NOEXCEPT
shared_ptr< detector::Vibe > mVibeDetector
shared_ptr< detector::Transient > getTransientDetector() FL_NOEXCEPT
MicProfile getMicProfile() const FL_NOEXCEPT
void onCompressionRatio(function< void(float compression)> callback) FL_NOEXCEPT
void onBuildupEnd(function< void()> callback) FL_NOEXCEPT
float getDynamicTrend() FL_NOEXCEPT
shared_ptr< detector::TempoAnalyzer > getTempoAnalyzer() FL_NOEXCEPT
float getKeyConfidence() FL_NOEXCEPT
void setSampleRate(int sampleRate) FL_NOEXCEPT
Set the sample rate for all frequency-based calculations.
shared_ptr< Context > getContext() const FL_NOEXCEPT
shared_ptr< detector::Downbeat > getDownbeatDetector() FL_NOEXCEPT
shared_ptr< detector::BuildupDetector > mBuildupDetector
void onKey(function< void(const detector::Key &key)> callback) FL_NOEXCEPT
void onVoiced(function< void(u8 voiced)> callback) FL_NOEXCEPT
void onOnset(function< void(float strength)> callback) FL_NOEXCEPT
void onBeatPhase(function< void(float phase)> callback) FL_NOEXCEPT
void onNoteOn(function< void(u8 note, u8 velocity)> callback) FL_NOEXCEPT
shared_ptr< detector::KeyDetector > getKeyDetector() FL_NOEXCEPT
float getTransientStrength() FL_NOEXCEPT
void onChord(function< void(const detector::Chord &chord)> callback) FL_NOEXCEPT
void onPercussion(function< void(detector::PercussionType type)> callback) FL_NOEXCEPT
float getTempoConfidence() FL_NOEXCEPT
float getEqVolumeDb() FL_NOEXCEPT
Volume in approximate dB.
const Sample & getSample() const FL_NOEXCEPT
void configureNoiseFloorTracker(const NoiseFloorTrackerConfig &config) FL_NOEXCEPT
Configure noise floor tracker.
void onSilenceEnd(function< void()> callback) FL_NOEXCEPT
void onKeyEnd(function< void()> callback) FL_NOEXCEPT
float getGain() const FL_NOEXCEPT
float getPitch() FL_NOEXCEPT
shared_ptr< detector::Transient > mTransientDetector
float getMidRaw() FL_NOEXCEPT
void onHiHat(function< void()> callback) FL_NOEXCEPT
void onSilence(function< void(u8 silent)> callback) FL_NOEXCEPT
void onVocalStart(function< void()> callback) FL_NOEXCEPT
float getBPM() FL_NOEXCEPT
void onDynamicTrend(function< void(float trend)> callback) FL_NOEXCEPT
float getMeasurePhase() FL_NOEXCEPT
bool isVibeMidSpike() FL_NOEXCEPT
float getVibeTreb() FL_NOEXCEPT
void onVibeLevels(function< void(const detector::VibeLevels &)> callback) FL_NOEXCEPT
void onVocalConfidence(function< void(float confidence)> callback) FL_NOEXCEPT
float getTempoBPM() FL_NOEXCEPT
void onPitchChange(function< void(float hz)> callback) FL_NOEXCEPT
void onNoteOff(function< void(u8 note)> callback) FL_NOEXCEPT
shared_ptr< detector::Pitch > getPitchDetector() FL_NOEXCEPT
float getEqAutoGain() FL_NOEXCEPT
vector< shared_ptr< Detector > > mActiveDetectors
void setSignalConditioningEnabled(bool enabled) FL_NOEXCEPT
Enable/disable signal conditioning pipeline (DC removal, spike filter, noise gate)
void onTransient(function< void()> callback) FL_NOEXCEPT
shared_ptr< detector::EnergyAnalyzer > mEnergyAnalyzer
shared_ptr< detector::Beat > getBeatDetector() FL_NOEXCEPT
NoiseFloorTracker mNoiseFloorTracker
float getBuildupIntensity() FL_NOEXCEPT
void onMeasurePhase(function< void(float phase)> callback) FL_NOEXCEPT
shared_ptr< detector::Pitch > mPitchDetector
void update(const Sample &sample) FL_NOEXCEPT
float getVibeTrebAtt() FL_NOEXCEPT
void onPitchWithConfidence(function< void(float hz, float confidence)> callback) FL_NOEXCEPT
void configureSignalConditioner(const SignalConditionerConfig &config) FL_NOEXCEPT
Configure signal conditioner.
float getEqDominantMagnitude() FL_NOEXCEPT
Magnitude of strongest bin (0.0-1.0)
void onTom(function< void()> callback) FL_NOEXCEPT
float getBuildupProgress() FL_NOEXCEPT
void onMood(function< void(const detector::Mood &mood)> callback) FL_NOEXCEPT
void onDownbeat(function< void()> callback) FL_NOEXCEPT
shared_ptr< detector::Vocal > getVocalDetector() FL_NOEXCEPT
void onTempoChange(function< void(float bpm, float confidence)> callback) FL_NOEXCEPT
shared_ptr< detector::MoodAnalyzer > getMoodAnalyzer() FL_NOEXCEPT
shared_ptr< detector::FrequencyBands > mFrequencyBands
float getBeatConfidence() FL_NOEXCEPT
float getVibeBass() FL_NOEXCEPT
shared_ptr< detector::Silence > mSilenceDetector
shared_ptr< detector::ChordDetector > getChordDetector() FL_NOEXCEPT
void registerDetector(shared_ptr< Detector > detector) FL_NOEXCEPT
shared_ptr< detector::DropDetector > mDropDetector
float getBackbeatConfidence() FL_NOEXCEPT
float getPitchConfidence() FL_NOEXCEPT
void onMeasureBeat(function< void(u8 beatNumber)> callback) FL_NOEXCEPT
void onNormalizedEnergy(function< void(float normalizedRms)> callback) FL_NOEXCEPT
float getVibeMidAtt() FL_NOEXCEPT
float getVibeVolAtt() FL_NOEXCEPT
~Processor() FL_NOEXCEPT
float getPeakLevel() FL_NOEXCEPT
void onValenceArousal(function< void(float valence, float arousal)> callback) FL_NOEXCEPT
shared_ptr< detector::MoodAnalyzer > mMoodAnalyzer
shared_ptr< detector::Backbeat > getBackbeatDetector() FL_NOEXCEPT
void onVibeMidSpike(function< void()> callback) FL_NOEXCEPT
float getVocalConfidence() FL_NOEXCEPT
void configureEqualizer(const detector::EqualizerConfig &config) FL_NOEXCEPT
Configure equalizer detector tuning parameters.
shared_ptr< detector::DynamicsAnalyzer > getDynamicsAnalyzer() FL_NOEXCEPT
SignalConditioner performs low-level audio preprocessing to clean raw PCM samples before FFT analysis...
Get current statistics (for debugging/monitoring)
Detects backbeats (beats 2 and 4 in 4/4 time) in music.
Definition backbeat.h:45
Detects downbeats (first beat of each measure) in music.
Definition downbeat.h:33
WLED-style equalizer detector that provides a 16-bin frequency spectrum normalized to 0....
Definition equalizer.h:83
Note - Musical note detection with MIDI output.
Definition note.h:32
Pitch - Continuous pitch tracking using autocorrelation.
Definition pitch.h:33
Transient - Detects sharp attack transients in audio.
Definition transient.h:21
Configuration for the equalizer detector.
Definition equalizer.h:26
MicProfile
Microphone frequency response correction profile.
@ None
No correction (flat response assumed)
Configuration for signal conditioning pipeline.
Configuration for noise floor tracking.
unsigned char u8
Definition stdint.h:131
CRGB sample(const CRGB *grid, const XYMap &xyMap, float x, float y, SampleMode mode)
Sample a pixel from a 2D CRGB grid at floating-point coordinates.
Definition sample.cpp.hpp:9
Base definition for an LED controller.
Definition crgb.hpp:179
Snapshot of self-normalizing MilkDrop-style vibe levels.
Definition audio_batch.h:21
#define FL_NOEXCEPT
Definition Keyboard.h:22
Snapshot of equalizer state, passed to onEqualizer callbacks.
Definition equalizer.h:49