bool32.rising stop
frac32.positive envstate
int32.positive note
int32.positive velo
bool32 gate
bool32.pulse retrig
objref polymaster
uint8_t pren;
uint8_t prev;
uint8_t velon;
bool gate;
uint8_t index;
bool stop;
bool trigon;
bool trigoff;
uint8_t note;
uint8_t velo;
index = parent->polyIndex;
pren = 0;
prev = 0;
outlet_retrig = 0;
trigon = 0;
trigoff = 0;
note = attr_polymaster.Snote[index] - 1;
velo = attr_polymaster.Svelo[index];
if ((note != pren) || (velo != prev) || (stop && velo)) {
stop = 0;
pren = note;
prev = velo;
if (prev) {
trigon = 1;
velon = prev;
if (inlet_envstate)
outlet_retrig = 1;
} else
trigoff = 1;
}
if (trigon && !gate)
gate = 1;
if (trigoff && gate)
gate = 0;
if (inlet_stop && !stop) {
gate = 0;
stop = 1;
attr_polymaster.Svelo[index] = 0;
attr_polymaster.Rhold[index] = 0;
}
if (inlet_envstate)
attr_polymaster.Rrelease[index] = pren + 1;
else
attr_polymaster.Rrelease[index] = 0;
outlet_gate = gate;
outlet_note = pren;
outlet_velo = velon;