Sonar Workflow - Multisesson Tracking Loopback Latency

From Sonar

(Difference between revisions)
Line 1: Line 1:
'''Introduction -- Sample Accurate Recording With loop-back Latency'''
'''Introduction -- Sample Accurate Recording With loop-back Latency'''
-
Imagine you have a killer drummer playing along with a beat (an audio loop for example).  You record their performance, and it sounds very tight while recording.  Now when we play both tracks back, it sounds OK, but there is this feeling that the groove is gone, or the beat is no longer tight and "in the pocket" like it was when recording.  This is a common problem with DAW hardware and software on computers and is caused by incorrectly compensating for loop-back latency.  
+
Imagine you have a killer drummer playing along with a beat (an audio loop for example).  You record their performance, and it sounds very tight while recording -- very tight timing.  Now when we play both tracks back, it sounds OK, but there is this feeling that the groove is gone, or the beat no longer has tight timing nor feels "in the pocket" as it was when recording.  This is a common problem with DAW hardware and software on computers and is caused by incorrectly compensating for loop-back latency.  
Loop-back latency is the time it takes for sound to play back out of a computer into the analog world and loop-back into the computer to be recorded again.  This is a real and finite latency.  If everything is perfect in the system, this loop-back latency is compensated for and the recorded track lines up perfectly with the playback track, giving us a sample accurate recording.  That is to say that the loop-back latency still exists but the various tracks in the DAW software line up accurate to the sample.  When the loop-back latency isn't perfectly compensated for we end up with a loop-back offset.
Loop-back latency is the time it takes for sound to play back out of a computer into the analog world and loop-back into the computer to be recorded again.  This is a real and finite latency.  If everything is perfect in the system, this loop-back latency is compensated for and the recorded track lines up perfectly with the playback track, giving us a sample accurate recording.  That is to say that the loop-back latency still exists but the various tracks in the DAW software line up accurate to the sample.  When the loop-back latency isn't perfectly compensated for we end up with a loop-back offset.
Line 65: Line 65:
<li>Zoom in on the two tracks so that you can see the loopback offset.</li>
<li>Zoom in on the two tracks so that you can see the loopback offset.</li>
-
[[:Media:LB-bothzoom.png|Click For Full Size]]
+
[[:Media:LB-bothzoom.png|Click This Text For Full Size Picture]]
[[Image:LB-bothzoom.png|600px]]
[[Image:LB-bothzoom.png|600px]]
Line 71: Line 71:
<li>Zoom in on the FIRST PULSE of the ''Original Track'' so that you can locate a point that is obviously visiable on the ''Loop-back Track''.</li>
<li>Zoom in on the FIRST PULSE of the ''Original Track'' so that you can locate a point that is obviously visiable on the ''Loop-back Track''.</li>
-
[[:Media:LB-origzoom.png|Click For Full Size]]
+
[[:Media:LB-origzoom.png|Click This Text For Full Size Picture]]
[[Image:LB-origzoom.png|600px]]
[[Image:LB-origzoom.png|600px]]
-
<li>Place Now Time Marker over that obviously repeatable point on the ''Original Track'' and zoom in until you can see the exact sample number of your Now Time Marker location in the Time Ruler. This is the ''Original Track Location''.</li>
+
<li>Place Now Time Marker over that obviously repeatable point on the ''Original Track'' and zoom in until you can see the exact sample number of your Now Time Marker location in the Time Ruler. This is the ''Original Track Sample Location''.</li>
-
[[:Media:LB-origzoomfull.png|Click For Full Size]]
+
[[:Media:LB-origzoomfull.png|Click For This Text Full Size Picture]]
[[Image:LB-origzoomfull.png|600px]]
[[Image:LB-origzoomfull.png|600px]]
-
<li>Place Now Time Marker over THE SAME obviously repeatable point on the FIRST PULSE of the ''Loop-back Track''. Zoom in until you can see the exact sample number of your Now Time Marker location in the Time Ruler. This is the ''Loop-back Track Location''.</li>
+
<li>Place Now Time Marker over THE SAME obviously repeatable point on the FIRST PULSE of the ''Loop-back Track''. Zoom in until you can see the exact sample number of your Now Time Marker location in the Time Ruler. This is the ''Loop-back Track Sample Location''.</li>
-
<li>Finally calculate your offset: simply subtrack the ''Loop-back Track Location'' from the ''Original Track Location''. '''This is your Latency Offset!!'''</li>
+
<li>Finally calculate your offset: simply subtrack the ''Loop-back Track Sample Location'' from the ''Original Track Sample Location''. '''This is your Latency Offset in number of samples!!'''</li>
 +
 
 +
<li>Now use your Correcting loop-back Offset method below to correct the recorded track to make sure the tracks line up with your measured value.</li>
</ol>
</ol>
-
Notes:
+
NOTE:
-
If you ever change DMA buffer sizes, or “Samples per Buffer” in your soundcard driver, you'll have to do this test for each setting you use. This setting can change the loop-back offset. Also, if you change driver version or driver type (ASIO, DMA, MME) for your audio interface, you'll have to retest the loop-back offset.
+
If you ever change DMA buffer sizes, or “Samples per Buffer” in your audio interface driver, you'll have to do this test for each setting you use. This setting can change the loop-back offset. Also, if you change driver version or driver type (ASIO, DMA, MME) for your audio interface, you'll have to retest the loop-back offset.
 +
 
 +
The author has only done this one on 1 audio interface (MOTU 896) and has found that the "Samples per Buffer" is the only setting that affects the loopback offset (must rerun Wave Profiler or offset will be very wrong). Other interfaces may have other settings that affect the loopback offset and may use different terminology than "Samples per Buffer". For the MOTU, the "Samples per Buffer" always translates to "DMA Buffer Sizes" in Sonar under "Options -> Audio -> Driver Profiles" after the Wave Profiler is run.
-
Make sure to use your Correcting loop-back Offset method below to correct the recorded track to make sure the tracks line up with your measured value.
 
Line 113: Line 116:
-
'''Alternate Correcting Methods for Sonar 3 and Older'''
+
'''Alternate Correcting Methods''' (only needed for Sonar 3)
'''I.'''
'''I.'''
Line 120: Line 123:
-
'''Calculating''' you only need to do once (for each DMA buffer size you use) and remember the results: convert the # of samples to a time. Use the worksheet above or this formula:
+
CALCULATING: you only need to do once (for each DMA buffer size you use) and remember the results: convert the # of samples to a time:
Divide the “latency offset number of samples” by “Sample Rate” (in Samples per Second) that you are running in. Example of 1128 samples & 44.1 kHz sampling rate:
Divide the “latency offset number of samples” by “Sample Rate” (in Samples per Second) that you are running in. Example of 1128 samples & 44.1 kHz sampling rate:
Line 126: Line 129:
1128/44100 = .02557  seconds = 2.6 milliseconds loop-back offset
1128/44100 = .02557  seconds = 2.6 milliseconds loop-back offset
-
 
+
APPLYING: now each time you record a track alternate-click on the recorded track and select “Clip-Properties”. Subtract the loop-back offset from the “Start” time in that panel. Enter the resulting value in the “Start” time and click “OK”. The track will now be moved over.
-
''Applying'' now each time you record a track alternate-click on the recorded track and select “Clip-Properties”. Subtract the loop-back offset from the “Start” time in that panel. Enter the resulting value in the “Start” time and click “OK”. The track will now be moved over.
+
Line 133: Line 135:
'''II.'''
'''II.'''
-
Use a software plug in for each recorded track to compensate. Downside is a reduction is CPU processing power. Example:
+
Use a software plug in for each track as needed to compensate. Downside is a reduction is CPU processing power. Example:
[http://www.analogx.com/contents/download/audio/sslide.htm Sample Slide]
[http://www.analogx.com/contents/download/audio/sslide.htm Sample Slide]
-
Thanks for djkepi for making many of us first aware of this problem by providing the article at http://www.djkepi.com/latency/ and making the included xcel worksheet.
+
 
 +
 
 +
 
 +
Thanks for djkepi for making many of us first aware of this problem by providing the article at http://www.djkepi.com/latency/. Part of the opening introduction is a reworded version of his introduction.
 +
 
 +
 
 +
[[User:Xavier|Xavier]] 20:57, 23 November 2006 (EST)

Revision as of 01:57, 24 November 2006

Introduction -- Sample Accurate Recording With loop-back Latency

Imagine you have a killer drummer playing along with a beat (an audio loop for example). You record their performance, and it sounds very tight while recording -- very tight timing. Now when we play both tracks back, it sounds OK, but there is this feeling that the groove is gone, or the beat no longer has tight timing nor feels "in the pocket" as it was when recording. This is a common problem with DAW hardware and software on computers and is caused by incorrectly compensating for loop-back latency.

Loop-back latency is the time it takes for sound to play back out of a computer into the analog world and loop-back into the computer to be recorded again. This is a real and finite latency. If everything is perfect in the system, this loop-back latency is compensated for and the recorded track lines up perfectly with the playback track, giving us a sample accurate recording. That is to say that the loop-back latency still exists but the various tracks in the DAW software line up accurate to the sample. When the loop-back latency isn't perfectly compensated for we end up with a loop-back offset.

This problem is also often referred to as loop back delay, recording latency, recording offset, and recording timing delay.


List of Terms

  • Multisession Tracking: recording a new instrument while playing along with a previously recorded instruments or sounds in a multitrack environment.
  • Loop-back Latency: time delay caused by a the process of digital to analog and analog to digital conversions (DAC & ADC) and any functions of the ADC/DAC related hardware and their software drivers that cause time delay.
  • Loop-back Offset: when loop-back latency is not fully compensated for and therefore results in offsets between tracks when multisession tracking.
  • Sample Accurate Recording: when loop-back latency is fully compensated for, resulting in no loop-back offsets. The tracks line up perfectly with each other.


Concerns

Loop-back offsets on the order of a few milliseconds are nothing to be concerned about for standard multisession tracking since we can't tell when different instruments are off by that amount. So sample accurate recording isn't an absolute requirement. Much more than a few milliseconds and songs just don't sound tight. A bit more than that and something is obviously wrong. [Since this is all somewhat subjective no numbers were used.]


However, there are instances where sample accurate recording may be desired. Routing tracks out of the digital domain for external processing of some sort and then recording them back into the DAW software again could have adverse affects. Some examples of this are re-amping, or utilizing external effects processors, a reverb chamber, or a reverb plate.

Problem scenarios:

  1. Several DAC to ADC conversions (or other delays of some sort) add enough overall loop-back latency that the final track is delayed from the rest of the tracks enough to be heard as a timing issue in relation to the other instruments.
  2. The looped-back track is mixed in with the original track. Depending on the contents of the loop-back track, this mixing could add undesired phase distortion.


This is an issue that can happen with any DAW software. This is because it is generally caused by the drivers for the sound interface (soundcard) not reporting the true loop-back latency so the DAW software can compensate properly. There a number of reasons that this happens that we won't worry about here. The point is that you need to measure your DAW's actual compensated loop-back latency and correct for it if needed.


Measuring Loopback Offset In Sonar

  1. Start Sonar project with a few audio tracks.
  2. Run “Options -> Audio -> General -> Wave Profiler” if needed.
  3. Set Time Ruler Format to “Samples”
  4. Turn off Snap to Grid mode.
  5. Import or record a short section of a percussive sound like a kick drum. Call this Original Track. What is needed is something that shows up as tall pulses in the track view. This way you have something easy to identify when comparing the loopback track to the recorded track.
  6. Route Original Track to play back through audio interface.
  7. Use a mixer or cable audio interface so that the output of Original Track loops back to an input track.
  8. Enable for Recording an empty track in Sonar to record the input track from previous step.
  9. Record. You now have a Loop-back Track.
  10. Zoom in on the two tracks so that you can see the loopback offset.
  11. Click This Text For Full Size Picture

  12. Zoom in on the FIRST PULSE of the Original Track so that you can locate a point that is obviously visiable on the Loop-back Track.
  13. Click This Text For Full Size Picture

  14. Place Now Time Marker over that obviously repeatable point on the Original Track and zoom in until you can see the exact sample number of your Now Time Marker location in the Time Ruler. This is the Original Track Sample Location.
  15. Click For This Text Full Size Picture

  16. Place Now Time Marker over THE SAME obviously repeatable point on the FIRST PULSE of the Loop-back Track. Zoom in until you can see the exact sample number of your Now Time Marker location in the Time Ruler. This is the Loop-back Track Sample Location.
  17. Finally calculate your offset: simply subtrack the Loop-back Track Sample Location from the Original Track Sample Location. This is your Latency Offset in number of samples!!
  18. Now use your Correcting loop-back Offset method below to correct the recorded track to make sure the tracks line up with your measured value.


NOTE:

If you ever change DMA buffer sizes, or “Samples per Buffer” in your audio interface driver, you'll have to do this test for each setting you use. This setting can change the loop-back offset. Also, if you change driver version or driver type (ASIO, DMA, MME) for your audio interface, you'll have to retest the loop-back offset.

The author has only done this one on 1 audio interface (MOTU 896) and has found that the "Samples per Buffer" is the only setting that affects the loopback offset (must rerun Wave Profiler or offset will be very wrong). Other interfaces may have other settings that affect the loopback offset and may use different terminology than "Samples per Buffer". For the MOTU, the "Samples per Buffer" always translates to "DMA Buffer Sizes" in Sonar under "Options -> Audio -> Driver Profiles" after the Wave Profiler is run.



Correcting loop-back Offset

This is how you use the measured latency offset number of samples calculated above to eliminate loop-back offset (See your Sonar help for more information):

  • Sonar 6: Enter the latency offset number of samples in the "Record latency adjustment" field using samples. Should be automatic from here on.

  • Sonar 4 & 5: Enter latency offset number of samples in the Nudge configuration, and manually nudge tracks every time you record. Nudge configuration is under "Options -> Global -> Nudge".

  • Sonar 3 and Older: Enable “Snap to Grid” and configure it for “Absolute Time” in “Samples” and enter the latency offset number of samples. Select “Mode” “Move By”. Now when you record new tracks, zoom in on the beginning of them, select them and manually move them over one “Snap”.


Alternate Correcting Methods (only needed for Sonar 3)

I.

If you commonly use the “Snap to Grid” for other things and don't want to reconfigure it each time you record here is another way, but it is more work.


CALCULATING: you only need to do once (for each DMA buffer size you use) and remember the results: convert the # of samples to a time:

Divide the “latency offset number of samples” by “Sample Rate” (in Samples per Second) that you are running in. Example of 1128 samples & 44.1 kHz sampling rate:

1128/44100 = .02557 seconds = 2.6 milliseconds loop-back offset

APPLYING: now each time you record a track alternate-click on the recorded track and select “Clip-Properties”. Subtract the loop-back offset from the “Start” time in that panel. Enter the resulting value in the “Start” time and click “OK”. The track will now be moved over.


II.

Use a software plug in for each track as needed to compensate. Downside is a reduction is CPU processing power. Example:

Sample Slide



Thanks for djkepi for making many of us first aware of this problem by providing the article at http://www.djkepi.com/latency/. Part of the opening introduction is a reworded version of his introduction.


Xavier 20:57, 23 November 2006 (EST)

Personal tools