None
frac32 n1
frac32 n2
frac32 n3
bool32.tgl singleOctave
spinner ccl
spinner channel
int32_t note[3];
int32_t bend[3];
int cnt;
int32_t bendl;
bool ntrig;
bool singleOct;
cnt = 2;
bendl = 0;
for (int i = 0; i < 3; i++) {
note[i] = 0;
bend[i] = 0;
}
outlet_n1 = note[0] + (bend[0] >> 7);
outlet_n2 = note[1] + (bend[1] >> 7);
outlet_n3 = note[2] + (bend[2] >> 7);
singleOct = param_singleOctave;
if ((status == MIDI_NOTE_ON + attr_channel - 1) && data2) {
cnt += 1;
cnt = cnt > 2 ? 0 : cnt;
note[cnt] = data1 - 64;
if (singleOct > 0) {
note[cnt] = note[cnt] - note[cnt] / 12 * 12 + (note[cnt] < 0 ? 12 : 0);
}
note[cnt] = note[cnt] << 21;
}
if (status == MIDI_PITCH_BEND + attr_channel - 1) {
bend[cnt] = (((int)((data2 << 7) + data1) - 0x2000) << 14) + bendl;
ntrig = 0;
} else if ((status == attr_channel - 1 + MIDI_CONTROL_CHANGE) &&
(data1 == attr_ccl)) {
bendl = data2 << 7;
}