The thing to check with checking Sample Rate is to see if the Sample Rate is set within the user interface for the Audio Interface to the same Sample Rate that is set within the Sonar project.
IF one or the other is different than the other one, then you can very well have things play back either too sharp or too flat - such as one being 44.1 k and the other at 48 k.
Another thing to check is whether or not the loaded SOUND that the M-Audio Keystation 88 ES is triggering uses the Mod Wheel to control some aspect of the sound. I used to have a similar issue in projects that used a particular synth preset for a particular synth (Native Instruments Reaktor 5).
I don't recall ever figuring out why things were goofy, but it had something to do with the mod wheel, and if I changed the Sonar Preferences option to NOT zero out all controllers when playback stopped, the issue would stop presenting itself - the issue was that for some reason, the Reaktor 5 sound would load up and play, but for some reason would change pitch down exactly one whole step. If I closed the project and loaded it back, it would fix it to play the notes back at the right pitch. DROVE ME NUTS.
I happen to have and love that same Keystation 88 ES controller, and I don't find there to be much at all in the area of it having many things it actually controls (unlike my M-Audio AxiomPro 61, which has all kinds of faders and knobs and performance controlling functionality), so it seems quite unlikely for the Keystation 88 ES to actually be causing whatever issues you are having.
Perhaps you can explain more about what synth and preset you are controlling with the Keystation controller, as maybe it is something as simple to fix, like tweaking a Sonar preference or the preset.
Bob Bone