There is no hidden handling of MIDI messages behind the scene: what your patch does is what you get. Each incoming pitch message should come with channel information and it's up to you to handle it appropriately. Can you verify you are receiving the expected channel number with each pitch message? This part of yhe code is definitely undertested but I looked at it just now and I think it should work.