int32 pitch
int32 key
int32 scale
int32 note
int32 octave
int32 semi
objref scale
int scale = inlet_scale;
scale = scale - scale / 46 * 46;
scale = scale < 0 ? scale + 46 : scale;
scale = scale * 7;
int key = (inlet_key)*7 - 4;
key = key - (key / 12) * 12;
key = key < 0 ? key + 12 : key;
int32_t pitch = inlet_pitch + 64;
int32_t octave = pitch / 7;
int semitone = pitch - octave * 7;
outlet_octave = octave;
outlet_semi = semitone;
outlet_note = (attr_scale.note[semitone + scale] + octave * 12) - 112 + key;