This:
Tripod, you are trying to record the audio from your TD9, while listening to (monitoring) playback from Sonar? " Yes, that's what i am doing (i think) Is that wrong? I will check out the input echo thing.
Is different than this:
I use programs like EZdrummer so the TD9 goes through the computer to pick up those sounds.
The first one says you want to record the sounds of the TD9 into the computer (maybe along with the midi data).
The second one says you don't want the TD9 sounds, just the midi data which will trigger EZ drummer.
In the first scenario, you can monitor with headphones at the TD9, capture the midi data at the same time, then use that midi data to trigger EZ. Time shift as needed.
In the second scenario there will be perceived delay from hitting the drums because you are monitoring the sound off EZ after the midi data has been captured and then after it triggers EZ. This is not a great place to monitor from unless you have very fast hardware and exceptional drivers. Alternatively as pointed out above, you can just record at a faster rate to lower your latency.
Here is what I use to do before I upgraded my computer. I monitored off the drum module as I am listening to the computer tracks. These are both routed into a headphone amp so I can hear both signals. Then I just record the midi data into the computer during the process. Later I come back and adjust the midi track to time align accurately with the previously recorded guitars and bass.
Currently I have low enough latency that I can monitor off the computer but generally, I track the drums early in the process with a guide bass or guitar or click. Then I time come back and make sure the drums are aligned to the click if there is a lag, and then I track the rest of the music.
There may be a better way, but I have not found it yet.