29 using SelectedNote::SelectedNote;
31 [[nodiscard]] int32_t getMaxValue()
const override {
return 8; }
32 [[nodiscard]] int32_t getMinValue()
const override {
return 1; }
40 Note* leftMostNote = instrumentClipView.getLeftMostNotePressed();
43 Iterance iterance = leftMostNote->getIterance();
44 if (iterance == kDefaultIteranceValue) {
47 iterance = kCustomIteranceValue;
49 int32_t divisor = iterance.divisor;
50 this->setValue(std::clamp<int32_t>(divisor, 1, 8));
53 void writeCurrentValue()
override {
54 int32_t val = this->getValue();
55 Note* leftMostNote = instrumentClipView.getLeftMostNotePressed();
57 Iterance iterance = leftMostNote->getIterance();
58 if (iterance == kDefaultIteranceValue) {
61 iterance = kCustomIteranceValue;
63 int32_t mask = (1 << val) - 1;
65 int32_t newIteranceSteps = ((iterance.toInt() & 0xFF) & mask);
66 instrumentClipView.adjustNoteIteranceWithFinalValue(
Iterance{(uint8_t)val, newIteranceSteps});