A technical support community for Apple Logic Pro users.

 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Audio and MIDI not recording in sync

Fri Oct 23, 2020 6:25 pm

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.
Attachments
screen.png
screen.png (8.33 KiB) Viewed 3725 times
Last edited by en5ca on Sat Oct 24, 2020 7:12 pm, edited 1 time in total.
 
User avatar
Atlas007
Posts: 9580
Joined: Mon Dec 14, 2009 11:58 pm
Location: Montreal

Re: Audio and MIDI not recording in sync

Fri Oct 23, 2020 6:33 pm

I think that's how Logic compensates for the plug-in latencies.
LogicPro 10.6.2, MainStage3.5.2
MBPro 17", Core2Duo, 8G, OSX 10.12.6
MacPro, Xeon 6Cores, 64GB, OSX 10.15.7
ULN8, MOTU MIDI TP-AV, C4, MCU Pro, KorgNano, Novation SLMkII
AAS, NI, Celemony, Spectrasonics, Korg, Arturia, etc...
PC, iPad3(V-Control & LogicRemote), AtariST(Notator SL), Several vintage gear
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Fri Oct 23, 2020 6:57 pm

Atlas007 wrote:
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.
Last edited by en5ca on Sat Oct 24, 2020 10:15 pm, edited 1 time in total.
 
User avatar
Atlas007
Posts: 9580
Joined: Mon Dec 14, 2009 11:58 pm
Location: Montreal

Re: Audio and MIDI not recording in sync

Fri Oct 23, 2020 7:15 pm

Wild guess: have you tried disabling Plug-in Latency Compensation during the recording?
LogicPro 10.6.2, MainStage3.5.2
MBPro 17", Core2Duo, 8G, OSX 10.12.6
MacPro, Xeon 6Cores, 64GB, OSX 10.15.7
ULN8, MOTU MIDI TP-AV, C4, MCU Pro, KorgNano, Novation SLMkII
AAS, NI, Celemony, Spectrasonics, Korg, Arturia, etc...
PC, iPad3(V-Control & LogicRemote), AtariST(Notator SL), Several vintage gear
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Fri Oct 23, 2020 7:23 pm

Atlas007 wrote:
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.
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Sat Oct 24, 2020 9:40 pm

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

screen.png
screen.png (34.42 KiB) Viewed 3640 times

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
screen2.png (30.6 KiB) Viewed 3625 times

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.
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Sun Oct 25, 2020 8:23 pm

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.
 
pjderobot
Posts: 1
Joined: Fri Oct 30, 2020 3:49 pm

Re: Audio and MIDI not recording in sync

Fri Oct 30, 2020 4:11 pm

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...
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Fri Oct 30, 2020 11:54 pm

pjderobot wrote:
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).
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Thu Nov 12, 2020 5:14 pm

Sadly, no luck with Logic Pro 10.6. Yet, stated at their website that:
Full plug-in latency compensation, also for external audio and MIDI gear
 
drakeholloway
Posts: 12
Joined: Wed Jul 17, 2019 10:52 am

Re: Audio and MIDI not recording in sync

Thu Dec 31, 2020 1:01 am

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
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Thu Dec 31, 2020 1:15 am

drakeholloway wrote:
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.
 
drakeholloway
Posts: 12
Joined: Wed Jul 17, 2019 10:52 am

Re: Audio and MIDI not recording in sync

Sun Jan 03, 2021 1:54 am

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.
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Sun Jan 03, 2021 4:43 am

drakeholloway wrote:
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.
 
drakeholloway
Posts: 12
Joined: Wed Jul 17, 2019 10:52 am

Re: Audio and MIDI not recording in sync

Mon Jan 18, 2021 8:32 am

Outstanding thanks for this additional info!
 
Philonious
Posts: 1
Joined: Sun Mar 07, 2021 8:13 am

Re: Audio and MIDI not recording in sync

Sun Mar 07, 2021 8:21 am

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.
Attachments
Screen Shot 2021-03-07 at 10.10.13 AM.png
Screen Shot 2021-03-07 at 10.10.13 AM.png (548.87 KiB) Viewed 1071 times
 
drakeholloway
Posts: 12
Joined: Wed Jul 17, 2019 10:52 am

Re: Audio and MIDI not recording in sync

Sun Mar 07, 2021 8:49 am

Thanks so much. I will definitely try this. Off the top of my head I'm not sure what my slider is set to but of course the latency changes based on buffer settings. I will report back asap
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Sun Mar 07, 2021 2:05 pm

Philonious wrote:
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.
 
drakeholloway
Posts: 12
Joined: Wed Jul 17, 2019 10:52 am

Re: Audio and MIDI not recording in sync

Sun Mar 07, 2021 2:16 pm

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.
 
en5ca
Topic Author
Posts: 30
Joined: Thu May 06, 2010 12:03 pm

Re: Audio and MIDI not recording in sync

Sun Mar 07, 2021 2:35 pm

drakeholloway wrote:
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.