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