43class KeyboardLayoutChord :
public ColumnControlsKeyboard {
45 KeyboardLayoutChord() =
default;
46 ~KeyboardLayoutChord()
override =
default;
51 bool encoderPressed =
false)
override;
54 void renderPads(
RGB image[][kDisplayWidth + kSideBarWidth])
override;
56 l10n::String name()
override {
return l10n::String::STRING_FOR_KEYBOARD_LAYOUT_CHORD_KEYBOARD; }
58 bool supportsKit()
override {
return false; }
59 RequiredScaleMode requiredScaleMode()
override {
return RequiredScaleMode::Disabled; }
60 bool supportsScale(Scale scale)
override {
return acceptedScales.find(scale) != acceptedScales.end(); }
62 ChordKeyboardMode mode = ChordKeyboardMode::COLUMN;
65 bool allowSidebarType(ColumnControlFunction sidebarType)
override;
68 void offsetPads(int32_t offset,
bool shiftEnabled);
69 void handleControlButton(int32_t x, int32_t y);
70 uint8_t noteFromCoordsRow(int32_t x, int32_t y, int32_t root,
NoteSet& scaleNotes, uint8_t scaleNoteCount);
73 void drawChordName(int16_t noteCode,
const char* chordName =
"",
const char* voicingName =
"");
75 Scale lastScale = NO_SCALE;
79 std::array<RGB, static_cast<int>(ChordQuality::CHORD_QUALITY_MAX)> qualityColours = {
80 colours::blue, colours::purple, colours::green, colours::kelly::very_light_blue,
81 colours::cyan, colours::yellow};
83 std::array<int32_t, kOctaveSize + kDisplayHeight + kDisplayWidth> qualities{};
85 std::array<int32_t, kDisplayWidth - 1> scaleSteps = {
88 SCALETHIRD + SCALEOCTAVE,
89 SCALESEVENTH + SCALEOCTAVE,
90 SCALEFIFTH + SCALEOCTAVE,
91 SCALETHIRD + 2 * SCALEOCTAVE,
92 SCALESECOND + 2 * SCALEOCTAVE,
93 SCALESIXTH + SCALEOCTAVE,
97 SCALETHIRD - SCALEOCTAVE,
104 std::array<
const std::array<
const Chord, majorChords.size()>*, 6> chordColumns = {
105 &majorChords, &minorChords, &diminishedChords, &augmentedChords, &dominantChords, &otherChords};
107 std::set<Scale> acceptedScales = {Scale::MAJOR_SCALE, Scale::MINOR_SCALE, Scale::DORIAN_SCALE,
108 Scale::PHRYGIAN_SCALE, Scale::LYDIAN_SCALE, Scale::MIXOLYDIAN_SCALE,
109 Scale::LOCRIAN_SCALE};
void handleHorizontalEncoder(int32_t offset, bool shiftEnabled, PressedPad presses[kMaxNumKeyboardPadPresses], bool encoderPressed=false) override
Will be called with offset 0 to recalculate bounds on clip changes.
Definition chord_keyboard.cpp:129