frac32buffer.positive index in fraction of table size
frac32buffer audio in
bool32.rising trigger recording
bool32 recording state
objref table
int rec;
uint32_t spos;
uint32_t csample;
int count;
bool rollover;
rec = 0;
csample = (__USAT(inlet_pos, 27) >> (27 - attr_table.LENGTHPOW));
rollover = count;
// record
if ((inlet_rec) && !rec) {
rec = 1;
spos = csample;
count = -1;
} else if (rollover) {
rec = 0;
spos = 0;
}
// rec + count
if (rec) {
if (csample == spos) {
count++;
}
attr_table.array[csample] = __SSAT((inlet_wave), 28) >> attr_table.GAIN;
}
outlet_recstate = rec;