commit bb5bbfa1c0748d62b2f918e89c15ec42840c25de
parent 6ede0848c600973c78f3e68b1f527377080aef31
Author: Adam M <aemalone@gmail.com>
Date: Sun, 9 Feb 2020 17:54:18 -0600
patrix lives
Diffstat:
5 files changed, 141 insertions(+), 24 deletions(-)
diff --git a/Makefile b/Makefile
@@ -11,30 +11,30 @@ CXXFLAGS +=
LDFLAGS +=
# Add .cpp and .c files to the build
-#SOURCES += $(wildcard src/*.cpp)
-SOURCES += $(wildcard src/ComputerscareSVGPanel.cpp)
-SOURCES += $(wildcard src/ComputerscareSvgPort.cpp)
-
-
-SOURCES += $(wildcard src/ComputerscarePatchSequencer.cpp)
-SOURCES += $(wildcard src/ComputerscareLaundrySoup.cpp)
-SOURCES += $(wildcard src/ComputerscareILoveCookies.cpp)
-SOURCES += $(wildcard src/ComputerscareDebug.cpp)
-SOURCES += $(wildcard src/ComputerscareOhPeas.cpp)
-
-SOURCES += $(wildcard src/ComputerscareKnolyPobs.cpp)
-SOURCES += $(wildcard src/ComputerscareBolyPuttons.cpp)
-SOURCES += $(wildcard src/ComputerscareRolyPouter.cpp)
-SOURCES += $(wildcard src/ComputerscareTolyPools.cpp)
-SOURCES += $(wildcard src/ComputerscareSolyPequencer.cpp)
-SOURCES += $(wildcard src/ComputerscareFolyPace.cpp)
-SOURCES += $(wildcard src/ComputerscareBlank.cpp)
-SOURCES += $(wildcard src/ComputerscareStolyFickPigure.cpp)
-SOURCES += $(wildcard src/ComputerscareGolyPenerator.cpp)
-
-SOURCES += $(wildcard src/Computerscare.cpp)
-SOURCES += $(wildcard src/dtpulse.cpp)
-SOURCES += $(wildcard src/golyFunctions.cpp)
+SOURCES += $(wildcard src/*.cpp)
+# SOURCES += $(wildcard src/ComputerscareSVGPanel.cpp)
+# SOURCES += $(wildcard src/ComputerscareSvgPort.cpp)
+
+
+# SOURCES += $(wildcard src/ComputerscarePatchSequencer.cpp)
+# SOURCES += $(wildcard src/ComputerscareLaundrySoup.cpp)
+# SOURCES += $(wildcard src/ComputerscareILoveCookies.cpp)
+# SOURCES += $(wildcard src/ComputerscareDebug.cpp)
+# SOURCES += $(wildcard src/ComputerscareOhPeas.cpp)
+
+# SOURCES += $(wildcard src/ComputerscareKnolyPobs.cpp)
+# SOURCES += $(wildcard src/ComputerscareBolyPuttons.cpp)
+# SOURCES += $(wildcard src/ComputerscareRolyPouter.cpp)
+# SOURCES += $(wildcard src/ComputerscareTolyPools.cpp)
+# SOURCES += $(wildcard src/ComputerscareSolyPequencer.cpp)
+# SOURCES += $(wildcard src/ComputerscareFolyPace.cpp)
+# SOURCES += $(wildcard src/ComputerscareBlank.cpp)
+# SOURCES += $(wildcard src/ComputerscareStolyFickPigure.cpp)
+# SOURCES += $(wildcard src/ComputerscareGolyPenerator.cpp)
+
+# SOURCES += $(wildcard src/Computerscare.cpp)
+# SOURCES += $(wildcard src/dtpulse.cpp)
+# SOURCES += $(wildcard src/golyFunctions.cpp)
# Add files to the ZIP package when running `make dist`
diff --git a/plugin.json b/plugin.json
@@ -85,6 +85,11 @@
"name":"Goly Penerator",
"description":"Polyphonic constant CV signal generation",
"tags":["Polyphonic","Utility"]
+ },
+ {"slug":"computerscare-moly-patrix",
+ "name":"Moly Patrix",
+ "description":"Polyphonic mix matrix",
+ "tags":["Polyphonic","Utility","Mixer"]
}
]
}
\ No newline at end of file
diff --git a/src/Computerscare.cpp b/src/Computerscare.cpp
@@ -23,5 +23,6 @@ void init(Plugin *p) {
p->addModel(modelComputerscareStolyFickPigure);
p->addModel(modelComputerscareGolyPenerator);
+ p->addModel(modelComputerscareMolyPatrix);
}
diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp
@@ -40,6 +40,7 @@ extern Model *modelComputerscareFolyPace;
extern Model *modelComputerscareStolyFickPigure;
extern Model *modelComputerscareBlank;
extern Model *modelComputerscareGolyPenerator;
+extern Model *modelComputerscareMolyPatrix;
static const NVGcolor COLOR_COMPUTERSCARE_LIGHT_GREEN = nvgRGB(0xC0, 0xE7, 0xDE);
static const NVGcolor COLOR_COMPUTERSCARE_GREEN = nvgRGB(0x24, 0xc9, 0xa6);
diff --git a/src/ComputerscareMolyPatrix.cpp b/src/ComputerscareMolyPatrix.cpp
@@ -0,0 +1,110 @@
+#include "Computerscare.hpp"
+
+struct ComputerscareMolyPatrix;
+
+const int numKnobs = 256;
+const int numRows =16;
+const int numColumns=16;
+
+const int numOutputs = 1;
+
+struct ComputerscareMolyPatrix : Module {
+ int counter = 0;
+ ComputerscareSVGPanel* panelRef;
+ enum ParamIds {
+ KNOB,
+ NUM_PARAMS = KNOB + numKnobs
+
+ };
+ enum InputIds {
+ CHANNEL_INPUT,
+ NUM_INPUTS
+ };
+ enum OutputIds {
+ POLY_OUTPUT,
+ NUM_OUTPUTS = POLY_OUTPUT + numOutputs
+ };
+ enum LightIds {
+ NUM_LIGHTS
+ };
+
+
+ ComputerscareMolyPatrix() {
+
+ config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
+ for(int n = 0; n < numKnobs; n++) {
+ configParam(KNOB+n,-1.f,1.f,0.f);
+ }
+ /* for (int i = 0; i < numRows; i++) {
+ for(int j = 0; j < numColumns; j++) {
+ configParam(KNOB + i*16+j, -10.f, 10.f, 0.f);
+ }
+ }*/
+
+ }
+ void process(const ProcessArgs &args) override {
+ counter++;
+ if (counter > 5012) {
+ //printf("%f \n",random::uniform());
+ counter = 0;
+ //rect4032
+ //south facing high wall
+ }
+ outputs[POLY_OUTPUT].setChannels(16);
+ for (int i = 0; i < 16; i++) {
+ outputs[POLY_OUTPUT].setVoltage(params[KNOB + i].getValue(), i);
+ }
+ }
+
+};
+
+struct ComputerscareMolyPatrixWidget : ModuleWidget {
+ ComputerscareMolyPatrixWidget(ComputerscareMolyPatrix *module) {
+
+ setModule(module);
+ //setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ComputerscareMolyPatrixPanel.svg")));
+ box.size = Vec(12 * 15, 380);
+ {
+ ComputerscareSVGPanel *panel = new ComputerscareSVGPanel();
+ panel->box.size = box.size;
+ panel->setBackground(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ComputerscareKnolyPobsPanel.svg")));
+
+ //module->panelRef = panel;
+
+ addChild(panel);
+
+ }
+ float xx;
+ float yy;
+ for (int i = 0; i < numRows; i++) {
+ for(int j = 0; j < numColumns; j++) {
+ xx = 10+j*10;
+ yy = 10+i*10;
+ addLabeledKnob(std::to_string(i + 1), xx, yy, module, i*16+j, 0, 0);
+ }
+ }
+
+
+
+ addOutput(createOutput<PointingUpPentagonPort>(Vec(28, 24), module, ComputerscareMolyPatrix::POLY_OUTPUT));
+
+ }
+ void addLabeledKnob(std::string label, int x, int y, ComputerscareMolyPatrix *module, int index, float labelDx, float labelDy) {
+
+ smallLetterDisplay = new SmallLetterDisplay();
+ smallLetterDisplay->box.size = Vec(5, 10);
+ smallLetterDisplay->fontSize = 16;
+ smallLetterDisplay->value = label;
+ smallLetterDisplay->textAlign = 1;
+
+ addParam(createParam<ComputerscareDotKnob>(Vec(x, y), module, ComputerscareMolyPatrix::KNOB + index));
+ smallLetterDisplay->box.pos = Vec(x + labelDx, y - 12 + labelDy);
+
+
+ addChild(smallLetterDisplay);
+
+ }
+ SmallLetterDisplay* smallLetterDisplay;
+};
+
+Model *modelComputerscareMolyPatrix = createModel<ComputerscareMolyPatrix, ComputerscareMolyPatrixWidget>("computerscare-moly-patrix");