bool32.rising reset to 'offset'
int32.positive offset
int32.positive range
frac32.bipolar direction
frac32.positive tansposition in semi-notes
bool32.risingfalling toggle playback
frac32buffer.positive position inside table
objref table to index
spinner forward or reverse
int32_t index;
int32_t pos;
uint8_t i_shift;
int32_t i_inc;
uint16_t l_div;
bool play;
bool rro;
uint8_t t_length =
((22 - attr_wave.LENGTHPOW) > 2) ? 2 : 22 - attr_wave.LENGTHPOW;
l_div = 1428 >> t_length;
i_shift = 9 + t_length;
MTOFEXTENDED(inlet_transpose - (1 << 27), i_inc);
i_inc = ___SMMUL(i_inc, inlet_direction) << 5;
i_inc = i_inc / l_div;
if (inlet_play && !play) {
play = 1;
index = 0;
}
if (!inlet_play)
play = 0;
if (inlet_reset && (!rro)) {
index = 0;
rro = 1;
}
if (!inlet_reset)
rro = 0;
if (!inlet_range)
play = 0;
pos = index >> i_shift;
outlet_smps = (play) ? pos + inlet_offset : 0;
index += i_inc;
if (i_inc > 0) {
if (pos >= inlet_range)
index = 0;
} else if (pos <= 0)
index = inlet_range << i_shift;