int32 pitch
int32 scale
int32 key
frac32 note
objref scale
int key = inlet_key;
key = key - (key / 12) * 12;
key = key < 0 ? key + 12 : key;
int Scale = inlet_scale;
Scale = Scale - (Scale / 46) * 46;
Scale = Scale < 0 ? Scale + 46 : Scale;
int pitch = inlet_pitch + 4 - (key - 4);
int octave = pitch / 12 - (pitch < 0 ? 1 : 0);
int semitone = pitch - octave * 12;
outlet_note = (attr_scale.note[semitone + Scale * 12] + octave * 12 + (key - 4))
<< 21;