sel b 16 2t pulse

select one out of 16 booleans, chainable, 2 tracks, pulse output
Author: Johannes Taelman
License: BSD
Github: sel/sel b 16 2t pulse.axo

Inlets

bool32 default value channel 1

bool32 default value channel 2

int32 in

Outlets

int32 chain out (in-16)

bool32.pulse output channel 1

bool32.pulse output channel 2

Parameters

bin16 p1

bin16 p2

Declaration
int in_prev;
Init
in_prev = 0;
Control Rate
if ((inlet_in >= 0) && (inlet_in < 16)) {
  outlet_o1 = (inlet_in != in_prev) && (param_p1 & (1 << inlet_in));
  outlet_o2 = (inlet_in != in_prev) && (param_p2 & (1 << inlet_in));
} else {
  outlet_o1 = inlet_def1;
  outlet_o2 = inlet_def2;
}
outlet_chain = inlet_in - 16;
in_prev = inlet_in;

Privacy

© 2024 Zrna Research