In Midi Remote API, difference between Control Layer and Mapping Page…

I think I might understand this but if not, an explanation would be greatly appreciated.

I understand mapping pages (I think). The physical device always sends data on the same midi carrier (i.e. a particular knob always sends on midi CC#43) and the Midi Remote uses different Mapping Pages to assign what the data controls (i.e. one page assigns it to selected track volume and another page assigns it to selected track pan).

But I think a Control Layer changes the midi data sent by the physical device. So, on one control layer, a knob sends data on midi CC#7 (volume) and on a different control layer the same knob sends data on midi CC#10 (pan).

So, the difference between Mapping Pages and Control Layers is that Mapping Pages are in the software (Midi Remote) and Control Layers are in the hardware (on the device). Am I correct?

It could mean that. “Control layer” is not a standardized term. Where are you reading it?

You are absolutely right. Just as Cubase MIDI Remote devices support multiple software control layers (called mapping pages), something similar can also be implemented in MIDI keyboards. Hardware control layers can usually be freely assigned with different MIDI controller data.

1 Like

In the MIDI Remote API. There are objects called “Control Layer Zone” and “Control Layer”.

These are apparently separate from the “Mapping”, “Factory Mapping”, “Page”, etc., objects.

Thank you. So, I guess instead of “doubling up” the controls on the Cubase MIDI remote for the different Control Layers on the device, you could use the API Control Layer objects in your script to only display the currently active “Control Layer” on the physical device.

So, for example, if the button on the device that toggles between sending CC#7 and CC#10 can also send a message to Cubase, then you could have that message activate a different “Control Layer” on the MIDI Remote surface do display the knobs as “Volume” knobs or “Pan” knobs.

Yes, that would be possible in theory. In practice, however, there is a catch, because Cubase doesn’t provide a function for selecting a specific mapping page. The only functions available for mapping pages are the following:

Only with a specific selection, you could synchronize the hardware control layers and the software mapping pages.

Nope, once you have more than one mapping pages, you will find them in the mapping page actions:

By the way, the control layer concept is only available via scripting, where we can always manipulate page changes the way we want.

There is no direct binding to freely alter the control layer using an “action” connected to a specific control outside the layer’s ones. However, whenever you use a control of another layer, Cubase will notice it and automatically set the surface to the new layer in the MR UI, containing the corresponding assignments obviously. Noticing this, we can actually cheat and let Cubase think that the layer is changed even before it really is.
Say we have two layers and a knob that in layer 1 is named as knobLayer1 and in the second as knobLayer2. Now, say we know the midi message coming from the layer toggling button (in case we have more than one layer buttons, we have to adapt the code), let’s call this buttonLayer.

We can write something like this:

var selectedLayer=0 // 1 is for the second layer in this example
buttonLayer.mSurfaceValue.mOnProcessValueChange=function(activeDevice,value,diff){
    if(value==1){
       selectedLayer=1-selectedLayer
       var knobToAlter=selectedLayer==0 ? knobLayer1 : knobLayer2
       knobToAlter.mSurfaceValue.setProcessValue(activeDevice,knobToAlter.mSurfaceValue.getProcessValue(activeDevice))
    }
}

As you can see, we’re not really changing the value of the knobs, we just let Cubase think that we do. It will then change the layer accordingly. Not sure though, if all this is really something we’d want to do, since whenever we have a real layer change, Cubase will notice as already said.

2 Likes

Well, that’s good news! You really never stop learning… :slightly_smiling_face:

1 Like

Control layers are for dealing with things like fader banks and pad banks. They’re the same controller element but have different mappings and bindings. For example, the Akai MPK88 has 16 physical trigger pads, but you have four banks of those for a total of 64.