Beepster
Do you mean the Wavetable synth? That's garbage. What you really want is simply for Sonar to output the sound from the Master bus directly to your sound device. It would be essentially the same thing as having you browser send the sound from a youtube clip to the sound device so you can hear it. The MIDI input really has nothing to do with this. The MIDI track or input gets translated by Sonar into an audio signal and that audio signal gets sent out to the device. That last part seems to be where the problem is. You just need Sonar to point to your audio device. If you mean you want Sonar to send the MIDI to your Casio keyboard to trigger the sounds it contains well that is a more complicated task and you should work on the basics first. Cheers.
I've been using MIDI software for close to 30 years, starting with the infinitely easier to use Mark of the Unicorn Composer program, c. 1985. So I had a fairly easy time setting up Sonar to MIDI-interface with my Casio. The Casio sound mixing I refer to is the Casio "mixer," which allows me to assign specific tones to each of the 16 MIDI channels. This feature is very quirky (my tone assignments pop in and out, for some reason) but usually I can get it to work. But the mixing/layering in the Casio itself is kind of lousy. As for audio mixing on the Sonar, I've been doing that for months with fabulous results. But I want to be able to control the tempo of my tracks in some instances, so I tried the MIDI feature and had nice results. However, once I used Sonar's MIDI, suddenly my ASIO 4 All's audio output isn't being received by Sonar. I've concluded there's a connection. I realize MIDI and Line In audio are two different things, but if (as I suspect) Sonar is still connecting to a MIDI function in Windows, that would explain the sudden refusal of Sonar to accept audio input from ASIO 4 All--namely, it's still interacting with Windows 7's MIDI device.