automux b 2

input collector.outputs an input's value if it changes.
Author: Robert Schirmer
License: BSD
Github: rbrt/patching/automux b 2.axo

Inlets

bool32 i0

bool32 i1

Outlets

bool32 o

Declaration
int32_t prev0;
int32_t prev1;
int32_t prev2;
int32_t prev3;

int src;
Control Rate
if (inlet_i0 != prev0) {
  src = 0;
  prev0 = inlet_i0;
}
if (inlet_i1 != prev1) {
  src = 1;
  prev1 = inlet_i1;
}

switch (src) {
case 0:
  outlet_o = inlet_i0;
  break;
case 1:
  outlet_o = inlet_i1;
  break;
default:
  outlet_o = inlet_i0;
  break;
}

Privacy

© 2024 Zrna Research