bool32 trig
int32 X
int32 Y
bool32 gate
frac32 CV
int32 X
int32 Y
frac32.s.map V1
frac32.s.map V2
frac32.s.map V3
frac32.s.map V4
objref ref
int i;
int j;
int gate;
int32_t V[4];
int v;
int X = param_X + inlet_X;
X = X & 15;
int Y = param_Y + inlet_Y;
Y = Y & 15;
int degate = 0;
if ((inlet_trig > 0) && (!gate)) {
gate = 1;
degate = 1;
} else if (inlet_trig == 0) {
gate = 0;
}
V[0] = param_V1;
V[1] = param_V2;
V[2] = param_V3;
V[3] = param_V4;
outlet_gate = attr_ref.array[X][Y] > 0
? (attr_ref.array[X][Y] > 1
? (attr_ref.array[X][Y] > 2 ? inlet_trig - degate
: 1 - inlet_trig)
: 1)
: 0;
if (outlet_gate > 0) {
v = attr_ref.array[X][Y];
}
outlet_CV = V[v];