frac32buffer.positive index in fraction of table size
frac32buffer audio in
bool32.risingfalling overdub
frac32.positive feedback amount
frac32.positive recording fade-in time
frac32.positive recording fade-out time
bool32 recording state with fade-out
frac32.u.map feedback
frac32.s.map.kdecaytime.exp attack
frac32.s.map.kdecaytime.exp release
bool32.tgl hard
bool32.tgl nofade
objref table
uint32_t csample;
uint32_t dub;
uint8_t shift;
int32_t env;
bool dubstate;
uint32_t attack;
uint32_t release;
shift = 27 - attr_table.LENGTHPOW;
attack = inlet_attack + param_attack;
release = inlet_release + param_release;
if (!param_nofade) {
if (inlet_overdub)
env = (param_hard) ? -(1 << 27)
: (1 << 27) - (___SMMUL((1 << 27) - env, attack) << 1);
else
env = ___SMMUL(env, release) << 1;
dubstate = env;
} else {
dubstate = inlet_overdub;
env = 1 << 27;
}
outlet_state = dubstate;
if (dubstate) {
csample = (__USAT(inlet_pos, 27) >> shift);
dub = (___SMMUL((attr_table.array[csample] << attr_table.GAIN),
(inlet_feedback + param_feedback))
<< 5);
attr_table.array[csample] =
(__SSAT((___SMMUL((inlet_wave), env) << 5) + dub, 28)) >> attr_table.GAIN;
}