play interp

read from table, linear interpolated
Author: Johannes Taelman
License: BSD
Github: rbrt/sstation/play interp.axo

Inlets

frac32buffer.positive index in fraction of table size

Outlets

frac32buffer table[a]

Attributes

objref smplr

Audio Rate
uint32_t asat = __USAT(inlet_a, 27);
int index = (asat >> attr_smplr.SHIFT);
int32_t y1 = attr_smplr.WAVE[index] << 16;
int32_t y2 = attr_smplr.WAVE[(index + 1) & attr_smplr.W_LENGTHMASK] << 16;
int frac = (asat - (index << attr_smplr.SHIFT)) << (attr_smplr.W_LENGTHPOW + 3);
int32_t rr;
rr = ___SMMUL(y1, (1 << 30) - frac);
rr = ___SMMLA(y2, frac, rr);
outlet_o = rr << 2;

Privacy

© 2024 Zrna Research