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

Method OnPush2Control

Source/StepSequencer.cpp:576–601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576bool StepSequencer::OnPush2Control(Push2Control* push2, MidiMessageType type, int controlIndex, float midiValue)
577{
578 mPush2Connected = true;
579
580 if (type == kMidiMessage_Note)
581 {
582 if (controlIndex >= 36 && controlIndex <= 99)
583 {
584 int gridIndex = controlIndex - 36;
585 int gridX = gridIndex % 8;
586 int gridY = 7 - gridIndex / 8;
587 OnGridButton(gridX, gridY, midiValue / 127, mGridControlTarget->GetGridController());
588 return true;
589 }
590 }
591
592 if (type == kMidiMessage_PitchBend)
593 {
594 float val = midiValue / MidiDevice::kPitchBendMax;
595 mGridYOffDropdown->SetFromMidiCC(val, gTime, true);
596
597 return true;
598 }
599
600 return false;
601}
602
603void StepSequencer::UpdatePush2Leds(Push2Control* push2)
604{

Callers

nothing calls this directly

Calls 2

GetGridControllerMethod · 0.80
SetFromMidiCCMethod · 0.45

Tested by

no test coverage detected