frac32buffer audio input
frac32buffer.bipolar audio output
static const int blepvoices = 8;
int16_t *oscp[blepvoices];
uint32_t nextvoice;
int32_t i0;
int j;
for (j = 0; j < blepvoices; j++)
oscp[j] = &blept[BLEPSIZE - 1];
nextvoice = 0;
i0 = 0;
int j;
int16_t *lastblep = &blept[BLEPSIZE - 1];
for (j = 0; j < BUFSIZE; j++) {
int i;
int i1 = inlet_in[j] >> 2;
int32_t sum = 0;
if ((i1 > 0) && !(i0 > 0)) { // dispatch
nextvoice = (nextvoice + 1) & (blepvoices - 1);
int32_t x = 64 - ((-i0 << 6) / (i1 - i0));
oscp[nextvoice] = &blept[x];
} else if ((i1 < 0) && !(i0 < 0)) { // dispatch
nextvoice = (nextvoice + 1) & (blepvoices - 1);
int32_t x = 64 - ((i0 << 6) / (i0 - i1));
oscp[nextvoice] = &blept[x];
}
i0 = i1;
for (i = 0; i < blepvoices; i++) { // sample
int16_t *t = oscp[i];
if (i & 1)
sum += *t;
else
sum -= *t;
t += 64;
if (t >= lastblep)
t = lastblep;
oscp[i] = t;
}
sum -= ((((nextvoice + 1) & 1) << 1) - 1) << 13;
outlet_out[j] = sum << 13;
}