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