loop_slave_1

write to table,at inlet pos (in fraction of the table's size) will record for exactly 1 phase (well,bar...)
Author: robert schirmer
License: who cares
Github: rbrt/old/loop_slave_1.axo

Inlets

frac32buffer.positive index in fraction of table size

frac32buffer audio in

bool32.rising trigger recording

Outlets

bool32 recording state

Attributes

objref table

Declaration
int rec;
uint32_t spos;
uint32_t csample;
int count;
bool rollover;
Init
rec = 0;
Audio Rate
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;

Privacy

© 2024 Zrna Research