phaser_HQ

HQ phaser effect. Rate parameter is disconnected when the Hz-input is used! Use Hz input together with my Clock2Timing module (sss->timers) to sync the effect to host tempo. Set the recording delay to a high value (21.8s) to be able to morph from small to large modulation width. Then use an int-control to set the length of the phaser's counter (see delay's XML for the maximum "power" length sizes of the delay buffer). This modulation width can be controlled "realtime" and only sets till how far the counter can count. If count is higher then max, count will invert and slowely count back again.
Author: Remco van der Most
License: BSD
Github: sss/fx/phaser_HQ.axo

Inlets

int32 Use int-control to set "power length" (see delay module for corresponding "power values"

frac32 Connect to the Clock2Timing module (sss->Clock2Timing)

Outlets

frac32buffer wave

frac32.positive res

Parameters

frac32.s.map.kpitch rate

Attributes

objref delayname

Declaration
uint64_t phase;
uint64_t phrase;
int64_t val;
int64_t ctrl1;
int64_t ctrl2;
int32_t ctrl3;
int64_t next1;
int64_t next2;
int64_t next3;
int64_t prev;
int64_t ccomp;
int64_t tri;
int trg;
int64_t dir;
int64_t val2;
int64_t out;
Control Rate
outlet_res = ctrl1 << 28 - inlet_length;
Audio Rate
int64_t freq;
MTOFEXTENDED(param_rate - (50 << 21), freq);
if (inlet_Hz) {
  freq = ((inlet_Hz) / 44 * 30);
}
if (phase > (1 << 27)) {
  trg = 1;
  phase = (phase + freq) & ((1 << 27) - 1);
} else {
  trg = 0;
  phase += freq;
}

if (trg == 1) {
  ctrl3 = ctrl2;
  ctrl2 = ctrl1;
  if (ctrl1 >= ((1 << inlet_length - 1))) {
    dir = 1;
  }
  if (ctrl1 <= 1) {
    dir = 0;
  }

  if (dir == 0) {
    ctrl1 += 1;
  }
  if (dir == 1) {
    ctrl1 -= 1;
  }
}

ccomp = (1 << 27) - phase;

uint32_t delay1 = attr_delayname.writepos - ctrl3 - BUFSIZE + buffer_index;
next1 = attr_delayname.array[delay1 & attr_delayname.LENGTHMASK] << 14;
uint32_t delay2 = attr_delayname.writepos - ctrl2 - BUFSIZE + buffer_index;
next2 = attr_delayname.array[delay2 & attr_delayname.LENGTHMASK] << 14;
uint32_t delay3 = attr_delayname.writepos - ctrl1 - BUFSIZE + buffer_index;
next3 = attr_delayname.array[delay3 & attr_delayname.LENGTHMASK] << 14;

out = (___SMMUL(ccomp << 3, next1 << 2) + next2 +
       ___SMMUL(phase << 3, next3 << 2)) >>
      1;
val2 = val2 + ((out << 32) - val2) >> 1;
outlet_out = (val2) >> 32;
// outlet_out=next1;

//(__USAT(param_time + inlet_time,27)>>(27-attr_delayname.LENGTHPOW))

Privacy

© 2024 Zrna Research