git.s-ol.nu vcvmods / 781a2ad
remove more deprecated math s-ol 1 year, 6 months ago
1 changed file(s) with 9 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
2727
2828
2929 void CircleVCO::step() {
30 float deltaTime = 1.0 / engineGetSampleRate();
30 float deltaTime = 1.0f / engineGetSampleRate();
3131
3232 float pitch = params[PITCH_PARAM].value;
3333 pitch += inputs[PITCH_INPUT].value;
3434 pitch = clamp(pitch, -4.0f, 4.0f);
35 float freq = 200 * (powf(2.0, pitch) - powf(2.0, -4.0));
35 float freq = 200.0f * (pow(2.0f, pitch) - powf(2.0f, -4.0f));
3636
3737 phase += freq * deltaTime;
38 while (phase >= 1.0)
39 phase -= 1.0;
38 while (phase >= 1.0f)
39 phase -= 1.0f;
4040
41 float sine = sinf(2 * M_PI * phase);
42 float cosn = cosf(2 * M_PI * phase);
43 outputs[SIN_OUTPUT].value = sine * 5;
44 outputs[COS_OUTPUT].value = cosn * 5;
45 outputs[PHS_OUTPUT].value = phase * 5;
41 float sine = sin(2.0f * M_PI * phase);
42 float cosn = cos(2.0f * M_PI * phase);
43 outputs[SIN_OUTPUT].value = sine * 5.0f;
44 outputs[COS_OUTPUT].value = cosn * 5.0f;
45 outputs[PHS_OUTPUT].value = phase * 5.0f;
4646 }
4747
4848