Hi Kreative,
i think your problem is midi related, to be sure, do this:
in sonar or any other daw, draw some midi notes in PRV. but don't use your keyboard at all, you can even turn it off.
try sustain notes and lots of variations, and if with this manner every thing is fine, then your problem is a midi related one, maybe an unwanted CC changes...