frac32.positive v0
frac32.positive v1
frac32.positive v2
frac32.positive v3
frac32.positive v4
frac32.positive v5
frac32.positive v6
frac32.positive v7
bool32.rising redraw
int32 row
bool32.risingfalling mute
None
objref LEDmaster
spinner row
bool trig;
bool mtrig;
int8_t fb;
int16_t nb;
uint8_t prerow;
uint8_t count;
int8_t in[8];
int8_t prev[8];
int8_t v;
bool doit;
bool update;
uint8_t row;
uint16_t offset;
#define BARS_ONE_L 0x03
#define BARS_ONE_R 0x04
#define BARS_TWO 0x05
#define BARS_NONE 0x06
if (!inlet_mute && !mtrig) {
mtrig = 1;
update = 1;
count = 0;
}
if (inlet_mute)
mtrig = 0;
if (!inlet_mute) {
in[0] = inlet_v0 >> 20;
in[1] = inlet_v1 >> 20;
in[2] = inlet_v2 >> 20;
in[3] = inlet_v3 >> 20;
in[4] = inlet_v4 >> 20;
in[5] = inlet_v5 >> 20;
in[6] = inlet_v6 >> 20;
in[7] = inlet_v7 >> 20;
row = (inlet_row + attr_row) % 4;
if (inlet_redraw && !trig) {
trig = 1;
update = 1;
count = 0;
}
if (!inlet_redraw)
trig = 0;
if (row != prerow) {
prerow = row;
update = 1;
count = 0;
}
v = in[count];
offset = attr_LEDmaster.array[count + 308] + (row * 77);
if ((v != prev[count]) || update) {
prev[count] = v;
if (v <= 0)
v = 0;
memset(attr_LEDmaster.array + offset, BARS_NONE, 8);
nb = ((v + 1) << 4) >> 7;
fb = nb >> 1;
memset(attr_LEDmaster.array + offset, BARS_TWO, fb);
if (nb % 2)
attr_LEDmaster.array[fb + offset] = BARS_ONE_L;
doit = 1;
}
if ((doit && !attr_LEDmaster.ROW) && !attr_LEDmaster.LOCKED) {
attr_LEDmaster.ROW = row + 1;
doit = 0;
}
count++;
if (count == 8)
update = 0;
count = count % 8;
}