git.s-ol.nu vcvmods / 82b514e
align VCO v/oct formula with Fundamental-VCO Close #5 s-ol 4 years ago
1 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
2929 float deltaTime = 1.0f / engineGetSampleRate();
3030
3131 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);
3534
3635 phase += freq * deltaTime;
3736 while (phase >= 1.0f)
6059 Vec center = Vec(box.size.x, 0).minus(p.box.size).div(2);
6160 Vec kcenter = Vec(box.size.x, 0).minus(k.box.size).div(2);
6261
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));
6463
6564 addInput(Port::create<PJ301MPort>(center.plus(Vec(0, 144)), Port::INPUT, module, CircleVCO::PITCH_INPUT));
6665