Santa got me a Novation Launchkey 61 MK3 this year. I learned playing piano as a kid on a Yamaha PSR-340 and have been wanting to get back into music for a while now. These days, good low-priced MIDI keyboards and great-sounding virtual instruments are available for low prices, so the up-front investment is much smaller than back then.
I wanted a MIDI keyboard with a display and a couple of buttons and faders so I could select and control virtual pianos, synths, and organs on my computer. I also wanted integration of the controls with Apple Logic Pro. Some older MIDI devices used binary plugins for this purpose (which get installed into /Library/Application Support/MIDI Device Plug-ins), but with Apple recently having switched from Intel to its own custom Arm processors and many manufacturers not providing updates in a timely manner, the better way going forward is using Lua scripts.
Browsing through the Thomann store, I found that my criteria are met by the Akai MPK 261, Nektar Panorama P6, Novation Launchkey 61 MK3, and Roland A-800 Pro. (The Nektar Panorama T6 might also be okay once the manufacturer delivers the update promised. Same might go for the Novation SL MKIII if it gets an update.) The Nektar Panorama P series only has a binary plugin for Logic Pro, but a Lua script for MainStage. The Novation MK3 has a downloadable Lua script for Logic. The Roland A-PRO series and Akai MPK series are apparently supported out of the box through Lua scripts. Finally, there is the Studiologic Mixface SL, which is a controller with faders, knobs and buttons that magnetically attached to the Studiologic SL series of MIDI keyboards and which has a Lua script for Logic. There is also the Roland Fantom 6, a high-end synthesizer, that has a binary plugin for Logic and a Lua script for MainStage.
When you are not recording, but just playing virtual instruments, a DAW like Logic Pro is overkill. That’s what Apple MainStage is for — it hosts Audio Units (virtual instruments and effects), but unlike a DAW it has no concept of recording or timeline. After seeing Roland’s and Nektar’s documentation on their support of MainStage (they display all the on-screen controls on the keyboard display and allow you to interact with them via the knobs, buttons and faders), I wanted to see how much I could do with the Launchkey. It has special MIDI messages for all kinds of things and should thus be able to do most of the same. The Lua scripts that configure MIDI devices are installed into ~/Music/Audio Music Apps/MIDI Device Scripts (for Logic) and ~/Music/Audio Music Apps/MainStage Devices (for MainStage). The Lua API is not documented publicly, but can easily be deduced by poking through Apple’s own scripts, which are in /Applications/MainStage 3.app/Contents/Frameworks/MACore.framework/Versions/A/Resources/MIDI Device Scripts. The basic API is identical between MainStage and Logic, but Logic uses a different parameter feedback mechanism and supports multiple layers (or “modes”), both of which are not used by any of Apple’s scripts.
I am happy to report that I managed to create a complete MainStage integration for the Launchkey that pretty much matches what Roland (Fantom) and Nektar managed to do. Of course, due to lack of a graphical display, it’s not as nice, but it only costs half as much as the Nektar and a tenth of the Roland Fantom. Automatic mapping of knobs, faders, buttons, and drum pads works perfectly. The LEDs of the buttons mirror the state of the UI. The display shows parameter feedback (name and value) when you move a knob or fader. This goes beyond what the Roland A-800 or Akai MPK261 do, which have a similar price as the Launchkey, but cannot display parameter information.
Note that MainStage’s automatic mapping of controls has a few bugs. My device script cannot work around these, but you can manually re-map these controls if you need them:
- The Keyboard quick-start project does not map Smart Drawbars to MIDI faders. The Tonewheel organ project template does however. You can manually map the Smart Drawbar controls though.
- Smart Faders are not mapped to MIDI faders. You can manually map the Smart Fader controls.
- Instruments that have Smart Controls spread across multiple pages only have their first page’s controls mapped. You can manually map the Tab 2 Smart Knobs though.
- Drumpads on the keyboard trigger notes in the C6-B7 range and are mapped to MainStage’s Drum Pad controls. However, the virtual instruments expect notes in the C1-B2 range. You can manually change the trigger notes on all 24 drum channels.
Check out https://github.com/mkuron/launchkey-mk3-mainstage if you want to use your own Launchkey MK3 with MainStage. The versions for the smaller (25-key, 37-key, 49-key) models are untested, but should work just as well.
Update February 2022: The Novation SL MKIII got its promised Logic Pro integration. MainStage integration could be done in a similar way as I did for the Launchkey MK3. The Novation SL MKIII seems quite comparable to the Nektar Panorama P6, but a bit more modern.
Update March 2022: I uploaded a video to YouTube and tweeted about this, hoping to get it out to more people. Novation even liked my tweet:
Update April 2022: Downloadable installer packages (.pkg files) are now available for release versions at https://github.com/mkuron/launchkey-mk3-mainstage/releases. You will need to right-click to install the package as it is not signed.
Update September 2022: The Novation SL61 MK3 is not currently supported as it has a completely different MIDI protocol is different from the Launchkey MK3. I would gladly add support for it, but don’t own this keyboard, so unless someone ships me one, it won’t happen. The SL61 would be perfect for MainStage with its little displays etc.
Super interesting as I just got a Launchkey 49 and want to use it with MainStage.
I copied the text and pasted into a file in BBEdit and named it config.lua. I had to make a MainStage Devices folder in ~/Music/Audio Music Apps and for the config.lua
But I see no response in MainStage reflecting the config.lua
Am I missing something?
Sorry, I’m knowledgeable but not a programmer, and this feels a tad out of my depth.
You need the same directory structure as in the Git repository — i.e. MainStage Devices/Focusrite – Novation/Launchkey MK3 49.device/config.lua. Alternatively, use the installer package referenced in my latest update to the blog post.
Hey there- I’m thinking about trying this with the MK2 version, assuming that the HUI commands didn’t change with the hardware upgrade (except the new features of course) . Do you know more?
Novation provides documentation for the MK2 MIDI implementation at https://fael-downloads-prod.focusrite.com/customer/prod/s3fs-public/novation/downloads/10535/launchkey-mk2-programmers-reference-guide.pdf. I am not using HUI, I don’t think the MK3 supports it. The InControl mode described in the MK2 document appears conceptually similar to the MK3’s DAW mode — even the initialization sequence is identical. However, the CCs and note numbers are different, so you will need to make quite some modifications. You can delete all the sysex handling from the file though since the MK2 does not have an alphanumeric display.
Hi! Great work!
I`m playing around with creating some scripts for some midi controllers. Do you know if it`s possible to print something to the console? Would be great for debugging purposes. Print() doesn`t seem to do anything.
Also, I’m wondering what the “string.crunch” function does. I assume it’s translating ASCII to midi/sysex?
print(...)does work internally for Apple (some of their scripts have contain commented-out print calls), but I never figured out how to get that working, I would have liked it myself. When you enable debug mode (see my GitHub), it will at least tell you about syntax errors etc. on the console.
string.crunch(..., 16)removes/replaces all non-ASCII characters to make them sysex compatible. It also trims the string to the specified number of characters, but it does so intelligently — for example, ‘Piano’ might be replaced with ‘Pno’ or spaces might be removed to squeeze as much information into those characters.
Ah, I see. That makes it kinda smooth to send strings over sysex! Very useful.
I might just make a “faux” print function and send messages over midi to MAX/MSP or PureData and use that as a kind of console for debugging.
I got the console logging lua and syntax errors. So that’s good.
On a sidenote:
I’m also toying with the idea of trying to reverse engineer the MDSN handshake between the Logic Remote iOS app, to try and get MainStage sending OSC messages elsewhere. Would be cool to be able to control and get feedback in a custom TouchOSC layout!
That is amazing! Is there any way to support you for implementing such a solution for the Novation SL61 MKIII? I would love to get this running but this seems to be beyond my capabilities.
If someone wants to buy me a Novation SL61 MK3, I would gladly implement MainStage support for it. The MIDI protocol is different from the Launchkey MK3, so this is going to be a completely new implementation, but I learned enough about Novation MIDI and MainStage doing it the first time that I think I can do it again.