1shot nointerp

drives a phasor (saw-wave) for reading/writing data
Author: robert schirmer
License: BSD
Github: rbrt/testing/1shot nointerp.axo

Inlets

bool32.rising play

frac32.positive offset inside the table

frac32.positive length of the area to index,or loop end

frac32.positive position inside range on reset

bool32 direction

Outlets

int32 spos

int32 slength

frac32buffer audio out

frac32buffer plaback phase in fraction of table

bool32 play

Parameters

int32.hradio direction

Attributes

objref table

Declaration
int32_t index1;
uint8_t shift;

int32_t dir;
int32_t start;

uint32_t phase;

bool play;
bool ntrig;
Init
// set 'shift factor' for storing the recording length/the sync output
shift = (27 - attr_table.LENGTHPOW);
Control Rate
dir = ((((!(inlet_direction || param_direction)) << 1) - 1) << 27) >>
      attr_table.LENGTHPOW;
start = (___SMMUL(inlet_range, inlet_startpoint) << 5);

if (inlet_play && (!ntrig)) {
  ntrig = 1;
  index1 = (dir < 0) ? (inlet_range - start) : 0;
  play = 1;
} else if (!(inlet_play > 0))
  ntrig = 0;

outlet_play = play;

outlet_slength = (inlet_range - start) >> shift;
outlet_spos = index1 >> shift;
Audio Rate
if ((index1 > inlet_range) || (index1 < start))
  play = 0;

outlet_phase = __USAT(index1 + inlet_offset, 27);
outlet_wave = attr_table.array[outlet_phase >> shift] << attr_table.GAIN;

if (play)
  index1 += dir;
else
  outlet_wave = 0;

Privacy

© 2024 Zrna Research