align VCO v/oct formula with Fundamental-VCO
Close #5
s-ol
4 years ago
29 | 29 | float deltaTime = 1.0f / engineGetSampleRate(); |
30 | 30 | |
31 | 31 | float pitch = params[PITCH_PARAM].value; |
32 | pitch += inputs[PITCH_INPUT].value; | |
33 | pitch = clamp(pitch, -4.0f, 4.0f); | |
34 | float freq = 200.0f * (pow(2.0f, pitch) - powf(2.0f, -4.0f)); | |
32 | pitch += 12.0f * inputs[PITCH_INPUT].value; | |
33 | float freq = 261.626f * powf(2.0f, pitch / 12.0f); | |
35 | 34 | |
36 | 35 | phase += freq * deltaTime; |
37 | 36 | while (phase >= 1.0f) |
60 | 59 | Vec center = Vec(box.size.x, 0).minus(p.box.size).div(2); |
61 | 60 | Vec kcenter = Vec(box.size.x, 0).minus(k.box.size).div(2); |
62 | 61 | |
63 | addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(0, 90)), module, CircleVCO::PITCH_PARAM, 0.0, 1.0, 0.0)); | |
62 | addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(0, 90)), module, CircleVCO::PITCH_PARAM, -54.0f, 54.0f, 0.0f)); | |
64 | 63 | |
65 | 64 | addInput(Port::create<PJ301MPort>(center.plus(Vec(0, 144)), Port::INPUT, module, CircleVCO::PITCH_INPUT)); |
66 | 65 |