| @@ -1,10 +1,10 @@ | |||
| ARCH ?= linux | |||
| CXXFLAGS = -MMD -fPIC -g -Wall -std=c++11 -O3 -msse -mfpmath=sse -ffast-math -DTEST \ | |||
| ARCH ?= lin | |||
| FLAGS = -fPIC -g -Wall -O3 -msse -mfpmath=sse -ffast-math \ | |||
| -fshort-enums -DTEST \ | |||
| -I./src -I../../include -I./eurorack \ | |||
| -fshort-enums | |||
| -Wno-unused-local-typedefs | |||
| LDFLAGS = | |||
| SOURCES = $(wildcard src/*.cpp) \ | |||
| eurorack/stmlib/utils/random.cc \ | |||
| @@ -46,30 +46,17 @@ SOURCES = $(wildcard src/*.cpp) \ | |||
| eurorack/warps/resources.cc | |||
| # Linux | |||
| ifeq ($(ARCH), linux) | |||
| CC = gcc | |||
| CXX = g++ | |||
| CXXFLAGS += -Wno-unused-local-typedefs | |||
| ifeq ($(ARCH), lin) | |||
| LDFLAGS += -shared | |||
| TARGET = plugin.so | |||
| endif | |||
| # Apple | |||
| ifeq ($(ARCH), apple) | |||
| CC = clang | |||
| CXX = clang++ | |||
| CXXFLAGS += -stdlib=libc++ | |||
| LDFLAGS += -stdlib=libc++ -shared -undefined dynamic_lookup | |||
| ifeq ($(ARCH), mac) | |||
| LDFLAGS += -shared -undefined dynamic_lookup | |||
| TARGET = plugin.dylib | |||
| endif | |||
| # Windows | |||
| ifeq ($(ARCH), windows) | |||
| CC = x86_64-w64-mingw32-gcc | |||
| CXX = x86_64-w64-mingw32-g++ | |||
| CXXFLAGS += -D_USE_MATH_DEFINES -Wno-unused-local-typedefs | |||
| SOURCES += | |||
| ifeq ($(ARCH), win) | |||
| LDFLAGS += -shared -L../../ -lRack | |||
| TARGET = plugin.dll | |||
| endif | |||
| @@ -1,31 +1,15 @@ | |||
| #include "AudibleInstruments.hpp" | |||
| void ValueLight::step() { | |||
| float v = getf(value); | |||
| if (v > 0) { | |||
| color = nvgHSL(0.36, 0.7, 0.7); | |||
| color.a = v; // May be larger than 1 | |||
| } | |||
| else if (v < 0) { | |||
| color = nvgHSL(0.0, 0.7, 0.7); | |||
| color.a = -v; | |||
| } | |||
| else { | |||
| color = nvgRGBAf(1.0, 1.0, 1.0, 0.0); | |||
| } | |||
| } | |||
| void ModeLight::step() { | |||
| int mode = (int) roundf(getf(value)); | |||
| switch (mode) { | |||
| case 0: color = nvgHSL(0.36, 0.7, 0.7); break; | |||
| case 1: color = nvgHSL(0.18, 0.7, 0.7); break; | |||
| case 2: color = nvgHSL(0.0, 0.7, 0.7); break; | |||
| default: color = nvgRGBAf(0.0, 0.0, 0.0, 0.0); break; | |||
| } | |||
| } | |||
| // void ModeLight::step() { | |||
| // int mode = (int) roundf(getf(value)); | |||
| // switch (mode) { | |||
| // case 0: color = nvgHSL(0.36, 0.7, 0.7); break; | |||
| // case 1: color = nvgHSL(0.18, 0.7, 0.7); break; | |||
| // case 2: color = nvgHSL(0.0, 0.7, 0.7); break; | |||
| // default: color = nvgRGBAf(0.0, 0.0, 0.0, 0.0); break; | |||
| // } | |||
| // } | |||
| struct AudibleInstrumentsPlugin : Plugin { | |||
| @@ -165,49 +165,18 @@ struct SlideSwitch : Switch { | |||
| } | |||
| }; | |||
| //////////////////// | |||
| // lights | |||
| //////////////////// | |||
| struct ValueLight : virtual Light { | |||
| float *value = NULL; | |||
| void step(); | |||
| }; | |||
| struct ModeLight : ValueLight { | |||
| void step(); | |||
| }; | |||
| struct SmallLight : virtual Light { | |||
| SmallLight() { | |||
| box.size = Vec(7, 7); | |||
| spriteOffset = Vec(-16, -16); | |||
| spriteSize = Vec(38, 38); | |||
| spriteImage = Image::load("plugins/AudibleInstruments/res/light_small.png"); | |||
| } | |||
| }; | |||
| struct MediumLight : virtual Light { | |||
| MediumLight() { | |||
| box.size = Vec(14, 14); | |||
| spriteOffset = Vec(-16, -15); | |||
| spriteSize = Vec(45, 45); | |||
| spriteImage = Image::load("plugins/AudibleInstruments/res/light_medium.png"); | |||
| struct TripleModeLight : ValueLight { | |||
| void step() { | |||
| float v = roundf(getf(value)); | |||
| if (v == 0.0) | |||
| color = SCHEME_CYAN; | |||
| else if (v == 1.0) | |||
| color = SCHEME_ORANGE; | |||
| else | |||
| color = SCHEME_RED; | |||
| } | |||
| }; | |||
| struct SmallValueLight : SmallLight, ValueLight {}; | |||
| struct MediumValueLight : MediumLight, ValueLight {}; | |||
| struct SmallModeLight : SmallLight, ModeLight {}; | |||
| template <class TLight> | |||
| ValueLight *createValueLight(Vec pos, float *value) { | |||
| ValueLight *light = new TLight(); | |||
| light->box.pos = pos; | |||
| light->value = value; | |||
| return light; | |||
| } | |||
| //////////////////// | |||
| // module widgets | |||
| //////////////////// | |||
| @@ -84,7 +84,9 @@ void Blinds::step() { | |||
| } | |||
| BlindsWidget::BlindsWidget() : ModuleWidget(new Blinds()) { | |||
| BlindsWidget::BlindsWidget() { | |||
| Blinds *module = new Blinds(); | |||
| setModule(module); | |||
| box.size = Vec(15*12, 380); | |||
| { | |||
| @@ -94,10 +96,10 @@ BlindsWidget::BlindsWidget() : ModuleWidget(new Blinds()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(150, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(150, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(150, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(150, 365))); | |||
| addParam(createParam<SmallWhiteKnob>(Vec(8, 52), module, Blinds::GAIN1_PARAM, -1.0, 1.0, 0.0)); | |||
| addParam(createParam<SmallWhiteKnob>(Vec(8, 131), module, Blinds::GAIN2_PARAM, -1.0, 1.0, 0.0)); | |||
| @@ -124,14 +126,13 @@ BlindsWidget::BlindsWidget() : ModuleWidget(new Blinds()) { | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(141, 195), module, Blinds::OUT3_OUTPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(141, 274), module, Blinds::OUT4_OUTPUT)); | |||
| Blinds *blinds = dynamic_cast<Blinds*>(module); | |||
| addChild(createValueLight<MediumValueLight>(Vec(149, 86), &blinds->lights[0])); | |||
| addChild(createValueLight<MediumValueLight>(Vec(149, 165), &blinds->lights[1])); | |||
| addChild(createValueLight<MediumValueLight>(Vec(149, 244), &blinds->lights[2])); | |||
| addChild(createValueLight<MediumValueLight>(Vec(149, 323), &blinds->lights[3])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(150, 87), &module->lights[0])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(150, 166), &module->lights[1])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(150, 245), &module->lights[2])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(150, 324), &module->lights[3])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(78, 97), &blinds->gainLights[0])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(78, 176), &blinds->gainLights[1])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(78, 255), &blinds->gainLights[2])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(78, 334), &blinds->gainLights[3])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(77, 96), &module->gainLights[0])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(77, 175), &module->gainLights[1])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(77, 254), &module->gainLights[2])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(77, 333), &module->gainLights[3])); | |||
| } | |||
| @@ -173,14 +173,16 @@ struct BraidsDisplay : TransparentWidget { | |||
| NVGcolor color = nvgRGB(0xaf, 0xd2, 0x2c); | |||
| nvgFillColor(vg, nvgTransRGBA(color, 16)); | |||
| nvgText(vg, box.pos.x, box.pos.y, "~~~~", NULL); | |||
| nvgText(vg, 0.0, 0.0, "~~~~", NULL); | |||
| nvgFillColor(vg, color); | |||
| nvgText(vg, box.pos.x, box.pos.y, algo_values[shape], NULL); | |||
| nvgText(vg, 0.0, 0.0, algo_values[shape], NULL); | |||
| } | |||
| }; | |||
| BraidsWidget::BraidsWidget() : ModuleWidget(new Braids()) { | |||
| BraidsWidget::BraidsWidget() { | |||
| Braids *module = new Braids(); | |||
| setModule(module); | |||
| box.size = Vec(15*16, 380); | |||
| { | |||
| @@ -197,10 +199,10 @@ BraidsWidget::BraidsWidget() : ModuleWidget(new Braids()) { | |||
| addChild(display); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(210, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(210, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(210, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(210, 365))); | |||
| addParam(createParam<MediumWhiteKnob>(Vec(187-10, 71-11), module, Braids::SHAPE_PARAM, 0.0, braids::MACRO_OSC_SHAPE_LAST-2, 0.0)); | |||
| @@ -73,7 +73,9 @@ void Branches::step() { | |||
| } | |||
| BranchesWidget::BranchesWidget() : ModuleWidget(new Branches()) { | |||
| BranchesWidget::BranchesWidget() { | |||
| Branches *module = new Branches(); | |||
| setModule(module); | |||
| box.size = Vec(15*6, 380); | |||
| { | |||
| @@ -83,8 +85,8 @@ BranchesWidget::BranchesWidget() : ModuleWidget(new Branches()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addParam(createParam<SmallRedKnob>(Vec(24, 64), module, Branches::THRESHOLD1_PARAM, 0.0, 1.0, 0.5)); | |||
| addParam(createParam<MediumToggleSwitch>(Vec(69, 58), module, Branches::MODE1_PARAM, 0.0, 1.0, 0.0)); | |||
| @@ -100,7 +102,6 @@ BranchesWidget::BranchesWidget() : ModuleWidget(new Branches()) { | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(5, 313), module, Branches::OUT2A_OUTPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(52, 313), module, Branches::OUT2B_OUTPUT)); | |||
| Branches *branches = dynamic_cast<Branches*>(module); | |||
| addChild(createValueLight<SmallValueLight>(Vec(42, 170), &branches->light[0])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(42, 326), &branches->light[1])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(40, 169), &module->light[0])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(40, 325), &module->light[1])); | |||
| } | |||
| @@ -156,7 +156,9 @@ void Clouds::step() { | |||
| } | |||
| CloudsWidget::CloudsWidget() : ModuleWidget(new Clouds()) { | |||
| CloudsWidget::CloudsWidget() { | |||
| Clouds *module = new Clouds(); | |||
| setModule(module); | |||
| box.size = Vec(15*18, 380); | |||
| { | |||
| @@ -166,10 +168,10 @@ CloudsWidget::CloudsWidget() : ModuleWidget(new Clouds()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(240, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(240, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(240, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(240, 365))); | |||
| // TODO | |||
| // addParam(createParam<MediumMomentarySwitch>(Vec(211, 51), module, Clouds::POSITION_PARAM, 0.0, 1.0, 0.5)); | |||
| @@ -189,7 +189,9 @@ void Elements::step() { | |||
| } | |||
| ElementsWidget::ElementsWidget() : ModuleWidget(new Elements()) { | |||
| ElementsWidget::ElementsWidget() { | |||
| Elements *module = new Elements(); | |||
| setModule(module); | |||
| box.size = Vec(15*34, 380); | |||
| { | |||
| @@ -199,10 +201,10 @@ ElementsWidget::ElementsWidget() : ModuleWidget(new Elements()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(480, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(480, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(480, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(480, 365))); | |||
| addParam(createParam<SmallWhiteKnob>(Vec(29, 43), module, Elements::CONTOUR_PARAM, 0.0, 1.0, 0.5)); | |||
| addParam(createParam<SmallWhiteKnob>(Vec(100, 43), module, Elements::BOW_PARAM, 0.0, 1.0, 0.5)); | |||
| @@ -260,7 +262,6 @@ ElementsWidget::ElementsWidget() : ModuleWidget(new Elements()) { | |||
| addParam(createParam<LargeMomentarySwitch>(Vec(36, 116), module, Elements::PLAY_PARAM, 0.0, 2.0, 0.0)); | |||
| Elements *elements = dynamic_cast<Elements*>(module); | |||
| addChild(createValueLight<MediumValueLight>(Vec(184, 168), &elements->lights[0])); | |||
| addChild(createValueLight<MediumValueLight>(Vec(395, 168), &elements->lights[1])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(184, 165), &module->lights[0])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(395, 165), &module->lights[1])); | |||
| } | |||
| @@ -85,7 +85,9 @@ void Kinks::step() { | |||
| } | |||
| KinksWidget::KinksWidget() : ModuleWidget(new Kinks()) { | |||
| KinksWidget::KinksWidget() { | |||
| Kinks *module = new Kinks(); | |||
| setModule(module); | |||
| box.size = Vec(15*4, 380); | |||
| { | |||
| @@ -95,8 +97,8 @@ KinksWidget::KinksWidget() : ModuleWidget(new Kinks()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addInput(createInput<InputPortPJ3410>(Vec(0, 72), module, Kinks::SIGN_INPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(29, 72), module, Kinks::INVERT_OUTPUT)); | |||
| @@ -113,8 +115,7 @@ KinksWidget::KinksWidget() : ModuleWidget(new Kinks()) { | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(0, 313), module, Kinks::NOISE_OUTPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(29, 313), module, Kinks::SH_OUTPUT)); | |||
| Kinks *kinks = dynamic_cast<Kinks*>(module); | |||
| addChild(createValueLight<SmallValueLight>(Vec(12, 61), &kinks->lights[0])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(12, 164), &kinks->lights[1])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(12, 264), &kinks->lights[2])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(11, 59), &module->lights[0])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(11, 161), &module->lights[1])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(11, 262), &module->lights[2])); | |||
| } | |||
| @@ -48,13 +48,15 @@ void Links::step() { | |||
| setf(outputs[B2_OUTPUT], in2); | |||
| setf(outputs[C1_OUTPUT], in3); | |||
| lights[0] = in1; | |||
| lights[1] = in2; | |||
| lights[2] = in3; | |||
| lights[0] = in1 / 5.0; | |||
| lights[1] = in2 / 5.0; | |||
| lights[2] = in3 / 5.0; | |||
| } | |||
| LinksWidget::LinksWidget() : ModuleWidget(new Links()) { | |||
| LinksWidget::LinksWidget() { | |||
| Links *module = new Links(); | |||
| setModule(module); | |||
| box.size = Vec(15*4, 380); | |||
| { | |||
| @@ -64,8 +66,8 @@ LinksWidget::LinksWidget() : ModuleWidget(new Links()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addInput(createInput<InputPortPJ3410>(Vec(0, 72), module, Links::A1_INPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(29, 72), module, Links::A1_OUTPUT)); | |||
| @@ -82,8 +84,7 @@ LinksWidget::LinksWidget() : ModuleWidget(new Links()) { | |||
| addInput(createInput<InputPortPJ3410>(Vec(0, 313), module, Links::C3_INPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(29, 313), module, Links::C1_OUTPUT)); | |||
| Links *links = dynamic_cast<Links*>(module); | |||
| addChild(createValueLight<SmallValueLight>(Vec(26, 61), &links->lights[0])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(26, 164), &links->lights[1])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(26, 264), &links->lights[2])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(26, 59), &module->lights[0])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(26, 161), &module->lights[1])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(26, 262), &module->lights[2])); | |||
| } | |||
| @@ -196,7 +196,9 @@ void Rings::step() { | |||
| } | |||
| RingsWidget::RingsWidget() : ModuleWidget(new Rings()) { | |||
| RingsWidget::RingsWidget() { | |||
| Rings *module = new Rings(); | |||
| setModule(module); | |||
| box.size = Vec(15*14, 380); | |||
| { | |||
| @@ -206,10 +208,10 @@ RingsWidget::RingsWidget() : ModuleWidget(new Rings()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(180, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(180, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(180, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(180, 365))); | |||
| addParam(createParam<MediumToggleSwitch>(Vec(14, 40), module, Rings::POLYPHONY_PARAM, 0.0, 2.0, 0.0)); | |||
| addParam(createParam<MediumToggleSwitch>(Vec(179, 40), module, Rings::RESONATOR_PARAM, 0.0, 2.0, 0.0)); | |||
| @@ -239,7 +241,6 @@ RingsWidget::RingsWidget() : ModuleWidget(new Rings()) { | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(128, 313), module, Rings::ODD_OUTPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(166, 313), module, Rings::EVEN_OUTPUT)); | |||
| Rings *rings = dynamic_cast<Rings*>(module); | |||
| addChild(createValueLight<SmallModeLight>(Vec(39, 45), &rings->params[Rings::POLYPHONY_PARAM])); | |||
| addChild(createValueLight<SmallModeLight>(Vec(164, 45), &rings->params[Rings::RESONATOR_PARAM])); | |||
| addChild(createValueLight<SmallLight<TripleModeLight>>(Vec(38, 44), &module->params[Rings::POLYPHONY_PARAM])); | |||
| addChild(createValueLight<SmallLight<TripleModeLight>>(Vec(163, 44), &module->params[Rings::RESONATOR_PARAM])); | |||
| } | |||
| @@ -75,7 +75,9 @@ void Shades::step() { | |||
| } | |||
| ShadesWidget::ShadesWidget() : ModuleWidget(new Shades()) { | |||
| ShadesWidget::ShadesWidget() { | |||
| Shades *module = new Shades(); | |||
| setModule(module); | |||
| box.size = Vec(15*6, 380); | |||
| { | |||
| @@ -85,8 +87,8 @@ ShadesWidget::ShadesWidget() : ModuleWidget(new Shades()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addParam(createParam<SmallRedKnob>(Vec(40, 41), module, Shades::GAIN1_PARAM, 0.0, 1.0, 0.5)); | |||
| addParam(createParam<SmallWhiteKnob>(Vec(40, 107), module, Shades::GAIN2_PARAM, 0.0, 1.0, 0.5)); | |||
| @@ -104,8 +106,7 @@ ShadesWidget::ShadesWidget() : ModuleWidget(new Shades()) { | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(52, 278), module, Shades::OUT2_OUTPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(52, 314), module, Shades::OUT3_OUTPUT)); | |||
| Shades *shades = dynamic_cast<Shades*>(module); | |||
| addChild(createValueLight<SmallValueLight>(Vec(42, 256), &shades->lights[0])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(42, 292), &shades->lights[1])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(42, 328), &shades->lights[2])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(41, 254), &module->lights[0])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(41, 290), &module->lights[1])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(41, 326), &module->lights[2])); | |||
| } | |||
| @@ -46,7 +46,9 @@ void Streams::step() { | |||
| } | |||
| StreamsWidget::StreamsWidget() : ModuleWidget(new Streams()) { | |||
| StreamsWidget::StreamsWidget() { | |||
| Streams *module = new Streams(); | |||
| setModule(module); | |||
| box.size = Vec(15*12, 380); | |||
| { | |||
| @@ -56,10 +58,10 @@ StreamsWidget::StreamsWidget() : ModuleWidget(new Streams()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(150, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(150, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(150, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(150, 365))); | |||
| // addParam(createParam<HugeGlowKnob>(Vec(30, 53), module, Streams::ALGORITHM_PARAM, 0.0, 8.0, 0.0)); | |||
| @@ -137,11 +137,13 @@ void Tides::step() { | |||
| setf(outputs[UNI_OUTPUT], unif); | |||
| setf(outputs[BI_OUTPUT], bif); | |||
| lights[1] = sample.flags & tides::FLAG_END_OF_ATTACK ? -unif : unif; | |||
| lights[1] = (sample.flags & tides::FLAG_END_OF_ATTACK ? -unif : unif) / 8.0; | |||
| } | |||
| TidesWidget::TidesWidget() : ModuleWidget(new Tides()) { | |||
| TidesWidget::TidesWidget() { | |||
| Tides *module = new Tides(); | |||
| setModule(module); | |||
| box.size = Vec(15*14, 380); | |||
| { | |||
| @@ -151,10 +153,10 @@ TidesWidget::TidesWidget() : ModuleWidget(new Tides()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(180, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(180, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(180, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(180, 365))); | |||
| addParam(createParam<LargeToggleSwitch>(Vec(19, 52), module, Tides::MODE_PARAM, -1.0, 1.0, 0.0)); | |||
| addParam(createParam<LargeToggleSwitch>(Vec(19, 93), module, Tides::RANGE_PARAM, -1.0, 1.0, 0.0)); | |||
| @@ -170,11 +172,11 @@ TidesWidget::TidesWidget() : ModuleWidget(new Tides()) { | |||
| addInput(createInput<InputPortPJ3410>(Vec(90, 216), module, Tides::SLOPE_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(161, 216), module, Tides::SMOOTHNESS_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(18, 270), module, Tides::TRIG_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(54, 270), module, Tides::FREEZE_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(90, 270), module, Tides::PITCH_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(125, 270), module, Tides::FM_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(161, 270), module, Tides::LEVEL_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(18, 271), module, Tides::TRIG_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(54, 271), module, Tides::FREEZE_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(90, 271), module, Tides::PITCH_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(125, 271), module, Tides::FM_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(161, 271), module, Tides::LEVEL_INPUT)); | |||
| addInput(createInput<InputPortPJ3410>(Vec(18, 313), module, Tides::CLOCK_INPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(54, 313), module, Tides::HIGH_OUTPUT)); | |||
| @@ -182,8 +184,7 @@ TidesWidget::TidesWidget() : ModuleWidget(new Tides()) { | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(125, 313), module, Tides::UNI_OUTPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(161, 313), module, Tides::BI_OUTPUT)); | |||
| Tides *tides = dynamic_cast<Tides*>(module); | |||
| addChild(createValueLight<SmallValueLight>(Vec(58, 63), &tides->lights[0])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(58, 84), &tides->lights[1])); | |||
| addChild(createValueLight<SmallValueLight>(Vec(58, 105), &tides->lights[2])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(57, 62), &module->lights[0])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(57, 83), &module->lights[1])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(57, 103), &module->lights[2])); | |||
| } | |||
| @@ -93,7 +93,9 @@ void Veils::step() { | |||
| } | |||
| VeilsWidget::VeilsWidget() : ModuleWidget(new Veils()) { | |||
| VeilsWidget::VeilsWidget() { | |||
| Veils *module = new Veils(); | |||
| setModule(module); | |||
| box.size = Vec(15*12, 380); | |||
| { | |||
| @@ -103,10 +105,10 @@ VeilsWidget::VeilsWidget() : ModuleWidget(new Veils()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(150, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(150, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(150, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(150, 365))); | |||
| addParam(createParam<SmallWhiteKnob>(Vec(8, 52), module, Veils::GAIN1_PARAM, 0.0, 1.0, 0.0)); | |||
| addParam(createParam<SmallWhiteKnob>(Vec(8, 131), module, Veils::GAIN2_PARAM, 0.0, 1.0, 0.0)); | |||
| @@ -133,9 +135,8 @@ VeilsWidget::VeilsWidget() : ModuleWidget(new Veils()) { | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(141, 195), module, Veils::OUT3_OUTPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(141, 274), module, Veils::OUT4_OUTPUT)); | |||
| Veils *veils = dynamic_cast<Veils*>(module); | |||
| addChild(createValueLight<MediumValueLight>(Vec(149, 86), &veils->lights[0])); | |||
| addChild(createValueLight<MediumValueLight>(Vec(149, 165), &veils->lights[1])); | |||
| addChild(createValueLight<MediumValueLight>(Vec(149, 244), &veils->lights[2])); | |||
| addChild(createValueLight<MediumValueLight>(Vec(149, 323), &veils->lights[3])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(150, 87), &module->lights[0])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(150, 166), &module->lights[1])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(150, 245), &module->lights[2])); | |||
| addChild(createValueLight<MediumLight<GreenRedPolarityLight>>(Vec(150, 324), &module->lights[3])); | |||
| } | |||
| @@ -76,7 +76,9 @@ void Warps::step() { | |||
| } | |||
| WarpsWidget::WarpsWidget() : ModuleWidget(new Warps()) { | |||
| WarpsWidget::WarpsWidget() { | |||
| Warps *module = new Warps(); | |||
| setModule(module); | |||
| box.size = Vec(15*10, 380); | |||
| { | |||
| @@ -86,10 +88,10 @@ WarpsWidget::WarpsWidget() : ModuleWidget(new Warps()) { | |||
| addChild(panel); | |||
| } | |||
| addChild(createScrew(Vec(15, 0))); | |||
| addChild(createScrew(Vec(120, 0))); | |||
| addChild(createScrew(Vec(15, 365))); | |||
| addChild(createScrew(Vec(120, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(120, 0))); | |||
| addChild(createScrew<SilverScrew>(Vec(15, 365))); | |||
| addChild(createScrew<SilverScrew>(Vec(120, 365))); | |||
| addParam(createParam<HugeGlowKnob>(Vec(30, 53), module, Warps::ALGORITHM_PARAM, 0.0, 8.0, 0.0)); | |||
| @@ -108,6 +110,5 @@ WarpsWidget::WarpsWidget() : ModuleWidget(new Warps()) { | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(77, 313), module, Warps::MODULATOR_OUTPUT)); | |||
| addOutput(createOutput<OutputPortPJ3410>(Vec(113, 313), module, Warps::AUX_OUTPUT)); | |||
| Warps *warps = dynamic_cast<Warps*>(module); | |||
| addChild(createValueLight<SmallModeLight>(Vec(21, 168), &warps->lights[0])); | |||
| addChild(createValueLight<SmallLight<GreenRedPolarityLight>>(Vec(20, 167), &module->lights[0])); | |||
| } | |||