change b

Generates a single pulse at 'change' when the input changes; if there's a transition from 0 to 1, outlet '0to1' will produce a pulse, else, outlet '1to0'.
Author: Robert Schirmer
License: BSD
Github: rbrt/control/change b.axo

Inlets

bool32.risingfalling bool

Outlets

bool32.pulse change

bool32.pulse 0to1

bool32.pulse 1to0

Declaration
bool ontrig;
bool offtrig;
Init
offtrig = 1;
Control Rate
outlet_0to1 = 0;
outlet_1to0 = 0;
outlet_change = 0;
if (inlet_bool && !ontrig) {
  ontrig = 1;
  outlet_0to1 = 1;
  outlet_change = 1;
}

if (!inlet_bool)
  ontrig = 0;

if (!inlet_bool && !offtrig) {
  offtrig = 1;
  outlet_1to0 = 1;
  outlet_change = 1;
}

if (inlet_bool)
  offtrig = 0;

Privacy

© 2024 Zrna Research