• SONAR
  • Timing Between Midi Track And VSTi TRack (p.2)
2016/11/11 03:43:52
Ruckman65
bvideo
I don't suppose you are using "Direct monitoring for latency-free recording (inputs 1 / 2)" for your SC, are you?


I use the audio out from the SC into the audio interface and there is absolutely no latency there.
2016/11/11 03:44:24
Ruckman65
azslow3
I must admit, I am also puzzled now...
Ruckman65
I can play through the Casio into AD and there is no latency. So, still unsure how to correct this!

Can you do the following?
* set MIDI -> SC and MIDI -> AD Inputs to "Omni", check there is no "MIDI loops" in the project (no VSTi has "MIDI Output on", etc) and set "Input Echo" to "On" on both
* when you play with Casio, SC and AD should sound simultaneously. Do you have the delay in this case?
Arm both tracks and record several notes. Are resulting clips aligned? When you "play" recorded performance, does it sounds different from what you could hear live?


I will try this soon and see what the results look like.
2016/11/11 04:22:55
Ruckman65
azslow3
I must admit, I am also puzzled now...
Ruckman65
I can play through the Casio into AD and there is no latency. So, still unsure how to correct this!

Can you do the following?
* set MIDI -> SC and MIDI -> AD Inputs to "Omni", check there is no "MIDI loops" in the project (no VSTi has "MIDI Output on", etc) and set "Input Echo" to "On" on both
* when you play with Casio, SC and AD should sound simultaneously. Do you have the delay in this case?
Arm both tracks and record several notes. Are resulting clips aligned? When you "play" recorded performance, does it sounds different from what you could hear live?


OK. I have tried that. When playing the Casio into the SC and AD, there is a delay of perhaps 5ms. When I record on both tracks, both clips are aligned. On playback, the delay stretches to something closer to 15ms.
2016/11/11 04:54:04
Ruckman65
I just measured the playback latency. When recording an SC track simultaneously with an AD track, when I hit the keyboard note, the two tracks sound pretty much at the same time. On playback, there is a difference between the two tracks of almost 100ms. When I nudge the AD track forward by 100ms, they play in time. I have adjusted the buffer size from 32 samples up to 1024 samples and it makes no difference at all to the latency during playback. The AD track still needs to be nudged forward by 100ms to be in time with the SC track.
2016/11/11 08:40:24
azslow3
Ruckman65
OK. I have tried that. When playing the Casio into the SC and AD, there is a delay of perhaps 5ms. When I record on both tracks, both clips are aligned. On playback, the delay stretches to something closer to 15ms.

MIDI is processed a bit different when played live vs recorded. Recorded playback is the subject of Sonar internal delay compensations for recorded material and for playback.
 
For a good reason (too long for this post), we should distinguish between delays with order of your Round Trip Time (Effective latency), so delays 2*20ms ~ 40ms, and bigger delays, like 100ms and more. The first kind is expected, the second is an indication that something is wrong.
 
Ruckman65
I just measured the playback latency. When recording an SC track simultaneously with an AD track, when I hit the keyboard note, the two tracks sound pretty much at the same time. On playback, there is a difference between the two tracks of almost 100ms.

If I understand both messages right, if you just hear the output of 2 MIDI tracks going to SC and AD, the delay is ~15ms. If you RECORD SC output (as audio), then when you play that recorded track with MIDI->AD track (directly/freeze/recorded), the delay is ~100ms. Right?
 
If so (and useful in general) is to check that Sonar has correct information about delays in your NI. Some interfaces/drivers report it correctly, some report it a bit wrong, some return complete nonsense. There are "loop back" tests to check that reported values as seen in Sonar (so, your 18ms) are real. I normally use the following method (turn off/disconnect completely any monitors/headphones attached to the interface):
* put some file on another player (phone) and connect one channel from it to the first interface input
* loop the first interface output to the second interface input
* create one mono track with input set to the first interface input and output set to the first interface output, enable echo
* create another stereo track with input set to both interface inputs, disable echo on this track
* arm second track and record external player, so one channel will record the signal directly and another will record the same signal looped throw the interface and Sonar.
* check time shift between channels (amplitude obviously does not matter). Since Sonar apply whatever compensation it currently think to BOTH channels (Sonar has no idea that once channel is physically looped), the difference is absolute and real.
* compare that number with reported in Sonar, if it is wrong by more then ~1ms, there is a setting in Sonar to compensate.
 
In addition to nudging, there is another method to "correct" timing: "Cakewalk Channel Tools" FX plug-in. It has "Delay" section. So you can put it on AD2 instrument track and set delay to 100ms. While working well for 1-2ms, with bigger values this method prevents low latency recording while listening current material. But if you first record everything with SC and then add VSTi(s), that can be a reasonable workaround.
 
2016/11/11 15:28:06
azslow3
I have tried similar framework with my hardware and here is what I get.
Sonar Plat (latest version), Kawai CN-43 as "external MIDI Synth", AD2, VS-20 as the interface (ASIO, buffer 96, effective latency 13ms).
Kawai get MIDI throw USB, its audio output is connected to VS-20 input. Kawai and VS-20 are connected throw separately powered USB Hub with 10m cable (usually connecting an interface throw USB hub is a bad idea, 10m long is a very bad idea... but I am lucky and that combination is working sufficient for my purpose).
 
* there is no significant delay playing live (but samples I use are so different that even with corrected timing the combination does not sound as a single drum set)
* I put a MIDI clip to AD2 and MIDI track with output to Kawai
* I can not notice any difference between playing clips and playing live with AD2 and Kawai enabled
* I have recorded Kawai into the third track
* I have rendered (with freeze then drag, not AUX...) AD2 into the forth track
 
Comparing the third track with the forth track (so, rendered AD2 with recorded Kawai) I get 5ms difference. AD2 result is early then Kawai (so should be nudged forward), I guess Sonar "think" that I have "played" along with AD2 and "corrected" the recording by the interface output latency (~5ms).
 
So, from my perspective, your 5ms - 15ms deference is ok. But 100ms and more is not.
2016/11/23 23:17:19
Ruckman65
Well, I have discovered the strangest thing. When I disable the wifi driver on my laptop, the latency almost completely disappears. This is good news on one front (no latency) but is disappointing on another (can't access the Internet when working in Sonar). As much as I think the NI Komplete Audio 6 is a great unit, this may be a deal breaker.
2016/11/23 23:18:01
Ruckman65
Thank you all for your advice and assistance. You are a great group of people!
 
2016/11/24 12:02:02
brundlefly
WiFi drivers are notorious for increasing Deferred Procedure Call (DPC) latency. This is a measure of the time it takes your CPU to respond to a request from an application or driver. With most audio drivers, audio latency is unaffected; high DPC latency just causes buffers to be dropped so you get clicks and pops. Possibly the NI driver is detecting this, and increasing latency automatically, but I've never heard of this before.
 
In any case, the bottom line is that the WiFi driver is going to cause trouble with any audio interface whether it manifests as higher latency or clicks/pops/dropouts. You're just going to have to bite the bullet and disable it when working in SONAR (or any other DAW app). If you really need Internet access at the same time, you'll need to use wired connection.
 
Free DPC Latency checkers:
 
http://www.resplendence.com/latencymon
 
http://www.thesycon.de/eng/latency_check.shtml
 
 
12
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account