frac32 v
int32 select
bool32.rising trig
bool32.rising add
bool32 r
bool32.pulse o1
bool32.pulse o2
bool32.pulse o3
bool32.pulse o4
int32 maxcount
int32 count
int32.hradio channel
int32.hradio selectbar
int32 preset
int32 barlength
int32 bars
objref table
bool32 01
bool32 02
bool32 03
bool32 04
bool32 05
bool32 06
bool32 07
bool32 08
bool32 09
bool32 10
bool32 11
bool32 12
bool32 13
bool32 14
bool32 15
bool32 16
int32.bar16 position
int ntrig;
int32_t pcount;
int strig;
int rtrig;
int count;
int32_t maxcount;
ntrig = 0;
count = 0;
strig = 0;
rtrig = 0;
maxcount = param_barlength * param_bars;
if ((inlet_trig > 0) && !strig) {
count += 1;
if (count >= maxcount) {
count = 0;
}
strig = 1;
} else if (!(inlet_trig > 0))
strig = 0;
if ((inlet_r > 0) && !rtrig) {
count = 0;
rtrig = 1;
} else if (!(inlet_r > 0))
rtrig = 0;
int32_t addbar = (count >> 4) << 4;
int TRIG = count != pcount ? 1 : 0;
int32_t bor = param_selectbar * 16;
int32_t select = inlet_select + param_channel * 64 + param_preset * 256 + bor;
if ((inlet_add > 0) && !ntrig) {
ntrig = 1;
if (select < attr_table.LENGTH)
attr_table.array[select] = __SSAT(inlet_v, 28) >> attr_table.GAIN;
}
if (!(inlet_add > 0))
ntrig = 0;
int32_t readA = count + param_preset * 256;
outlet_o1 = (attr_table.array[__USAT(readA, attr_table.LENGTHPOW)]
<< attr_table.GAIN) &&
TRIG;
outlet_o2 = (attr_table.array[__USAT(readA + 64, attr_table.LENGTHPOW)]
<< attr_table.GAIN) &&
TRIG;
outlet_o3 = (attr_table.array[__USAT(readA + 128, attr_table.LENGTHPOW)]
<< attr_table.GAIN) &&
TRIG;
outlet_o4 = (attr_table.array[__USAT(readA + 192, attr_table.LENGTHPOW)]
<< attr_table.GAIN) &&
TRIG;
disp_position = count - addbar;
int32_t readB = param_channel * 64 + param_preset * 256 + bor + addbar;
disp_01 = attr_table.array[__USAT(readB, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_02 = attr_table.array[__USAT(readB + 1, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_03 = attr_table.array[__USAT(readB + 2, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_04 = attr_table.array[__USAT(readB + 3, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_05 = attr_table.array[__USAT(readB + 4, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_06 = attr_table.array[__USAT(readB + 5, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_07 = attr_table.array[__USAT(readB + 6, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_08 = attr_table.array[__USAT(readB + 7, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_09 = attr_table.array[__USAT(readB + 8, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_10 = attr_table.array[__USAT(readB + 9, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_11 = attr_table.array[__USAT(readB + 10, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_12 = attr_table.array[__USAT(readB + 11, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_13 = attr_table.array[__USAT(readB + 12, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_14 = attr_table.array[__USAT(readB + 13, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_15 = attr_table.array[__USAT(readB + 14, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
disp_16 = attr_table.array[__USAT(readB + 15, attr_table.LENGTHPOW)]
<< attr_table.GAIN;
pcount = count;
outlet_count = count;