Cubase DAW integration crashes the Keylab Essential Mk3

Hi everyone,

I just got my new Keylab Essential 49 Mk3. Everything is working fine so far except the DAW integration into Cubase using the MIDI Remote script.

As soon as I move a fader on the Keylab, the unit seems to freeze. I can still move the faders - and Cubase gets the values changes. And I can play MIDI notes, too. But all buttons do not work anymore, the display does not change content anymore, and event the Arturia MIDI Control Center claims that the unit is disconnected.

The only way to fix this is to dis- and reconnect the unit. As I said: This only happens if I move in fader inside Cubase.

I have installed firmware 1.0.17, and I have tested this with both Cubase MIDI remote scripts currently available from Arturia.

Some help would be great!

Best regards,
Stephan

I have debugged the script in the Cubase MIDI remote manager … and I found the culprit: It is the german translation my Cubase installation is running in.

When I move a fader the script wants to display the parameter name on the Keylab screen … and in German, volume translates to “Lautstärke”. The “ä” cannot be handled by the Keylab correctly … and it freezes.

By the way: This problem affects the complete control mapping: As soon as a German “umlaut” is used in a label, the Keylab freezes, i.e. if a track name has an umlaut.

@Arturia: Can this be reported as a bug?

Thanks,
Stephan

1 Like

Hi, yes this can be considered as bug, since the cc values should be limited to the range [0,127] while some unicode characters are greater.

Till this is fixed by Arturia, and if you’re filling comfortable with editing such files, you can open the file KeyLab_Essential_mk3_Screen.js which is in the script’s folder, and find this code segment:

function _get_line_bytes(str, length){

    console.log(str.toString())
    var line_bytes = []

    if (str.length > length) {
        for (var i=0; i < length-4; i++){
            line_bytes = line_bytes.concat(str.charCodeAt(i))
        }
        line_bytes = line_bytes.concat([46, 46, 46])
    }
    else {
        for (var i=0; i < str.length; i++){
            line_bytes = line_bytes.concat(str.charCodeAt(i))
        }
    }

    return line_bytes
}

I’ve made some additions, you will see that I’ve remarked them as (added) and two changes, remarked as (changed).

Here’s the altered code segment:

function _get_line_bytes(str, length){

    console.log(str.toString())
    var line_bytes = []

    if (str.length > length) {
        for (var i=0; i < length-4; i++){
            var charCode=str.charCodeAt(i)//added
            if(charCode>127){charCode=32}//added
            line_bytes = line_bytes.concat(charCode)//changed
        }
        line_bytes = line_bytes.concat([46, 46, 46])
    }
    else {
        for (var i=0; i < str.length; i++){
            var charCode=str.charCodeAt(i)//added
            if(charCode>127){charCode=32}//added
            line_bytes = line_bytes.concat(charCode)//changed
        }
    }

    return line_bytes
}

This will replace any non standard character (i.e. above the 127 limit) to a “space”.

You may want to give this a try and please backup the previous version of the file, in case things don’t work as expected.

Hi @m.c ,

I have already implemented an interim fix in the control script … exactly at the place you mentioned above.

But I implemented a little helper function that replaces the German umlaut characters to their “non-umlaut” counterparts via regexp. For example, “Lautstärke” is changed to “Lautstaerke”.

That has fixed the problem for now until a fix is published by Arturia.

Below is my interim implementation … it does not win a beauty contest but it works for now:

function translateUmlautCharacters(source) {
    var label = source
    label = label.replace(/ä/g, 'ae')
    label = label.replace(/ö/g, 'oe')
    label = label.replace(/ĂĽ/g, 'ue')
    label = label.replace(/Ă„/g, 'Ae')
    label = label.replace(/Ă–/g, 'Oe')
    label = label.replace(/Ăś/g, 'Ue')
    label = label.replace(/Ăź/g, 'ss')
    return label
}
function _get_line_bytes(str, length){
    var translatedString = translateUmlautCharacters(str.toString())
    console.log(translatedString)
    var line_bytes = []

    if (translatedString.length > length) {
        for (var i=0; i < length-4; i++){
            line_bytes = line_bytes.concat(translatedString.charCodeAt(i))
        }
        line_bytes = line_bytes.concat([46, 46, 46])
    }
    else {
        for (var i=0; i < translatedString.length; i++){
            line_bytes = line_bytes.concat(translatedString.charCodeAt(i))
        }
    }

    return line_bytes
}

In Live btw. all German umlaut characters are displayed as question marks in the screen.

Best regards,
Stephan

1 Like

Cool! I suggest that you add the >127 check just in case there are characters not covered by the translation function (happens to other languages).

That’s because the script there properly traps the >127 chars.

Good idea!