Help with code for Midi legato playing and pitchbend

I don't think I understand what you mean.

If any note other than 62 is playing, PB = 0, if note 62 is playing, and all other notes are off PB = -2949. Is that a correct interpretation of your problem?