30 using SelectedNote::SelectedNote;
32 [[nodiscard]] int32_t getMaxValue()
const override {
return 8; }
33 [[nodiscard]] int32_t getMinValue()
const override {
return 1; }
41 Note* leftMostNote = instrumentClipView.getLeftMostNotePressed();
44 Iterance iterance = leftMostNote->getIterance();
45 if (iterance == kDefaultIteranceValue) {
48 iterance = kCustomIteranceValue;
50 int32_t divisor = iterance.divisor;
51 this->setValue(std::clamp<int32_t>(divisor, 1, 8));
54 void writeCurrentValue()
override {
55 int32_t val = this->getValue();
56 Note* leftMostNote = instrumentClipView.getLeftMostNotePressed();
58 Iterance iterance = leftMostNote->getIterance();
59 if (iterance == kDefaultIteranceValue) {
62 iterance = kCustomIteranceValue;
64 int32_t mask = (1 << val) - 1;
66 int32_t newIteranceSteps = ((iterance.toInt() & 0xFF) & mask);
67 instrumentClipView.adjustNoteIteranceWithFinalValue(
Iterance{(uint8_t)val, newIteranceSteps});