bool32.rising play
frac32.positive offset inside the table
frac32.positive length of the area to index,or loop end
frac32.positive position inside range on reset
bool32 direction
int32 spos
int32 slength
frac32buffer audio out
frac32buffer plaback phase in fraction of table
bool32 play
int32.hradio direction
objref table
int32_t index1;
uint8_t shift;
int32_t dir;
int32_t start;
uint32_t phase;
bool play;
bool ntrig;
// set 'shift factor' for storing the recording length/the sync output
shift = (27 - attr_table.LENGTHPOW);
dir = ((((!(inlet_direction || param_direction)) << 1) - 1) << 27) >>
attr_table.LENGTHPOW;
start = (___SMMUL(inlet_range, inlet_startpoint) << 5);
if (inlet_play && (!ntrig)) {
ntrig = 1;
index1 = (dir < 0) ? (inlet_range - start) : 0;
play = 1;
} else if (!(inlet_play > 0))
ntrig = 0;
outlet_play = play;
outlet_slength = (inlet_range - start) >> shift;
outlet_spos = index1 >> shift;
if ((index1 > inlet_range) || (index1 < start))
play = 0;
outlet_phase = __USAT(index1 + inlet_offset, 27);
outlet_wave = attr_table.array[outlet_phase >> shift] << attr_table.GAIN;
if (play)
index1 += dir;
else
outlet_wave = 0;