Jump to content

External MIDI slowly drifts out of sync only when Tempo is automated


wjm

Recommended Posts

Yesterday I opened a project I've not worked on in about a year to record some basslines with an external hardware synthesizer. The project has tempo automation that varies from 141bpm to 144bpm, and back, throughout the song. I noticed immediately that the tempo of the notes coming into Logic from the external synthesizer were lagging further and further behind the tempo of the rest of the track the longer it recorded. Begging your pardon if I'm long-winded, but I like to be as thorough as possible when asking for help. 

 

The first bassline midi note starts at 5 1 1 1 and the first note of incoming audio from the synth is recorded into Logic at 5 1 1 17, (a perfectly acceptable 17 tick latency if it remains more or less constant). Now by the time the first verse is ending at 21 1 1 1 that lag has only increased to 21 ticks - not a huge deal - but then there hasn't been much tempo change throughout the first verse, and it's this that seems to be the issue. Throughout the chorus the tempo ramps up from 142bpm to 144bpm and then down to 141bpm for the bridge. By the end of the bridge my 17-21 tick lag has now increased to a very audible 179 tick lag - the first midi note of the second verse that starts at 46 1 1 1 doesn't see its audio come in from the external synthesizer until 46 1 1 179. This lag remains more or less constant again throughout the verse (as there's little tempo change happening) and by the start of the second chorus (after a bassline pause from 62 1 1 1 to 64 1 1 1 1) that lag has increased to 201 ticks. As the tempo ramps up again the lag starts to increase even more and by 68 1 1 1 its at 240 ticks. Out of curiosity I removed all tempo changes from 68 1 1 1 onward just to see what would happen. Not surprisingly the lag did not get any worse. What did surprise me was that the it actually started to decrease, and by only 5 second later at 71 1 1 1, it was back to its initial latency of 17 ticks and from there until the end of the track it was rock solid (as there was no more tempo automation). So if the tempo changes stop the MIDI will actually drift back into proper sync. 

 

It should probably be noted that I have recorded external midi instruments from this project with all of its automated tempo changes in the past without encountering this issue. At that time I was using the same computer and the same MIDI interfaces. So whatever the issue I can't imagine that it's the hardware. But I'm running out of ideas to rectify the issue . . . and I need to get this song done.  :?

 

What I've tried to correct this problem:

1. Comp restart - no change

2. Unplug and replug MOTU MIDI interfaces - no change

3. tried two other MIDI interfaces (M-Audio and Alesis) - no change

4. tried two other external hardware synths - no change

5. tried both an old school External MIDI track and a new school External Instrument MIDI Plugin Track - no change

6. removed ALL other tracks from the project and ALL plugins - no change

7. tried creating a new empty project and importing only the midi file and tempo info - no change

8, put Logic in Low Latency Mode - no change

9. tried changing Logic's I/O buffer size - some minor change in the numbers, but exactly the same behaviour 

 

Here are some images to illustrate the issue. First image shows the MIDI regions and the tempo automation. The green boxes show where the punch-in images are on the timeline. On the punch-ins I've place the playhead at the start of the incoming audio note so it's position relative to its MIDI note can be seen.

http://i.imgur.com/tcD5TqB.jpg

http://i.imgur.com/CyJ9e0a.jpg

http://i.imgur.com/LbTmgAJ.jpg

http://i.imgur.com/55i6iFi.jpg

http://i.imgur.com/9yHSqPy.jpg

 

Any ideas? 

Link to comment
Share on other sites

Thanks for the response Eric. I've looked at your links and spent all of today trying different things and getting pretty much the same results. Changing the three options to do with processing/multithreading in Preferences/Audio/Devices makes a bit of difference as to the rate of decay, but not enough to create a workable environment. Something else that seems odd is that the problem seems to be getting worse the longer I play with it - i.e. with the exact same settings I'm getting worse results now than when I fired up the computer to resume troubleshooting first thing this morning. 

 

I haven't updated to LPX 10.3 yet - do you know if there's any change this has been addressed since that first thread 4 months ago? 

Link to comment
Share on other sites

  • 3 years later...
Hello all, I'm running into what seems to be the same issue and this is the closest thing to explain the behavior I'm seeing. I'm curious, @wjm, if you've tried using the Tempo Operations tool to build your "curve" instead of the global track? It seems like the automation curve in the global track is continuous whereas the curves constructed with Tempo Operations are just incremental discrete steps that mimic a curve. I'm going to play around with this on my track to see if it helps and will report back, but it will be time consuming and I'm half-tempted to give up and just record the MIDI at a constant tempo, bounce the audio and use flex on it to match the tempo drift I need.
Link to comment
Share on other sites

Wow, okay, so it only took me an hour or so to redo my tempo automation using the Tempo Operations (Edit > Tempo > Tempo Operations...) window. It's not quite as user friendly, but at least I don't have to fight with the tempo curve handles like I do in the global track.

 

I changed most of my curves to just 1/4 steps up and down over a bar. I have a couple of bigger drifts where I felt like it needed 1/8.

 

It actually worked! The clock doesn't drift out of sync now.

 

I speculate there's a bug in whatever they're doing to calculate the tempo from those continuous style curves in the global track that is additive in nature. The longer you playback the larger the error becomes. I don't have a guess as to why certain settings tweaks seem to amplify the error and make it more noticeable sooner in the playback.

 

And I guess bug doesn't exist if you use incremental steps up and down to simulate a curve rather than an actual curve.

 

Anyway, I've burned 3 late night sessions trying to figure this out, so while I'm perturbed, at least I have a workaround. On the bright side, it forced me to understand a ton of settings I never bothered to dig into before.

Link to comment
Share on other sites

  • 1 year later...

@Toomerm -

 

I think it's a floating point or some kind of numeric rounding bug that compounds during playback when automating the global tempo track with the curve handles. The tempo operations method I described in my post to workaround the issue isn't all that bad once you get used to how it works. The global tempo track creates prettier curves, but the tempo operations that just makes discrete steps actually works.

 

One thing I remember helps to distinguish this issue from others like it is the drift starts to become noticeable relative to where you start the playhead and then continues to get worse until you stop and reposition the playhead. For example, if you start playhead at time 0, the drift will become noticeable sooner than say if you start with the playhead on bar 10.

 

I tried to log the issue with Apple through a support page, but the barrier to entry was so high that I gave up. They basically want your first born no matter how detailed you are before they'll let a bug report get past their support triage that way. I've seen rumors on Reddit that there's a support line you can call which is a better way to get through to them.

 

Cheers

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...