frac32buffer level input
frac32buffer trigger input, triggers on rising zero-crossing
frac32buffer.bipolar audio output
static const int blepvoices = 8;
int16_t *oscp[blepvoices];
int32_t vgain[blepvoices];
uint32_t nextvoice;
int32_t i0;
int32_t in0;
int32_t acc;
int j;
for (j = 0; j < blepvoices; j++)
oscp[j] = &blept[BLEPSIZE - 1];
nextvoice = 0;
i0 = 0;
in0 = 0;
acc = 0;
int j;
int16_t *lastblep = &blept[BLEPSIZE - 1];
for (j = 0; j < BUFSIZE; j++) {
int i;
int i1 = inlet_trig[j] >> 2;
if ((i1 > 0) && !(i0 > 0)) { // dispatch
nextvoice = (nextvoice + 1) & (blepvoices - 1);
int32_t x = (i1 << 6) / (i1 - i0);
oscp[nextvoice] = &blept[x];
int32_t val = (((64 - x) * (inlet_in[j] >> 2)) + (x * (in0 >> 2))) >> 6;
vgain[nextvoice] = (acc - val) << 2;
acc = val;
}
int32_t sum = 0;
i0 = i1;
in0 = inlet_in[j];
for (i = 0; i < blepvoices; i++) { // sample
int16_t *t = oscp[i];
sum = ___SMMLA((16384 - (*t)) << 16, vgain[i], sum);
t += 64;
if (t >= lastblep) {
t = lastblep;
vgain[i] = 0;
}
oscp[i] = t;
}
outlet_out[j] = (sum + acc) << 1;
}