int32 key
int32 scale
int32 note
bool32 trg
bin32 b1
objref scalebank
int32.label val
int64_t ch;
int i;
int64_t tmp;
bool trg;
int prv;
int64_t cur;
int k;
if (!((inlet_key + inlet_scale) == prv)) {
cur = 0;
for (i = 0; i < 32; i++) {
int m = i - i / 12 * 12;
k = i + inlet_key;
k = k - k / 32 * 32;
k = k < 0 ? k + 32 : k;
trg = (!(attr_scalebank.note[m + inlet_scale * 12] == m));
cur += trg << k;
}
PExParameterChange(&parent->PExch[PARAM_INDEX_attr_legal_name_b1], cur,
0xFFFD);
}
outlet_trg = 0;
if (!(param_b1 == cur)) {
outlet_trg = 1;
tmp = param_b1 - cur;
if (tmp > 0) {
ch = 0;
for (i = 0; i < 32; i++) {
ch += ((tmp >> i) & 1) * i;
}
}
}
outlet_note = ch;
disp_val = tmp;
PExParameterChange(&parent->PExch[PARAM_INDEX_attr_legal_name_b1], cur, 0xFFFD);
prv = inlet_key + inlet_scale;