New feature to test: MIDI out

• May 29, 2017 - 09:52

MuseScore 2.1 and previous versions can send MIDI messages to external devices or synthesizers using JACK. Jack offers many great professional features, but unfortunately it’s hard to install on Windows and macOS, as it’s primarily a Linux software.

For many years, we didn’t want MuseScore to have an easier way to send MIDI events to the outside world, for two main reasons.

  1. MuseScore is first and foremost a music notation software. Its purpose is to easily create beautiful sheet music. Playback is nice, but the core team wants to focus on the notation.
  2. We were (and still are) worried that if we offer minimal support for MIDI out, we would get many feature requests to improve it, sometimes in ways that are not possible, or that we prefer to not spend our time on, or that would make MuseScore complex to use for users who don’t care about MIDI.

Eric Fontaine was not happy with this state of affairs and really wanted to make MuseScore usable on a low end device where the internal synth takes a lot of CPU cycles and MIDI out would be more performant. So he checked the various available libraries (RtMidi, PortMidi etc…) and decided to use PortMidi, which MuseScore already uses for MIDI in. After > 100 comments and some code, we now have MIDI out in master! You can test with a nightly build.

How to enable MIDI out

MIDI out is not enabled by default. You need to go to Preferences / I/O and choose an option for MIDI output. If you use an external device, it’s probably the name of your device. If you use a software synth, you might need virtual MIDI cables. Note that MuseScore will send MIDI events out to the selected device but it will also send the events to its own built-in synthesizer. If you don’t want to hear the built-in synth, you will need to either lower the volume, or remove the SoundFont in View / Synthesizer.

2017-05-29 10_25_25-MuseScore Preferences.png

Note about output buffer latency: if this is set to 0, then messages are sent as soon as possible after MuseScore sends them to PortMidi, and might sound before the playback cursor. You can set this greater than 0 to try to find a value that will cause the notes to sound at the same time of the playback cursor.

What you can do currently with this feature?

  • Play a simple score through an external MIDI device (keyboard, synthesizer, etc…)
  • Play a simple score through a virtual instrument in standalone mode

What you can’t do with this feature?

  • Play an overly complex score out of the box. MuseScore is not a sequencer and its basic MIDI support is limited to the default 16 channels (also, no automation, no custom sysex etc…)
  • Send a MIDI song position event
  • Send a MIDI clock signal
  • Synchronize different MIDI devices or software together

This feature might evolve depending on your feedback. However, we will make sure that we do not overload the software with dozens of options dedicated to MIDI out specifically.


Comments

Hi,

that's a great news. But... I don't see these parameters in the latest nightly builds (MuseScoreNightly-2017-05-29-1951-2.2-3bfcab8.7z on Windows 10 64 bits).
A friend of mine have it working fine on Mac....
Is there a problème on windows ?

I have a question: does this mean that MuseScore will be able to drive some VST plugin, maybe via some sort of vst host like this one? My idea is NOT to make MuseScore a dedicated sequencer (there are so many and so good around already), rather, provide some higher quality audio feedback while writing sheet music.

In reply to by Aldo

Yes ! I tried it with Addictive Keys and The Galaxy II pianos on a Kontakt Player. Works fine. Just had to install LoopBe1 as a virtual midi cable (on windows).
I also used it to send midi datas from MuseScore to a vsti loaded in REAPER and Cubase 8 Le.
Works fine too !!!!!

Tested some scores out on Windows 10, using loopMIDI virtual cable with the Pianoteq and ARIA plugins loaded in REAPER - it works really well! Just have to make sure that when MuseScore is started, no MIDI-input tracks are armed for recording, or else it will fail to connect to them.

About the output latency - when set to zero, the MIDI is indeed heard before the MuseScore synth, but still in sync with the cursor. Because of this, I think it is the synth that is late, not the MIDI that is early.

Anonymous
Jun 10, 2017 - 20:19

Untitled.jpg Darn. I set everything up to send midi out to an editor but I keep getting this error "qt core" cannot be found. Attached screen shot. Tried reloading. There are some longer duration notes (half notes) that sustain and then drop suddenly. I want to attempt to smooth out the release, decay times by adjusting in steps the envelope generator.

Anonymous
Jun 11, 2017 - 15:54

In reply to by jeetee

Here is the bin unzipped with nightly.exe double clicked

The error message can't find platform "windows in" is attached. But it is in the platform folder

thanks for all the help. Its time for a new computer. The operating system is not supported and its not even a genuine copy. (whatever that means)

I tried out some software synths with an exported MIDI file. They sounded pretty awful. But the possibility of 16 individual channel assignments is appealing

Attachment Size
Untitled 2.jpg 127.28 KB

In reply to by Anonymous

Any reason you're using a nightly from May 29th rather than the latest from June 8th? Please give that a try, it does start cleanly here for me (Windows 7).
Are you by chance still on Vista, like Shoichi?
Also your latest screenshot S
shows that there are Windows updates panding and that Microsoft Defender has some alerts.

Just wanted you to know that I tried out the first June 12 master nightly build with a yamaha P-115 connected to a Windows 10 laptop through USB and it all worked beautifully. I'm keeping my fingers crossed that at least this basic MIDI output support stays in as I have been unable to find anything else for Windows that can decently do score editing and supports MIDI output and is freeware. Plus, I just bought the MuseScore book.

In reply to by bcbarnes

Hi, I too have a Yamaha P-115 and can't get my Windows 10 laptop to play out to the keyboard. Could you show a screenshot or document how you got it working? I am using the current 2.2 nightly build. I can see that the output audio setting is set to the Yamaha, but no sound comes out.

Is there any setting I need to change on the Yamaha to accept midi-in from the laptop?

In reply to by chtshop

I'm not the person you are replying to, so I can't help you specifically. My first question is have you verified with another program that you are indeed able to send midi from your windows computer to your keyboard? If not you might need a driver (http://www.yamahaproaudio.com/global/en/downloads/firmware_software/mid…). And my second question would be have you tried changing your keyboard's MIDI receive channel (see page 2 "Setting the Receive Channel" of https://tw.yamaha.com/files/download/other_assets/0/333280/p115_en_mr_a…)?

Anonymous
Jul 28, 2017 - 07:41

I am curious as to why the drumset checked instruments get different ports but the same channel.
(mostly so-called unpitched percussion) All non-drumset instruments get the same port but different channels.

(BTW; if need be, right click on nightly.exe and choose a correct compatibility setting. I had to do this to get Windows 7 to open MS 3.0 on an older machine. I don;t know if it will work with Vista.
In both cases I got the error message "qt 5 core cannot be found" until I did this)

In reply to by Anonymous

In case you aren't aware, the General MIDI standard reserves channel 10 for drum set, so any standards-compliant synth will be expecting that. I assume that's why it is done this way. But I'm not an expert i this area, maybe you are aware of that standard but also have additional information about alternate ways this could have been implemented and are wondering why one of those alternate solutions wasn't chosen?

Anonymous
Jul 28, 2017 - 17:33

In reply to by Marc Sabatella

Thanks. Well I guess my question would then be about the standard itself. Maybe it is related to the availability of 16 channels when the standard was adopted? The drums would use up too many channels. The number of ports creates a practical issue. For a smaller score, you can change the port to the same number as the instruments (usually #1). This will call up a box that asks you to "reassign to next available channel." You might squeeze the drums in. Or, you can switch cables ( in my case from loopbe1 to loopbe30 and keep the drums on separate ports (#2.3.4 etc.) preserving channels on port #1.

In order to test this feature a little bit faster, and maybe release it a bit faster too, I just merged it in the 2.2 branch. Next development version on this branch will then have MIDI out support. Please report any issue !

In reply to by [DELETED] 5

Happy new year! I've been testing out this new feature tonight in the nightly 2.2 builds and it seems to be working very well.

With this new addition, the obvious problem is that there's no simple way to disable audio output to Musescore's soundfont engine. Would it be possible to allow us the ability to completely disable the audio output device in Musescore so that only MIDI out is used?

What with should I connect Jack to actually get VSTi sound on Windows? Or, alternatively, what do I need to get anything in 'MIDI output' dropdown menu? Most simple suggestion?

My Experience ...

MIDI via Core Audio is working well since being included in V 2.2 nightly builds.

Testing here is on very low end Mac Mini using MainStage 3.2 (with no more than 3 stave's active in the score communication) Plays flawlessly which is a huge improvement.

Previous Versions including master (3) nightly have been unusable by comparison.

Occasionally miss a note being played by the "midi device" (mainstage3) when creating an arrangement however that is because of "CPU hogging" the app is generating the MIDI sequences correctly MainStage is dropping them...

Otherwise I have not been able to make it crash so it is much more stable than 2.1 so far.

Thanks for the effort.

In reply to by Ron Southworth

Nice to hear you are testing on a low end machine. One of my motivations for getting musescore midi output working was to make musescore more usuable on lower-end machines where musescore's internal synth was too slow.

I believe if you increase MainStage's driver latency with a larger buffer, that will help allow MainStage to avoid dropping notes (but at the drawback of having all notes be delayed by a constant amount): https://support.apple.com/en-us/HT202982

There also may be ways you can make MainStage use less CPU. I would first lower the sample rate (can probably get by with ~22kHz at the cost of not having all the highest human-perceptable frequencies). Also try searching online for "MainStage lower cpu usage".

In reply to by ericfontainejazz

Thanks for the suggestions re MainStage...

Appreciate your advise on reducing the sample rates et al.

MIDI to VST he he Well, It is a whole separate tin of worms
The MainStage audio driver is running at 192/24 ....
My DAW is Cubase Elements 9.5

Both have a lot of challenges with CPU performance and optimisation when using a low end machine however since the work on the MIDI output code I have something here in my home studio that is very useable that enables me to have noise and error free arrangement reproductions.

Keep up all the excellent work on the product something the team can be proud of !

Hello,

I successfully connected MuseScore with my VSTi. However, when I play my music, some kind of echoes come along the sounds. I mean, it sounds okay when I disconnect my VSTi from Musescore and play music with a built-in instrument, but each note makes its echoes when I play music through my VSTi.

Any solutions in this situation?
I'm using Cantabile 2.0 to connect Musescore and my VSTi, The Grand 2.
I'm Korean, so my English is not very good. If my question is confusing, I'll add more explanations. Thanks!

I just used this feature to play a simple score (just piano) and it worked great! Then, I tried an extremely complex score (piano with 4 voices, complete orchestra, guitar with 2 voices) and the only issue was that some notes were a fraction of a second off, but it truly works great. This feature works great and has almost no bugs to be heard of. Thanks and good luck on improvements!

Been testing this and it works great, except I really wished it would send the note off command if you pause in the middle of a song. Its great if you want to just have a MIDI device play the music for you!

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