setLabelFieldText with midi remote to different value on demand

i have create a label in my midi remote script in my page

i am able to set the value once but if i call it the second time the value s empty

my code Sequence something like this

var surface = deviceDriver.mSurface
var label1 = surface.makeLabelField(x, y, w, h)
page.setLabelFieldText(lable1, “value1”)

up to this point it works fine

but if i try to call
page.setLabelFieldText(lable1, “value2”)
the label value is empty

any one knows of this issue is it a limitation
what am i doing wrong

my only workaround until now is to recreate the label and set the new value

but if i activate deactivate the subpage many times the values all stick above each other

from performance and memory i know this is bad other than the render looks bad after several time

is there a way to set the label to desired value on demand

Labels are static objects by design. As you’ve already noticed, we can set their text per page, we can attach them to host objects (transport, selected track etc) or a subPages area.

This is because you’re not actually recreating a specific label, but rather creating a new one, even when you think that by reassigning its name should do the trick.

What is your use case? Perhaps there may be ways to handle it, by either using the MIDI Remote, or engaging external utilities.

the full code of my on going project
is here
midiremote-userscripts/Combined/Controls/Combined_Controls.js at main · oussamamk/midiremote-userscripts

i have 2 controllers M-Wave (SMX-Mixer)
and iCon-iControls
my initial - then i have pages and subpages

on the effects or strip page i able to map dynamicly the knobs and buttons on effect change
i can get parameters, names , tags .. map them to a knob or button
i wanted to have a text field under the knob or button to have the name of the value it controls like “Release” , “Attack”
now i f i have different effects the names need to change
this is my psudo code the full code in the git hub project for now all in one file later i will re-wrie the code

the psudo code

buttons.length = 0
knobs.length = 0
var pZone = strip.mGate.mParameterBankZone
var dam2 = page.mHostAccess.makeDirectAccess(pZone)
var baseID = dam2.getBaseObjectID(activeMapping);
var numParams = dam2.getNumberOfParameters(activeMapping, baseID)
var b = 0
var k = 0

var arr = [‘baseID:’, baseID, ‘numParams:’, numParams]
console.log(arr.join(’ ‘))
for (var i = 0; i < numParams; i++) {
var pTag = dam2.getParameterTagByIndex(activeMapping, baseID, i)
var pName = dam2.getParameterTitle(activeMapping, baseID, pTag, 20)
var pDisplayValue = dam2.getParameterDisplayValue(activeMapping, baseID, pTag)
var pValue = dam2.getParameterProcessValue(activeMapping, baseID, pTag)
arr = [‘pTag:’, pTag, ‘pName:’, pName, ‘pDisplayValue:’, pDisplayValue, ‘pValue’, pValue]
console.log(arr.join(’ '))

if (pDisplayValue == 'On' || pDisplayValue == 'Off' || isButton) {
    if (b < numStrips) {
        page.makeValueBinding(btns[b].d.mSurfaceValue, customVar).setTypeToggle().setSubPage(subPage).mOnValueChange = function (activeDevice, activeMapping, value, arg3) {
            dam2.setParameterProcessValue(activeMapping, baseID, this.pTag, value)
        }.bind({ pTag })
        btns[i].d.mSurfaceValue.setProcessValue(activeDevice, pValue)
        midiOutput.sendMidi(activeDevice, [0x90, btns[i].note, pValue]) // light the button
    }
	b++
} else {
    if (k < numStrips) {
        page.makeValueBinding(knobs[i].d.mSurfaceValue, customVar).setValueTakeOverModeScaled().setSubPage(subPage).mOnValueChange = function (activeDevice, activeMapping, value, arg3) {
            dam2.setParameterProcessValue(activeMapping, baseID, this.pTag, value)
        }.bind({ pTag})
        knobs[i].d.mSurfaceValue.setProcessValue(activeDevice, pValue)
    }
	k++
}

}

what i would like to have like when i create button or knob at index

knob.d = (the device /physical surface button)
kbob.t = is makeLable ….

and then set the knob.t (the parameter name)

Not doable, since there are no mSurfaceValue.setTitle/setTitle2 methods exposed.
Your best bet (for now) would be to create an external app showing a window containing labels for showing parameters’ names etc. This is something I’ve done in the past for some of my controllers, see this pic: https://europe1.discourse-cdn.com/steinberg/original/3X/c/a/ca8d467127879f6775f0d446ed85488d4f169ed1.jpeg

thank you
i am not sure if this what you meant
but what i will planning to do is have an external app with virtual midi interface

and this app will have the look of the controllers

i will send midi messages of the knobs and buttons and text fields by sending message of “names”, values …

and hook a separate monitor with the app running showing the mapping with names

this will take a while when i get to it

Exactly what I meant.

Most probably today, I will share a solution for this.

thank you i have already started
Created in c# custom (i choose c# as it faster to develop than c++ for UI)
Knob

Fader

Strip Channel with 4 buttons

Classes

and Main windows with 8 strip channels as test

Next to attach to Virtual Midi Channel to receive the messages

1 Like

Cool!
I must say that I don’t quite get the necessity of having faders/knobs drawn when we have a real controller, labels should be enough if a small monitor is placed right above our controller. Unless of course, you’re talking about a virtual surface acting as a controller as well, which makes perfect sense.

you are correct i thought maybe visually easy to find things
but now you gave me an idea. for the future if i get an iPad or Microsoft surface
meaning with touch screen to have it as a virtual controller.

but yes, you are correct for names it’s enough to have a text box