split 3 overlap

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

Inlets

frac32buffer in

Outlets

frac32buffer o1

frac32buffer o2

frac32buffer o3

Parameters

frac32.s.map cutoff1

frac32.s.map cutoff2

frac32.u.map overlap

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;
width = param_overlap;
Audio Rate
if (center1 < center2) {
  if (inlet_in < center1 - width) {
    o1 = inlet_in;
    o2 = 0;
    o3 = 0;
  } else if (inlet_in > center2 + width) {
    o1 = 0;
    o2 = 0;
    o3 = inlet_in;
  } else if (inlet_in < center1 + width) {
    o1 = inlet_in;
    o2 = inlet_in;
    o3 = 0;
  } else if (inlet_in > center2 - width) {
    o1 = 0;
    o2 = inlet_in;
    o3 = inlet_in;
  } else {
    o1 = 0;
    o2 = inlet_in;
    o3 = 0;
  }

} else if (center1 > center2) {
  if (inlet_in < center2 - width) {
    o1 = inlet_in;
    o2 = 0;
    o3 = 0;
  } else if (inlet_in > center1 + width) {
    o1 = 0;
    o2 = 0;
    o3 = inlet_in;
  } else if (inlet_in < center2 + width) {
    o1 = inlet_in;
    o2 = inlet_in;
    o3 = 0;
  } else if (inlet_in > center1 - width) {
    o1 = 0;
    o2 = inlet_in;
    o3 = inlet_in;
  } else {
    o1 = 0;
    o2 = inlet_in;
    o3 = 0;
  }

} else {
  if (inlet_in < center1 - width) {
    o1 = inlet_in;
    o2 = 0;
    o3 = 0;
  } else if (inlet_in > center1 + width) {
    o1 = 0;
    o2 = 0;
    o3 = inlet_in;
  } else {
    o1 = inlet_in;
    o2 = inlet_in;
    o3 = inlet_in;
  }
}

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

Privacy

© 2024 Zrna Research