read step

read from table. 'value' = value at index. 'trig' = puts out a pulse if 'value' > 0. 'vhold' = the current value,held until next 'trig'.
Author: Robert Schirmer
License: BSD
Github: rbrt/old/read step.axo

Inlets

int32.positive offset

int32.positive index

Outlets

frac32 value at index

frac32 hold current value until next trigger

bool32.pulse trigger if value > 0

Parameters

int32 offset

Attributes

objref table

Declaration
int prev;
int hold;
Control Rate
outlet_value =
    attr_table.array[__USAT((inlet_index + inlet_offset + param_offset),
                            attr_table.LENGTHPOW)]
    << attr_table.GAIN;

if ((inlet_index != prev) && (outlet_value > 0))
  outlet_trig = 1;
else
  outlet_trig = 0;
prev = inlet_index;

if (outlet_trig) {
  hold = outlet_value;
  outlet_vhold = outlet_value;
} else {
  outlet_vhold = hold;
}

Privacy

© 2024 Zrna Research