FastLED 3.9.15
Loading...
Searching...
No Matches

◆ ToBrightness()

float ToBrightness ( int velocity)

Definition at line 99 of file util.cpp.

99 {
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}
ValT Interp(const KeyT &k, const InterpData< KeyT, ValT > *array, const int n)

References Interp().

Referenced by KeyboardState::HandleNoteOn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: