bool32.risingfalling mute1
bool32.risingfalling muteOnOnly1
bool32.risingfalling mute2
bool32.risingfalling muteOnOnly2
bool32.risingfalling mute3
bool32.risingfalling muteOnOnly3
bool32.risingfalling mute4
bool32.risingfalling muteOnOnly4
int32.positive note1
int32.positive velo1
int32.positive note2
int32.positive velo2
int32.positive note3
int32.positive velo3
int32.positive note4
int32.positive velo4
int32.positive note
int32.positive velo
uint8_t nin[4];
uint8_t vin[4];
uint8_t pren[4];
uint8_t prev[4];
uint8_t nstack[8] = {0};
uint8_t vstack[8] = {0};
uint8_t slength;
uint8_t swrite;
uint8_t sread;
uint8_t noteout;
uint8_t veloout;
if (!inlet_mute1) {
nin[0] = inlet_note1;
vin[0] = inlet_velo1;
} else if ((!inlet_velo1) && inlet_muteOnOnly1) {
nin[0] = inlet_note1;
vin[0] = 0;
}
if (!inlet_mute2) {
nin[1] = inlet_note2;
vin[1] = inlet_velo2;
} else if ((!inlet_velo1) && inlet_muteOnOnly2) {
nin[1] = inlet_note2;
vin[1] = 0;
}
if (!inlet_mute3) {
nin[2] = inlet_note3;
vin[2] = inlet_velo3;
} else if ((!inlet_velo3) && inlet_muteOnOnly3) {
nin[2] = inlet_note3;
vin[2] = 0;
}
if (!inlet_mute4) {
nin[3] = inlet_note4;
vin[3] = inlet_velo4;
} else if ((!inlet_velo4) && inlet_muteOnOnly4) {
nin[3] = inlet_note4;
vin[3] = 0;
}
int i;
for (i = 0; i < 4; i++) {
if ((nin[i] != pren[i]) || (vin[i] != prev[i])) {
nstack[swrite] = nin[i];
vstack[swrite] = vin[i];
pren[i] = nin[i];
prev[i] = vin[i];
slength++;
swrite++;
swrite = swrite % 8;
}
}
if (slength) {
noteout = nstack[sread];
veloout = vstack[sread];
sread++;
sread = sread % 8;
slength--;
}
outlet_note = noteout;
outlet_velo = veloout;