split 3

Split the incoming signal in three, based on the amplitude.
Author: Sputnki
License: BSD
Github: sptnk/split/split 3.axo

Inlets

frac32buffer in

Outlets

frac32buffer o1

frac32buffer o2

frac32buffer o3

Parameters

frac32.s.map cutoff1

frac32.s.map cutoff2

Declaration
int32_t center1;
int32_t center2;
int32_t width;
int32_t o1;
int32_t o2;
int32_t o3;
Control Rate
center1 = param_cutoff1;
center2 = param_cutoff2;
Audio Rate
if (center1 < center2) {
  if (inlet_in < center1) {
    o1 = inlet_in;
    o2 = 0;
    o3 = 0;
  } else if (inlet_in > center2) {
    o1 = 0;
    o2 = 0;
    o3 = inlet_in;
  } else {
    o1 = 0;
    o2 = inlet_in;
    o3 = 0;
  }
} else if (center1 > center2) {
  if (inlet_in < center2) {
    o1 = inlet_in;
    o2 = 0;
    o3 = 0;
  } else if (inlet_in > center1) {
    o1 = 0;
    o2 = 0;
    o3 = inlet_in;
  } else {
    o1 = 0;
    o2 = inlet_in;
    o3 = 0;
  }
} else {
  if (inlet_in < center1) {
    o1 = inlet_in;
    o2 = 0;
    o3 = 0;
  } else if (inlet_in > center1) {
    o1 = 0;
    o2 = 0;
    o3 = inlet_in;
  }
}

outlet_o1 = o1;
outlet_o2 = o2;
outlet_o3 = o3;

Privacy

© 2024 Zrna Research