add parameter descriptions
s-ol
4 years ago
0 | #include "s-ol.hpp" | |
0 | #include "plugin.hpp" | |
1 | 1 | |
2 | 2 | struct CircleVCO : Module { |
3 | 3 | enum ParamIds { |
4 | PITCH_PARAM, | |
4 | FREQ_PARAM, | |
5 | 5 | NUM_PARAMS |
6 | 6 | }; |
7 | 7 | enum InputIds { |
22 | 22 | |
23 | 23 | CircleVCO() { |
24 | 24 | 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); | |
26 | 26 | } |
27 | 27 | void process(const ProcessArgs &args) override; |
28 | 28 | }; |
31 | 31 | void CircleVCO::process(const ProcessArgs &args) { |
32 | 32 | float deltaTime = 1.0f / args.sampleRate; |
33 | 33 | |
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); | |
37 | 37 | |
38 | 38 | phase += freq * deltaTime; |
39 | 39 | while (phase >= 1.0f) |
63 | 63 | Vec center = Vec(box.size.x, 0).minus(p.box.size).div(2); |
64 | 64 | Vec kcenter = Vec(box.size.x, 0).minus(k.box.size).div(2); |
65 | 65 | |
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)); | |
67 | 67 | |
68 | 68 | addInput(createInput<PJ301MPort>(center.plus(Vec(0, 144)), module, CircleVCO::PITCH_INPUT)); |
69 | 69 |
0 | #include "s-ol.hpp" | |
0 | #include "plugin.hpp" | |
1 | 1 | |
2 | 2 | struct Modulo : Module { |
3 | 3 | enum ParamIds { |
21 | 21 | Modulo() { |
22 | 22 | config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); |
23 | 23 | configParam(GAIN_PARAM, -3.0, 3.0, 0.0); |
24 | configParam(GAIN_PARAM, -3.0f, 3.0f, 0.0f, "Gain", "%", 2.0f, 100.0f); | |
24 | 25 | } |
25 | 26 | void process(const ProcessArgs &args) override; |
26 | 27 | }; |
0 | #include "s-ol.hpp" | |
0 | #include "plugin.hpp" | |
1 | 1 | |
2 | 2 | struct WrapComp : Module { |
3 | 3 | enum ParamIds { |
25 | 25 | |
26 | 26 | WrapComp() { |
27 | 27 | 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"); | |
32 | 32 | } |
33 | 33 | void process(const ProcessArgs &args) override; |
34 | 34 | }; |
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; |