subducer

a sub-octave generator that has it's highest possible frequency fixed in a particular frequency region no matter the octave of the incoming signal.
Author: Remco van der Most
License: BSD
Github: sss/dist/subducer.axo

Inlets

frac32buffer trig

Outlets

frac32buffer o

Parameters

frac32.s.map rate

frac32.s.map.pitch slew

Declaration
int ntrig;
int count;
int cnt;

uint32_t val;
int32_t v26 = 1 << 26;
int32_t vel;
Init
count = 0;
ntrig = 0;
cnt = 0;
Control Rate
int32_t slew;
MTOFEXTENDED(param_slew, slew)
int32_t rate;
MTOFEXTENDED(param_rate, rate)
Audio Rate
rate = rate >> 2;

val = __USAT(val - rate, 31);
if ((inlet_trig > 0) && !ntrig) {
  count += 1;
  if (count >= 1 << cnt) {
    cnt += 1;
    count = 0;

    if (val < 1) {
      vel = vel > 0 ? -v26 : v26;
      val = 1 << 30;
      count = 0;
      cnt = 0;
    }
  }
  ntrig = 1;
} else if (!(inlet_trig > 0))
  ntrig = 0;

outlet_o = vel;

Privacy

© 2024 Zrna Research