Meta attribute for param in Web Export?

Liam Fisher's icon

Looking to access the "meta" attribute of the parameter object in my javascript in order to select a nexusui element (e.g. dial, slider, number etc...) as a control and add tooltips. Basically just making it a little more like Max...
But I can't seem to find it! Checked the typescript and it wasn't there, nor were there any comments about adding it in a later release.
Will this be added in a future release? It works great for inport objects!

Alternatively, if anyone has is a clever workaround for this, please share. I was thinking stuffing all the parameter metadata into a single (otherwise unused) inport object?

Alex Norman's icon

unfortunately this looks like an oversight in our JS library code, I've created a ticket to add it in a future release but I don't have a timeframe for when that would happen.
in the mean time, the data does actually exist in the "patch.export.json" file that you have to import to create your device, so I think you might be able to get it after you import but before you `createDevice` ?

{
  "desc": {
    "parameters": [
      {
        "type": "ParameterTypeNumber",
        "index": 0,
        "name": "foo",
        "paramId": "foo",
        "minimum": 20,
        "maximum": 2000,
        "exponent": 1,
        "steps": 0,
        "initialValue": 403,
        "isEnum": false,
        "enumValues": [],
        "displayName": "",
        "unit": "",
        "order": 0,
        "debug": false,
        "visible": true,
        "signalIndex": null,
        "ioType": "IOTypeUndefined",
        "meta": {
          "foo": true
        }
      }
    ],
    "numParameters": 1,
    "numSignalInParameters": 0,
    "numSignalOutParameters": 0,
    "numInputChannels": 0,
    "numOutputChannels": 2,
    "numMidiInputPorts": 0,
    "numMidiOutputPorts": 0,
    "externalDataRefs": [],
    "patcherSerial": 0,
    "inports": [],
    "outports": [],
    "inlets": [],
    "outlets": [
      {
        "type": "signal",
        "index": 1,
        "tag": "out1",
        "meta": ""
      },
      {
        "type": "signal",
        "index": 2,
        "tag": "out2",
        "meta": ""
      }
    ],
    "paramConversion": {
      "applyStepsToNormalizedParameterValue": "function applyStepsToNormalizedParameterValue(normalizedValue, steps) {\n    if (steps == 1) {\n        if (normalizedValue > 0) {\n            normalizedValue = 1.;\n        }\n    } else {\n        let oneStep = 1. / (steps - 1);\n        let numberOfSteps = rnbo_fround(normalizedValue / oneStep * 1 / 1) * 1;\n        normalizedValue = numberOfSteps * oneStep;\n    }\n\n    return normalizedValue;\n}",
      "convertToNormalizedParameterValue": "function convertToNormalizedParameterValue(index, value) {\n    switch (index) {\n    case 0:\n        {\n            value = (value < 20 ? 20 : (value > 2000 ? 2000 : value));\n            let normalizedValue = (value - 20) / (2000 - 20);\n            return normalizedValue;\n        }\n    default:\n        return value;\n    }\n}",
      "convertFromNormalizedParameterValue": "function convertFromNormalizedParameterValue(index, value) {\n    value = (value < 0 ? 0 : (value > 1 ? 1 : value));\n\n    switch (index) {\n    case 0:\n        {\n            value = (value < 0 ? 0 : (value > 1 ? 1 : value));\n\n            {\n                return 20 + value * (2000 - 20);\n            }\n        }\n    default:\n        return value;\n    }\n}",
      "getNumParameters": "function getNumParameters() {\n    return 1;\n}",
      "constrainParameterValue": "function constrainParameterValue(index, value) {\n    var v = value;\n\n    switch (index) {\n    case 0:\n        {\n            v = (v > 2000 ? 2000 : (v < 20 ? 20 : v));\n            return v;\n        }\n    default:\n        return value;\n    }\n}",
      "subpatches": {},
      "isPolyphonic": false
    },
    "presetid": "rnbo",
    "meta": {
      "architecture": "x64",
      "rnboobjname": "rnbomatic",
      "maxversion": "9.0.0",
      "rnboversion": "1.3.0-dev",
      "name": "untitled"
    }
  },
...
}
Liam Fisher's icon

Thanks Alex, I didn't think of that! That works great.

Alex Norman's icon

happy to hear that!