how to getParameter of midimodule

How can I get access to the parameters of a Mono envelope from a Luascript midi module ?

There is a bug in H6 and the mono envelope module’s parameters can’t be accessed by name. You have to use the parameter IDs.

I have posted this bug in the ‘Issues’ thread, but it hasn’t been addressed yet.

In case you don’t know, parameter IDs can be displayed in the paramlist window by right click in the headings bar and selecting ‘ID’.

Ah that’s unfortunate.

It’s a bit confusing as the parameter ID’s aren’t unique in the whole structure.
I can’t get it to fetch the data.

filterEnvPoints = this.parent:getParameter(65586)


I can get the ID of the Mono Env midi module which is
Screenshot 2020-05-13 at 18.29.15.png
By printing
print(this.program:getChild(“Mono Env”).id)

:getChild() and :findChildren() should be avoided if possible. They use more CPU than the targeted functions such as :getZone(), and can cause a script to run slow if searching for large numbers of elements.
Only use them if you don’t now what the nth object will be or need to find objects of varying type.

IDs for parameters are not unique across the structure, as you noted, but only within the containing object. Therefor you need to get the object first and then the parameter value.
You can get the module without its ID:

env = this.parent:getMidiModule('Mono Env')

Then get the parameter value when you have the Env object.

points = env:getParameter(65586)

Thanks I’m going to try it.