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

Function clampI16

tests/misc/vibe_mid_treb_dynamic_range.hpp:25–29  ·  view source on GitHub ↗

Clamp and cast a float to i16

Source from the content-addressed store, hash-verified

23
24// Clamp and cast a float to i16
25i16 clampI16(float v) {
26 if (v > 32767.0f) v = 32767.0f;
27 if (v < -32768.0f) v = -32768.0f;
28 return static_cast<i16>(v);
29}
30
31// Generate a multi-frequency audio::Sample (bass + mid + treble mixed)
32audio::Sample makeMix(float bassAmp, float midAmp, float trebAmp,

Callers 4

makeMixFunction · 0.85
makeMixWithNoiseFunction · 0.85
makeMixWithLeakageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected