git.s-ol.nu vcvmods / 82b514e
align VCO v/oct formula with Fundamental-VCO Close #5 s-ol 1 year, 2 months ago
1 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
3030 float deltaTime = 1.0f / engineGetSampleRate();
3131
3232 float pitch = params[PITCH_PARAM].value;
33 pitch += inputs[PITCH_INPUT].value;
34 pitch = clamp(pitch, -4.0f, 4.0f);
35 float freq = 200.0f * (pow(2.0f, pitch) - powf(2.0f, -4.0f));
33 pitch += 12.0f * inputs[PITCH_INPUT].value;
34 float freq = 261.626f * powf(2.0f, pitch / 12.0f);
3635
3736 phase += freq * deltaTime;
3837 while (phase >= 1.0f)
6160 Vec center = Vec(box.size.x, 0).minus(p.box.size).div(2);
6261 Vec kcenter = Vec(box.size.x, 0).minus(k.box.size).div(2);
6362
64 addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(0, 90)), module, CircleVCO::PITCH_PARAM, 0.0, 1.0, 0.0));
63 addParam(ParamWidget::create<RoundSmallBlackKnob>(kcenter.plus(Vec(0, 90)), module, CircleVCO::PITCH_PARAM, -54.0f, 54.0f, 0.0f));
6564
6665 addInput(Port::create<PJ301MPort>(center.plus(Vec(0, 144)), Port::INPUT, module, CircleVCO::PITCH_INPUT));
6766