retrig

copies inlet 'in' to outlet 'out'. if 'trig' is high,puts out a fixed value of -666 ,THEN outputs and keeps the value at inlet 'in'.
Author: Robert Schirmer
License: BSD
Github: rbrt/patching/retrig.axo

Inlets

int32 input

bool32.rising trigger

Outlets

int32 output

Declaration
int ntrig;
int latch;
Control Rate
if ((inlet_trig > 0) && !ntrig) {
  latch = inlet_in;
  ntrig = 1;
  outlet_out = -666;
}

if (!(inlet_trig > 0)) {
  ntrig = 0;
  outlet_out = latch;
}

if ((!(inlet_trig > 0)) && !ntrig)
  outlet_out = inlet_in;

Privacy

© 2024 Zrna Research