Browse Source

Use new ode API

tags/v1.0.1
Andrew Belt 5 years ago
parent
commit
baa041b7f7
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      src/VCF.cpp

+ 11
- 11
src/VCF.cpp View File

@@ -32,17 +32,17 @@ struct LadderFilter {
}

void process(float input, float dt) {
stepRK4(0.f, dt, state, 4, [&](float t, const float y[], float dydt[]) {
float inputc = clip(input - resonance * y[3]);
float yc0 = clip(y[0]);
float yc1 = clip(y[1]);
float yc2 = clip(y[2]);
float yc3 = clip(y[3]);
dydt[0] = omega0 * (inputc - yc0);
dydt[1] = omega0 * (yc0 - yc1);
dydt[2] = omega0 * (yc1 - yc2);
dydt[3] = omega0 * (yc2 - yc3);
ode::stepRK4(0.f, dt, state, 4, [&](float t, const float x[], float dxdt[]) {
float inputc = clip(input - resonance * x[3]);
float yc0 = clip(x[0]);
float yc1 = clip(x[1]);
float yc2 = clip(x[2]);
float yc3 = clip(x[3]);
dxdt[0] = omega0 * (inputc - yc0);
dxdt[1] = omega0 * (yc0 - yc1);
dxdt[2] = omega0 * (yc1 - yc2);
dxdt[3] = omega0 * (yc2 - yc3);
});

lowpass = state[3];


Loading…
Cancel
Save