git.s-ol.nu vcvmods / 77d1f54
add parameter descriptions s-ol 2 months ago
7 changed file(s) with 35 addition(s) and 34 deletion(s). Raw diff Collapse all Expand all
1 #include "s-ol.hpp"
1 #include "plugin.hpp"
22
33 struct CircleVCO : Module {
44 enum ParamIds {
5 PITCH_PARAM,
5 FREQ_PARAM,
66 NUM_PARAMS
77 };
88 enum InputIds {
2323
2424 CircleVCO() {
2525 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
26 configParam(PITCH_PARAM, -54.0f, 54.0f, 0.0f);
26 configParam(FREQ_PARAM, -54.0f, 54.0f, 0.0f, "Frequency", " Hz", dsp::FREQ_SEMITONE, dsp::FREQ_C4);
2727 }
2828 void process(const ProcessArgs &args) override;
2929 };
3232 void CircleVCO::process(const ProcessArgs &args) {
3333 float deltaTime = 1.0f / args.sampleRate;
3434
35 float pitch = params[PITCH_PARAM].getValue();
36 pitch += 12.0f * inputs[PITCH_INPUT].getVoltage();
37 float freq = 261.626f * powf(2.0f, pitch / 12.0f);
35 float pitch = params[FREQ_PARAM].getValue() / 12.f;
36 pitch += inputs[PITCH_INPUT].getVoltage();
37 float freq = dsp::FREQ_C4 * powf(2.f, pitch);
3838
3939 phase += freq * deltaTime;
4040 while (phase >= 1.0f)
6464 Vec center = Vec(box.size.x, 0).minus(p.box.size).div(2);
6565 Vec kcenter = Vec(box.size.x, 0).minus(k.box.size).div(2);
6666
67 addParam(createParam<RoundSmallBlackKnob>(kcenter.plus(Vec(0, 90)), module, CircleVCO::PITCH_PARAM));
67 addParam(createParam<RoundSmallBlackKnob>(kcenter.plus(Vec(0, 90)), module, CircleVCO::FREQ_PARAM));
6868
6969 addInput(createInput<PJ301MPort>(center.plus(Vec(0, 144)), module, CircleVCO::PITCH_INPUT));
7070
1 #include "s-ol.hpp"
1 #include "plugin.hpp"
22
33 struct Modulo : Module {
44 enum ParamIds {
2222 Modulo() {
2323 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
2424 configParam(GAIN_PARAM, -3.0, 3.0, 0.0);
25 configParam(GAIN_PARAM, -3.0f, 3.0f, 0.0f, "Gain", "%", 2.0f, 100.0f);
2526 }
2627 void process(const ProcessArgs &args) override;
2728 };
1 #include "s-ol.hpp"
1 #include "plugin.hpp"
22
33 struct WrapComp : Module {
44 enum ParamIds {
2626
2727 WrapComp() {
2828 config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
29 configParam(OFFSET_PARAM, -5.0, 5.0, 0.0);
30 configParam(RANGE_PARAM, -5.0, 5.0, 0.0);
31 configParam(A_OUT_PARAM, -8.0, 8.0, 1.0);
32 configParam(B_OUT_PARAM, -8.0, 8.0, 0.0);
29 configParam(OFFSET_PARAM, -5.0f, 5.0f, 0.0f, "Window Offset", " V");
30 configParam(RANGE_PARAM, -5.0f, 5.0f, 0.0f, "Window Size", " V");
31 configParam(A_OUT_PARAM, -8.0f, 8.0f, 8.0f, "A Output", " V");
32 configParam(B_OUT_PARAM, -8.0f, 8.0f, 0.0f, "B Output", " V");
3333 }
3434 void process(const ProcessArgs &args) override;
3535 };
1 #include "plugin.hpp"
2
3 Plugin *pluginInstance;
4
5 void init(rack::Plugin *p) {
6 pluginInstance = p;
7
8 p->addModel(modelCircleVCO);
9 p->addModel(modelWrapComp);
10 p->addModel(modelModulo);
11 }
1 #include <rack.hpp>
2
3
4 using namespace rack;
5
6 extern Plugin *pluginInstance;
7
8 extern Model *modelCircleVCO;
9 extern Model *modelWrapComp;
10 extern Model *modelModulo;
+0
-11
src/s-ol.cpp less more
1 #include "s-ol.hpp"
2
3 Plugin *pluginInstance;
4
5 void init(rack::Plugin *p) {
6 pluginInstance = p;
7
8 p->addModel(modelCircleVCO);
9 p->addModel(modelWrapComp);
10 p->addModel(modelModulo);
11 }
+0
-10
src/s-ol.hpp less more
1 #include <rack.hpp>
2
3
4 using namespace rack;
5
6 extern Plugin *pluginInstance;
7
8 extern Model *modelCircleVCO;
9 extern Model *modelWrapComp;
10 extern Model *modelModulo;