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

Method OnGridButton

Source/NoteStepSequencer.cpp:1156–1175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1154}
1155
1156void NoteStepSequencer::OnGridButton(int x, int y, float velocity, IGridController* grid)
1157{
1158 int col = x + mGridControlOffsetX;
1159 int row = y - mGridControlOffsetY;
1160 if (grid == mGridControlTarget->GetGridController() && col >= 0 && col < mLength && velocity > 0)
1161 {
1162 int tone = mGridControlTarget->GetGridController()->NumRows() - 1 - row;
1163 if (mTones[col] == tone && mVels[col] > 0)
1164 {
1165 mVels[col] = 0;
1166 }
1167 else
1168 {
1169 mTones[col] = tone;
1170 mVels[col] = velocity * 127;
1171 }
1172 SyncGridToSeq();
1173 UpdateGridControllerLights(false);
1174 }
1175}
1176
1177void NoteStepSequencer::ButtonClicked(ClickButton* button, double time)
1178{

Callers

nothing calls this directly

Calls 2

GetGridControllerMethod · 0.80
NumRowsMethod · 0.45

Tested by

no test coverage detected