==remap

remap integer input to other integer output, hit boolean is true when input is "in range". output stays on last integer if not in range.
Author: Simon Iten
License: BSD
Github: lokki/math/==remap.axo

Inlets

int32.bipolar in

Outlets

int32.bipolar out

bool32 hit

Attributes

spinner in0

spinner out0

spinner in1

spinner out1

spinner in2

spinner out2

spinner in3

spinner out3

Declaration
uint8_t outValue;
Init
outValue = 0;
Control Rate
switch (inlet_in) {

case attr_in0:
  outlet_hit = true;
  outValue = attr_out0;
  break;
case attr_in1:
  outlet_hit = true;
  outValue = attr_out1;
  break;
case attr_in2:
  outlet_hit = true;
  outValue = attr_out2;
  break;
case attr_in3:
  outlet_hit = true;
  outValue = attr_out3;
  break;
default:
  outlet_hit = false;
}

outlet_out = outValue;

Privacy

© 2024 Zrna Research