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

Method GridUpdated

Source/NoteStepSequencer.cpp:425–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423}
424
425void NoteStepSequencer::GridUpdated(UIGrid* grid, int col, int row, float value, float oldValue)
426{
427 if (grid == mGrid)
428 {
429 for (int i = 0; i < mGrid->GetCols(); ++i)
430 {
431 bool colHasPitch = false;
432 for (int j = 0; j < mGrid->GetRows(); ++j)
433 {
434 float val = mGrid->GetVal(i, j);
435 if (val > 0)
436 {
437 mTones[i] = j;
438 mNoteLengths[i] = val;
439 colHasPitch = true;
440 break;
441 }
442 }
443
444 if (!colHasPitch)
445 mVels[i] = 0;
446 else if (colHasPitch && mVels[i] == 0)
447 mVels[i] = gStepVelocityLevels[(int)StepVelocityType::Normal] * 127;
448 mVelocityGrid->SetVal(i, 0, mVels[i] / 127.0f, false);
449 }
450 }
451 if (grid == mVelocityGrid)
452 {
453 for (int i = 0; i < mVelocityGrid->GetCols(); ++i)
454 mVels[i] = mVelocityGrid->GetVal(i, 0) * 127;
455 SyncGridToSeq();
456 }
457}
458
459int NoteStepSequencer::RowToPitch(int row)
460{

Callers

nothing calls this directly

Calls 4

GetValMethod · 0.80
SetValMethod · 0.80
GetColsMethod · 0.45
GetRowsMethod · 0.45

Tested by

no test coverage detected