int32 pitch
int32 scale
int32 key
frac32 note
int32 key
objref scale
int key = inlet_key - 4;
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 octave = inlet_pitch / 12 - (inlet_pitch < 0 ? 1 : 0);
int semitone = inlet_pitch - octave * 12;
outlet_note = (attr_scale.note[semitone + Scale * 12] + octave * 12 + key)
<< 21;
outlet_key = key;