step read H 4

reads a block of 4 elements from a table ,starting at 'step'. 'trig' = puts out a pulse if the first element of the block is greater than 0. 'h0' - 'h3' = the 4 values at index 'step' + index of the output, IF 'trig' is 'true'.
Author: Robert Schirmer
License: BSD
Github: rbrt/seq/step read H 4.axo

Inlets

int32.positive offset

int32.positive index

Outlets

frac32 h0

frac32 h1

frac32 h2

frac32 h3

bool32.pulse trigger if value > 0

Parameters

int32 offset

Attributes

objref table

Declaration
int prev;
int offset;
int h0;
int h1;
int h2;
int h3;
Control Rate
offset = (inlet_offset + param_offset);

if ((inlet_step != prev) &&
    ((attr_table.array[__USAT((inlet_step + offset), attr_table.LENGTHPOW)]
      << attr_table.GAIN) > 0)) {
  outlet_trig = 1;
  h0 = attr_table.array[__USAT((inlet_step + offset), attr_table.LENGTHPOW)]
       << attr_table.GAIN;
  outlet_h0 = h0;
  h1 = attr_table.array[__USAT((inlet_step + offset + 1), attr_table.LENGTHPOW)]
       << attr_table.GAIN;
  outlet_h1 = h1;
  h2 = attr_table.array[__USAT((inlet_step + offset + 2), attr_table.LENGTHPOW)]
       << attr_table.GAIN;
  outlet_h2 = h2;
  h3 = attr_table.array[__USAT((inlet_step + offset + 3), attr_table.LENGTHPOW)]
       << attr_table.GAIN;
  outlet_h3 = h3;
} else {
  outlet_trig = 0;
  outlet_h0 = h0;
  outlet_h1 = h1;
  outlet_h2 = h2;
  outlet_h3 = h3;
}
prev = inlet_step;

Privacy

© 2024 Zrna Research