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

◆ ToBrightness()

float ToBrightness ( int velocity)

Definition at line 98 of file util.cpp.

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