commit 05afff01f8f9f8354889a76ef766933ac1134f64
parent f3f21a92bedc48064aeffdd24404bfd604d24932
Author: Matt Demanett <matt@demanett.net>
Date: Sat, 3 Oct 2020 22:51:56 -0400
SWITCH81: add exclusive option -- only one switch can be on at a time.
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/README-prerelease.md b/README-prerelease.md
@@ -679,7 +679,7 @@ _Polyphony:_ <a href="#polyphony">Polyphonic</a>, with polyphonic channels defin
#### <a name="switch1616"></a> SWITCH1616
-An 16x16 version of SWITCH44.
+A 16x16 version of SWITCH44.
_Polyphony:_ <a href="#polyphony">Polyphonic</a>, with polyphonic channels defined by input 1.
diff --git a/src/matrix_base.cpp b/src/matrix_base.cpp
@@ -259,7 +259,7 @@ void SwitchMatrixModule::configSwitchParam(int id, const char* label) {
void SwitchMatrixModule::switchChanged(int id, float value) {
if (value != 0.0f) {
int row = (id - _firstParamID) % _ins;
- int col = (id - _firstParamID) / _outs;
+ int col = (id - _firstParamID) / _ins;
if (_rowExclusive) {
for (int i = 0; i < col; ++i) {
@@ -333,4 +333,7 @@ void SwitchMatrixModuleWidget::contextMenu(Menu* menu) {
menu->addChild(new OptionMenuItem("Exclusive by rows", [m]() { return m->_rowExclusive; }, [m]() { m->setRowExclusive(!m->_rowExclusive); }));
menu->addChild(new OptionMenuItem("Exclusive by columns", [m]() { return m->_columnExclusive; }, [m]() { m->setColumnExclusive(!m->_columnExclusive); }));
}
+ else {
+ menu->addChild(new OptionMenuItem("Exclusive", [m]() { return m->_columnExclusive; }, [m]() { m->setColumnExclusive(!m->_columnExclusive); }));
+ }
}