pos speed m

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

Inlets

frac32 mod inlet for the speed parameter

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

int32 startpos

int32 endpos

frac32buffer.positive pos signal generator for the rec object

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

frac32.s.map speed

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;

startpos = startpos << 8;
maxlength = maxlength << 8;

int32_t increment =
    __USAT(___SMMLA(param_speed + inlet_speed, 1 << 13, 1 << 8), 30);
Audio Rate
if (play && !hold)
  counter += increment;
else if (!play)
  counter = startpos;

if (counter > maxlength)
  counter = startpos;

outlet_pos = counter >> 8;

Privacy

© 2024 Zrna Research