Lag/Delay in LMMS when trying to play with a keyboard (MIDI)

Having trouble with LMMS? Ask about it here.
Hey all,

So I'll try to keep it as simple, yet detailed as I can. I'm running LMMS 1.1.3 (64-bt) on a fairly new laptop with Windows 8.1 (64-bit). I plugged in a piano keyboard to try and record music using that in LMMS.

It would all be good except for one thing. There's a slight pause between when I press a key on the keyboard and a sound plays in LMMS. When I turn up the volume of my keyboard to check, I can hear a note play there before a note plays in LMMS. It's a short delay, but it keeps me from being able to keep time with any kind of beat while playing.

My keyboard is a CASIO WK-110
It's connected to the laptop by a USB cable made by Gigaware (text printed on the cord says it's "high speed 2.0 revision" amongst other technical abbreviated gibberish which I can write here if someone needs to know)

I would really appreciate some help with this issue, so I could get to working on some music!

Thanks in advance! :)
Welcome to the forum.
In LMMS click "Edit" then "settings" then change the default buffer setting to something that works the best with your hardware.
Mine is set around the middle 185 ms. I don't use a widows computer, so I don't know what will work the best for you.
Yes welcome!
In adition to the good tip you just got, you may also like to read
https://lmms.io/documentation/Using_MIDI
Which is a page from the lmms-wiki
https://lmms.io/documentation/Manual

In case you do not know this documentation
Thanks for getting back to me guys!

I've tried lowering the latency in LMMS. I moved the bar all the way to the left to have the least latency possible, but the program says there is still a 1.5 ms latency. When I play, I definitely still feel and hear the timing difference between the keyboard and the software. Is there any way to have no latency at all? Or is that impossible?
@ 1.5ms you should not really be able to notice a lag/delay from playing to hearing audio, I suspect there is something else going on here with your midi setup.
Things to note:-
(1) Is the usb cable quite long? if so this can cause a delay, solution get a short as possible midi cable.
(2) Do you have the correct drivers installed for your Midi cable or setup ( Im unsure of how this works in Windows as I only use Linux )
(3) In LMMS, >Edit>Settings>Midi Settings Do you have any changeable options, if so experiment with these settings and remember to restart LMMS each time you make a change for it to take effect.
(4) Can you try another Midi based program on you computer and test to see if you get a lag/delay in this also, which would eliminate LMMS as being the culprit alone, perhaps even some app the benchmark your Midi setup?
(5) Possibly use the ASIO drivers for your audio card as this could help if the delay is audio related.
1.5 ms = 0.0015 seconds Like mikobuntu said, its very unlikely you can hear this.
mikobuntu wrote:@ 1.5ms you should not really be able to notice a lag/delay from playing to hearing audio, I suspect there is something else going on here with your midi setup.
Things to note:-
(1) Is the usb cable quite long? if so this can cause a delay, solution get a short as possible midi cable.
(2) Do you have the correct drivers installed for your Midi cable or setup ( Im unsure of how this works in Windows as I only use Linux )
(3) In LMMS, >Edit>Settings>Midi Settings Do you have any changeable options, if so experiment with these settings and remember to restart LMMS each time you make a change for it to take effect.
(4) Can you try another Midi based program on you computer and test to see if you get a lag/delay in this also, which would eliminate LMMS as being the culprit alone, perhaps even some app the benchmark your Midi setup?
(5) Possibly use the ASIO drivers for your audio card as this could help if the delay is audio related.
Gps wrote:1.5 ms = 0.0015 seconds Like mikobuntu said, its very unlikely you can hear this.
Now that I think about it, that's true. there's no reason I should notice that simple of a delay. My USB cable is rather long, so that could definitely be a problem. I'll tinker around with the other possible solutions you mentioned, mikobuntu, and if that doesn't fix anything I'll just go and buy a shorter cable at my local Radioshack this weekend.

I'll try and reply here again by Saturday night to mention if any of those solutions worked.
From an electrical engineering standpoint I can't really see why a long USB cable in itself would or should add to the delay. The electromagnetic wave in a copper wire travels at about 95% of the speed of light so a few feet is not going to add 1.5ms delay.

This must be a driver issue of some sort.

Edit:
Just a reflection.
Why should there even be problems with MIDI latency? MIDI is a very slow interface from the beginning of the 80's running at a meager 31.5kbaud. A 9MHz Atari ST could handle that with ease but the 64-bit multi GHz monster machines of today cant... something went wrong somewhere.
C_H is no doubt more clued up on the MIDI cable length thing, I can't remember where I heard /read this about cable length being an issue, but I remember using hardware synths master clocked by an Alesis MMT8 and cable length was thought of as a contributing factor to latency ( which could cause erratic behaviour like signals jamming on a note on etc ) , as well as things like interference from other devices at that time, but I guess MIDI as we know it now and especially with the computing horse power that is out now this should not really be an issue . But as you say something went wrong somewhere. Another thing I'm unsure of the actual USB Midi cable the OP is talking about, but I know from experience that those cheap MIDI 5 pin to USB connectors def have a latency issue no matter what the settings are on the software, but direct USB to USB midi should be fine I guess.
mikobuntu wrote: I know from experience that those cheap MIDI 5 pin to USB connectors def have a latency issue no matter what the settings are on the software, but direct USB to USB midi should be fine I guess.
I know that all to well, I use multiple keyboards, and I went with iConnectMIDI4 midi to usb connection and have little latancy. My cords coming off my portable piano are 8 feet long, but the usb cord to the computer is about 2 feet in length. .If you go with cheap connections, you get cheap results.