MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / UpdateVelocityLights

Method UpdateVelocityLights

Source/StepSequencer.cpp:243–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243void StepSequencer::UpdateVelocityLights()
244{
245 if (mVelocityGridController->GetGridController() == nullptr)
246 return;
247
248 float stepVelocity = 0;
249 if (mHeldButtons.size() > 0)
250 stepVelocity = mGrid->GetVal(mHeldButtons.begin()->mCol, mHeldButtons.begin()->mRow);
251
252 for (int x = 0; x < mVelocityGridController->GetGridController()->NumCols(); ++x)
253 {
254 for (int y = 0; y < mVelocityGridController->GetGridController()->NumRows(); ++y)
255 {
256 GridColor color;
257 if (stepVelocity >= (8 - y) / 8.0f)
258 color = kGridColor2Bright;
259 else
260 color = kGridColorOff;
261
262 mVelocityGridController->GetGridController()->SetLight(x, y, color);
263 }
264 }
265}
266
267void StepSequencer::UpdateMetaLights()
268{

Callers

nothing calls this directly

Calls 6

GetGridControllerMethod · 0.80
sizeMethod · 0.80
GetValMethod · 0.80
NumColsMethod · 0.45
NumRowsMethod · 0.45
SetLightMethod · 0.45

Tested by

no test coverage detected