How to Set Bus Effect Parameters in Halion Script

Post topics about HALion scripting.
Post Reply
mbiermann
New Member
Posts: 13
Joined: Fri Nov 17, 2017 1:14 am
Contact:

How to Set Bus Effect Parameters in Halion Script

Post by mbiermann » Mon Feb 18, 2019 1:34 am

Hey team, really loving the collaboration here! I'm trying to assign a knob to the Distortion.hardclip amount in the Distortion effect of one of my layer's busses, but having trouble figuring out how to set the parameter correctly. Any help is appreciate!

This is what I came up with looking at the examples here, but it's not working .

Code: Select all

effects = this.program:findEffects(true)
distEffect = effects[1]

function onBoostChange()
  newDist = DIST_AMOUNT
  distEffect:setParameter("Distortion.hardclip", newDist)
end

defineParameter("DIST_AMOUNT","DIST_AMOUNT",0,0,100,1,onBoostChange) 
Here is a pic of my program tree and the effect.
Program Tree.PNG
(4.91 KiB) Not downloaded yet
Effect.PNG
(14.21 KiB) Not downloaded yet

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

Re: How to Set Bus Effect Parameters in Halion Script

Post by misohoza » Mon Feb 18, 2019 6:44 pm

Hi mbiermann,

The parameter name should be "hardclip" not "Distortion.hardclip".

Once you change this it should work.

You could also use the name of the effect as second argument of findEffects(). Otherwise if you change the order of effects or add some effects to Program Bus the Distortion might not be the first effect returned by findEffects().

Code: Select all

effects = this.program:findEffects(true, "Distortion")
distEffect = effects[1]

function onBoostChange()
  distEffect:setParameter("hardclip", DIST_AMOUNT)
end

defineParameter("DIST_AMOUNT","DIST_AMOUNT",0,0,100,1,onBoostChange)
There are several ways how to do this. I would probably do something like this:

Code: Select all

function onBoostChange()
  local distEffect = this.parent:getBus():getEffect("Distortion")
  if distEffect then
    distEffect:setParameter("hardclip", DIST_AMOUNT)
  end
end

defineParameter("DIST_AMOUNT","DIST_AMOUNT",0,0,100,1,onBoostChange)
Put everything inside the callback function. The if statement is there to guard against script errors. If it finds the effect it sets the parameter, if not then nothing happens.

On the other hand if you're sure you won't change the structure of the program tree (adding more effects or reorder them) the first option might be a bit more efficient. It doesn't look for the effect each time you change the DIST_AMOUNT parameter. Only looks for the effect when the script is loaded.
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

mbiermann
New Member
Posts: 13
Joined: Fri Nov 17, 2017 1:14 am
Contact:

Re: How to Set Bus Effect Parameters in Halion Script

Post by mbiermann » Tue Feb 19, 2019 12:56 am

Thanks misohoza, that did the trick! I've read a lot of your posts here and really appreciate your willingness to share.

So is there a reference somewhere that lists the names and addresses of each component in Halion and how to address them? For example this hardclip parameter I found the name for by first connecting the knob to the macro page and then going into the macro page to see what came up as available to connect a knob to.

And is there some reference that then helps explain the tree that these components live in, for example "this.parent:getBus():getEffect("Distortion")". This seems a bit esoteric unless you know what you are looking for. But I never would have figured that out looking at the manual, as it doesn't really explain that process that I could find, and it seems there are multiple ways to do it as well.

Again, many thanks!

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

Re: How to Set Bus Effect Parameters in Halion Script

Post by misohoza » Tue Feb 19, 2019 3:43 pm

The online documentation can be found here:
https://developer.steinberg.help/displa ... r+Resource

You can read the parameter names in Parameter List. Some of them are organised in folders. In that case you address them by "Folder.parameter" (for example "Filter.Cutoff", "Filter.Resonance"). Otherwise just use the parameter name as it appears in Parameter List. Special category are modulation matrix parameters. First you need to address the modulation matrix row by getModulationMatrixRow ()
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

Post Reply

Return to “Halion Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest