pos

Phase generator for the loop recorder object. Essential to avoid horrible noises.
Author: Sputnki
License: BSD
Github: sptnk/looper/pos.axo

Inlets

int32 last value of the table to read

bool32 set the object to play mode. When released, the phasor resets to 0

bool32 set the object to pause mode

Outlets

frac32buffer.positive pos signal generator for the rec object

int32 startpos

int32 endpos

Parameters

int32 numerator for a further subdivision of the loop interval

int32 denominator for a further subdivision of the loop interval

int32 offsets the start position by a factor mulstart*num/den

Attributes

objref 32b table in which the 4 tracks are stored

Declaration
uint32_t counter = 0;
uint32_t maxlength = attr_table.LENGTH;

bool play;
bool hold;
Control Rate
uint32_t maxlength = inlet_length ? inlet_length : attr_table.LENGTHMASK;
uint32_t startpos = 0;

uint32_t base = (param_num * maxlength) / param_den;

startpos = (param_mulstart * maxlength) / param_den;
maxlength = startpos + base;

if (startpos > attr_table.LENGTHMASK)
  startpos = 0;
if (maxlength > attr_table.LENGTHMASK)
  maxlength = attr_table.LENGTHMASK;

play = inlet_play;
hold = inlet_hold;

outlet_startpos = startpos;
outlet_endpos = maxlength;
Audio Rate
if (play && !hold)
  counter++;
else if (!play)
  counter = startpos;

if (counter > maxlength)
  counter = startpos;

outlet_pos = counter;

Privacy

© 2024 Zrna Research