record

record audio into table, starting from position
Author: Johannes Taelman
License: BSD
Github: table/record.axo

Inlets

frac32buffer wave

frac32.positive start position in table

bool32.rising start playback

bool32.rising stop playback

Outlets

None

Attributes

objref table

Declaration
int pstart;
int pstop;
int pos;
Init
pos = 0;
pstart = 0;
pstop = 1;
Control Rate
if ((inlet_start > 0) && !pstart) {
  pstart = 1;
  pstop = 0;
  uint32_t asat = __USAT(inlet_pos, 27);
  pos = asat >> (27 - attr_table.LENGTHPOW);
} else if (!(inlet_start > 0)) {
  pstart = 0;
}
if ((inlet_stop > 0) && !pstop) {
  pstop = 1;
  pstart = 0;
}
Audio Rate
if (!pstop) {
  if (pos < attr_table.LENGTH)
    attr_table.array[pos++] = __SSAT(inlet_wave, 28) >> attr_table.GAIN;
}

Privacy

© 2024 Zrna Research