lfsrburstMod

lfsr burst with controllable "burst" using a knob and velocity-dependent trigger input.
Author: Remco van der Most
License: BSD
Github: sss/pulse/lfsrburstMod.axo

Inlets

frac32 trig

Outlets

frac32buffer.bipolar lfs burst

Parameters

frac32.u.map p1

Declaration
uint32_t state;
int32_t count;
int32_t ntrig;
Init
state = 0;
count = 0;
ntrig = 0;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  state = 1;
  count = (inlet_trig >> 24) + 3;
  ntrig = 1;
} else {
  if (!(inlet_trig > 0))
    ntrig = 0;
}
Audio Rate
if (count > 0) {
  count--;
  if (state & 1) {
    state = (state >> 1) ^ (___SMMUL(param_p1 + 0xC << 3, 0x9 + param_p1));
    outlet_out = 1 << 27;
  } else {
    state = (state >> 1);
    outlet_out = -1 << 27;
  }
} else
  outlet_out = 0;

Privacy

© 2024 Zrna Research