I began to have constant pitch bend messages being sent by one of my midi controllers, and it turns out it is due to cheap components in the hardware of the controller. Apparently several different brands of keyboards and controllers have the potentiometers that are connected to the pitch bend wheels end up wearing out, and then they start generating random crap that gets picked up by Sonar.
For MY situation, I went into edit mode on the controller and I turned off Pitch Bend altogether. It had been making things play back out of tune anytime I played something on that controller.
I used Midi OX (Edited to correct) to monitor the data, but you could also just arm a midi track and hit record and let it run for a minute, and it will capture any of that random data. Then you can look at the Event List for that track to see what is being spewed out.
Bob Bone