loop min

drives a phasor (saw-wave) for reading/writing data
Author: robert schirmer
License: BSD
Github: rbrt/sdrive/loop min.axo

Inlets

frac32.bipolar speed modulation

bool32.risingfalling toggle playback

bool32.rising reset to 'offset'

frac32.positive offset inside the table

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

frac32.positive tansposition in semi-notes

Outlets

frac32buffer.positive position inside table

Attributes

objref table to index

spinner forward or reverse

Declaration
uint32_t lrange;
uint32_t inc;
int32_t t_speed;
int32_t index;
uint8_t shift;
uint8_t scale;
bool play;
bool rro;
Init
scale = (attr_wave.LENGTHPOW < 6) ? 0 : 4;
shift = (27 - attr_wave.LENGTHPOW);
Control Rate
MTOFEXTENDED(inlet_transpose + (1 << 22) + 512000, inc);
t_speed = ((___SMMUL(inc, inlet_direction + (attr_direction << 21))) << 5) >>
          (attr_wave.LENGTHPOW - (scale + 2));
lrange = inlet_range << scale;

if (inlet_play && !play) {
  play = 1;
  index = 0;
}
if (!inlet_play)
  play = 0;

if (inlet_reset && (!rro)) {
  index = 0;
  rro = 1;
}
if (!inlet_reset)
  rro = 0;

if (!lrange)
  play = 0;
Audio Rate
if (t_speed > 0) {
  if (index >= lrange)
    index = 0;
} else if (index <= (-t_speed))
  index = lrange;

outlet_phase = __USAT(((index >> scale) + inlet_offset), 27) * play;
index += t_speed;

Privacy

© 2024 Zrna Research