commit 1258bddac86d796a48256347ec22e03918843cf0
parent ae8b0593b3cb591a14866876e02fc9139cd6b6ab
Author: Adam M <aemalone@gmail.com>
Date: Sun, 24 May 2020 09:33:14 -0500
Knoly Pobs re-add the unused toggles params so old patches are compatabile
Diffstat:
3 files changed, 24 insertions(+), 22 deletions(-)
diff --git a/res/ComputerscareSolyPequencerPanel.svg b/res/ComputerscareSolyPequencerPanel.svg
@@ -26,9 +26,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="7.9999999"
- inkscape:cx="34.717698"
- inkscape:cy="276.34433"
+ inkscape:zoom="5.6568542"
+ inkscape:cx="24.111096"
+ inkscape:cy="343.51948"
inkscape:document-units="mm"
inkscape:current-layer="g1669"
showgrid="false"
@@ -278,10 +278,10 @@
</g>
<path
style="fill:#626262;fill-opacity:1;stroke:none;stroke-width:0.53296405;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 1.9745243,224.3018 -1.94771373,-4.72299 c 6.04481953,-0.0555 10.04134843,-0.464 13.62107943,-0.21394 l 2.263825,4.08991 c -4.541363,0.0382 -9.3957168,0.82606 -13.9371907,0.84709 z"
+ d="m 2.0797617,224.29595 -2.05295113,-4.71714 c 6.04481953,-0.0555 10.04134843,-0.464 13.62107943,-0.21394 l 2.263825,4.08991 c -4.8549,-0.0169 -9.6236702,0.79655 -13.8319533,0.84117 z"
id="path892"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccccc" />
+ sodipodi:nodetypes="ccccc" />
<path
sodipodi:nodetypes="cccccc"
inkscape:connector-curvature="0"
diff --git a/src/ComputerscareKnolyPobs.cpp b/src/ComputerscareKnolyPobs.cpp
@@ -4,13 +4,15 @@
struct ComputerscareKnolyPobs;
const int numKnobs = 16;
+const int numToggles = 16;
struct ComputerscareKnolyPobs : ComputerscarePolyModule {
ComputerscareSVGPanel* panelRef;
enum ParamIds {
KNOB,
- POLY_CHANNELS = KNOB + numKnobs,
+ TOGGLES = KNOB + numKnobs,
+ POLY_CHANNELS = TOGGLES + numToggles,
GLOBAL_SCALE,
GLOBAL_OFFSET,
NUM_PARAMS
@@ -38,23 +40,23 @@ struct ComputerscareKnolyPobs : ComputerscarePolyModule {
}
configParam(POLY_CHANNELS, 1.f, 16.f, 16.f, "Poly Channels");
configParam(GLOBAL_SCALE, -2.f, 2.f, 1.f, "Scale");
- configParam(GLOBAL_OFFSET, -10.f, 10.f, 0.f, "Offset"," volts");
+ configParam(GLOBAL_OFFSET, -10.f, 10.f, 0.f, "Offset", " volts");
}
void process(const ProcessArgs &args) override {
ComputerscarePolyModule::checkCounter();
float trim = params[GLOBAL_SCALE].getValue();
float offset = params[GLOBAL_OFFSET].getValue();
for (int i = 0; i < polyChannels; i++) {
- outputs[POLY_OUTPUT].setVoltage(params[KNOB + i].getValue()*trim+offset, i);
+ outputs[POLY_OUTPUT].setVoltage(params[KNOB + i].getValue()*trim + offset, i);
}
}
void checkPoly() override {
- polyChannels = params[POLY_CHANNELS].getValue();
- if(polyChannels == 0) {
- polyChannels=16;
- params[POLY_CHANNELS].setValue(16);
- }
- outputs[POLY_OUTPUT].setChannels(polyChannels);
+ polyChannels = params[POLY_CHANNELS].getValue();
+ if (polyChannels == 0) {
+ polyChannels = 16;
+ params[POLY_CHANNELS].setValue(16);
+ }
+ outputs[POLY_OUTPUT].setChannels(polyChannels);
}
};
@@ -119,26 +121,26 @@ struct ComputerscareKnolyPobsWidget : ModuleWidget {
panel->setBackground(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ComputerscareKnolyPobsPanel.svg")));
addChild(panel);
}
- channelWidget = new PolyOutputChannelsWidget(Vec(1,24),module,ComputerscareKnolyPobs::POLY_CHANNELS);
+ channelWidget = new PolyOutputChannelsWidget(Vec(1, 24), module, ComputerscareKnolyPobs::POLY_CHANNELS);
addOutput(createOutput<PointingUpPentagonPort>(Vec(30, 22), module, ComputerscareKnolyPobs::POLY_OUTPUT));
addChild(channelWidget);
- addParam(createParam<NoRandomSmallKnob>(Vec(11,54), module, ComputerscareKnolyPobs::GLOBAL_SCALE));
- addParam(createParam<NoRandomMediumSmallKnob>(Vec(32,57), module, ComputerscareKnolyPobs::GLOBAL_OFFSET));
+ addParam(createParam<NoRandomSmallKnob>(Vec(11, 54), module, ComputerscareKnolyPobs::GLOBAL_SCALE));
+ addParam(createParam<NoRandomMediumSmallKnob>(Vec(32, 57), module, ComputerscareKnolyPobs::GLOBAL_OFFSET));
float xx;
float yy;
- float yInitial=86;
+ float yInitial = 86;
float ySpacing = 34;
- float yRightColumnOffset=14.3/8;
+ float yRightColumnOffset = 14.3 / 8;
for (int i = 0; i < numKnobs; i++) {
xx = 1.4f + 24.3 * (i - i % 8) / 8;
- yy = yInitial + ySpacing* (i % 8) + yRightColumnOffset* (i - i % 8) ;
- addLabeledKnob(std::to_string(i + 1), xx, yy, module, i, (i - i % 8) * 1.2 - 3 +(i==8 ? 5 : 0), 2);
+ yy = yInitial + ySpacing * (i % 8) + yRightColumnOffset * (i - i % 8) ;
+ addLabeledKnob(std::to_string(i + 1), xx, yy, module, i, (i - i % 8) * 1.2 - 3 + (i == 8 ? 5 : 0), 2);
}
}
diff --git a/src/golyFunctions.cpp b/src/golyFunctions.cpp
@@ -50,7 +50,7 @@ void Goly::invoke(int algorithm, std::vector<float> gp, int num = 16) {
}
break;
case 4:
- //sin wave
+ //sine wave
for (int i = 0; i < num; i++) {
float ip = (float)i / num;
float d = trigFactor*(ip - gp[0]);