31 using SelectedNoteRow::SelectedNoteRow;
33 [[nodiscard]] int32_t getMaxValue()
const override {
return 8; }
34 [[nodiscard]] int32_t getMinValue()
const override {
return 1; }
42 char modelStackMemory[MODEL_STACK_MAX_SIZE];
46 if (modelStackWithNoteRow->getNoteRowAllowNull() !=
nullptr) {
47 NoteRow* noteRow = modelStackWithNoteRow->getNoteRowAllowNull();
48 Iterance iterance = noteRow->iteranceValue;
49 if (iterance == kDefaultIteranceValue) {
52 iterance = kCustomIteranceValue;
54 int32_t divisor = iterance.divisor;
55 this->setValue(std::clamp<int32_t>(divisor, 1, 8));
59 void writeCurrentValue()
override {
60 int32_t val = this->getValue();
61 char modelStackMemory[MODEL_STACK_MAX_SIZE];
65 if (modelStackWithNoteRow->getNoteRowAllowNull() !=
nullptr) {
66 NoteRow* noteRow = modelStackWithNoteRow->getNoteRowAllowNull();
67 Iterance iterance = noteRow->iteranceValue;
68 if (iterance == kDefaultIteranceValue) {
71 iterance = kCustomIteranceValue;
73 int32_t mask = (1 << val) - 1;
75 int32_t newIteranceSteps = ((iterance.toInt() & 0xFF) & mask);
76 instrumentClipView.setNoteRowIteranceWithFinalValue(
Iterance{(uint8_t)val, newIteranceSteps});