int32 note
int32 note
objref scale
int prv;
outlet_note = inlet_note;
int oct = inlet_note / 12;
oct -= inlet_note < 0 ? 1 : 0;
int note = inlet_note - oct * 12;
if (attr_scale.notes > 0) {
int A = 0;
int B = note;
// if(!(prv==note)){
while (A == 0) {
B = B - B / 12 * 12;
B += B < 0 ? 12 : 0;
A = ((attr_scale.array[B] <= attr_scale.NT) && (attr_scale.array[B] >= 1))
? 1
: 0;
B -= 1;
//}
}
outlet_note = B + oct * 12;
}
prv = note;