morphController

Morph-controller the phase-input sends a positive triangle to the outputs one by one like: /\__ _/\_ __/\ \__/ The width of the triangle as well as the spreading between these and the start-position (which one(s) is/are high at phase=0) can be controlled. The width goes from very narrow spikes to all 4 overlapping, though mixed. Spread allows to change the order of the triangles, to make 2 triangles go high at the same time or follow-up shortly after each other while having "blank" spaces in the middle. Very nice to use for modulation-widths of different modulations!
Author: Remco van der Most
License: BSD
Github: sss/math/morphController.axo

Inlets

frac32 phase

frac32 lvl

Outlets

frac32 o1

frac32 o2

frac32 o3

frac32 o4

Parameters

frac32.u.map.gain width

frac32.u.map.gain start

frac32.u.map.gain spread

Declaration
uint32_t Phase;
int r = 1;
int32_t lvl;
int32_t SHAPE(int32_t in, int32_t width, int32_t start, int32_t spread,
              int nr) {
  float32_t ratio = (float32_t)(lvl) / width;
  in += start;
  in += spread * nr;
  in = (in > 0 ? -in : in) + width >> 4;
  return in = (int32_t)(in > 0 ? in * ratio : 0) << 1;
}
Init
Phase = 0;
Control Rate
Phase = inlet_phase << 4;
int32_t strt = param_start << 1;
int32_t sprd = param_spread << 1;
lvl = inlet_lvl << 3;
outlet_o1 = SHAPE(Phase, param_width, strt, sprd, 0);
outlet_o2 = SHAPE(Phase, param_width, strt, sprd, 1);
outlet_o3 = SHAPE(Phase, param_width, strt, sprd, 2);
outlet_o4 = SHAPE(Phase, param_width, strt, sprd, 3);

Privacy

© 2024 Zrna Research