setParameter question

Post topics about HALion scripting.
Post Reply
Worra
New Member
Posts: 26
Joined: Sun May 13, 2012 6:07 pm
Contact:

setParameter question

Post by Worra » Thu Jan 10, 2019 2:54 pm

I have a programtree that looks like:
Instrument
LuaScript
MainLayer1
SubLayer1_1
SubLayer1_2
MainLayer2
SubLayer2_1
SubLayer2_2

In the Luascript, I want to be able to change the LayerMute for SubLayer1_1
I've defined a boolean parameter and know I want to use that value to switch the LayerMute on/off for SubLayer1_1

Can't really get my head around how to use the setParameter function to do this. Any ideas?
Per

misohoza
Member
Posts: 858
Joined: Sun Oct 05, 2014 12:18 am
Contact:

Re: setParameter question

Post by misohoza » Fri Jan 11, 2019 1:56 am

First you need to specify the layer with getLayer() or findLayers() and then use the setParameter.

Code: Select all

function subLayer1MuteChanged()
  local layer = this.parent:findLayers(true, "SubLayer1_1")[1]
  if layer then
    layer:setParameter("LayerMute", Sub1Mute)
  end
end

defineParameter("Sub1Mute", nil, false, subLayer1MuteChanged)
Win 10 Home, 64 bit, 8 gb ram,
Cubase Pro 9, Wavelab Pro 9, Halion 6, Dorico,
NI Komplete 10 Ultimate, Ozone 7,
UR 44

Worra
New Member
Posts: 26
Joined: Sun May 13, 2012 6:07 pm
Contact:

Re: setParameter question

Post by Worra » Wed Jan 30, 2019 1:04 pm

Thanks!!!
Per

Post Reply

Return to “Halion Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest