pos m

Phase generator for the loop recorder object. Essential to avoid horrible noises. Modulation inlets for num, den and mulstart parameters (override)
Author: Sputnki
License: BSD
Github: sptnk/looper/pos m.axo

Inlets

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

bool32 set the object to pause mode

int32 last value of the table to read

int32 mod inlet for the num parameter (overrides the parameter)

int32 mod inlet for the den parameter (overrides the parameter)

int32 mod inlet for the mulstart parameter (overrides the parameter)

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;

int32_t num;
int32_t den;
int32_t mulstart;
Control Rate
uint32_t maxlength = inlet_length ? inlet_length : attr_table.LENGTHMASK;
uint32_t startpos = 0;

num = inlet_num > 0 ? inlet_num : param_num;
den = inlet_den > 0 ? inlet_den : param_den;
mulstart = inlet_mulstart >= 0 ? inlet_mulstart : param_mulstart;

uint32_t base = (num * maxlength) / den;

startpos = (mulstart * maxlength) / 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