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

Function samplesInRange

tests/fl/audio/synth.hpp:12–19  ·  view source on GitHub ↗

Helper to check if samples are within valid range [-1.0, 1.0] with some tolerance

Source from the content-addressed store, hash-verified

10
11// Helper to check if samples are within valid range [-1.0, 1.0] with some tolerance
12static bool samplesInRange(const float* samples, int32_t count, float tolerance = 1.5f) {
13 for (int32_t i = 0; i < count; ++i) {
14 if (samples[i] < -tolerance || samples[i] > tolerance) {
15 return false;
16 }
17 }
18 return true;
19}
20
21// Helper to check if waveform has significant variation (not all zeros or constant)
22static bool hasVariation(const float* samples, int32_t count) {

Callers 1

synth.hppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected