|
|
@@ -99,6 +99,12 @@ struct Quantizer : Module { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void rotateNotes(int delta) { |
|
|
|
delta = eucMod(-delta, 12); |
|
|
|
std::rotate(&enabledNotes[0], &enabledNotes[delta], &enabledNotes[12]); |
|
|
|
updateRanges(); |
|
|
|
} |
|
|
|
|
|
|
|
json_t* dataToJson() override { |
|
|
|
json_t* rootJ = json_object(); |
|
|
|
|
|
|
@@ -253,6 +259,19 @@ struct QuantizerWidget : ModuleWidget { |
|
|
|
quantizerDisplay->setModule(module); |
|
|
|
addChild(quantizerDisplay); |
|
|
|
} |
|
|
|
|
|
|
|
void appendContextMenu(Menu* menu) override { |
|
|
|
Quantizer* module = getModule<Quantizer>(); |
|
|
|
|
|
|
|
menu->addChild(new MenuSeparator); |
|
|
|
|
|
|
|
menu->addChild(createMenuItem("Shift notes up", "", [=]() { |
|
|
|
module->rotateNotes(1); |
|
|
|
})); |
|
|
|
menu->addChild(createMenuItem("Shift notes down", "", [=]() { |
|
|
|
module->rotateNotes(-1); |
|
|
|
})); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
|