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

Function ToBrightness

examples/LuminescentGrand/shared/util.cpp:99–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99float ToBrightness(int velocity) {
100 typedef InterpData<int, float> Datum;
101 static const Datum kData[] = {
102 Datum(0, 0.02),
103 Datum(32, 0.02),
104 Datum(64, 0.10),
105 Datum(80, 0.30),
106 Datum(90, 0.90),
107 Datum(100, 1.00),
108 Datum(120, 1.00),
109 Datum(127, 1.00)
110 };
111
112 static const int n = sizeof(kData) / sizeof(kData[0]);
113 const float val = Interp(velocity, kData, n);
114
115 return val;
116}

Callers 1

HandleNoteOnMethod · 0.85

Calls 1

InterpFunction · 0.85

Tested by

no test coverage detected