|
|
@@ -3,6 +3,7 @@
|
|
|
|
|
|
struct SSI2164_Mixer1 : Module
|
|
|
{
|
|
|
+ float disp1, disp2, disp3;
|
|
|
enum ParamId
|
|
|
{
|
|
|
CH1_AUX1_PARAM,
|
|
|
@@ -63,6 +64,30 @@ struct SSI2164_Mixer1 : Module
|
|
|
|
|
|
void process(const ProcessArgs &args) override
|
|
|
{
|
|
|
+ float aux1_cv, aux2_l_cv, aux2_r_cv, master_l_cv, master_r_cv;
|
|
|
+ float aux1_control, aux2_control, pan_control, pan_cv_in, fad_control;
|
|
|
+
|
|
|
+ float pan_cv, pan_l_control, pan_r_control;
|
|
|
+
|
|
|
+ aux1_control = params[CH1_AUX1_PARAM].getValue();
|
|
|
+ aux2_control = params[CH1_AUX2_PARAM].getValue();
|
|
|
+ pan_control = params[CH1_PAN_PARAM].getValue();
|
|
|
+ pan_cv_in = inputs[CH1_PAN_INPUT].getVoltage();
|
|
|
+ fad_control = params[CH1_FAD_PARAM].getValue();
|
|
|
+
|
|
|
+ // Normalize pan voltages to +-1 and do calculations based on that
|
|
|
+ pan_cv = pan_control + pan_cv_in / 5;
|
|
|
+ pan_l_control = fmax(.0f, pan_cv * (2.5));
|
|
|
+ pan_r_control = fmax(.0f, pan_cv * (-2.5));
|
|
|
+
|
|
|
+ disp1 = pan_l_control;
|
|
|
+ disp2 = pan_r_control;
|
|
|
+
|
|
|
+ aux1_cv = fad_control + aux1_control;
|
|
|
+ aux2_l_cv = fad_control + pan_l_control + aux2_control;
|
|
|
+ aux2_r_cv = fad_control + pan_r_control + aux2_control;
|
|
|
+ master_l_cv = fad_control + pan_l_control;
|
|
|
+ master_r_cv = fad_control + pan_r_control;
|
|
|
|
|
|
float ssi2164_cv = .0f, ssi2164_in = .0f, ssi2164_out = .0f;
|
|
|
float ch1_in = inputs[CH1_IN_INPUT].getVoltage();
|
|
|
@@ -100,6 +125,36 @@ struct KnobPenis : RoundKnob
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+struct numberBox : TransparentWidget
|
|
|
+{
|
|
|
+ float *val1, *val2, *val3;
|
|
|
+ void draw(const DrawArgs &args) override
|
|
|
+ {
|
|
|
+ nvgFillColor(args.vg, nvgRGBf(1.0, 1.0, 0.0));
|
|
|
+ nvgBeginPath(args.vg);
|
|
|
+ nvgRect(args.vg, 0.0, 0.0, box.size.x, box.size.y);
|
|
|
+ nvgFill(args.vg);
|
|
|
+
|
|
|
+ std::string fontPath = asset::system("res/fonts/DejaVuSans.ttf");
|
|
|
+ std::shared_ptr<Font> font = APP->window->loadFont(fontPath);
|
|
|
+
|
|
|
+ if(font)
|
|
|
+ {
|
|
|
+ std::string text1 = string::f("%6.2f V", *val1);
|
|
|
+ std::string text2 = string::f("%6.2f V", *val2);
|
|
|
+ std::string text3 = string::f("%6.2f V", *val3);
|
|
|
+
|
|
|
+ text1 = "Yoman!";
|
|
|
+
|
|
|
+ nvgFontFaceId(args.vg, font->handle);
|
|
|
+ nvgFontSize(args.vg, 16.0);
|
|
|
+ nvgTextAlign(args.vg, NVG_ALIGN_LEFT | NVG_ALIGN_BASELINE);
|
|
|
+ nvgStrokeColor(args.vg, nvgRGBf(0.0, 0.0, 0.0));
|
|
|
+ nvgText(args.vg, 10,10, text1.c_str(), NULL);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
struct SSI2164_Mixer1Widget : ModuleWidget
|
|
|
{
|
|
|
SSI2164_Mixer1Widget(SSI2164_Mixer1 *module)
|
|
|
@@ -130,10 +185,17 @@ struct SSI2164_Mixer1Widget : ModuleWidget
|
|
|
SSI2164_Mixer1::CH1_MUTE_PARAM));
|
|
|
addChild(createLightCentered<MediumLight<RedLight>>(
|
|
|
mm2px(Vec(12, 77)), module, SSI2164_Mixer1::CH1_LEVEL_LIGHT));
|
|
|
-
|
|
|
addParam(createParamCentered<VCVSlider>(mm2px(Vec(12, 101)), module,
|
|
|
SSI2164_Mixer1::CH1_FAD_PARAM));
|
|
|
|
|
|
+ numberBox *myDisp = new numberBox;
|
|
|
+ myDisp->setSize(Vec(100, 100));
|
|
|
+ myDisp->box.pos = Vec(80, 50);
|
|
|
+ myDisp->val1 = &module->disp1;
|
|
|
+ myDisp->val2 = &module->disp2;
|
|
|
+ myDisp->val3 = &module->disp3;
|
|
|
+ addChild(myDisp);
|
|
|
+
|
|
|
addOutput(createOutputCentered<ThemedPJ301MPort>(
|
|
|
mm2px(Vec(141, 13)), module, SSI2164_Mixer1::AUX1_SEND_OUTPUT));
|
|
|
addInput(createInputCentered<ThemedPJ301MPort>(
|