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)