Z-3

Author: Smashed Transistors
License: LGPL
Github: tiar/delay/Z 3.axo

Inlets

frac32buffer in

Outlets

frac32buffer out

Declaration
int32_t d[3];
Init
for (int i = 0; i < 3; i++) {
  d[i] = 0;
}
Control Rate
/*
//local:
int32_t d[4];
uint8_t c = 0;
//krate
for(int i = 0; i < BUFSIZE; i++){
  outlet_out[i] = d[(c + 2) & 3];  // 0 <-> previous i.e. -1
  c--; c &= 3;
  d[c] = inlet_in[i];
}
*/

for (int i = 0; i < 3; i++) {
  outlet_out[i] = d[i];
  d[i] = inlet_in[i + 13];
}
for (int i = 3; i < BUFSIZE; i++) {
  outlet_out[i] = inlet_in[i - 3];
}

// todo use memcpy(dest,src,len) ?
/*
memcpy(outlet_out,     d,                      4*(        3));
memcpy(outlet_out + 3, inlet_in,               4*(BUFSIZE-3));
memcpy(d,              inlet_in + BUFSIZE - 3, 4*(        3));
*/

Privacy

© 2024 Zrna Research