Musescore 4 midi latency

• Aug 24, 2023 - 11:51

I'm new to Musescore and installed latest version of Musescore 4. When inputting notes via my midi keyboard I get horrible latency, making it impossible to enter even simple single note phrases. As I've seen in other posts, it only occurs in Musescore 4 - I also use Cakewalk by Bandlab and have no latency, even with lots of complex VST instruments loaded (Kontakt, Toontrack, Ample Sound, etc.).

I installed Musescore 3 version (64-bit): 3.6.1.515740707, revision d0fc8e9 and get NO latency.
I do get a slight audible "click" on note release when in midi input mode, but not when out of input mode - weird, but I can deal with it.
Guess I'll stick with 3 and hope a future release of 4 solves the latency issue. :^(

Hardware:
Win10 Pro 64-bit
Intel i9-10850K @3.60GHz, Comet Lake 14nm, 10 Cores
ASRock Z490 Extreme4 Motherboard
128GB RAM
(2) 2TB Samsung 970 EVO Plus NVMe Drives
(1) 2TB Samsung 860 EVO SSD
(1) 4TB Crucial CT4000MX500SSD1 SSD
Focusrite Scarlett 8i6 3rd Gen
Intel UHD Graphics 630
Arturia mkII Keylab 88


Comments

Normally there shouldn't be any appreciable difference for ordinary note input. But, I have seen some reports of issues using the Scarlett device specifically. What happens if you connect directly?

In reply to by SoriceConsulting

Can you explain why it wouldn't be viable? Also, is there a special reason you need to use MIDI for input instead of simply using the computer keyboard normally? It's usually more efficient anyhow.

Right now it's not understood why some small percentage of MIDi interfaces introduce additional latency with MU4, so in order for the developers to be able to address it, they'd need to understand more about how to reproduce the problem (for me it works exactly as MU3, for example). So it's vitally important those who experience the issue help in isolating what triggers it.

In reply to by Marc Sabatella

I'd rather not have to disconnect/reconnect my Focusrite to use MU4. Not sure how to find out what triggers the latency. All I know is that MU4 is the only thing that has the latency issue. If you have any suggestions as to how I can try to find the cause please let me know - I'm an absolute newbie to Musescore!

For input, I'm a pianist, so just playing in the notes I want is easy. I haven't even tried using the computer keyboard, but not sure how that would be better.

In reply to by SoriceConsulting

Disconnecting the Focusrite just to test is that is the variable here - the thing different about your system compared to most - would be useful You can then connect it again. but at least then we'd know if it's the Focusrite driver that is the issue here - something about it not working well with the libraries used in MU4 (which are different from the libraries used in other software, including MU3).

The reason computer keyboard input is normally more efficient is that you can get correct spelling of accidentals right away. The flip side is, you do sometimes need to fix octaves, but in that case you have audible feedback, plus it is very easy to predict when you'll need it. All in all, it ends up being very similar, but still for most use cases, it is measurably faster to use computer keyboard, and for the few where MIDI can have a win, it's very very slight.

In reply to by Marc Sabatella

Hello,

I'm having the same issue with a Mac Mini M1, Focusrite Scarlett Solo and MU4.

I bypassed the Focusrite, changed output to Mac Mini speakers and still had latency. Using an Impact LX 49 keyboard controller with USB connected to a hub that is then connected to the computer. The Focusrite is connected directly to the computer.

If I have Logic Pro open at the same time, there is no noticeable latency with its playback. I hear the Logic instrument first, followed by the MU4 instrument.

Any other info/testing needed for development troubleshooting?

Thanks!

Notation software is not like other audio software. You will need to tune you computer to MU4. MU3 is light weight in comparison. It appears that you do a lot of music work. I assume that you know how to get to the advanced settings for your audio devices. If so, try unchecking "Exclusive mode" and dropping the bit rate a notch or two. I had to do this with my Focusrite. I had to do some of these thinds in Sibelius, also.

In reply to by bobjp

Marc and bobjp,
First - I am no MIDI expert at all - I'm an IT guy who does Server/Workstation stuff. DAW stuff is still a new world for me, Sorry!

I tried disconnecting my Focusrite 8i6 (3rd gen) and other experiments. Ended up with no sound out of MU4. Fired up MU3 and all was fine. No latency - and got sound.

I'm probably doing something wrong (not the first time :^).

Not sure what to try or do, but it looks like MU3 is my best option until a new MU4 version is released.

In reply to by SoriceConsulting

With MU4 open, go to Edit>Preferences>I/O and make sure the audio device you are using (be it onboard or Focusrite) is selected. Onboard my show up as Default. After that, don't plug in or un plug anything. If you use headphones make sure they are plugged in before you open MU4. This Software work fine on my less powerful than yours, system.
And make sure you have the latest drivers for your midi keyboard.

In reply to by bobjp

Thanks. Drivers are all up to date. Did a PC restart, opened MU4, checked to be sure in IO that it was set to Focusrite (or System Default, they both yield the same result). Buffer set to 1024. Opened a blank Piano score. Made sure Toggle Midi Input was active, Pressed N and played a few notes. Noticeable latency.

Opened MU3 and no latency.

Hi ! I have the same issue! I've already plug my Midi keys directly to my Macbook Pro. But it still the same result!

And, I realise that it's the Buffer size plays a huge role with this latency issue!
Unfortunately, MuseScore 4 only have 3 options. even the lowest one (1024) still got a latency.
Perhaps by adding a lower buffer size than 1024 will fix the Midi latency. (e.g. 512 , 256 & 128)

**I just know this because I set to the highest buffer size (4096) and my feeling of that latency just like a delayed flight 😂 .

Im using M2 chip Macbook Pro, 1TB.

Attachment Size
Screenshot 2023-10-31 at 10.40.24.png 258.8 KB

In reply to by samjaissen

Same issue. M1 MacBook. It doesn't matter if I'm using MIDI input or the computer keyboard for input. There's audible (and visible) lag when entering notes. It doesn't matter if I'm using computer speakers, headphones, or an external interface. There's about 200ms latency from the time I press a key to the time I hear it.

My work-around is to turn off audio output in MuseScore, and use the audio from a different playback engine when I'm recording MIDI notes. Works great every time.

I'm wondering if it has anything to do with the number of VSTs on my system? I do have a boatload of them, and MuseScore isn't actually using any of them.

In reply to by samjaissen

Same MuseScore 4.1 MIDI latency problem here on my MacBook Air M2, 2TB, 24GB RAM. It makes note entry in MuseScore 4 quite annoying. But that's okay. Due to WAY too many V4 issues I work exclusively in MuseScore 3.7, tho0ugh occasionally I peek at MS4 to see if there are improvements and to explore and use new features like Partial Capo and Muse Guitars.

Regarding VST comment by OP, I encountered the MIDI latency long before I started using Kontakt or other third party VST libraries.

It's quite astonishing that so many people are experiencing this problem which can really be a deal breaker for many people and yet it hasn't been addressed.

I'm at a crossroads now - not sure if to abandon MS for Dorico/Sibelius or hope that it gets fixed soon. Either way, I'm in midst of a semester studying composition and this literally adds hours to my workload.

In reply to by jonathankraka

Have you tried the 4.2 beta yet, which has a number of optimizations around this?

In any case, I’m not understanding how a slight MIDI latency adds hours to anything. For one thing, if you are concerned with efficiency, you’d be using step time entry in the first place rather than messing with real-time. And even for step-time, the computer keyboard is usually at least as efficient as MIDI.

So, I’m not saying it wouldn’t be good for you to test the beta to see if the change improve the situation on your system, or that further improvements shouldn’t be considered as well. I’m just trying to help save you hours of your time by advising you on more efficient workflows.

In reply to by Marc Sabatella

Hi Marc, I did try 4.2 Beta, the problem isn't solved.

The keyboard is a problem for chords, Alberti bass and the like when writing for piano. It requires extra steps to write something that can be played in seconds on midi.

The system works well for me and for many others who use midi as part of their workflow, I understand that it isn't important to you.

Thanks

In reply to by jonathankraka

It's not a question of whether it is important to me or not - like I said, I'm just trying to help you get back the hours you say you are losing. i absolutely guarantee, you can enter music as fast if not faster with step-time input, computer keyboard or MIDI. So if you're truly concerned about saving time, why not give it a shot? might take a little practice if you're not used to it, so don't give up if your first attempt isn't quite as fast.

Couldn't this be the same latency you would get in MU3 when not selecting the ASIO driver
which you can't select in MU4? You can only select the device in MU4 but not the driver...

In reply to by oMrSmith

I am getting very bad latency on a Macbook Pro M3, same on my previous intel MBP with MU4. It is really bad.
Needs to get sorted out PLEASE!

I just use my Logic sounds for real time input by muting MU4 and unmute for playback. No latency on MU3.

Marc - it does waste time and makes you feel you are working on an unfinished piece of software - much as I LOVE MUSESCORE!

I don't know anything about Musescore 3 because I just subscribed a few days ago and Musescore 4 is the first version I've ever used. But I have the same issue as everybody here, a lag that is not extreme, but still noticeable. These are my specs, but, this lag occurs even if I connect other I/O devices, like a Qudelix T71 and a 5K DACs, all of which don't have any latency in Cubase, or when using standalone players like Kontakt or Opus.

  • Mac Studio M1 Ultra
  • 64 GB of RAM
  • 4 TB internal storage
  • Native Instruments Komplete Kontrol MK2 connected to the Mac directly
  • Audio interface is a Behringer UMC404HD 192K

Also, 98% of the times I open Musescore, when I close the app, it crashes. It works fine, but it crashes when you quit it.

I am experiencing the same lag issues in MuseScore 4.2.1 whether I enter notes via my MIDI keyboard (Yamaha MOXF6) connected directly to my MacBook Air M2 (macOS Sonoma 14.2.1) or enter the notes directly using the computer keyboard. So in my situation, both methods have a very noticeable lag. If I press a piano key, MuseScore triggers the instrument sound a few milliseconds after I release the piano key. And when entering notes via the computer keyboard, the same thing happens. I tap on any letter A–G and the sound triggers a few milliseconds after I release the computer keyboard key. It is very noticeable in both situations.

Any advice will be appreciated on how this can be resolved since it happens utilizing the suggested method of entering notes via step method, which I have.

In God's Harmony

As MuseScore does not have the ordinary definition of real-time note input the MIDI controller latency is quite concerning but doesn't interupt my workflow. If I want to record in real-time to a metronome I can do so in other notation apps and in Logic Pro.

That said, the half second lag between mouse click and note playback is very annoying. And I've heard a chorus of voices here that agree. And here in MacOS 13.5.2 and MuseScore 4.2.1 the playback cursor lags, on average, about a full beat in 4/4 or 3/4. Would be great to see these timing issues addressed. I continue to check new features and report 4.x bugs but I use MuseScore 3.7 Evolution for production and editing.

scorster

In reply to by scorster

Hmm, are you saying that simply clicking on a note causes a perceptible lag? That's not normal at all. Could be something to do with the unique configuration of your audio system. Worth posting more details so others with similar hardware / software configurations can try to help debug what is going on with your system specifically.

In reply to by Marc Sabatella

Hello, Marc. I have troubleshooted various scenarios, and all have a delay. And, yes, just clicking on a notehead with the cursor, a delay is noticeable at about half a second or more. The delay is almost exactly of the same length regardless if a notehead is clicked directly, a letter key is pressed on the computer keyboard, or a key is pressed from the piano keyboard controller. Even when the Yamaha is turned off and disconnected, the delay is still noticeable.

I don't see anything in my audio system configuration that would cause this. I'm not using a hub, or an audio interface at this time. Here is my setup and gear:
•MacBook Air M2, 16 GB, Sonoma 14.2.1, 250 GB SSD (APFS)
•Yamaha MOXF6 (connected directly via USB to computer)
•MuseScore version (64-bit): 4.2.1-240230937, revision: d757433

In God's Harmony

In reply to by rawsaxy

Great, then the next step is to wait for those others who experience the same issue to also post their system details, then you can all start comparing notes and brainstorming things to try in the effort to determine what makes your systems so differently from all the rest where things work smoothly. Hoepfully, at some point, one of you will discover the specific setting or other factor that is triggering it - what causes your system to work differently from most others - and then report that back to the developers.

In reply to by scorster

There are many things I've learned over the last year or so. The OP here had a problem on his Windows computer that was plenty powerful, but had a noticeable delay on note input from his midi keyboard. There is an annoying delay when I hook up my Yamaha. But I don't use it for note input. Only to experiment. And that delay is different depending on whether I'm using headphones or built in speakers. It is less with headphones. Which is interesting because they are cheap wired earbuds. Which brings me to the first point I'd like to make.

  1. In Windows, every audio device that is hooked up has separate settings available. Involving bit rate, exclusive mode, and default. These are outside of MuseScore. Add an audio device, and the same adjustments are possible. All three should be checked, if needed, and adjusted separately. It doesn't make any difference how powerful your computer is. Things may or may not need to be adjusted.
    That brings us to Macs. I know nothing about how to adjust them or even if it is possible.

  2. Mac users are reporting that there is a delay just clicking a note. All I can say is that on my system there is no delay. None. With the Yamaha, yes. But just clicking a note, no. Does anyone have any information on Mac audio devices? I've done some looking around and can't really find anything. I think it might be useful for everyone if we could find something about this.

In reply to by bobjp

Hi bobjp, what exactly would you like to know about Mac audio devices?
On a Mac system, if you want to see what devices/gear are/is connected to the actual computer, you would go to two places: Audio MIDI Setup, and System Settings> Sound. Both will show what devices are connected, if any, to the actual computer, and any audio routing, if any. In my particular case, since at this time, I am not using a hub or an external audio interface, no special audio routing will be present since the piano/keyboard is connected directly via USB to the computer. As stated before, even with the piano/keyboard turned off and disconnected from the computer, there is an audible delay just entering notes directly from the computer keyboard (letters A–G), or merely clicking a note head with the cursor.

Something else I've come across while leaving the MuseScore app open is that if for any reason the computer goes into sleep mode, or I am using another app for a while and come back to MuseScore, MIDI input from the piano/keyboard no longer works and I must turn off the piano/keyboard then back on again for MuseScore to recognize it. Sometimes I also must go into MuseScore Preferences> I/O change the Audio Device and MIDI Input to something else and change it back to what it was for it to work again.

I understand most users have stated they rather not use a piano/keyboard for input, but for me at least it's a lot faster to press a piano key for a pitch (making it faster for me to get the correct octave, and even complex chords/voicings, even 7+ simultaneous notes) and press a numeric key on the computer keyboard for the note value. But once again, even when not using a piano/keyboard, I still experience an audible delay just clicking on note heads and pressing pitch letters from the computer keyboard. At this time, I'm not concerned about real-time input, just inputting in step-time, which is what I'm doing now.

In God's Harmony

In reply to by rawsaxy

All Windows audio devices, including onboard devices, have bit rate and exclusive mode setting. These settings probably won't help midi keyboard lag, But they can help playback in general. If the computer meets or is close to the needed specs. These settings are true of Sibelius, also. I am wondering if Mac has any similar setting.
And, MU4 doesn't like to be put to sleep.

Just started using Musescore 4 and am experiencing the lag.

William Allegro II keyboard (connect via USB to computer)

Musescore 4.2.1 Revision d757433 API level 420

Edition Windows 10 Home
Version 22H2
OS build 19045.4046
Experience Windows Feature Experience Pack 1000.19053.1000.0
Processor Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz 2.70 GHz
Installed RAM 8.00 GB (7.73 GB usable)
System type 64-bit operating system, x64-based processor

I don't see options for setting bit rate and exclusive mode, i.e. doing a search on these terms in Settings returns nothing

Same for me. Musescore 4.2.1, windows 11, i7, with 32G ram. M-Audio Keystation 49ES MKIII. Lags when using Musescore, no lag when using Pro Tools. Direct connection to the USB port. Audio interface is not part of the equation here. And to whomever said adding notes via the computer keyboard is faster than using a piano keyboard, umm...no.

This should be a P1 bug fix.

Have the exact same problem with version 4 on my Macbook Pro M1. I find it quite funny how some argue this isn't a problem or what it's been designed for. Good grief - it's a bug and should be fixed as I'm sure it matters to many. I deleted version 4 of the s/w and installed the last version of 3 and that latency issue is gone. If half the time spend arguing that it shouldn't be important to us was spent looking at the code change history, maybe, just maybe, the problem would be solved LOL

In reply to by rg2135

I know, right? I am not talking about being able to enter midi notes in real time like a DAW, either (although that should be there too), but just being able to hit a key and have the note play without lag when adding to the staff. I am just a beginner at this, but I can't image any working composer would look at that and go, "...that's ok." Does Sibelius or Finale have that kind of lag? I doubt it. If this worked in 3.x and is broken in 4.x, that's an inexcusable regression.

In reply to by bill0287

Again, for the vast majority of users, there is no discernible difference. I believe you when you say there is on your system, but until the people experiencing this system gather together to compare notes about aspect fo their system is triggering this specific hardware, settings, or other apps on their systems - it won't be possible to make progress on figuring out a solution. That's why it is so important those experiencing the problem share these details and do their own investigation - trying different things in terms of changing settings, closing other apps, etc - so that progress can be made. Only the handful of people experiencing this problem are in a position to be able to do this, so I do hope all of you who see this will participate in the effort!

In reply to by Marc Sabatella

My set up couldn't be more simple:

-no midi device connected - just using the Mac's keyboard to enter notes
-Macbook Pro M1 with 16GB (no external anything connected to Mac)
-no other apps running after a fresh reboot

-with a midi controller connected, the delay issue is exactly the same. Devices tested include M-Audio KeystationMini32 MK3 as well as Yamaha P515 with identical results. In this config, connection is via USB from midi device directly to Macbook.

Latest build of 3 has no delay issue.
Latest build of 4 does have the delay issue.

Doesn't matter if headphone are used or sound is coming from Mac's built-in speakers with headphones removed.

Changing the setting for Audio buffer size (in Preferences/IO) from 4K to 2K and to 1K reduces the delay in seemingly proportional steps. At 1K buffer size, delay is still an issue but not as bad as at 4K.

I'd say there is a very good starting point for the investigation given the results from that simple buffer size test in an absolutely bare bones H/W scenario. Hopefully proactive developers will take notice of this problem and start working the issue with the information provided.

In reply to by Marc Sabatella

What settings can be changed? There is almost nothing in the I/O section of the program other than buffer size which can only go down to 1024? I don't know what else there is to change. I have done similar to the above.

I have no lag when using Pro Tools or Studio One with everything being the same.

Cross posting from my reply to the relevant thread on github (https://github.com/musescore/MuseScore/issues/16112)

Some more measurements vs buffer size:

My setup is garageband recording a loopback from another track synthesized by garageband, as well as the output of musescore. I built from source and added more buffer size options, all the way down to 32. The reported number is the time delta between the audio produced by garageband (always first) and the audio produced by musescore:

4096: ~440ms
2048: ~290ms
1024: ~210ms
512: ~160ms
256: ~140ms
128: ~120ms
64:~110ms
32:~110ms

Note: The baseline delta between garageband recognizing midi input and garageband synthesizing an audio sample is ~60ms. So all the numbers above should have 60ms tacked on to get an "absolute" delay from the time you press the key (practically speaking).

I'm using a Scarlett 2i4 on a mac pro M1.

For a ~2x improvement, simply reducing the value of MINIMUM_BUFFER_SIZE in audiotypes.h to 64 would do the trick. However, IMO 170ms is still an unacceptably distracting amount of latency. Something else needs to happen as well.

For concrete numbers, if we take GarageBand's 60ms as acceptable, then the goal would be to get under 60ms for MuseScore.

Update: I measured Musescore 3 and found it to be in the 60-70ms ballpark (time from garageband registering a midi event to time MS3 produced a sound)

Summary (time from midi event to audio):

MS3: 60-70ms
GarageBand: 60-70ms
MS4, buffer size <=128: 170-180ms
MS4, buffer size = 1024: ~270ms

In reply to by Tyler Mullins 2

Tyler, those are significant numbers. I'm not sure what was changed, or why, in MuseScore 4.x that is causing such a difference from version 3.x
I posted my findings and current experience in this thread and read many posts dating back quite some time. I came across several comments stating that they do not hear a significant delay from the time a note is either entered or clicked on. Right now the debate seems to be between what is considered an acceptable delay and what isn't.

I'm curious if there would be a way to have a well-synchronized video with audio of some of those who state they have no delay in their system, seeing and hearing when a note is entered or clicked on so that those of us who do hear a significant delay can compare. It could be a question as to how each individual perceives delays or their tolerance or acceptance of any.

Unless notes are played in real-time in an acoustic environment with no audio reflections, there will always be some delay, as minimal as it may be perceived. And even then, depending on the acoustics of the environment, greater delays might be quite noticeable.

In God's Harmony

In reply to by rawsaxy

I agree. As a software engineer, I'm trying to push this as far into the realm of the empirical as possible.

I urge other people to take measurements and provide their own numbers as well. People simply stating that they don't hear a noticeable or bothersome delay, without quantifying the delay numerically, is not very helpful.

For what it's worth, apparently 60ms is "good enough" for me. In my experience with midi buffers in the past, I would've expected ~30ms to be my cutoff, but I regularly practice piano on garage band and it hasn't been prohibitive.

Do you still have an unanswered question? Please log in first to post your question.