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

Method UpdateLights

Source/NoteStepSequencer.cpp:965–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963}
964
965void NoteStepSequencer::UpdateLights()
966{
967 if (mController)
968 {
969 for (int i = 0; i < NSS_MAX_STEPS; ++i)
970 {
971 int button = StepToButton(i);
972 int color = 0;
973 if (i < mLength)
974 {
975 if (i == mGrid->GetHighlightCol(NextBufferTime(true)))
976 {
977 color = LaunchpadInterpreter::LaunchpadColor(0, 3);
978 }
979 else if (mVels[i] > 1)
980 {
981 int level = (mVels[i] / 50) + 1;
982 color = LaunchpadInterpreter::LaunchpadColor(level, level);
983 }
984 else
985 {
986 color = LaunchpadInterpreter::LaunchpadColor(1, 0);
987 }
988 }
989 mController->SendNote(0, button, color);
990 }
991 }
992}
993
994int NoteStepSequencer::ButtonToStep(int button)
995{

Callers

nothing calls this directly

Calls 3

NextBufferTimeFunction · 0.85
GetHighlightColMethod · 0.45
SendNoteMethod · 0.45

Tested by

no test coverage detected