git.s-ol.nu vcvmods / f7c4b46
update to rack0 compat layer s-ol 2 years ago
6 changed file(s) with 53 addition(s) and 52 deletion(s). Raw diff Collapse all Expand all
0 SLUG = s-ol
1 VERSION = 0.6.1
2
30 # FLAGS will be passed to both the C and C++ compiler
41 FLAGS +=
52 CFLAGS +=
2020
2121 float phase = 0.0;
2222
23 CircleVCO() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {}
23 CircleVCO() {
24 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
25 }
2426 void step() override;
2527 };
2628
4850 CircleVCOWidget(CircleVCO *module);
4951 };
5052
51 CircleVCOWidget::CircleVCOWidget(CircleVCO *module) : ModuleWidget(module) {
52 setPanel(SVG::load(assetPlugin(plugin, "res/CircleVCO.svg")));
53 CircleVCOWidget::CircleVCOWidget(CircleVCO *module) {
54 setModule(module);
55 setPanel(SVG::load(assetPlugin(pluginInstance, "res/CircleVCO.svg")));
5356
54 addChild(Widget::create<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
55 addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
57 addChild(createWidget<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
58 addChild(createWidget<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
5659
5760 PJ301MPort p;
5861 RoundSmallBlackKnob k;
5962 Vec center = Vec(box.size.x, 0).minus(p.box.size).div(2);
6063 Vec kcenter = Vec(box.size.x, 0).minus(k.box.size).div(2);
6164
62 addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(0, 90)), module, CircleVCO::PITCH_PARAM, -54.0f, 54.0f, 0.0f));
65 addParam(createParam<RoundSmallBlackKnob>(kcenter.plus(Vec(0, 90)), module, CircleVCO::PITCH_PARAM, -54.0f, 54.0f, 0.0f));
6366
64 addInput(Port::create<PJ301MPort>(center.plus(Vec(0, 144)), Port::INPUT, module, CircleVCO::PITCH_INPUT));
67 addInput(createPort<PJ301MPort>(center.plus(Vec(0, 144)), PortWidget::INPUT, module, CircleVCO::PITCH_INPUT));
6568
66 addOutput(Port::create<PJ301MPort>(center.plus(Vec(0, 218)), Port::OUTPUT, module, CircleVCO::SIN_OUTPUT));
67 addOutput(Port::create<PJ301MPort>(center.plus(Vec(0, 268)), Port::OUTPUT, module, CircleVCO::COS_OUTPUT));
68 addOutput(Port::create<PJ301MPort>(center.plus(Vec(0, 318)), Port::OUTPUT, module, CircleVCO::PHS_OUTPUT));
69 addOutput(createPort<PJ301MPort>(center.plus(Vec(0, 218)), PortWidget::OUTPUT, module, CircleVCO::SIN_OUTPUT));
70 addOutput(createPort<PJ301MPort>(center.plus(Vec(0, 268)), PortWidget::OUTPUT, module, CircleVCO::COS_OUTPUT));
71 addOutput(createPort<PJ301MPort>(center.plus(Vec(0, 318)), PortWidget::OUTPUT, module, CircleVCO::PHS_OUTPUT));
6972 }
7073
71 Model *modelCircleVCO = Model::create<CircleVCO, CircleVCOWidget>("s-ol", "CircleVCO", "Circle VCO", OSCILLATOR_TAG, VISUAL_TAG);
74 Model *modelCircleVCO = createModel<CircleVCO, CircleVCOWidget>("CircleVCO");
1818 NUM_LIGHTS
1919 };
2020
21 Modulo() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {}
21 Modulo() {
22 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
23 }
2224 void step() override;
2325 };
2426
3840 ModuloWidget(Modulo *module);
3941 };
4042
41 ModuloWidget::ModuloWidget(Modulo *module) : ModuleWidget(module) {
42 setPanel(SVG::load(assetPlugin(plugin, "res/Modulo.svg")));
43 ModuloWidget::ModuloWidget(Modulo *module) {
44 setModule(module);
45 setPanel(SVG::load(assetPlugin(pluginInstance, "res/Modulo.svg")));
4346
44 addChild(Widget::create<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
45 addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
47 addChild(createWidget<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
48 addChild(createWidget<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
4649
4750 PJ301MPort p;
4851 RoundSmallBlackKnob k;
5053 Vec kcenter = Vec(box.size.x, 0).minus(k.box.size).div(2);
5154
5255
53 addInput(Port::create<PJ301MPort>(center.plus(Vec(0, 120)), Port::INPUT, module, Modulo::SIGNAL_INPUT));
54 addInput(Port::create<PJ301MPort>(center.plus(Vec(-15, 180)), Port::INPUT, module, Modulo::GAIN_INPUT));
56 addInput(createPort<PJ301MPort>(center.plus(Vec(0, 120)), PortWidget::INPUT, module, Modulo::SIGNAL_INPUT));
57 addInput(createPort<PJ301MPort>(center.plus(Vec(-15, 180)), PortWidget::INPUT, module, Modulo::GAIN_INPUT));
5558
56 addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(15, 180)), module, Modulo::GAIN_PARAM, -3.0, 3.0, 0.0));
59 addParam(createParam<RoundSmallBlackKnob>(kcenter.plus(Vec(15, 180)), module, Modulo::GAIN_PARAM, -3.0, 3.0, 0.0));
5760
58 addOutput(Port::create<PJ301MPort>(center.plus(Vec(0, 265)), Port::OUTPUT, module, Modulo::STAIR_OUTPUT));
59 addOutput(Port::create<PJ301MPort>(center.plus(Vec(0, 345)), Port::OUTPUT, module, Modulo::WRAP_OUTPUT));
61 addOutput(createPort<PJ301MPort>(center.plus(Vec(0, 265)), PortWidget::OUTPUT, module, Modulo::STAIR_OUTPUT));
62 addOutput(createPort<PJ301MPort>(center.plus(Vec(0, 345)), PortWidget::OUTPUT, module, Modulo::WRAP_OUTPUT));
6063 }
6164
62 Model *modelModulo = Model::create<Modulo, ModuloWidget>("s-ol", "Modulo", "Modulo", LOGIC_TAG);
65 Model *modelModulo = createModel<Modulo, ModuloWidget>("Modulo");
2323 NUM_LIGHTS
2424 };
2525
26 WrapComp() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) {}
26 WrapComp() {
27 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
28 }
2729 void step() override;
2830 };
2931
4951 WrapCompWidget(WrapComp *module);
5052 };
5153
52 WrapCompWidget::WrapCompWidget(WrapComp *module) : ModuleWidget(module) {
53 setPanel(SVG::load(assetPlugin(plugin, "res/WrapComp.svg")));
54 WrapCompWidget::WrapCompWidget(WrapComp *module) {
55 setModule(module);
56 setPanel(SVG::load(assetPlugin(pluginInstance, "res/WrapComp.svg")));
5457
55 addChild(Widget::create<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
56 addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
57 addChild(Widget::create<ScrewSilver>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
58 addChild(Widget::create<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
58 addChild(createWidget<ScrewSilver>(Vec(RACK_GRID_WIDTH, 0)));
59 addChild(createWidget<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, 0)));
60 addChild(createWidget<ScrewSilver>(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
61 addChild(createWidget<ScrewSilver>(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH)));
5962
6063 PJ301MPort p;
6164 RoundSmallBlackKnob k;
6467 Vec kcenter = Vec(box.size.x, 0).minus(k.box.size).div(2);
6568 Vec lcenter = Vec(box.size.x, 0).minus(l.box.size).div(2);
6669
67 addInput(Port::create<PJ301MPort>(center.plus(Vec(0, 70)), Port::INPUT, module, WrapComp::SIGNAL_INPUT));
70 addInput(createPort<PJ301MPort>(center.plus(Vec(0, 70)), PortWidget::INPUT, module, WrapComp::SIGNAL_INPUT));
6871
69 addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(25, 135)), module, WrapComp::OFFSET_PARAM, -5.0, 5.0, 0.0));
70 addInput(Port::create<PJ301MPort>(center.plus(Vec(-25, 135)), Port::INPUT, module, WrapComp::OFFSET_INPUT));
72 addParam(createParam<RoundSmallBlackKnob>(kcenter.plus(Vec(25, 135)), module, WrapComp::OFFSET_PARAM, -5.0, 5.0, 0.0));
73 addInput(createPort<PJ301MPort>(center.plus(Vec(-25, 135)), PortWidget::INPUT, module, WrapComp::OFFSET_INPUT));
7174
72 addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(25, 210)), module, WrapComp::RANGE_PARAM, -5.0, 5.0, 0.0));
73 addInput(Port::create<PJ301MPort>(center.plus(Vec(-25, 210)), Port::INPUT, module, WrapComp::RANGE_INPUT));
75 addParam(createParam<RoundSmallBlackKnob>(kcenter.plus(Vec(25, 210)), module, WrapComp::RANGE_PARAM, -5.0, 5.0, 0.0));
76 addInput(createPort<PJ301MPort>(center.plus(Vec(-25, 210)), PortWidget::INPUT, module, WrapComp::RANGE_INPUT));
7477
75 addChild(ModuleLightWidget::create<MediumLight<RedLight>>(lcenter.plus(Vec(-15, 255)), module, WrapComp::A_LIGHT));
76 addChild(ModuleLightWidget::create<MediumLight<RedLight>>(lcenter.plus(Vec( 15, 255)), module, WrapComp::B_LIGHT));
78 addChild(createLight<MediumLight<RedLight>>(lcenter.plus(Vec(-15, 255)), module, WrapComp::A_LIGHT));
79 addChild(createLight<MediumLight<RedLight>>(lcenter.plus(Vec( 15, 255)), module, WrapComp::B_LIGHT));
7780
78 addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(-25, 280)), module, WrapComp::A_OUT_PARAM, -8.0, 8.0, 1.0));
79 addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec( 25, 280)), module, WrapComp::B_OUT_PARAM, -8.0, 8.0, 0.0));
81 addParam(createParam<RoundSmallBlackKnob>(kcenter.plus(Vec(-25, 280)), module, WrapComp::A_OUT_PARAM, -8.0, 8.0, 1.0));
82 addParam(createParam<RoundSmallBlackKnob>(kcenter.plus(Vec( 25, 280)), module, WrapComp::B_OUT_PARAM, -8.0, 8.0, 0.0));
8083
81 addOutput(Port::create<PJ301MPort>(center.plus(Vec(0, 315)), Port::OUTPUT, module, WrapComp::MAIN_OUTPUT));
84 addOutput(createPort<PJ301MPort>(center.plus(Vec(0, 315)), PortWidget::OUTPUT, module, WrapComp::MAIN_OUTPUT));
8285 }
8386
84 Model *modelWrapComp = Model::create<WrapComp, WrapCompWidget>("s-ol", "WrapComp", "Wrapping Comparator", LOGIC_TAG);
87 Model *modelWrapComp = createModel<WrapComp, WrapCompWidget>("WrapComp");
00 #include "s-ol.hpp"
11
2 Plugin *plugin;
2 Plugin *pluginInstance;
33
44 void init(rack::Plugin *p) {
5 plugin = p;
6
7 p->slug = TOSTRING(SLUG);
8 p->version = TOSTRING(VERSION);
9 p->website = "https://github.com/s-ol/vcvmods";
10 p->manual = "https://github.com/s-ol/vcvmods";
5 pluginInstance = p;
116
127 p->addModel(modelCircleVCO);
138 p->addModel(modelWrapComp);
0 #include "rack.hpp"
0 #include <rack0.hpp>
11
22
33 using namespace rack;
44
5 extern Plugin *plugin;
5 extern Plugin *pluginInstance;
66
77 extern Model *modelCircleVCO;
88 extern Model *modelWrapComp;