external MIDI instrument timing

Discussion of Digital Performer use, optimization, tips and techniques on MacOS.

Moderator: James Steele

Forum rules
This forum is for most discussion related to the use and optimization of Digital Performer [MacOS] and plug-ins as well as tips and techniques. It is NOT for troubleshooting technical issues, complaints, feature requests, or "Comparative DAW 101."
Post Reply
dewdman42
Posts: 1217
Joined: Thu Jul 21, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

external MIDI instrument timing

Post by dewdman42 »

I was a little disappointed that MOTU did not include an external hardware instrument plugin, in addition to the hardware insert plugin they provided in 9.1

Anyone have any suggestions for the best way to deal with setting up external hardware instruments with DP, so that MIDI delays and audio latency delays will be compensated for appropriately?

I think DP must be engineered to send MIDI events to external MIDI ports in time with the automatic plugin latency delay, so that in theory if you're listening to playback of your tracks, the MIDI sent to the external synths will be playing back exactly in time with the audio(ignoring MIDI wire slop).

That is probably what is desired most of the time for playback, but the problem is when I am trying to record the tracks back to a DP audio track, it ends up recorded on the track quite a bit late. Obviously I can use the MIDI plugin to nudge the playback forward, but I am just wondering if any of you have devised a more elegant/automatic solution to ensure external MIDI devices are rendered to audio tracks to line up with the MIDI events. When I did some simple tests, I get 400 samples lateness when my buffer setting is 128 samples.

I sure wish MOTU had provided an external plugin for this like they did for FX in 9.1. But anyway, just wondering how most of you work around this in DP aside from just sending the recorded MIDI events early, and using your ear to figure out how early.
5,1 MacPro 3.46ghz x 12 cores,96gb, Monterey (OpenCore), Lynx AES16e-50+X32
User avatar
bayswater
Posts: 11923
Joined: Fri Feb 16, 2007 9:06 pm
Primary DAW OS: MacOS
Location: Vancouver

Re: external MIDI instrument timing

Post by bayswater »

I wasn't aware of the need for anything for external instruments. For years I used a DM5 for drums, a Profomance for piano, etc, and didn't get any noticeable timing issues. Printing the instruments worked fine and DP appeared to be figuring out how to keep these things altogether. There is a preference that adjusts the relative timing of MIDI and Audio as well, although I never had to move that away from zero. I think the MOTU MIDI interfaces had some feature that helped as well. There was an intermittent problem with timing in a V7 release that introduced a delay, but that seemed to be fixed in V8, and it always went away with a restart of DP.
2018 Mini i7 32G 10.14.6, DP 11.3, Mixbus 9, Logic 10.5, Scarlett 18i8
dewdman42
Posts: 1217
Joined: Thu Jul 21, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by dewdman42 »

Yea I don't know how that ever worked for you accurately, especially if you had any plugins going on at the same time. Anyway, its not accurate now...

At a minimum you have some MIDI delay and audio latency coming back in...but automatic plugin delay compensation appears to also be at work. That can be turned off I suppose for printing to audio, maybe that will tighten it up a bit, but still I would not expect it to be completely accurate due to MIDI delay and audio card latency..

So the point of the new hardware insert plugin in 9.1 is to determine how much latency is present in the FX send and introduce that much delay compensation to everything else, in theory it should be sample accurate results, notwithstanding the bugs people have been reporting...

The same thing is needed for external instruments. ideally it should be sending the MIDI late to match the automatic plugin delay compensation, but a little earlier then that to make up for the MIDI/audio latency required to go out to the external device and get the audio back into DP. Then the results should be very accurate. And DP should know that while recording, the incoming audio needs to be recorded to the track in time with the delay compensated audio...etc..

Near as I can tell..that is not happening now at all..not even close... so just wondering what people do to tighten this up.
5,1 MacPro 3.46ghz x 12 cores,96gb, Monterey (OpenCore), Lynx AES16e-50+X32
magicd
Posts: 1461
Joined: Sun Oct 31, 2004 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by magicd »

Edited for accuracy.


See post for accurate info:

viewtopic.php?f=26&t=62230&start=30#p531139

Dave
Last edited by magicd on Mon Aug 22, 2016 5:13 am, edited 2 times in total.
User avatar
Shooshie
Posts: 19820
Joined: Sat Oct 16, 2004 10:01 pm
Primary DAW OS: MacOS
Location: Dallas
Contact:

Re: external MIDI instrument timing

Post by Shooshie »

magicd wrote:What you need has been in DP for many years. Go to the Setup menu>Configure Audio System>Fine Tune Audio I/O timing.

Start by calibrating the audio I/O. Connect a cable from output back to input on your audio interface. Set up two audio tracks in DP. Drop a snare hit or some other transient audio into track one. Track one will play the transient out and back into the interface. Track 2 will record the returning transient. Make sure Track 2 is not set to the same audio output so as not to create a feedback loop.

When you record the transient back in, zoom down to the sample level to compare the two tracks. You want to see the re-recorded audio line up exactly with the original. Adjust the Recording offset until the tracks match.

Now set up a MIDI track with a single MIDI note. Send the MIDI note out to a synth and pick a sound with an obvious attack. Play the MIDI track and record the output from the synth back into DP. Compare the MIDI note and recorded audio. Adjust the Playback offset until they match.

Dave
But... CakeReap LogicalTools has a button. You just push it.
:P Sorry... Just anticipating the inevitable response. The wait was killing me, so I just said it.

:lol:

Shoosh
|l| OS X 10.12.6 |l| DP 10.0 |l| 2.4 GHz 12-Core MacPro Mid-2012 |l| 40GB RAM |l| Mach5.3 |l| Waves 9.x |l| Altiverb |l| Ivory 2 New York Steinway |l| Wallander WIVI 2.30 Winds, Brass, Saxes |l| Garritan Aria |l| VSL 5.3.1 and VSL Pro 2.3.1 |l| Yamaha WX-5 MIDI Wind Controller |l| Roland FC-300 |l|
magicd
Posts: 1461
Joined: Sun Oct 31, 2004 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by magicd »

Edited for accuracy.


See post for accurate info:

viewtopic.php?f=26&t=62230&start=30#p531139

Dave
Last edited by magicd on Mon Aug 22, 2016 5:13 am, edited 2 times in total.
dewdman42
Posts: 1217
Joined: Thu Jul 21, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by dewdman42 »

MIDI slop is an entirely different problem...and its a problem too, but that's not what I'm talking about here.
5,1 MacPro 3.46ghz x 12 cores,96gb, Monterey (OpenCore), Lynx AES16e-50+X32
dewdman42
Posts: 1217
Joined: Thu Jul 21, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by dewdman42 »

magic dave, thanks for chiming in. I'm familiar with that feature but it seems like a global value to calibrate once and use across projects, for very fine tuned calibration of the system. The manual doesn't say a whole lot about when or why we would need to use that..it just says something along the lines of: PDC is automatic, but if its not right, tweak it here....but I could really use some clarification.

I was under the impression this was to compensate for inaccuracies in the way the audio card driver may be reporting its own latency. I am definitely going to try the calibration you mentioned when I am setup to do so... However, I hope you are not saying that everytime I want to use an ext synth I have to do this calibration work again and then turn it off again for recording audio tracks.

I think, however, that the thing I am asking about is really notwithstanding that, but maybe if you clarify some of the automatic PDC mechanisms that DP executes...then I can wrap my head around it.

Can you please comment a bit about some of the following things:
  1. The manual says that MIDI and audio events are sent early to instruments in order to handle PDC. Is that how it actually works?
  2. If its true that MIDI is sent early, but only when DP knows it is being fed to instruments that need some PDC, then I guess MIDI being sent to an external synth will always be late since there is no way for DP to know how early to send the MIDI or that it even needs to be sent early. As far as DP knows, there is no PDC compensation required because its not being fed to an instrument track but rather to an external MIDI port. yes?
there is a free 3rd party latency correction plugin from ExpertSleepers which can be placed in an AudioFX slot and it reports some amount of latency to the host, which in theory could get DP to send the MIDI event early, but it looks to me like DP is not ever sending MIDI early when the MIDI track is going to a port rather then to an instrument and no way to use that plugin that I can figure out.

I hope MOTU will consider adding an external instrument plugin which can be added to a DP instrument track and provide all the necessary timing corrections to make this seamless. That way we can treat the external instrument like an "instrument", including the possibility to insert the above mentioned latency plugin if we need to in order to get DP to send the MIDI early, though a dedicated ext inst plugin would really take care of that already make this seamless.
Last edited by dewdman42 on Wed May 11, 2022 10:18 am, edited 1 time in total.
5,1 MacPro 3.46ghz x 12 cores,96gb, Monterey (OpenCore), Lynx AES16e-50+X32
User avatar
bayswater
Posts: 11923
Joined: Fri Feb 16, 2007 9:06 pm
Primary DAW OS: MacOS
Location: Vancouver

Re: external MIDI instrument timing

Post by bayswater »

dewdman42 wrote:Yea I don't know how that ever worked for you accurately, especially if you had any plugins going on at the same time.
I guess Dave covered it. I did the tests he suggests and saw offsets in the order he mentions and didn't worry about it. I suppose some synth would take a while to respond to external MIDI, but those I used didn't seem to.

Please explain why plugins would matter -- aren't they handled by existing delay compensation features? What sort of signal path do you have in mind that would have longer delays for more plugins?
2018 Mini i7 32G 10.14.6, DP 11.3, Mixbus 9, Logic 10.5, Scarlett 18i8
dewdman42
Posts: 1217
Joined: Thu Jul 21, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by dewdman42 »

here's a little test I just did, which I can't figure out....MagicDave, perhaps you can shed some light on what is happening under the covers to cause this added delay...
  1. Create MIDI track, put quantized MIDI events on it, exactly on the beat
  2. redirect output of that MIDI track to an IAC bus
  3. create a new MIDI track, use the IAC bus as MIDI input and record enable it
  4. hit record
  5. Looking at the second MIDI track, the recorded MIDI events are right where I would expect them to be, IAC is not introducing any noticeable delay (I have done independent tests and found IAC to be sub-ms delay)
Ok, second test
  1. delete the recorded region on the second MIDI track above
  2. create an instrument track with some instrument, I used TruePianos
  3. assign the output of the SECOND MIDI track to send to the TruePianos instrument track
  4. hit record
  5. observe that now the MIDI events are being delayed by a lot to record on the second MIDI track, in my case by 873 samples.
Presumably PDC is doing something to the loopback MIDI, but its not clear what or how.
5,1 MacPro 3.46ghz x 12 cores,96gb, Monterey (OpenCore), Lynx AES16e-50+X32
dewdman42
Posts: 1217
Joined: Thu Jul 21, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by dewdman42 »

bayswater wrote:
dewdman42 wrote:Yea I don't know how that ever worked for you accurately, especially if you had any plugins going on at the same time.
Please explain why plugins would matter -- aren't they handled by existing delay compensation features?
I have already explained the issue
5,1 MacPro 3.46ghz x 12 cores,96gb, Monterey (OpenCore), Lynx AES16e-50+X32
User avatar
Robert Randolph
Posts: 877
Joined: Tue Apr 29, 2014 6:50 am
Primary DAW OS: MacOS
Location: St. Petersburg, Florida

Re: external MIDI instrument timing

Post by Robert Randolph »

dewdman42 wrote:here's a little test I just did, which I can't figure out....MagicDave, perhaps you can shed some light on what is happening under the covers to cause this added delay...
  1. Create MIDI track, put quantized MIDI events on it, exactly on the beat
  2. redirect output of that MIDI track to an IAC bus
  3. create a new MIDI track, use the IAC bus as MIDI input and record enable it
  4. hit record
  5. Looking at the second MIDI track, the recorded MIDI events are right where I would expect them to be, IAC is not introducing any noticeable delay (I have done independent tests and found IAC to be sub-ms delay)
Ok, second test
  1. delete the recorded region on the second MIDI track above
  2. create an instrument track with some instrument, I used TruePianos
  3. assign the output of the SECOND MIDI track to send to the TruePianos instrument track
  4. hit record
  5. observe that now the MIDI events are being delayed by a lot to record on the second MIDI track, in my case by 873 samples.
Presumably PDC is doing something to the loopback MIDI, but its not clear what or how.
I'm really having trouble following these steps here. It seems like there's some steps missing, or I'm just an idiot.

Can you re-write example 2 without referring to example 1, and make it as dumbed down as possible please.
dewdman42
Posts: 1217
Joined: Thu Jul 21, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by dewdman42 »

Sure robert, here is dummy proof version of test #2
  1. Create MIDI track, put quantized MIDI events on it, exactly on the beat
  2. redirect output of that MIDI track to an IAC bus
  3. create an instrument track with some instrument, I used TruePianos.
  4. create a second MIDI track, use the IAC bus as MIDI input, and assign output to the instrument track you just created. record enable it
  5. hit record
  6. Looking at the second MIDI track, the looped back MIDI events are now severely late, in my case 873 samples late
5,1 MacPro 3.46ghz x 12 cores,96gb, Monterey (OpenCore), Lynx AES16e-50+X32
User avatar
HCMarkus
Posts: 9712
Joined: Tue Jan 10, 2006 9:01 am
Primary DAW OS: MacOS
Location: Rancho Bohemia, California
Contact:

Re: external MIDI instrument timing

Post by HCMarkus »

Could it be the proverbial " Sync Recorded Notes to MIDI Patch Thru" preference is rearing its head again? Great for when performing with VIs; when enabled, it puts the MIDI notes where they are HEARD while performing with VIs (varies with buffer size) to compensate for the performer's natural inclination to rush when there is a delay between note on and sound generation.

This is necessary because, on playback, MIDI events trigger VI sounds exactly as recorded; DP can look ahead and trigger the sounds with perfect timing. Of course, this is impossible when DP doesn't know in advance what notes will be played at any given moment, as is the case when recording with VIs.
dewdman42
Posts: 1217
Joined: Thu Jul 21, 2005 10:01 pm
Primary DAW OS: MacOS
Contact:

Re: external MIDI instrument timing

Post by dewdman42 »

Yep HC...that accounts for that test.... thanks for that... I do have to say that I'm rather surprised to find out that True Pianos is adding 873 samples of latency though. (my buffer is set to 128). As another distraction, anyone know if there are any other settings that might be causing an extra heavy amount of latency to be introduced?

In any case, that test was a distraction from the original question of the thread......sorry for the distraction... I was thinking that might be related to why an an external synth is getting delayed so much, but in this case the MIDI getting recorded to the track was getting recorded to the track to match what DP figures I am hearing with 873 samples of latency, by design in that case.

But back to the situation of sending MIDI to a synth and getting the audio back in..its always delayed by some amount....and...that is unrelated to the MIDI sync feature you mentioned... I think based on what I read in the manual...PDC is handled by sending MIDI events early. But external MIDI doesn't have PDC and doesn't send the MIDI early, so the only way to handle external synths is to use the time shift MIDI plugin to send MIDI earlier. It would be nicer if this was incorporated into a dedicated hardware instrument plugin though I think. it could even be possible to incorporate a ping feature to send a MIDI event and detect incoming audio and derive a latency time.
5,1 MacPro 3.46ghz x 12 cores,96gb, Monterey (OpenCore), Lynx AES16e-50+X32
Post Reply