Renoise does not like my Launchpad MK2...

Bought a Novation Launchpad MK2 recently for use with tools eg. Duplex. Installation of the hardware went flawlessly (Windows 7, x64) and Renoise (3.0.1) can see the midi i/o.

In Duplex I can see the overview of the Launchpad, but it looks like the buttons on the LP do not correspond to the ones in Duplex. The top row (with session, user, mixer) seems to be ok, but the rest is all over the place and the tool often crashes when pressing certain pads. Also the button colours are way off.

Next I tried Stepp0r, but got the same issues. Thinking I might have bought a faulty unit, I installed Ableton and from there it works. Maybe the differences between the Mk2 and S/ Pro versions are bigger than expected?

Is there anyone who can confirm this odd behaviour and knows how to make it work correctly?

Forgot to mention: When I select the Launchpad as a ‘master keyboard’ in preferences I can play scales (B0 to F7).

In Duplex I can see the overview of the Launchpad, but it looks like the buttons on the LP do not correspond to the ones in Duplex. The top row (with session, user, mixer) seems to be ok, but the rest is all over the place and the tool often crashes when pressing certain pads. Also the button colours are way off.

Hmm, since MKII support RGB (original only does red and green), it’s definitely not supported by Duplex - the MKII will require a new ‘driver’.

The trick is that Duplex needs to know how to tell the Launchpad how to light up it’s buttons. From that point on, everything should just work.

But probably shouldn’t be too hard if we collaborate a bit back and forth. And Novation is usually good at documenting their products.

… Are you willing to spend a bit of time testing this?

Hmm, since MKII support RGB (original only does red and green), it’s definitely not supported by Duplex - the MKII will require a new ‘driver’.

The trick is that Duplex needs to know how to tell the Launchpad how to light up it’s buttons. From that point on, everything should just work.

But probably shouldn’t be too hard if we collaborate a bit back and forth. And Novation is usually good at documenting their products.

… Are you willing to spend a bit of time testing this?

the mk2 and mk1 launchpads have different Midi layouts. thats why the buttons on the duplex do not correspond to the buttons on the LP.

@danoise: Absolutely no problem to do some testing. :slight_smile:

@danoise: has there been any news on this? I would love to help with testing

No, so far nothing has been done to support the LP MKII.

But if you could manage to describe the device in terms of a control-map file, that would be really useful

(a control-map is a layoutof the messages that the device can send)

For reference, you can check out the control-map for the classicLaunchpad:

https://raw.githubusercontent.com/renoise/xrnx/master/Tools/com.renoise.Duplex.xrnx/Duplex/Controllers/Launchpad/Controlmaps/Launchpad.xml

Having a description of the LPMKII should make Duplex applications able to run on the device, even if the colors are a bit wrong.

Take a copy of the whole /controllers/Launchpad folder to begin and use it as a starting point?

Perhaps getting rid of all device configuration but one - you can use them as starting points but they all need a unique name (as defined inside the file)

More tips on editing Duplex files here:https://forum.renoise.com/t/how-to-start-editing-duplex-files/30979

Later, I could create a basic driver for the controller - to support the RBG LEDs. Next week or so.

When you say “driver” is that just the function Launchpad:output_value inside Launchpad.lua? If so I may see if I can get the colors working properly based on what I know about their RGB values. I looked at the xml files and they seem pretty self explanatory too.

I had actually started writing an entire script for the launchpad last weekend but just realized yesterday that duplex already had all of the functionality I wanted, so I will try and get it working through that framework.

Cool, I’d be happy to assist :slight_smile:

And yes, it’s basically a modified version of Launchpad.lua that is required, along with an updated control-map.

So start by copying the entire Launchpad folder over and you’d have yourself a good starting point.

ok Danoise, maybe you can help me out with this one. Is there a way to change the rslt of function LaunchpadMK2:output_value() to a sysex message instead of a standard midi message? Novation allows individual setting of the RGB values through sysex and I think it would be an easy and more dynamic way of setting the color than trying to parse an 3 number RGB array to a 0-127 decimal.

I think it would be an easy and more dynamic way of setting the color than trying to parse an 3 number RGB array to a 0-127 decimal

I respectfully disagree. the color is already an array, so you’ll end up parsing it somehow, anyway.

But of course, since you are writing that driver you can do it in whichever way possible -

The Launchpad is based on MidiDevice, which in turn is based on the more generic Device class.
Here’s what the documentationhas to say about output_value():

--- Convert values into a something that the display & device can understand. 
--
-- Each type of value (number, boolean or text) is handled by a specific 
-- submethod: @{output_number}, @{output_boolean}, @{output_text}
-- 
-- Numbers are generally used for dials and faders, booleans are 
-- used for objects with an on/off state (buttons), and text is used for 
-- things like labels and segmented displays 
--
-- Depending on the device, you might want to override these submethods with 
-- your own implementation. For example, the Launchpad has its own method for 
-- converting a value into a color. You can also implement your own code for 
-- direct communication with the device by overriding these methods - 
-- in such a case, adding an additional boolean return value ("skip_hardware") 
-- will update the virtual display, but skip the hardware part

So yes, you can send raw sysex using send_sysex_message(), and then “skip hardware” as explained above

Edit. btw: you also want to change the colorspace property, for the Launchpad classic it looks like this

-- this device has a color-space with 4 degrees of red and green
self.colorspace = {4, 4, 0}

Which means, blue is ignored. You probably want to specify {4,4,4} as the new value.

Only once you have set this value can you start modding the device configurations to specify blue colors for the various applications.

Thanks for the detailed explanation. The “skip hardware” but was what I was missing.

I’m going to have to think about this. I wrote a method last night after I posted this that takes in the pt.color array and finds the closest value in a table of hex color values that correspond to the launchpad colors. Then it outputs the decimal corresponding to that color. It works just fine, I guess it just feels clunky. Is there a performance drawback to using sysex instead the 0-127 value?

I’ll post my code tonight, maybe I’ll think of a better way to do it during the day.

So for anyone interested, here is the github for the Launchpad MK2. The only map that is done is the MixerMatrix. I got all of the LEDs and buttons working properly. I will be doing the rest of the maps and fine tuning next week.

@danoise I ended up sticking with the 0-127 values for the colors. I have the sysex code in there, and it works, but the colors just didn’t turn out like I thought they would, they were a little lighter than the colors on the screen. I think the launchpad LEDs driver may interoperate the colors a little different than my monitor. So i’m going to just use the 0-127 method and fine tune it next week. Thanks for the help.

https://github.com/dplduffy/Renoise-Duplex-Launchpad-MK2

Hopefully not too much work to adopt all those controlmaps. This one thing where I thought of coding a visual editor.

In any case, regarding those colors: yes you will never see a complete consistency between onscreen and device colors. Just think of how the minimal brightness for the Launchpad is dark, almost black, on screen but of course, can’t look that way on the actual device :slight_smile:

LEDs often have very different strengths too, for example my Launchpad has quite weak green shades and strong yellows. For this reason, I picked colors that looked good on the device, not the screen :slight_smile:

It shouldn’t be too hard now that I know what I’m doing.

Also, I found a function MidiDevice:extract_midi_note() in the duplex code, but it doesn’t seem to be in the framework documentation. I just wanted to let you know about that.

I made a different implementation ofLaunchpadMK2:output_value()

https://github.com/amoetodi/Renoise-Duplex-Launchpad-MK2

You’d mapped your colorspace to {1,1,1} but there are {64,64,64} available colors. Most of these can only be called through sysex messages, there are colors that can be called via MIDI messages, but Novation just picked 128 colors and put them in a mostly random order to maintain easy compatibility with Live, but mapping RGB to their weird made up colorspace is too much of a pain to be worthwhile.

I was wondering if someone could help me with a less hackish way of implementing the thing I’ve kind of got working inLaunchpadMK2:output() with rainbow_mode using the Keyboard application. Right now, output_value() passes out the expected color, but when rainbow_mode is on and the user presses a button on the LargeGrid I replace it with a color of my own. I’ve mapped the circle of fifths to the colorwheel, so when chords are played in IsomorphicLayout on the Launchpad, consonant chords have similar colors and dissonant chords clash. The way I’ve coded this means the colors are laid out in IsomorphicLayout even when the grid isn’t. I was hoping someone could help me create a more generalised version of the code. I think it’d be quite easy if I could figure out how to get the pitch that is being sent to the sound engine after it has been quantized to the scale, rather that the pitch of the midi message received from the Launchpad. If not, if it were possible to work out through code which layout has been selected, I could write a color picker for each layout, but this seems a bit inelegant and would mean more effort each time a new layout is added. In any case, I prefer the IsomorphicLayout, so I’ve got most of the functionality I wanted now, but if it could be improved that’d be even better.

I made a different implementation ofLaunchpadMK2:output_value()
https://github.com/amoetodi/Renoise-Duplex-Launchpad-MK2

You’d mapped your colorspace to {1,1,1} but there are {64,64,64} available colors. Most of these can only be called through sysex messages, there are colors that can be called via MIDI messages, but Novation just picked 128 colors and put them in a mostly random order to maintain easy compatibility with Live, but mapping RGB to their weird made up colorspace is too much of a pain to be worthwhile.

I like your → magic number dance :slight_smile:
A shame if the full range of colors is not in formatted in a sensible way… then I better understand dplduffy’s approach.

when rainbow_mode is on and the user presses a button on the LargeGrid I replace it with a color of my own. I’ve mapped the circle of fifths to the colorwheel, so when chords are played in IsomorphicLayout on the Launchpad, consonant chords have similar colors and dissonant chords clash

Wow, really? I’m happy to see such a great improvement in the keyboard. I think I can help, too:

I think it’d be quite easy if I could figure out how to get the pitch that is being sent to the sound engine after it has been quantized to the scale, rather that the pitch of the midi message received from the Launchpad.

My xLib project has a class called xScale

-- restrict a note to a specific scale and key
function xScale.restrict_to_scale(note_value,scale_idx_or_name,scale_key)

Simply require the class in your tool and you should be good to go (it does not have any dependencies)…

I got it to work, now rainbow_mode works in every layout. I ended up casting the button text as a number and working out the color from there. I also added three different color palettes, a bright one and two more pastel shaded ones. I’ll probably tweak it a bit more, but for now I’m quite happy with it. I’ve updated the code on github for anyone who wants to try it, I’ll make a video at some point today to show the colors.

Well, that was quite a surprise noticing you guys got this thing to work. Great job!

Although I am not familiar with LUA scripting, I just downloaded the files from Github and added them to the Duplex Controllers folder. The MK2 shows up in the browser, but I get an error that class LaunchpadMK2 is ‘unknown’ (although it is there in the ‘root’ folder of the device). Most likely I forgot something, but I have absolutely no idea what it can be. Both Renoise and Duplex are updated to the latest version (Renoise 3.1 and Duplex v1).

Got it working now. My mistake was a wrong name for the folder (named it Launchpad-MK2 instead of LaunchpadMK2). :mellow:

Once again, thanks guys for getting this thing to work!

I just picked one of these up used and cheap. I’m noticing only the first Matrix+Nav+transport works. Did the other mappings get finished or should I dive in?