Jump to content

midi out latency from programmed piano roll


Lewis Dixon

Recommended Posts

going to try to explain this as best as I can...

I recently got hold of a minilogue XD, so want to use it in my projects, i have 2 options, sequence it using the piano roll or play live.
Ive got a keylab MkII and the XD connected to the PC, the keylab is sending midi to cakewalk, and i can set the output of a midi track to the XD so i can play it live with more keys.
This works fine.

However, if i sequence the XD from a midi track, the sequence is played back late, about 75-100ms from my testing, BUT, if i route the keylab as the input for the track and play live, in time to say, a drum beat, there is no delay from my keypress. If i record the midi in from the keylab to the piano roll, it records in time to when i press the keys (at the same time outputting to the XD which i'm monitoring, which is also perfectly in time), however, playing back this recorded midi sequence is not in time, there is a delay from each midi note.

to be clear, there is NO delay when laying live (keylab --> cakewalk midi track --> minilogue XD), but there is a delay when playing a sequence (midi track piano roll --> minilogue XD).
This is not an audio monitoring issue as there is no latency when playing live, this is not a driver issue as there is no latency playing live, it seems like some hidden midi track piano roll buffer that only exists when playing a sequence. notably however, this does not occur sequencing an internal soft synth.

if you don't understand what i'm on about, just mention in the replies...

Link to comment
Share on other sites

An odd one for sure

I'll try a few idea's on you

So if you playback any midi track and send it to the Korg it play's back late as in comparison to playing the same track through a VST instrument. In other words if you played them both at the same time the VST would be on time and the Korg a bit behind. You could prove this but connecting the audio output of the Korg and recording it as analog and compare the note placement. 

Is this a Midi DIN connector or USB? Was there a midi driver?  

Is this a fresh project with no weird other settings other than default? 

Link to comment
Share on other sites

yep, its a fresh project, everything is connected over USB, as i said also, theres no midi out delay when playing the XD live using the keylab as a master keyboard (midi is still routed through the midi track doing this, not directly to the XD) so, given theres a delay from piano roll, i would expect one when playing live, but there isnt. there is a midi driver for the XD, but it cant possibly be causing the issue as when playing live with the keylab controlling the XD through he midi track its fine.

and yep to you first question too, another way i tested this is playing the midi sequence to the XD and at the same time playing the XD live from the keylab, if i hit a note exactly on a beat, im in time, however, if ive recorded notes exactly on a beat and play back the track, its late, so if i play both live and the sequence the sequence is behind my live playing (which is in time to the metronome)

Edited by Lewis Dixon
Link to comment
Share on other sites

best way i can demonstrate this is with some recordings, both are using the piano roll, ive recorded midi into it from the keylab, the first is un-quantisized and is exactly when i played it on the keylab (out is perfectly in time), the second is the same sequence quantisized. The first sequence the midi notes are actually recorded before the beat, because if the midi offset that cakewalk has, but are played back on the beat. And i guess because of this offset, when quantisized they are played back later than the beat, but this doesn't occur with internal instruments, ive got a 40ms offset set, if i set it to ~100ms the delay is pretty much unnoticeable, but then internal soft synths are messed up.


in both samples however, notice how the first drum beat occurs before the first midi note is sent

--edit-- seems i didn't export the synth audio... sorry, fixed links to compensate

--edit again--
soooo, even more strange, and audio cant show this, turns out if i record the audio from the maid track and then play that back.... ITS IN TIME??????? but playing back the midi track live (ie. not recording the synth audio to an audio track, just monitoring the audio track) causes it to not be in time? seems like its an audio latency issue? really don't know now.

Edited by Lewis Dixon
Link to comment
Share on other sites

You have me a little confused as to how your actually determining this issue now. Example

"notes are actually recorded before the beat, because if the midi offset that cakewalk has, but are played back on the beat". 

A few things are now in question. Are you just "hearing" a delay?? 

The way to test for latency is to do a loopback test. You re record the midi track as an audio track using the audio output of a soft synth or as in your case, a hardware synth. You can then zoom in and "see" if the tracks line up. Possibly the way you are monitoring is causing you to hear your interfaces latency. 

And to test, stick with a midi track where you only quantized to a higher value like 1/8 notes. Do not use input auto quantize. Use the processed version after you record. 

Link to comment
Share on other sites

sorry if im being confusing... im not auto quantisizing input, i tried recording the audio out from the synth using a programmed piano roll, the audio recording is perfectly in time, BUT if i just monitor the audio track, rather than record it, the audio is not in time, as if the midi notes are being sent late. theres no audio latency however,  if i play the XD live using the keylab as a master controller (using the midi track to route it) the note is on as soon as i hit a key, compared to note on when i hit play on a sequence is later than the sequenced midi note.

 

ill externally record the audio to try to help explain. (phone mic unfortunately... sorry, internal recording wont demonstrate the issue)

Edited by Lewis Dixon
Link to comment
Share on other sites

Timing Offset should never have to be more than a few milliseconds. If it's big, it will cause issues because it shifts the MIDI grid against the audio clock, affecting both recording and playback. It's intended to compensate for small 3-5ms MIDI transmission/response latency of hardware synths, but if you're having to use it to compensate for MIDI being laid down in the wrong place when recording, you'll need to find a way to resolve that issue without using Timing Offset.

If this is what I think it is, the  MIDI recording timing issue seems to affect some hardware configurations. If your audio interface has MIDI ports on it, I would recommend you try to use those first, rather than separate usb ports on keyboards and sound modules.

Link to comment
Share on other sites

56 minutes ago, David Baay said:

Timing Offset should never have to be more than a few milliseconds. If it's big, it will cause issues because it shifts the MIDI grid against the audio clock, affecting both recording and playback. It's intended to compensate for small 3-5ms MIDI transmission/response latency of hardware synths, but if you're having to use it to compensate for MIDI being laid down in the wrong place when recording, you'll need to find a way to resolve that issue without using Timing Offset.

If this is what I think it is, the  MIDI recording timing issue seems to affect some hardware configurations. If your audio interface has MIDI ports on it, I would recommend you try to use those first, rather than separate usb ports on keyboards and sound modules.

iv'e got a 40ms offset for the midi sync, because if i set it any lower (though, i think i need to set it a bit lower...) notes i play are placed on the piano roll after they should be, i set this when i was working with soft synths, like i said, if i set the offset to 100ms, notes sequenced are on at the correct time.

anyway, as promised, 2 badly recorded samples of the issue to try to demonstrate it, sample 1 is just me playing in time to the drum beat, sample 2 is the exact same thing i was playing, but programmed into the piano roll in the same midi track, note how the synth is note on late in the second sample, strangely though, if i record the audio out from the XD using the programmed sequence, its perfectly in time to how i would play it, so it seems the only delay occurs when sequencing the XD live (not recording the audio).


sample 1: https://drive.google.com/open?id=121CI8JDDuVbN5W7uN-U-whKcf4qUhnkd

sample 2: https://drive.google.com/open?id=121FDZB3JLnxBuXEk5ted-Muvk3mxUwi4

hope the samples help identify the issue

 

--edit--
did a bit more fiddling around, turns out when playing a piano roll sequence, the midi notes are 1/32 off from when they should be, so i can *fix* the issue by moving all the notes 1/32 forward, but its not really a fix, and the first note is still too late, but of course, when i actually record the audio from the XD for this sequence, its 1/32 ahead of when it should be.... aaaaaaaaaaarghhhhh

Edited by Lewis Dixon
Link to comment
Share on other sites

23 hours ago, Lewis Dixon said:

iv'e got a 40ms offset for the midi sync, because if i set it any lower (though, i think i need to set it a bit lower...) notes i play are placed on the piano roll after they should be

As I said, you need to find and correct the root cause of this issue. Timing Offset is not the appropriate setting to address that.

What audio and MIDI interfaces are you using, and are you using the audio metronome?

If you're using ASIO driver mode, what is your Output latency shown in Driver Settings?

Are there any PDC-inducing FX in the project?

Link to comment
Share on other sites

13 hours ago, David Baay said:

As I said, you need to find and correct the root cause of this issue. Timing Offset is not the appropriate setting to address that.

What audio and MIDI interfaces are you using, and are you using the audio metronome?

If you're using ASIO driver mode, what is your Output latency shown in Driver Settings?

Are there any PDC-inducing FX in the project?

i'm using an ASIO driver otherwise there is loads of audio latency, voicemeeter, the total latency is 1536 samples, output is 1024, input is 512. but if this was actually a problem, wouldn't it be obvious when i play live, and when i use soft synths. the fact that its only an issue for sending a midi sequence to the minilogue from the piano roll implies otherwise.
i'm using the metronome built in to cakewalk, my audio interface is an el cheapo behringer UCA222, so I can't do midi with it (not that i need to), but as iv'e said, there's no latency issues playing live.
There are no FX plugins in the project other than some sidechaining on the audio track and transpose on the midi track for live midi through, these are not causing problems since with them off it still persists.

as for latency in the midi input, the latency only exists when recording midi, hence the timing offset iv'e got set, not when live playing an instrument using midi in (or through).

i'm pretty sure the root cause has nothing to do with timing offset as iv'e already tried changing it to 0 already, which made the problem worse, as i said earlier, changing it to 100ms basically fixes the issue, but breaks soft synths.

 

also, i'll attach the cwp file in a second post, theres not much in it, just a midi track and a drum track (using sitala and some samples, which obviously wont work on another system)

Link to comment
Share on other sites

5 hours ago, Lewis Dixon said:

voicemeeter, the total latency is 1536 samples

This is your problem. That's 35ms at 44.1kHz to get the sound out of the Minilogue through Cakewalk and back to your monitors. Most people would find that to be  an 'unplayable' amount of latency for performing in real time on a keyboard. If it's not, it's because your monitoring directly or closer to directly than through Cakewalk. But you'll be performing to a metronome click, and recorded audio or soft synths that are late vs. the MIDI grid by the output latency, so your recorded MIDI will be laid down late, unless you use a Timing Offset to compensate. But even when your recorded MIDI is on the grid, the reponse of the external hardware synths is going to be delayed by the full round-trip latency, and sound late relative to the metronome and playback of existing audio that is only delayed by the output latency.

Timing offset will allow you to compensate for these dalays either on playback or on recording, but not both, because the sync error is different depending on what you're doing.

The bottom line is you need to get a harware interface with native ASIO drivers that can operate without pops/clicks/dropouts at a total round-trip latency down around 6-8ms (or less). I would think the Behringer should get close to that without Voicemeeter in the picture. I don't know much about it, but any layer of software you put in between Cakewalk and your interface's native ASIO drivers can only cause trouble.

Edited by David Baay
  • Like 1
Link to comment
Share on other sites

28 minutes ago, David Baay said:

This is your problem. That's 35ms at 44.1kHz to get the sound out of the Minilogue through Cakewalk and back to your monitors. Most people would find that to be  an 'unplayable' amount of latency for performing in real time on a keyboard. If it's not, it's because your monitoring directly or closer to directly than through Cakewalk. But you'll be performing to a metronome click, and recorded audio or soft synths that are late vs. the MIDI grid by the output latency, so your recorded MIDI will be laid down late, unless you use a Timing Offset to compensate. But even when your recorded MIDI is on the grid, the reponse of the external hardware synths is going to be delayed by the full round-trip latency, and sound late relative to the metronome and playback of existing audio that is only delayed by the output latency.

Timing offset will allow you to compensate for these dalays either on playback or on recording, but not both, because the sync error is different depending on what you're doing.

The bottom line is you need to get a harware interface with native ASIO drivers that can operate without pops/clicks/dropouts at a total round-trip latency down around 6-8ms (or less). I would think the Behringer should get close to that without Voicemeeter in the picture. I don't know much about it, but any layer of software you put in between Cakewalk and your interface's native ASIO drivers can only cause trouble.

Makes sense, however, I feel like I'd notice the latency when playing live? There isn't any, as soon as I hit a key on the keylab (or the XD) there is sound, I'm not directly monitoring the XD, I'm inputting the audio into an audio track in cakewalk then monitoring that.

Unfortunately, the interface I've got doesn't have any drivers itself, on behringers site they say use asio4all (which I didn't like). My other option is to try the realtek asio drivers for my audio chipset. Buying a different interface is out of the question currently, I could try fiddling around with buffer settings in voicemeeter to decrease latency.

Still think there's some midi latency issue here, because I would expect exact symptoms playing live, which doesn't occur.

Link to comment
Share on other sites

34 minutes ago, David Baay said:

This is your problem. That's 35ms at 44.1kHz to get the sound out of the Minilogue through Cakewalk and back to your monitors. Most people would find that to be  an 'unplayable' amount of latency for performing in real time on a keyboard. If it's not, it's because your monitoring directly or closer to directly than through Cakewalk. But you'll be performing to a metronome click, and recorded audio or soft synths that are late vs. the MIDI grid by the output latency, so your recorded MIDI will be laid down late, unless you use a Timing Offset to compensate. But even when your recorded MIDI is on the grid, the reponse of the external hardware synths is going to be delayed by the full round-trip latency, and sound late relative to the metronome and playback of existing audio that is only delayed by the output latency.

Timing offset will allow you to compensate for these dalays either on playback or on recording, but not both, because the sync error is different depending on what you're doing.

The bottom line is you need to get a harware interface with native ASIO drivers that can operate without pops/clicks/dropouts at a total round-trip latency down around 6-8ms (or less). I would think the Behringer should get close to that without Voicemeeter in the picture. I don't know much about it, but any layer of software you put in between Cakewalk and your interface's native ASIO drivers can only cause trouble.

So, did a bit of checking... I feel like an idiot... Turns out I don't have any asio drivers installed, I've been using WDM, and somehow not noticing a delay, I guess there is one... Maybe I've got into a habit of playing early, i don't know, but I'll install the realtek asio drivers, set voicemeeter to use that as its output and see if that helps.

Voicemeeter seems to act like asio, but isn't truly an asio driver, guess that's where I'm going wrong, I'll fiddle around with stuff and report back.

Link to comment
Share on other sites

So, i fixed it, it was due to audio latency, seems the realtek asio driver isnt around anymore, but i'll keep looking for it, managed to get my full sample delay to 10.9ms (480 samples) trying to decrease it more is causing the audio to pop and crackle, but it has effectively fixed the timing issue! maybe i should invest in a better interface...

Link to comment
Share on other sites

Cool. So you have your Timing Offset back to zero, and everything is good? If 10.9ms is a round trip time with ASIO buffer at 128 samples, you might have to shell out to find a USB interface that does much better. I use a MOTU PCI-based interface that runs smoothly with a 32-sample buffer, and delivers an actual measured RTL of 2.3ms. RME is the only company I know of that gets close to that with USB. 8-10ms with a 128-sample buffer is more typical (3ms each way for the I/O buffers plus 2-4 ms for A/D/A conversion and 'hidden' firmware/hardware buffers.

Link to comment
Share on other sites

I have one of those Behringer USB interfaces. They used to ship free with there so called USB mixers. And ya they do not have real ASIO drivers, and asio4all is actually is a good driver to use with them,,,but,,, they have bad Latency specs no matter what driver you use. They are great for playback and I used mine for years for live performances playback without issue... but for recording seriously it's been stated here a million times--- You need a proper audio interface with good ASIO drivers . There's no point trying to use any other driver mode or on board sound cards unless you feel like fighting a loosing battle with your system.  

 

Your set up sort of worked because your USB/Midi devices had proper drivers.  The midi in/out would have used those and not your audio interface crummy drivers specs. 

Edited by Cactus Music
Link to comment
Share on other sites

5 hours ago, Lewis Dixon said:

seems the realtek asio driver isnt around anymore, but i'll keep looking for it

Save yourself the trouble. The Realtek ASIO driver is not a good one. It has been the subject of several problem reports in the old forum. WASAPI on Win10 or ASIO4All are better choices for Realtek chips. The best solution is a purpose build audio interface with a manufacturer supplied ASIO driver.

  • Great Idea 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...