What Beagle says is right, so basically; "don't use MME drivers"
Try the following;
. Connect your Keyboard and drum machine via the Midi port.
. Since you want to use the advance Midi option, turn it ON (switch is on the side of unit).
. Setup record sample rate at 48.kHz (switch is on the side of unit)
. Since you're running Midi in ASIO, I recommend you also run Audio drivers in ASIO mode.
next; SONAR setup....
. Open Sonar (without opening a project) and go to > Audio Options and make sure the following is setup...
. 24.bit @ 48.kHz sample rate. This means all your projects will be recording in that format. Also, I don't think the Advance mode should be on if running in 44.1.kHz ~ see * note in regards to Sampling Frequency; Click Here
. Run ASIO mode for both Midi and Audio
. Lower Que Buffer to = 2
. Setup Latency at around 10.ms
. Check that your interface is listed/enabled i/o for Midi and Audio.
. Run Wave Profiler.
When done, close Sonar and reboot.