Check Preferences in Sonar to make sure you are still running with the intended Driver Mode, Sample Rate, and Recording Bit Depth.
Check the settings on your audio interface, then make sure Sonar matches the Sample Rate. Usually, ASIO is the likely best sounding driver mode, though not always the case. I would suggest starting with a Sample Rate of either 44.1 or 48, a Recording Mode of ASIO, and a Recording Bit Depth of 24.
In addition, if your audio interface is connected to your computer through USB, make sure you are in the appropriate USB version for its connection. If the interface is designed for USB 2, you may have weird problems if you have it plugged into a USB 3 port.
While you are in Preferences, you should also look at the reported Latency within Sonar.
And lastly, make sure if you are using plugin effects that you are not trying to track using plugins that are meant to be used in Mixing and Mastering. These can cause significant audio problems.
Bob Bone