Jump to content

Audio and MIDI not recording in sync


en5ca

Recommended Posts

Audio signal and MIDI messages arriving in sync into Logic are not recorded in sync. MIDI messages seem to get delayed by the amount of CoreAudio output latency when recorded on a track.

 

UPDATE:

 

Did some further testing with this.

 

Trashed Logic preferences.

 

Made a new clean project. No latency inducing plugins etc.

 

External MIDI sequencer synced to Logic.

 

External sequencer is generating short MIDI notes on 1/4 beat.

 

MIDI notes are controlling external hardware synth generating a test tone, and software synth inside Logic generating a test tone. Software synth is panned left, and hardware synth is panned right.

 

MIDI notes are recorded into Logic directly from the external MIDI sequencer.

 

Hardware synth test tone is recorded as audio in Logic.

 

The monitored audio heard during recording is recorded on a stereo track with hardware loopback, for visual representation of the sync between Logic click and hardware and software synths. As heard, and seen on the waveform, during input monitoring and recording, they match very closely. Hardware synth (right channel) gets delayed perhaps a few ms, probably due to hardware synths internal latency.

 

During playback, the recorded MIDI notes control the software synth tone.

 

The resulting playback audio is recorded with hardware loopback. The playback is clearly not what is heard during the input monitoring and recording, as seen on the waveform.

 

However, in both input monitoring/recording and playback cases, the audio click lands precisely on timeline beat.

 

The software monitored input audio from hardware synth seems to get placed in the absolute moment of time when it arrived, and not where it was heard in sync with the click and software synth. This is too early, by the amount of the total roundtrip latency. During playback, the audio is then played too early by this amount.

 

The input MIDI also gets placed early, probably by the amount of the output latency. I think this would be the position, where the incoming MIDI first got delayed by the audio input latency, and then 'fires up' the software synth so that it the resulting audio output is in sync with the input audio and click, when monitoring audio inputs and software synth with software monitoring. But again, during playback the software synth plays too early by this amount.

 

Test is repeated in Ableton Live with clean project. The hardware, buffer size and routings in Logic and Ableton are identical, and physical cable connections stay the same. In Ableton, everything is in sync during monitoring and playback, and gets recorded in correct positions in relation to the Ableton click and timeline. Only noticeable delay here is again the hardware latency of the external hardware synth, which is understandable. The monitored input and playback audio seem to match at sample level with phase accuracy.

 

In Logic and Ableton, the external MIDI sequencer sync is adjusted to compensate for the total amount of roundtrip latency, so everything is heard in sync with the DAWs click during software monitoring. In this case about ~50 ms with the buffer size of 1024 at 44.1 kHz. With Logic and Ableton, sync is correct while monitoring the input and recording.

 

Turning Software Monitoring on or off, or using Low Latency Mode or changing Plugin Delay Compensation settings has no effect on this. In the video, software monitoring and plugin delay compensation are turned on. No plugins except for the test tone generating synth are in use.

 

In other words, in Logic the playback results match the recorded situation on Logic timeline, but the recording doesn't match the original monitored and recorded input.

screen.png.e4d2cc4b143c50397ee2a0e5ece1d1e5.png

Edited by en5ca
Link to comment
Share on other sites

I think that's how Logic compensates for the plug-in latencies.

 

That is not the issue.

 

For example:

 

If I use the incoming MIDI message to trigger a kick sample, it's in perfect sync with the incoming audio, when monitoring the audio through Logic. Meaning the latency compensation works. EDIT: But not with latency inducing plugins apparently.

 

The problem arises after recording this: Logic for some reason shifts (delays) the recorded MIDI by the amount of the CoreAudio output latency. As shown in the picture.

 

Now, if I try to playback this recording, the MIDI triggered sounds and recorded audio are no longer in sync: they arrived in sync into Logic, they we're monitored in sync with Logic, but during the recording MIDI get's shifted (recorded in delayed position) and then playback of this recording is not in sync.

Edited by en5ca
Link to comment
Share on other sites

Wild guess: have you tried disabling Plug-in Latency Compensation during the recording?

 

Tried, it has no effect. Turning Software Monitoring On or Off, or using Low Latency Mode has no effect.

 

Audio and MIDI signals are in sync when monitoring through Logic. No problem there. During recording, MIDI get's recorded in wrong position, as shown in the picture.

Link to comment
Share on other sites

Wild guess: have you tried disabling Plug-in Latency Compensation during the recording?

screen.thumb.png.4d8dccb5d0a8082455c2c71f189fc7dd.png

Updated the opening post with a video and a more detailed explanation.

 

I don't think this is directly related to the Plugin Delay Compensation problem, as the offset between audio and MIDI happens without any latency inducing plugins. Although this could indirectly be related:

 

Putting a few instances of linear phase EQ:s on the software synth (the video on the opening post) introduces offset between the hardware (audio) and software (MIDI) synths when monitoring the input.

 

I would expect them to play in sync with each other and the click, but with greater total latency. Meaning the click and audio track (no latency plugins) would be delayed by PDC to match the total latency of soft synth track. But this doesn't happen. PDC is enabled.

 

Still, the incoming MIDI note got recorded in the exact same position as without any latency plugins, but now it was clearly heard with a ~250 ms offset. And click and input audio were not PDCd. PDC is enabled for external MIDI sync also.

 

Here's a picture of the results:

 

Top track shows where the MIDI note got recorded.

 

2nd track shows whats was heard during monitoring: soft synth tone with 4 linear phase EQ plugins (left channel), gets delayd 'by a mile', but click and audio are not compensated.

 

3rd track shows playback of this recording: now PDC seems to work, and soft synth tone is where the MIDI note is (which is still wrong position however). And difference to what was monitored during recording is ~250 ms.

 

4th track shows where the incoming hardware synth audio got recorded, even though it was heard in sync with the click during the recording (2nd track, right channel).

 

EDIT:

screen2.png.adb679c2fbf110cd1378682c73e58a14.png

It would seem that even a simple audio recording by playing in 'pocket' (early) through software monitoring latency would result in the recorded audio to being placed in the absolute early 'non-pocket' position, and not how it was heard in relation with the other tracks when monitoring.

Link to comment
Share on other sites

Still no luck with this.

 

It seems that Logic places audio recording in the absolute audio interface AD input time position. Meaning, when using software monitoring, the audio recording position is off by the negative amount of total roundtrip latency. Oddly, enabling or disabling software monitoring has no effect on this.

 

MIDI recording position is off by ~1/2 of total roundtrip latency. This happens even when recording MIDI to blank external MIDI track with no software synth or any output routing.

 

So it would seem that Logic 'burns' the output latency delay into the MIDI recording, thus making audio and MIDI recordings to have an inevitable ~1/2 roundtrip latency offset. And when using software monitoring, instead of 'recording what you hear', Logic places the audio recording at the absolute moment of time when the information arrived into the system, and always offsets MIDI by ~1/2 of this amount.

 

EDIT:

Happens in LPX 10.4.8 and 10.5.1 with different gear, macOS version and computers etc, so it's probably not a hardware specific issue.

 

EDIT2:

In fact, Plugin Delay Compensation is not applied at all when monitoring inputs with Software Monitoring. To my understading this makes 'record what you hear' practically impossible if plugin latency is present.

Link to comment
Share on other sites

I might have the same problem.

 

When recording a hardware synth by external midi, the audio is to early compared to the midi note which triggered the synth.

Sometimes when recording just audio , it might happen sometimes that the audio is also 'recorded to early ' really enoying and embarising when a musician played a good take...

 

I don't trust Logic anymore timewise...

Link to comment
Share on other sites

I might have the same problem. ...

I guess this is just a 'feature' in Logic, and perhaps overlooked in design. Audio recording timing isn't compensated for monitoring latency, and ends up placed too early on timeline. MIDI recordings seem to get some compensation (even when they shouldn't), but ~1/2 the amount needed, and any extra plugin latency is ignored. This also happens when recording just individual audio or MIDI tracks, but users might easily attribute this as human timing error (edit: or assuming unrealistically long hardware latencies).

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

This is a bummer guys. I just got a Jupiter X and having a blast but everytime I bounce the midi the audio is early and I have to cut at first transient then move it to the downbeat.

It is interesting how you cannot uncheck the Auto-compensate latency box in the external instrument window as per the Apple website. Can't figure out how to post screenshot so here is the Apple link.

 

https://support.apple.com/en-us/HT206774

Link to comment
Share on other sites

This is a bummer guys. I just got a Jupiter X and having a blast but everytime I bounce the midi the audio is early and I have to cut at first transient then move it to the downbeat.

It is interesting how you cannot uncheck the Auto-compensate latency box in the external instrument window as per the Apple website. Can't figure out how to post screenshot so here is the Apple link.

 

https://support.apple.com/en-us/HT206774

 

Hi! I think that's slightly unrelated. AFAIK that controls the compensation during playback/realtime bouncing. E.g. MIDI routed to the external instrument is time compensated, so that the resulting should be in in sync.

 

OP is about audio and MIDI not recording in sync. E.g. a microphone and a MIDI trigger on a drum. MIDI gets offset by roughly the amount of buffer size. Initially I thought this could be a hardware issue, but this behavior is replicated with all external MIDI hardware, and seems to be related to buffer size and Logic, as same hardware performs flawlessly with other DAWs.

Link to comment
Share on other sites

Interesting. Yes I have noticed that when I switch the buffer from 1024 (I always record in Low Latency mode) to 64 the audio ends up being late and not early. This is irrelevant of low latency/software monitoring being enabled/disabled. I will play with the buffer in between the two values I mentioned and see if it lines up. Thank you.
Link to comment
Share on other sites

Interesting. Yes I have noticed that when I switch the buffer from 1024 (I always record in Low Latency mode) to 64 the audio ends up being late and not early. This is irrelevant of low latency/software monitoring being enabled/disabled. I will play with the buffer in between the two values I mentioned and see if it lines up. Thank you.

Yes. Just want to point out this technically has nothing to do with the latency itself, but the recording position offset between audio and MIDI. This becomes a problem, if the audio and MIDI sources have direct correlation between them. E.g. set buffer to 1024, load up some fast zero attack sound patch from Jupiter, and record both audio and MIDI from Jupiter. MIDI notes will have ~20 ms offset (if using 44.1 kHz sample rate) in relation to audio. Decrease the buffer size, and the offset will also get smaller. I would expect there to be no offset at any buffer size, and at lower buffer size there technically could be some jitter in MIDI note positions. Although, I don't think this has been a computer or hardware performance issue at least in a decade or something.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
Its really a simple fix that took me a better part of 2 hours to figure out. Slide the "recording delay" slider to 0. I think by default it's set to -5000. Before i did this, all of my audio tracks were appearing way earlier than they were tracked.

 

Hi! Unfortunately that does not solve the issue, at least for me, although it can be used as a workaround to some extent in a very simple setup. Indeed that was one of the first things I also ended up trying. The problem is that the offset between audio and MIDI recording seems to depend on the Logic buffer size setting and the total plugin latency of the Logic project, so it practically changes between projects and buffer size settings, and everytime you add/delete/reconfigure mixer with latency inducing plugins. So far I've found it easier to just adjust the recorded tracks manually after recording, than readjusting the recording offset for audio everytime.

 

Another thing is that even though you can get the audio and MIDI aligned with each other in some cases, usually you still can't get them to land on exact beats, meaning in sync with the Logic grid. And practically never when disabling software monitoring from Logic entirely and using external zero latency monitoring. Because Logic seems to always compensate the approximate (I think about 1/2 of buffer + plugins) total latency to MIDI recordings and never compensates audio recordings at all, whether the software monitoring and/or low latency modes are used or not.

Link to comment
Share on other sites

Yes I agree completely.

 

What I have found is when my buffer is at 1024 the midi fires early and my audio ends up early (from the real time bounce of my external synth). But when my audio buffer is 32 the midi fires late and thus the audio is late.

I found 128 to be the sweet spot which gets it pretty darn close but still not perfectly on the grid.

 

Maybe just better to zoom/slice at first transient/realign.

Link to comment
Share on other sites

Yes I agree completely.

 

What I have found is when my buffer is at 1024 the midi fires early and my audio ends up early (from the real time bounce of my external synth). But when my audio buffer is 32 the midi fires late and thus the audio is late.

I found 128 to be the sweet spot which gets it pretty darn close but still not perfectly on the grid.

 

Maybe just better to zoom/slice at first transient/realign.

Yes. The offset between audio and MIDI recording seems to initially depend on buffer size. With larger buffers the offset is greater. But, if you're working on a lower buffer size, like 64 for example, then plugin latency will play a relatively larger role. If the project has plugins with lookahead function and/or latency. If your buffer is 64, and the project has 2000 samples worth of plugin latency, then the MIDI recording will get compesates to this, but audio recording doesnt. So your sweetspot will probably vary between projects, unless you're always using the same exact template/mixer routing and plugin setup.

Link to comment
Share on other sites

To sum it up, It seems that the only case when recording timing is correct, is when recording only audio with external zero latency monitoring. MIDI will always get compensated for latency, but not the exact amount, whether it is monitored or not, resulting in offset between MIDI and audio recordings. In fact, any MIDI recordings will always end up with a 'non-correct' amount of compensation. This becomes noticeable with higher latencies and/or when recording audio and MIDI simultaniously. When recording audio through software monitoring, it doesn't get compensated at all.
Link to comment
Share on other sites

  • 1 month later...

I have a problem with audio/midi recording sync, but I'm not quite sure whether it is the same problem as described here.

 

I'm doing live multitrack recording of the whole band, including the audio outputs of the electronic drum kit, 8 tracks total. At the same time, I'm recording the MIDI of the drum kit on a separate track. Set all tracks to recording, press record, 1-2-3-4 and go.

(the intention is to use the drum kit audio, which is so-so, for monitoring (direct through the Behringer XR18 we're using for recording) and then later using the MIDI track for the mix).

 

MIDI drums and audio drums are not only out of sync initially, but also seem to follow a different clock. At the start of a take the midi drums are much further ahead of the audio than at the end of the take. So the solution of carefully moving the MIDI track in time to sync it up doesn't work...

 

Any ideas on how I could fix this?

Link to comment
Share on other sites

I have a problem with audio/midi recording sync, but I'm not quite sure whether it is the same problem as described here.

 

I'm doing live multitrack recording of the whole band, including the audio outputs of the electronic drum kit, 8 tracks total. At the same time, I'm recording the MIDI of the drum kit on a separate track. Set all tracks to recording, press record, 1-2-3-4 and go.

(the intention is to use the drum kit audio, which is so-so, for monitoring (direct through the Behringer XR18 we're using for recording) and then later using the MIDI track for the mix).

 

MIDI drums and audio drums are not only out of sync initially, but also seem to follow a different clock. At the start of a take the midi drums are much further ahead of the audio than at the end of the take. So the solution of carefully moving the MIDI track in time to sync it up doesn't work...

 

Any ideas on how I could fix this?

 

My solution was to jump ship, because of this and the neverending automation and PDC problems. Adjusting the audio recording offset on ad hoc basis can work on a very simple setup, but basically requires trial and error approach.

Link to comment
Share on other sites

  • 1 month later...
I have the same problem. Can't believe this would be an issue in Logic. :(

Hi! This affects anyone trying to record audio and MIDI at the same time in Logic. Or simply just pays a little closer attention to MIDI recording timings in general.

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