change

Generates a trigger pulse when current input value is different from previous value.
Author: Johannes Taelman
License: BSD
Github: logic/change.axo

IO Variants: 2


Variant: 1

Inlets

frac32 in

Outlets

bool32 trigger pulse

Declaration
int ptrig;
int32_t pval;
Init
ptrig = 0;
pval = 0;
Control Rate
if ((pval != inlet_in) & (!ptrig)) {
  outlet_trig = 1;
  pval = inlet_in;
  ptrig = 1;
} else {
  ptrig = 0;
  outlet_trig = 0;
}

Variant: 2

Inlets

int32 in

Outlets

bool32 trigger pulse

Declaration
int ptrig;
int32_t pval;
Init
ptrig = 0;
pval = 0;
Control Rate
if ((pval != inlet_in) & (!ptrig)) {
  outlet_trig = 1;
  pval = inlet_in;
  ptrig = 1;
} else {
  ptrig = 0;
  outlet_trig = 0;
}

Privacy

© 2024 Zrna Research