flashread interp

linear interpolated flash table read
Author: Johannes Taelman
License: BSD
Github: wave/flashread interp.axo

Inlets

frac32buffer position

Outlets

frac32buffer output

Attributes

combo sample

combo size

Declaration
static const uint32_t LENGTHPOW = (attr_size);
static const uint32_t LENGTH = (1 << attr_size);
static const uint32_t LENGTHMASK = ((1 << attr_size) - 1);
static const uint32_t BITS = 16;
static const uint32_t GAIN = 12;
Audio Rate
extern int16_t _binary_attr_sample_raw_start;
uint32_t asat = __USAT(inlet_pos, 27);
int index = asat >> (27 - LENGTHPOW);
int32_t y1 = (((int16_t *)(&_binary_attr_sample_raw_start))[index]) << GAIN;
int32_t y2 = (((int16_t *)(&_binary_attr_sample_raw_start))[index + 1]) << GAIN;
int frac = (asat - (index << (27 - LENGTHPOW))) << (LENGTHPOW + 3);
int32_t rr;
rr = ___SMMUL(y1, (1 << 30) - frac);
rr = ___SMMLA(y2, frac, rr);
outlet_o = rr << 2;

Privacy

© 2024 Zrna Research