how to getParameter of midimodule

Post topics about HALion scripting.
Post Reply
Yadihinz
New Member
Posts: 12
Joined: Tue Jan 25, 2011 1:36 pm
Contact:

how to getParameter of midimodule

Post by Yadihinz »

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

AposMus
Member
Posts: 230
Joined: Fri Nov 14, 2014 11:41 am
Contact:

Re: how to getParameter of midimodule

Post by AposMus »

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'.
Cubase Pro 8.5.2
Halion 6
HSO
Padshop Pro
Dark Planet

Yadihinz
New Member
Posts: 12
Joined: Tue Jan 25, 2011 1:36 pm
Contact:

Re: how to getParameter of midimodule

Post by Yadihinz »

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)
Screenshot 2020-05-13 at 18.27.54.png
(231.75 KiB) Not downloaded yet
I can get the ID of the Mono Env midi module which is
Screenshot 2020-05-13 at 18.29.15.png
(14.55 KiB) Not downloaded yet
By printing
print(this.program:getChild("Mono Env").id)

AposMus
Member
Posts: 230
Joined: Fri Nov 14, 2014 11:41 am
Contact:

Re: how to getParameter of midimodule

Post by AposMus »

: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:

Code: Select all

env = this.parent:getMidiModule('Mono Env')
Then get the parameter value when you have the Env object.

Code: Select all

points = env:getParameter(65586)
Cubase Pro 8.5.2
Halion 6
HSO
Padshop Pro
Dark Planet

Yadihinz
New Member
Posts: 12
Joined: Tue Jan 25, 2011 1:36 pm
Contact:

Re: how to getParameter of midimodule

Post by Yadihinz »

AposMus wrote:
Wed May 13, 2020 7:52 pm
: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:

Code: Select all

env = this.parent:getMidiModule('Mono Env')
Then get the parameter value when you have the Env object.

Code: Select all

points = env:getParameter(65586)
Thanks I'm going to try it.

Post Reply

Return to “Halion Scripting”

Who is online

Users browsing this forum: No registered users and 3 guests