fixed synthpp_simple on web

This commit is contained in:
Stefano D'Angelo 2024-02-10 09:25:18 +01:00
parent 129d44db76
commit 17ec290ae6

View File

@ -126,16 +126,17 @@ void impl_process(impl handle, const float **inputs, float **outputs, size_t n_s
int n = bw_minf(n_samples - i, BUFFER_SIZE); int n = bw_minf(n_samples - i, BUFFER_SIZE);
#ifdef WASM #ifdef WASM
float * const * b = reinterpret_cast<float * const *>(&instance->buf); float *y[1] = {out};
instance->phaseGen.process(nullptr, &out, b, n); float *b[1] = {instance->buf};
instance->oscPulse.process(&out, b, &out, n); char gate[1] = {instance->note >= 0};
instance->oscFilt.process(&out, &out, n); instance->phaseGen.process(nullptr, y, b, n);
instance->svf.process(&out, &out, nullptr, nullptr, n); instance->oscPulse.process(y, b, y, n);
char gate = instance->note >= 0; instance->oscFilt.process(y, y, n);
instance->envGen.process(&gate, b, n); instance->svf.process(y, y, nullptr, nullptr, n);
bufMul<1>(&out, b, &out, n); instance->envGen.process(gate, b, n);
instance->gain.process(&out, &out, n); bufMul<1>(y, b, y, n);
instance->ppm.process(&out, nullptr, n); instance->gain.process(y, y, n);
instance->ppm.process(y, nullptr, n);
#else #else
instance->phaseGen.process({nullptr}, {out}, {instance->buf}, n); instance->phaseGen.process({nullptr}, {out}, {instance->buf}, n);
instance->oscPulse.process({out}, {instance->buf}, {out}, n); instance->oscPulse.process({out}, {instance->buf}, {out}, n);