allphaseHQ

High quality allpass/phaser effect with internal memory. "Max" sets the maximum length of the buffer in power of 2. Read knob offsets the read input position. Feed allows to feed back the output into the input. Size sets the "working" size, thus you can adjust the size while playing. Dry and wet controls control the volume of original and phased signals.
Author: Remco van der Most
License: BSD
Github: sss/fx/allphaseHQ.axo

Inlets

frac32buffer in

frac32 read

Outlets

frac32buffer out

Parameters

frac32.u.map read

frac32.s.map feed

frac32.s.map dry

frac32.s.map wet

int32 size

Attributes

spinner max

Declaration
int32_t delay[1 << attr_max];
int32_t position;
int64_t read;
int64_t rea1;
int64_t rea2;
int64_t rea3;
int64_t reb1;
int64_t reb2;
int64_t reb3;
int64_t raad;
int64_t reed;
int64_t out;
int64_t mix;
int32_t ccomp;
int64_t prev;
int64_t READ;
int64_t ofs1;
int64_t ofs2;
int64_t ofs3;
float32_t scale;
int32_t prav;
int8_t dir;
int16_t size;
Control Rate
raad = (1 << 27) - ((param_read + inlet_read) & ((1 << 27) - 1));
dir = raad > prav ? 1 : 0;
size = param_size > attr_max ? attr_max : param_size;

prav = raad;
Audio Rate
position += 1;
position = position - ((position >> size) << size);

reed = reed + ((raad - reed) >> 9);
READ = ((reed) >> (27 - size));

if (!(READ == prev)) {
  ofs1 = ofs2;
  ofs2 = ofs3;
  ofs3 = READ;
}

rea1 = position + ofs1;
rea2 = position + ofs2;
rea3 = position + ofs3;
rea1 = rea1 - ((rea1 >> size) << size);
rea2 = rea2 - ((rea2 >> size) << size);
rea3 = rea3 - ((rea3 >> size) << size);

mix = reed - ((READ << 27) >> size);
mix = (mix << size);
if (dir == 1) {
  mix = (1 << 27) - mix;
}
ccomp = (1 << 27) - mix;

delay[position] = inlet_in + ___SMMUL(out << 3, param_feed << 2);
out = (delay[rea2] + ___SMMUL(mix << 3, delay[rea1] << 2) +
       ___SMMUL(ccomp << 3, delay[rea3] << 2)) >>
      1;

outlet_out = ___SMMUL(param_wet << 2, out << 3) +
             ___SMMUL(param_dry << 2, inlet_in << 3);
prev = READ;

Privacy

© 2024 Zrna Research