Is Latency Elimination Possible?

Support & discussion regarding DAWs and MIDI sequencers.

Moderators: MattKingUSA, khz

Post Reply
km4hr
Established Member
Posts: 12
Joined: Wed Jan 01, 2014 1:56 am
Has thanked: 4 times

Is Latency Elimination Possible?

Post by km4hr »

I've tried several times over the years to use a midi sequencer but gave up each time because latency is horrendous. I recently tried again using the Fedora Jam operating system. It includes a real time OS and several sequencers including Muse and Qtractor, but latency is as bad as ever. It seems to me that what I want to do is very simple but I'm beginning to wonder if it's actually possible. I've viewed many tutorials but they seem to concentrate on getting complicated sounds out of synthesizers. All I want is my keyboard's piano sound.

Here's my hardware setup. I have a Yamaha P-95 keyboard attached to my computer using a M-Audio Midiman Anniversary adapter. That's it. I think this setup is very common.

Here's what I want to do. I want to record myself playing on one track and then record a second track while the first track is playing. I'm not using a software synthesizer. Playback is through the Yamaha keyboard's internal sound system.

I tried several midi recorder programs but they all have the same latency problem. When I press a piano key it takes seconds for the sound to be heard, which is totally unacceptable. I can't imagine how anyone could ever get midi input from several instruments to come close to synchronizing.

I may not understand the recording process. Here's how I do it. I start a metronome in the sequencer and play a song. I expect my song's timing to correspond with the sequencer's graph, but it's not even close. The recording is sort of ok but the timing is delayed. The song's beats don't line up with the vertical lines on the graph. Am I supposed to adjust each note's timing using an editor? That would take forever and make the sequencer totally useless to me.

Technically, I'm puzzled as to why characters typed on my alphabetic keyboard reflect immediately on the computer screen but when I press a key on my piano keyboard it can take 4-5 seconds for the sound to be heard. How is that useful? Don't alphabetic and piano keyboards use a similar process?

Comments/Suggestions are appreciated.

thanks!

runiq
Established Member
Posts: 47
Joined: Fri Jun 09, 2023 9:55 am
Has thanked: 61 times
Been thanked: 14 times
Contact:

Re: Is Latency Elimination Possible?

Post by runiq »

Note that Fedora Jam is just stock Fedora with additional packages, that means you still have to do some fiddling to lower the latency. Have a look at the fine article for help with that.

User avatar
Impostor
Established Member
Posts: 1392
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 148 times
Been thanked: 366 times

Re: Is Latency Elimination Possible?

Post by Impostor »

I'm not sure how much you'd benefit from all those "real-time audio" tweaks in case you exclusively use midi, and no audio at all. That said, it wouldn't hurt to optimize your system for audio regardless and see if it helps.

But isn't Fedora Jam already optimized ootb? Should be, if they target pro audio. Just make sure then that your midi sequencer uses Jack, or maybe even better, pure Alsa (you can run MusE in exclusive midi (Alsa) mode).

User avatar
bluebell
Established Member
Posts: 1927
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 113 times
Been thanked: 122 times

Re: Is Latency Elimination Possible?

Post by bluebell »

km4hr wrote: Tue Oct 17, 2023 4:15 pm

I tried several midi recorder programs but they all have the same latency problem. When I press a piano key it takes seconds for the sound to be heard, which is totally unacceptable. I can't imagine how anyone could ever get midi input from several instruments to come close to synchronizing.

Is your P95 to slow?
Ask a friend to borrow you a MIDI keyboard and connect it to your P95's MIDI in. Still slow? Then the P95 is broken.

Is your MIDI interface too slow?
Connect the MIDI keyboard to your MIDI interface's MIDI in and your P95 to your MIDI interface's MIDI out.
Use qjackctrl or another program to connect your MIDI interface's MIDI in with your MIDI interface's MIDI out.
Stll slow? Then your MIDI interface is broken or not supported by your Linux.

Last edited by bluebell on Wed Oct 18, 2023 7:40 am, edited 1 time in total.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

User avatar
erlkönig
Established Member
Posts: 210
Joined: Tue May 31, 2022 8:58 am
Has thanked: 42 times
Been thanked: 48 times

Re: Is Latency Elimination Possible?

Post by erlkönig »

it can take 4-5 seconds

That points to a basic misconfiguration. Have you tried something like AVLinux?

Currently working with
https://www.honeysuckers.rocks/?lang=en
Fiddling with sequencers does not evolve into music necessarily and Mac users have smelly feet and guzzle little children.

User avatar
peter.semiletov
Established Member
Posts: 119
Joined: Thu May 11, 2023 1:09 pm
Has thanked: 25 times
Been thanked: 82 times
Contact:

Re: Is Latency Elimination Possible?

Post by peter.semiletov »

km4hr wrote: Tue Oct 17, 2023 4:15 pm

Here's my hardware setup. I have a Yamaha P-95 keyboard attached to my computer using a M-Audio Midiman Anniversary adapter. That's it. I think this setup is very common.
[...]
Here's what I want to do. I want to record myself playing on one track and then record a second track while the first track is playing. I'm not using a software synthesizer. Playback is through the Yamaha keyboard's internal sound system.

But if you connect Yamaha P-95 to PC via M-Audio Midiman Anniversary (by MIDI protocol), how you get the "Yamaha keyboard's internal sound system" on your PC? With MIDI connection, you have the soft synth on other side. If you want the natural Yamaha P-95 sound, you need connect it to Line In, and record to the audio track.

km4hr
Established Member
Posts: 12
Joined: Wed Jan 01, 2014 1:56 am
Has thanked: 4 times

Re: Is Latency Elimination Possible?

Post by km4hr »

runiq wrote: Tue Oct 17, 2023 4:30 pm

Note that Fedora Jam is just stock Fedora with additional packages, that means you still have to do some fiddling to lower the latency. Have a look at the fine article for help with that.

Thanks for the link. It looks very involved and beyond my interest/capability. I switched to Ubuntu Studio. It eliminated a lot of problems.

km4hr
Established Member
Posts: 12
Joined: Wed Jan 01, 2014 1:56 am
Has thanked: 4 times

Re: Is Latency Elimination Possible?

Post by km4hr »

erlkönig wrote: Tue Oct 17, 2023 7:57 pm

it can take 4-5 seconds

That points to a basic misconfiguration. Have you tried something like AVLinux?

I discovered that my latency (and damper pedal) problems were caused by my midi interface. I noticed that it would occasionally work properly. So after much trial and error I found a way to make it work consistently. The procedure involves a certain sequence of restarting the interface and reconnecting the midi cables. Unfortunately I have to do this every time I restart the system.

I bought two identical cheap midi interfaces. They both had problems. One never sent NOTE OFF, so notes stayed on forever. The other caused my damper pedal to occasionally play a note (E3) at highest velocity. But neither of them had latency issues.

I went to a couple of local music stores to buy a quality interface that I could return if it didn't work, but they don't stock midi interfaces any more. Apparently DIN jacks are being phased out on midi keyboards, or maybe a USB jack is being added.

km4hr
Established Member
Posts: 12
Joined: Wed Jan 01, 2014 1:56 am
Has thanked: 4 times

Re: Is Latency Elimination Possible?

Post by km4hr »

Impostor wrote: Tue Oct 17, 2023 6:27 pm

I'm not sure how much you'd benefit from all those "real-time audio" tweaks in case you exclusively use midi, and no audio at all. That said, it wouldn't hurt to optimize your system for audio regardless and see if it helps.

But isn't Fedora Jam already optimized ootb? Should be, if they target pro audio. Just make sure then that your midi sequencer uses Jack, or maybe even better, pure Alsa (you can run MusE in exclusive midi (Alsa) mode).

I think Fedora Jam is optimized for low latency but I had other issues. Specifically I got all kinds of errors trying to run Qsynth. The errors seemed to involve problems with allocating resources. My guess is that my user account wasn't set up properly but I couldn't find any help on that. I worked with it a while but quickly got in over my head so I switched to Ubuntu Studio. It eliminated those problems.

folderol
Established Member
Posts: 2083
Joined: Mon Sep 28, 2015 8:06 pm
Location: Here, of course!
Has thanked: 232 times
Been thanked: 400 times
Contact:

Re: Is Latency Elimination Possible?

Post by folderol »

km4hr wrote: Mon Nov 20, 2023 6:05 pm
erlkönig wrote: Tue Oct 17, 2023 7:57 pm

it can take 4-5 seconds

That points to a basic misconfiguration. Have you tried something like AVLinux?

I discovered that my latency (and damper pedal) problems were caused by my midi interface.

This is a known problem with quite lot of MIDI->USB interfaces. It is caused by receiving MIDI messages with nothing actively connected on the computer side.
If your MIDI source has active sensing (most synths do) that will do it without you touching a note. My solution is to delay powering up the synth until everything else is ready. It doesn't happen with any of my plain keyboard controllers (provided I don't hit any notes too soon) as they don't have active sensing.

The Yoshimi guy {apparently now an 'elderly'}
User avatar
erlkönig
Established Member
Posts: 210
Joined: Tue May 31, 2022 8:58 am
Has thanked: 42 times
Been thanked: 48 times

Re: Is Latency Elimination Possible?

Post by erlkönig »

Wow, i never had this problem, but that knowledge is worth to be kept in mind. ...one of those situations where you could look for hours or days without finding anything that's wrong.

Currently working with
https://www.honeysuckers.rocks/?lang=en
Fiddling with sequencers does not evolve into music necessarily and Mac users have smelly feet and guzzle little children.

Post Reply