triggerindex 4

trigger an index according to a connected boolean source, index can be momentary or latching
Author: Simon Iten
License: BSD
Github: lokki/math/triggerindex 4.axo

Inlets

bool32 b1

bool32 b2

bool32 b3

bool32 b4

Outlets

int32.positive output

int32.positive enc

Parameters

bool32.tgl latch index

Attributes

spinner c1

spinner c2

spinner c3

spinner c4

Displays

int32.label enc

Declaration
int index;
int combi;
Init
index = 0;
Control Rate
combi = inlet_b1 + (inlet_b2 << 1) + (inlet_b3 << 2) + (inlet_b4 << 3);

if (combi == 1)
  index = 1;
else if (combi == 2)
  index = 2;
else if (combi == 4)
  index = 3;
else if (combi == 8)
  index = 4;
else if (combi == attr_c1)
  index = 5;
else if (combi == attr_c2)
  index = 6;
else if (combi == attr_c3)
  index = 7;
else if (combi == attr_c4)
  index = 8;
else if (!param_indexlatch)
  index = 0;

outlet_out = index;
outlet_enc = combi;
disp_enc = combi;

Privacy

© 2024 Zrna Research