30 using SelectedNoteRow::SelectedNoteRow;
32 [[nodiscard]] int32_t getMaxValue()
const override {
return 8; }
33 [[nodiscard]] int32_t getMinValue()
const override {
return 1; }
41 char modelStackMemory[MODEL_STACK_MAX_SIZE];
45 if (modelStackWithNoteRow->getNoteRowAllowNull() !=
nullptr) {
46 NoteRow* noteRow = modelStackWithNoteRow->getNoteRowAllowNull();
47 Iterance iterance = noteRow->iteranceValue;
48 if (iterance == kDefaultIteranceValue) {
51 iterance = kCustomIteranceValue;
53 int32_t divisor = iterance.divisor;
54 this->setValue(std::clamp<int32_t>(divisor, 1, 8));
58 void writeCurrentValue()
override {
59 int32_t val = this->getValue();
60 char modelStackMemory[MODEL_STACK_MAX_SIZE];
64 if (modelStackWithNoteRow->getNoteRowAllowNull() !=
nullptr) {
65 NoteRow* noteRow = modelStackWithNoteRow->getNoteRowAllowNull();
66 Iterance iterance = noteRow->iteranceValue;
67 if (iterance == kDefaultIteranceValue) {
70 iterance = kCustomIteranceValue;
72 int32_t mask = (1 << val) - 1;
74 int32_t newIteranceSteps = ((iterance.toInt() & 0xFF) & mask);
75 instrumentClipView.setNoteRowIteranceWithFinalValue(
Iterance{(uint8_t)val, newIteranceSteps});