MCPcopy Create free account
hub / github.com/FastLED/FastLED / createFrequencyBins

Function createFrequencyBins

tests/fl/audio/detector/multiband_beat_detector.hpp:9–26  ·  view source on GitHub ↗

Helper: Create 16-element frequency bin array with specified band energies

Source from the content-addressed store, hash-verified

7
8// Helper: Create 16-element frequency bin array with specified band energies
9static array<float, 16> createFrequencyBins(float bassLevel, float midLevel, float trebleLevel) {
10 array<float, 16> bins;
11 bins.fill(0.1f); // Background noise level
12
13 // Bass bins (0-1)
14 bins[0] = bassLevel;
15 bins[1] = bassLevel;
16
17 // Mid bins (6-7)
18 bins[6] = midLevel;
19 bins[7] = midLevel;
20
21 // Treble bins (14-15)
22 bins[14] = trebleLevel;
23 bins[15] = trebleLevel;
24
25 return bins;
26}
27
28} // namespace test_multiband_beat
29using namespace test_multiband_beat;

Callers 1

Calls 1

fillMethod · 0.45

Tested by

no test coverage detected