Using MuseScore as a standard notation interface to Ableton Live

• Jul 30, 2016 - 22:59

What follows is a summary of what I’ve learned about using Ableton Live as a VST host for MuseScore. I can’t call it a “how to” because I’m using Windows 7 sp2 still, and I don’t know whether this will work for Windows 10. My hope is that it will be at least of some help for those running the latest OS. I am also still using Live 8 with 32 bit plugins. I don’t know that makes a difference.

Please reply with issues you find. I’ll update this to reflect your inputs. It would also be nice to relate your experiences with other DAWs if you can get this to work with them, too.

I’ve used sequencers from the very early days of the MIDI revolution – anyone remember Opcode Vision?– and have watched them go from something akin to a player piano to the self-enclosed recording studios they are today. The progression in functionality has been stunning. However, one thing that some of the early sequencers had that have now gone mostly by the wayside is the ability to enter notes via standard notation. The piano roll style window that is now standard today takes up way too much room to see more than a couple tracks at a time. For those of us who can’t hear everything in a piece of music before committing it to a sequencer’s tracks, it’s a real challenge to see what’s going on in other tracks at the same time. Standard notation allows this because it takes up so much less space on the screen. It’s a great pity so many musicians find standard notation so difficult to understand.

MuseScore is as good a scoring program as I’ve come across, but I don’t feel that Soundfonts are any replacement for my VSTs, so I set out to see if I can get Musescore to send MIDI to Live. This took quite a bit of trial and error, and caused almost as much frustration as I can bear. However, I have gotten it to work, and because MuseScore is an open source project, I owe it to the community to lay out my solution.

Definitions

First, let’s go through some quick definitions of terms.

ASIO: Audio Stream Input/Output is a computer sound card driver protocol for digital audio specified by Steinberg, providing a low-latency and high fidelity interface between a software application and a computer's sound card. ASIO bypasses the normal audio path from a user application through layers of intermediary Windows operating system software so that an application connects directly to the sound card hardware. (Wikipedia)

Virtual MIDI Driver: An internal MIDI device for transferring MIDI data between computer programs. Basically it is an "invisible cable" to connect a MIDI outport of an application to any other application´s MIDI in port. (LoopBe1’s page).

Audio Bus: This software provides for audio what a virtual MIDI driver does for MIDI: it’s basic infrastructure for audio applications to communicate with each other and with audio hardware. (JACK’s page)

The Tools

LoopBe1:

I use LoopBe1 as my Virtual Midi Driver. If you don’t have a Virtual Midi driver installed, download it and install it (http://www.nerds.de/en/loopbe1.html). It doesn’t require configuration, and has completely transparent operation. It simply presents MIDI in and out ports behind scenes that any MIDI application can use. You send MIDI to one of the in ports, and it sends it out all of the out ports. It detects and mutes itself in the event of a feedback loop.

JACK Audio Connection Kit:

JACK is an audio bus API (application programming interface) which allows audio from one JACK compatible application to be redirected to another. For those of you who are not familiar with the term, an API is a series of functions (or methods) that a programmer can call in code to execute functionality. An API does not have a front end (a GUI), so it’s invisible to users. However, other programmers can provide user interfaces that support the functions of the API. These programmers don’t usually communicate with each other, so it’s possible that you’ll find more than one application does the same thing, resulting in confusing overlap in functionality between interfaces. This is the case with JACK.

JACK was originally written for use in LINUX and has since been ported to Windows. Since JACK was written in C++ (as most audio programs are) , and since C++ doesn’t have a virtual machine like Java (the Java virtual machine automatically translates Java commands to commands native to the platform on which it is running), the JACK code had to be partially rewritten because Windows and LINUX do things differently. Porting code between platforms is always problematic, and this is evident in the port of JACK to Windows. To put in developer’s terms, JACK for Windows doesn’t play nicely in the sandbox. However, it does work.

JACK provides a virtual MIDI bus between applications that use the JACK API as well. MuseScore uses the JACK API; Live doesn’t. The good news is that there are JACK interfaces that can bridge the two worlds.

JACK also provides an ASIO driver -- something the community should make clearer in its documentation!

The JACK for Windows page has a list of steps necessary to install JACK on Windows, but I found that for our purposes, it’s not quite right. So, I’m providing an edited version of that below. You can find the original here (http://www.jackaudio.org/faq/jack_on_windows.html).

1. Download the Jack Audio Connection installer for Windows from the download page.

2. Use the installer (either the 32 bit or the mixed 64/32 bit one).

3. From the Windows Start menu, locate the Jack folder and right click on Jack PortAudio icon, then select ‘Send to Desktop’ (this will place a shortcut on your desktop).

4. Now go to your desktop and right click on the Jack PortAudio shortcut, and then select ‘Properties’ (use right click to open ‘Properties’)

5. Add the following information to the ‘Target’ property:
"C:\Program Files\Jack\jackd.exe" -R -S -d portaudio jackd -S -X winmme -d portaudio" [Do NOT specify ASIO4ALL as the original instructions specify. JACK has its own ASIO driver now, and if you’re running ASIO4ALL at the same time, you’ll get all sorts of problems.]

6. Click on OK.

7. Again, from the Windows Start menu, locate the Jack folder and right click on the Jack Control icon, then select ‘Send to Desktop’ (placing a Jack Control shortcut on your desktop). [This isn’t absolutely necessary for our purposes. JACK Control is one of the JACK interfaces to which I referred above. It works fine, but it’s not necessary unless you wish to use its transport buttons via JACK transport. Double clicking on the Jack PortAudio icon starts the JACK engine.]

KXStudio Carla:

The JACK interface we’ll be using is KXStudio’s Carla. Download it from http://kxstudio.linuxaudio.org/Applications:Carla and install it. Carla is a JACK compatible audio plugin host (it works with more than just VSTs). [Note: I can’t get the version 2 of this software to load any of my 32 bit VSTs, but others have. No matter, we’re not using it as a plugin host anyway.]

Operation

Ok, for this first attempt, you might want to reboot your machine. At the very least, ensure that Live and Musescore are not running. If you do reboot, always wait for the OS to come all the way up before you start Jack PortAudio. That includes all the services. JACK PortAudio is a very finicky program.

Double click on the Jack PortAudio shortcut that you just put on your desktop. This will open a command prompt and then puke all sorts of debug messages to its screen. I can’t tell you exactly what you’re going to see, but it should contain two lines:

1. Jack Server starting in realtime mode with priority 10
2. JackWinMMEDriver::Start – Driver started.

The first indicates that the JACK audio bus is running; the second, that it has connect to the Windows multimedia driver for MIDI. LoopBe1 also connects to this (which implements the bridge we need).

Start Live. Go to the audio tab on the Preferences dialog and if you’re using ASIO4ALL, change the driver to ‘No Device’.

Now, start Carla.exe. Since you can install the package anywhere, you’re going to have to find it yourself. Carla starts both a command prompt and opens a window. In that window, click on the Patchbay tab right under the Open icon in the top toolbar. What you looking at is Canvas, a programmer’s tool for showing audio and midi connections between JACK compatible applications. It seems to be quite popular with developers. Many JACK interfaces use it.

Go back to the audio tab on the Live Preferences dialog and select JackRouter as the audio device.

Return to the Carla screen. Search around the canvas for the Live icon and the two system icons. They will all have blue on them. Any icons with red on them are MIDI devices. You want to connect capture_1 and capture_2 to Live’s in1 and in2, and then Live’s out1 and out2 to system playback_1 and playback_2. The playback ports connect to JACK ASIO driver. By doing this, Live will output audio to JACK, MuseScore or not. If you right click on the system icon and choose split, you will create two icons, one for inputs and one for outputs. Visually speaking that may be easier to understand. It makes no functional difference.

Now, start MuseScore. Go to Edit->Preferences… and click on the I/O tab. Click the JACK audio server checkbox, uncheck Use JACK Audio, and check Use JACK MIDI. It you wish to control MuseScore playback outside of the application itself, check Use JACK Transport. [This will allow you to start and stop playback using the Transport menu in Carla or Jack Control’s transport buttons.]

Bounce (stop and start) MuseScore.

Return to Carla. Look for an icon called mscore with red ports. Also find the system_midi icon (also with red ports). You may be tempted to connect the mscore-midi-1 outputs to the system_midi imports, but this will not work. There’s a bug in MuseScore that is causing it to violate the MIDI specification ever so slightly (though I don’t know exactly how). My experience is that Native Instruments’ plugins will ignore the issue, but most others will lock up the system, including Live. Here’s the workaround: click the Add New Plugin icon in Carla and add the Midi Through plugin by FalkTX. That plugin can read MuseScore output and write proper MIDI to its output. Connect mscore-midi-1 to events-in on the MIDI Through icon, and events-out on the same icon to playback_2 on the system_midi icon. Why not playback_1? I haven’t a clue. It just doesn’t work for me. This provides the connection to LoopBe1.

Now, return to Ableton’s preferences page and click the Midi Sync tab. Find the Input: LoopBe Internal MIDI line and click the box in the Track column. Take care not to enable the track on the output line or you’ll get a MIDI feedback loop, which will cause LoopBe1 to mute itself. Once that’s done, you’re good to go. Assign midi channels to tracks as you normally would. If you want to go through the hassle, you can map the volume and pan continuous controllers to the individual tracks so that you can use MuseScore’s mixer. However, I find it just as easy as alt-tabbing to Live and adjusting Pan and Volume there.

Operational Notes

• Don’t stop the JACK audio engine (either with Carla or by killing the Jack PortAudio command prompt) without either stopping Live first, or going to the preferences page and selecting No Device on the audio tab. If you forget to do this, Live will hang in such a state that you’ll have to kill it using the task manager and then reboot the machine.

• The JACK engine doesn’t handle hibernation well at all. If you’re working on a laptop and put it into hibernation to save battery, you’ll probably end up having to reboot the laptop anyway when you bring it back up.

• MuseScore can get into a state where it can’t connect to the JACK engine. Setting the I/O back to Port Audio, bouncing it, setting the I/O to JACK port audio, and bouncing again sometimes resets the connection, but it’s usually only for a while. Reboot the machine and try again.

• If you’re using ASIO4ALL in Live and forget to select JackRouter before starting Jack PortAudio, the JACK ASIO driver will attempt to bind to the same sockets the ASIO4ALL is using. You can try going to Live preferences and switching it to JackRouter after the fact, and it usually works, but my experience is that you’ll likely be rebooting in the near future.

• MuseScore 2.0 assigns Midi channels to staves as they appear in the score from top to bottom with the exception of a drum staff which is hardcoded to channel 10. Unfortunately, you can only use channels 1 through 9 for the other staves. So, if you’re like me, you’ll lay out your arrangement using generic sounds and wait for the complex sound design until you import a MIDI dump from MuseScore into Live, or if you’re like me, play the parts into Live.

• MuseScore doesn’t send MIDI clock, so Live won’t sync to MuseScore playback. It seems to me that this might be possible if one were to load a VST like Reaktor into Carla, and using that as the transport mechanism. I haven’t tried it, yet. If that did work, though, you could use MIDI tracks in Live to control your VSTs during playback.

• Every so often you’ll boot everything up and hear nothing from Live. This can be the result of any number of things, but it’s often that JACK glitched in a way that triggered LoopBe1’s feedback loop detector, which cause LoopBe1 to mute itself. The important thing to note is that rebooting doesn’t necessarily unmute LoopBe1. So, the first thing to check is LoopBe1’s system tray icon. Otherwise you’ll be bouncing the other applications unnecessarily.

Conclusion

It’s important to have the right spirit when using this setup. The JACK port to Windows is sketchy at best, and you’ll find yourself rebooting your machine more often than you would ever imagine. Also, MuseScore is a scoring program, not a sequencer, so keep you expectations in line. You’ll almost certainly want to abandon this setup at some point during your project and work exclusively within Live from that point forward. You will at least have the arrangement of the piece put together by then, which for me is a big plus.

Please let me know when you find mistakes in this document. I’ll do my best to update it.

Now, go make music!

Andy


Comments

In reply to by Igor Abdo Aguilar

Ah, yes, nothing like having something that works for everyone automatically not work for you. It's a really a special feeling, isn't it?

First off, you need to select 'ASIO' from the Driver Type drop down. I suspect that you've tried that, and it's not offered in the list. So, what I would suggest is to test if there's something funky going on with your OS by downloading and installing ASIO4ALL (www.asio4all.com), even though you won't be using it with JACK. The reason is that it's much better supported, and the website has a bunch of trouble shooting steps for you if you can't get it to work. I also strongly recommend you use it regardless (when not trying to use MuseScore as described above naturally) because the latency is soooooo much better that with MME/DirectX.

Now if you do get that to work (if ASIO shows up in the device drop down), you most likely skipped a step or fat fingered something in the JACK configuration. One hint is whether the line in the JACK startup output that I described above as meaning the audio connection has started is present.

All I can say is that I really do sympathize and urge you to persevere. I can't tell you how long it took me to get this to work.

Musescore 2.1 does support midi out. If you're up to building that version yourself, that's also a possibility -- but I still recommend ASIO4ALL.

Best of luck!

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