latch

Copies the input to the output at the rising edge of the trigger input. Keeps the output otherwise.
Author: Johannes Taelman
License: BSD
Github: logic/latch.axo

IO Variants: 2


Variant: 1

Inlets

frac32 input

bool32.rising trigger

Outlets

frac32 output

Declaration
int ntrig;
int latch;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  latch = inlet_i;
  ntrig = 1;
}
if (!(inlet_trig > 0))
  ntrig = 0;
outlet_o = latch;

Variant: 2

Inlets

int32 input

bool32.rising trigger

Outlets

int32 output

Declaration
int ntrig;
int latch;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  latch = inlet_i;
  ntrig = 1;
}
if (!(inlet_trig > 0))
  ntrig = 0;
outlet_o = latch;

Privacy

© 2024 Zrna Research