Jump to content

Solving Track Alignment and Latency


Mojave

Recommended Posts

I spoke with a client today who mentioned that he set his sample rates in the negative to correct the track alignment which is frequently mistaken as latency. Does anyone know what this is exactly and more over, I would like to figure out how to set the sample rate so I can get my track alignment correct. I will post his article when it arrives but for now, if the experts who wold know might chime in, this is a very importation issue.

 

Thanks

Link to comment
Share on other sites

Here is Jon's Article:

 

I have addressed this question so many times in the past that I am just going to cut from what I have previously written and paste together the following (modified for you). If it doesn’t address your issue let me know.

 

First of all, I am now presuming that your goal is to add new tracks to Logic Pro (overdub) and have them fall into PERFECT alignment automatically—without nudging, without any effort at all. No problem with Logic Pro 7 or Logic Pro 8. I know the way I have written the steps may sound offensively simple, but every step is critical.

 

DETERMINE MISALIGNMENT

1. Open Logic Preferences and make sure that Record Delay is set to zero samples.

2. Get a log book or graph paper to start log data-- REALLY

3. Open a new Project and label it Misalignment Test

4. Record an audio click or percussion track, i.e. something with some good transients. call it Track 1. (by the way a pasted loop from GarageBand will not work perfectly—that is another discussion.).

5. I presume that with Rosetta 800 and Logic Pro – Logic Pro input 1 to 8 corresponds to 1 to 8 AD on the Rosetta and Logic Pro output 1 to 8 corresponds to 1 to 8 DA on the Rosetta-- if not modify accordingly. Track 1 is output to 1 Logic, to Rosetta DA 1. Rosetta DA 1 is patched directly over to Rosetta AD 2. Depending on your analog setup this should be a breeze with a patch cable.

6. Create a new track and name it Track 2. Select input 2 as its input.

7. Make sure that you are rewinded to zero and hit record.

 

What you have done here is bounced Track 1 across D/A converters, thru a patch cable, back across A/D converters and printed to Track 2. The sample difference between Track 1 and Track 2 is your magic number for 44.1 hz. This number will be different for every sample rate that you are working at. I also recently discovered that this number is different from Logic Pro 8. This is why you need your log book so that these precious valuable numbers will be available to you.

 

 

 

There are a number of ways you can precisely determine the sample difference between the two tracks. The following method has proven to be the easiest for me. One is the phase null method and the other is to use the Arrange Window under magnification. REMEMBER THAT AT THIS STAGE YOU ARE ONLY MAKING THE DETERMINATION OF THE OFFSET NUMBER, YOU ARE NOT ACTUALLY MAKING THE CORRECTION.

 

DETERMINING SAMPLE DIFFERECES BETWEEN TWO IDENTICAL TRACKS

(First of all remember that if a track is delayed it will be further to the right in Arrange track window. If this is at all confusing think about the SPL moving from left to right. If something moves toward the right will be delayed and if it is moved toward the left is will happen earlier. Again, this step is only for the purpose of determining the sample offset--NOT A MEASURE TO CORRECT FOR OFFSET.)

 

 

1. Get ready to use your ears to monitor Track 1 and Track 2 simultaneously. Make sure you are working with your tracks in mono and DO NOT PAN either track.

2. Track 1 (not Track 2) Insert --- Logic>Helper>Gain click Invert Phase. and Second Insert--- Logic>Delay>Sample Delay. Again, I am talking about Track 1 not Track 2. Keep in mind that the Sample Delay plugin can only delay. In order to determine the difference between the tracks you can't move Track 2 forward so you must likewise delay Track 1 to match Track 2.

3. Now hit play and monitor Track 1 and Track 2 (preferably through a single speaker) keeping the gains at unity if possible. If need be you can create a a cycle or loop if your tracks are short.

 

4. Start increasing the sample delay of Track 1. You do this by opening the Sample Delay plugin, click the Delay window and scroll up.

5. Simply increase the sample delay until the sound you are hearing is TOTALLY or NEAR TOTALLY CANCELLED OR NULLED.

 

(FRUSTRATING REASONS WHY YOU MAY NOT HEAR TOTAL CANCELLATION-- If track 1 and track two are coming out of separate speakers you will only get perfect cancellation at one exact spot in the room. If the gains on track 1 or track 2 aren’t perfectly matched you won’t get perfect cancellation. A trick is to listen and change the plugin delay as I described above. When the sound volume drops to its lowest point then tweek the volume of track 1 or track 2 up and down. When you hit the matched volume the cancellation will be optimal. If you introduct color or distortion into track 2 during your original bounce, you will not get perfect cancellation. If fact, the remaining sound that you hear will be the exact sound or color that you introduced.)

 

 

6. Write down the SAMPLE DELAY NUMBER number in your log book. This is the magic number= OFFSET FOR that sample rate. Ultimately, you will want to determine this number for the sample rates that you work at.

 

ENTERING THE MAGIC NUMBER IN LOGIC PREFERENCES

Open Preferences and navigate to Record Delay. Enter your magic number. BE CERTAIN TO PUT A MINUS (-) in front of the number.

 

Just in case this doesn't make sense to you let me explain. Record Delay under preferences if entered as a plus number will automatically place all new tracks to the right on the timeline. Remember to the right is delayed. Your goal is to have your new tracks automatically nudged to the left or eariler.

 

VERIFY, VERIFY, VERIFY

Use the same setup that you used to bounce Track 1 to Track 2. Create a new track-- Track 3. Select its input as 2 which is just a bounce from Track 1. Arm Track 3. Rewind to zero. MAKE CERTAIN THAT YOU TURN OFF THE PHASE REVERSAL AND SAMPLE DELAY FROM TRACK 1. Hit Record. Again, you have just bounced track 1 out into the analog world and back. BUT LOGIC KNOWS TO AUTOMATICALLY MOVE THE NEW RECORDING THE MAGIC NUMBER OF SAMPLES YOU ENTERED INTO THE PREFERENCES.

Mute Track 2 and monitor Track 1 and Track 3 simultaneously. Reverse the phase of of either Track 1 or 3 and you should get near total cancelation just as you did when you were determining the sample offset. Try changing sample delay in both Tracks 1 & 3 with the phase inverted on only one of the tracks if you are able to get more phase cancelation then your original number is probably off. Don't sweat a few samples as each sample is only 23 millionths of a second at 44.1KHz sample rate.

 

I know that this sounds like a big deal if you are just reading this. Once you do it a couple of times it only takes minutes to make the calculations for offset. Tips for making things faster-- save your Gain and Sample Delay inserts settings by clicking and holding over Inserts and select Save Channel Strip Settings. I named it misalignment test.

 

Now that you have entered the magic number in preferences and have verified that it is correct just leave it as long as you stick with the same sample rate. My tests revealed that I can vary buffer size and the track misalignment doesn't change. And you can increase CPU load and and track misalignment will not vary. I know many unwitting folks on the GearSlutz forum argue this from there arm chairs because they are emphatic about what makes sense to them, not what they have actually tested.

 

Get out your log and run your system through the paces determining and verifying how the offset will change as you change sample rate but not with buffer or CPU load change.

 

If you are having trouble doing the phase cancellation test try the following test to make sure you are setup properly--- Start a new project. Record a single track (track 1). Copy track 1 to track 2. Now you have two identical tracks. Add the plugins as described above. When you reverse the phase on track 1 you should get 100% cancellation (no sound). If not something is wrong with your setup.

 

TIP—Once you determine the magic number for a give sample rate just enter it into Logic Preferences and leave it. You don’t have to turn it on and off. Logic doesn’t care if your first track or tracks are moved a bit because they aren’t being compared to anything. Then any new tracks will automatically, perfectly aligned with previous tracks.

 

 

 

Change of topic

 

You have a nice setup with your Studer board. If you ever want to use outboard gear as inserts in your Logic tracks during mixdown ITB there is a way to calculate the round trip latency which is critical or phase issues WILL occur. If you use inserts in the analog relm on your board that is not the same issue.

 

Give your setup a cool way to do mixdowns would be:

Send tracks, groups, or stems to the Studer. Strap in any analog outboard gear you have and want to use. Send your analog stereo mix to a TASCAM DVRA1000. This way you can work in Logic Pro at say 88.2 to optimize the processing of plugins at a higher sample rate. Then you can print your stereo mix to what ever sample rate you wish off of the analog board. If you are making a demo printing directly to 44.1/16 beats the hell out of any sample rate conversion and bit dithering in any DAW platform. The only exception might be conversion done by the Weiss products. The first generation TASCAM DVRA1000 can be had for a song. Warning—the TASCAM converters aren’t great but not bad. Ideally, you buy the best set of converters you can affort to feed the DVRA1000. I use a Cranesong HEDD to convert my analog stereo bus to digital and feed that signal AES cables to the DVRA1000. If you are using an analog board it is so nice to not have to bounce back into the DAW for the final print. If want to send something in for mastering you can do your final print at 88.2 or 192. This is not digital upsampling which somepeople erroneously do and is totally useless if not destructive.

 

Good luck.

 

Jon

 

jonfrank@gci.net

Link to comment
Share on other sites

Here is an easier way

 

with this procedure you'll be playing back a track from Logic and recording it right back into Logic on another track. This "loopback" recording will likely be out of time (late*) with respect to the original due to latencies inherent in your interface, driver software, etc., things you have no control over. Note that Logic's I/O buffer and process buffer settings will have no influence on this procedure.

 

This procedure lets you figure out exactly -- to the sample -- how late* your looped-back track is with respect to the original. You'll then enter this number (per the instructions below) into Logic's recording delay setting in the audio prefs. From that point on, your live-recorded tracks will be perfectly in time with when you played them.

 

The procedure uses phase cancellation of the original and looped-back track to certify that you've found the right recording delay value (you'll see reference to "null point" below, and that's what this is about).

 

* Note: audio recorded by most audio interfaces ends up being late. But on some systems the recorded audio can actually end up early! And in a few cases it's been reported that a recording delay setting of zero will suffice. The procedure outlined below addresses the more common scenario -- late audio. At some point I will amend this to address early audio. It's the same procedure -- making a loopback recording, but the way to figure out the delay value is just slightly different.

 

 

Anyway, here we go!

 

 

HOW TO DETERMINE AND SET THE RECORDING DELAY

 

STEP 0 -- very important!

 

• Turn software monitoring off

• Turn the metronome off

• Set the recording delay value to zero

• Set Plugin delay compensation off

• Make sure you have no plugins anywhere.

 

1. Arrange Window, Track 1, assigned to Channel 1 -- import a CD track or use any stereo track of your own, preferably something with sharp transients at the top, like drums or percussion. I'm going to refer to this track as "A". Align it to start at bar 2.

 

2. Arrange Window, Track 2, assigned to Channel 2 -- set this channel to record from INPUTS 1/2. This is the track you're going to record your looped-back audio on.

 

3. Make sure the fader levels for both channels (tracks 1 and 2) are set to 0 dB and that both of their outputs are set to OUTPUTS 1/2

 

4. Use stereo cables to connect outputs 1&2 of your audio interface to inputs 1/2 of the interface

 

5. Start playback at bar 1 and go into record a little before bar 2 (punch on the fly works well for this). This recording -- the "loopback recording" is going to be called "B". You only need to record about 10 seconds of material max.

 

6. Take track 2 out of record and insert the Logic > Helper > Gain plug on this channel. Set the L & R channels to be out of phase.

 

What's going to happen next: you're going to play back both "A" (the original) and "B" (the loopback recording of "A"). Because of the settings on the gain plug, B is now out of phase with respect to A. If Logic recorded a perfect copy of A (i.e., the timing of B is identical to A) then playback at this point would result in silence. Yes, silence! That's because if you playback two exact copies of an audio file and put one of them out of phase, they will cancel each other out.

 

But chances are that A won't be aligned with B due to the latency inherent in your audio interface and its driver software. You'll likely hear flamming (slapback echo), or a thin, flanger-like sound. This is a clear indication that your recording delay setting needs to be adjusted.

 

NOTE: the proper recording delay setting for some systems is indeed ZERO. So if at this point you do actually hear silence, you can conclude the test. If you don't hear silence ZOOM IN ALL THE WAY TO SEE HOW FAR OFF IT WAS ACTUALLY RECORDED. IF ITS ALMOST PERFECT THEN YOU DONT NEED TO WORRY ABOUT ANYTHING. IF IT IS NOTICEABLY FAR OFF THEN CONTINUE TO TWEAK YOUR SETTINGS SO THEY ARE PERFECT

 

7. Reduce the level of output 1&2 by 6 dB (this is to prevent clipping at the output in case your tracks are loud)

 

8. Open "B" in the sample editor. Zoom ALLLLLLLLLLL the way in to the anchor point as far as you can go. Set the sample editor's "view" to "samples".

 

9. Click/hold on the anchor point, being careful not to move it. You will now see two numbers in the upper left hand corner of the window. Write down the bottom number.

 

On most system "B" will have been recorded late. This means that the top of "B" contains a little bit of dead air (the latency amount) as compared to the original, "A". We're going to move the anchor point to the right -- one sample at a time -- to get past the dead air and find the null point that causes A and B to cancel. As follows...

 

10. Play back your tracks. Move B's anchor point to the right one sample at a time until you start to hear the sound thin out. Start/stop Logic as needed. As you move the anchor more and more to the right the sound will thin out more and more. As you get closer to the null point a steady, flanger-like "pitch" will start to form in the sound. If the pitch gets increasingly higher you know you're moving in the right direction.( ALSO INSTEAD OF MOVING IT ONE SAMPLE AT A TIME, I ZOOMED ALL THE WAY IN THE ARRANGE AND LINED THE TRACKS UP AS CLOSE AS POSSIBLE FROM LOOKING AT IT, THEN I MOVED IT TO THE RIGHT OR LEFT BY 1 SAMPLE UNTILL ITS SILENT)

 

You will reach a point where the sound is extremely thin and almost silent, and then, moving one more sample to the right OR LEFT, it will cancel completely. When this happens, click and hold on the anchor and write down the bottom number.

 

 

11. Subtract the first number from the second number. Then put a "-" in front of it. THAT's your recording delay value; set it in your audio prefs.

 

To confirm that this is the correct number

 

12. Delete "A". Make a new loopback recording on track 2. This is going to be called "B".

 

13. If the number you calculated is correct, and the Gain plug is still active on track 2 (putting "B" out of phase with the original "A"), when you play back both tracks now you will hear silence. To confirm, bypass the plug and you should hear your original track 2x as loud.

 

If upon playing back A and B the sound is still not perfectly canceling, adjust your recording delay +1 or -1 from the value you calculated and repeat steps 12 and 13 again.)

Link to comment
Share on other sites

Recording delay has been discussed in these forums extensively,

http://www.logicprohelp.com/viewtopic.php?t=22161

as well as other threads, if you search.

 

gucciescalade,

ski's method that you've posted works well, (I'd recommend you credit the author).

 

Having done so much external effects routing here, I've found the following to be quick:

 

Turn off PDC in the audio prefs. Set up two mono audio tracks, panned hard L & R. Download the single sample tick file from this thread:

http://www.logicprohelp.com/viewtopic.php?t=41101

 

Drag it on to both your tracks at the same location. Insert the I/O plug on one of the tracks with its ports set to where your cable loop is. Don't ping. Realtime bounce to a short stereo file.

 

Look at the stereo bounce in the sample editor and measure the difference in samples between the arrival of the two ticks on the respective channels. Just create a selection and the helper flag will give you the sample count you can enter in the Recording Delay.

Link to comment
Share on other sites

SOLVED:

 

My test was the simplest of them all. Real simple. Here we go:

 

No plug ins, no software monitoring, set delay to 0. That is what everyone does to get started.

 

Step 1: Set up a new record project, set up 3 tracks.

 

Step 2: Track one. Plug in a test Oscillator. Select a test tone which you can stand. 1KHz is a bit annoying for me. I build amps and use 400Hz as a frequency I can tolerate fairly well, but that is up to you.

 

Step 3: Track 2. Record from the test oscillator. Feed your signal from your I/O units output, into it's input from where you will record. I took a mono signal from one output which is left or right. I fed it into input one where I recorded the signal from.

 

Step 4: Now that you have recorded the test signal, turn off your oscillator. Drag your recorded region to the Track one lane. This will now be called Sine Wave Source. At this point, you have a recorded (10-12 seconds) region of sine wave. Set it up where you like. Bar 1 or bar 2. I started at bar two for no particular reason other then I could swipe my magnifier from the left side if I wanted.

 

Step 5: Track 2 will now become your first test track. We call this Test track # 1. You used it to record the oscillator, now you will record the signal you recorded, now called Sine wave source. The reason you need a recorded signal is the oscillator will produce the signal constant and in cycle mode, the phase will change against a recored signal over and over. So you need a fixed signal. The oscillator will not stop when the cycle stops and starts over, thus you get a different start point on the oscillator when the playback starts.

 

Step 6: After you have recorded the signal, magnify (Control/Option) your wave form on Test Track #1, all the way down as far as you can. Now scroll so you can see both the Sine Wave Signal, and the Test Track # 1 at the fully magnified level. Put your play head on the 0 crossing point right before the wave form starts upward. When you do this, use your sine wave source region to set your play head up. See picture one. Now look and see how far off your recorded signal is. pretty far? Not to far? if its lagging and your recorded signal is left of your source signal, now you can see how much and start the process of moving it. Mute this track.

 

Step 7:

Track 3 This is your Test Track #2.Open up your Preferences>Audio>Devices and choose the Core audio tab. Set your recording delay to -10 samples as a start. This will work if your signal was left of your source. Record to track three from the Sine Wave Source (track one). All recordings are mono. Now check the the wave form in the same manner you did with Test Track #1. Did it get closer? If it's still not enough, set the sample rate further negative. Try a few samples. Delete the current region on Test Track #2 and rerecord. Check it again. Repeat the process until you have a visual alignment like picture one.

 

Step 8: Now that you have aligned your track so that Test Track #2 is visually lined up with the Sine Wave Source (track one) you can plug in a gain plug on Test Track # 2. Also plug in a "Level Meter" on the "Output Track". See picture two. The gain meter is at 0 db. If you put the regions in cycle mode, you will see a nominal reading of what ever the two signals are making. . You probably wound up with a smaller signal on Test Track #2 then the Sine Wave Source of track one, see picture 4. If you didn't and you avoided feedback and achieved unity, skip this next step.

 

Step 9: Now with track one, your source and Test Track # 2 playing back in cycle mode, click the "Phase Invert" on the gain plug. Now adjust your gain on the gain plug upward if your Test Track #2 is lower then your Since Wave Source (track one). Watch your level meter. When you clicked the phase invert you should have seen a drop on the output level meter. If so, thats good. Now adjust up your gain until the Level meter falls to its lowest level. Use the shift key to get fine resolution on the adjustment on the gain plug. I was clicking the level meter readings to reset them during this process. Once you have achieved the lowest possible level, that is unity or there about between the two tracks. Your done. The sample rate adjustment has aligned your tracks and you have set the gain equally to allow for phase cancelation proving you did the job.

 

you can toggle the phase invert on and off to hear your results. You should hear the test tone loud with it off, and barley at all with it on. See picture 3

1.thumb.jpg.de48670471906e2eb7a78802c4e4bd49.jpg

Top is the Sine Wave Source recorded from the Oscillator. The second track is Test Track #1. You can see it is fairly out of alignment with the top track. The bottom is Test Track 2. This is after setting a negative value on the sample rate, achieving cor

2.jpg.38d80df4b7cf4c4ca0d28e061434f545.jpg

Gain Plug for Test Track #2, Level Meter on output track

3.jpg.8ee5acddddf3dd77eb5faeb1a6bdc712.jpg

Phase inverter on, gain adjusted to unity with track one. Level meter shows minimum output possible

4.jpg.f55031f24debbf22876dc18bccbfcad6.jpg

The source signal, top is the largest. the Test tracks are smaller to avoid feedback during recording from the output of your I/o to your input

Link to comment
Share on other sites

fader8, have you tried just using the I/O plug in L9 to ping the the cable loop?

 

I've done this twice recently (once to confirm the offset on the ADAT loopback on my FF800 and once to calculate plug-in latency on an output) and the result was perfect in each case. That is, the number of samples measured by the I/O plug gave perfect cancellation in the null test.

 

Unless you can see any problems with this method, it seems like a very simple way of measuring record delay.

 

Tom

Link to comment
Share on other sites

fader8, have you tried just using the I/O plug in L9 to ping the the cable loop?

Yes. Having only recently up'd to LP9 myself, I wasn't inclined to trust it yet until I had a chance to try it out in various configurations. But for a fresh project, simple routing, I can also confirm it does the job.

Link to comment
Share on other sites

  • 10 months later...

I have a question for Fader 8. I have a new rig now. I installed a Lynx Aurora16 and companion AES16e PCI card. This spells freedom and with my 5 Vintech preamps, Lexicon PCM96, couple of EL8x Distressors, EL-7 Fatso and my prized Blue series DBX 160 SL. I've got some great freedom and great work flow improvement now using some external hardware. I do a ping on every I/O patch I set up and due to my low buffer rate, I see +22 samples on the I/O ping return. Normally I set my samples to the lowest I can get away with for the best low latency I can. 64 samples is where I have it set default. When things start adding up and I notice crackling, I bump the buffer samples up until that crackling settles down.

 

First, why are the crackling or static noises correlating to the buffer size?

 

I did some tests. I did in fact, tie the Aurora output into an input, both free and unused. They turned out to be port 14, both in and out. When the samples were retarded by 13 samples, a recording that was on the DAW and sent to anther track in the DAW on a round trip through the mac and the Aurora, I had perfect starting and stopping points on the corresponding wave forms. So that tells me the latency offset by samples for an existing track to line up correctly to the recorded track needs -13 samples pre set in the audio preferences within Logic.

 

Now, I opened up an I/O patch where by I used an actual piece of hardware. I put the hardware in bypass mode. But before I did that, I pinged the I/O port and used and the I/O soft patch setting the samples to +22 samples. That is logics automatic sampling adjustment. I did in fact check the samples and they were not right on. So by setting the internal offsets inside the audio preferences to only -4 samples, the hardware patch works with exact alignment using an existing test signal in the DAW making a round trip through the hardware (hardware in bypass).

 

So the question is, Should I set the offset to match the hardware or the actual DAW round trip for only the I/O rather then the I/O patch?

 

Or, Should I set the offset to match the round trip of the Mac and Aurora and make the adjustments to the Soft Patch Ping?

 

Also, Theoretically, the trip in for recording is only ½ of the total delay, so instead of -13 samples, I should try -7?

 

What would you do?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...