Range- scaling faders - how to

Use this forum to post about your macro page designs in HALion 6
Post Reply
User avatar
ggc
Senior Member
Posts: 1434
Joined: Thu Feb 17, 2011 6:17 am

Range- scaling faders - how to

Post by ggc » Fri Feb 17, 2017 7:59 pm

Hi:)

Ok, so the range slider is not really a range slider...

Soooo....

Please, somebody tell me how i can restrict sliders to a certain range (i.e. 30-50 instead of the full 0-127)

Thank you very much:)
Last edited by ggc on Fri Feb 17, 2017 10:00 pm, edited 1 time in total.

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

Re: Range- scaling faders

Post by AposMus » Fri Feb 17, 2017 8:52 pm

As far as I can tell, this has to be done with a little scripting.

With the macro page / canvas selected in the GUI tree, you will see the GUI scripting section in the properties box. It has 3 columns, "parameter", "value" and "connection", You might have to widen the tree section to see "connection".

Click the "e" to open and paste this code and hit OK:

Code: Select all

defineParameter('paramLimit', nil ,0 ,0 ,30)
In the knob / slider value box type @paramLimit. This connects the controller to the script parameter.

From the Halion parameter list, drag the parameter you want to control to the Macro page script section "connection" column. This should do the trick.

The knob or slider will still have its full range of motion but only output values up to 30.

The name "paramLimit" is determined by the user, so you can make it what you want, seeing as each name has to be unique on the macro page. Also, remember to change the name in the controller value box if you do change it.
Cubase Pro 8.5.2
Halion 6
HSO
Padshop Pro
Dark Planet

User avatar
ggc
Senior Member
Posts: 1434
Joined: Thu Feb 17, 2011 6:17 am

Re: Range- scaling faders

Post by ggc » Fri Feb 17, 2017 9:41 pm

Wow man..

You just defined the "scalable" macro controls...

Thank you so much:)!

User avatar
ggc
Senior Member
Posts: 1434
Joined: Thu Feb 17, 2011 6:17 am

Re: Range- scaling faders

Post by ggc » Fri Feb 17, 2017 10:00 pm

I wonder if we can define the sliders values..

Example: instead of x-x , we can define values like 1/8 , 1/8t, 1/16 etc .. Or ms.. etc...

Also, assign "jump values" .. So out of 1-10 ' it jumps from 0 to 3 to 6 to 9...

Hmmm:p

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

Re: Range- scaling faders - how to

Post by AposMus » Sat Feb 18, 2017 6:32 pm

defineParameter can create all kinds of parameters.

Something 1/4, 1/8 etc will likely be a table or string array parameter, but I'm still figuring out how they work.
Cubase Pro 8.5.2
Halion 6
HSO
Padshop Pro
Dark Planet

User avatar
ggc
Senior Member
Posts: 1434
Joined: Thu Feb 17, 2011 6:17 am

Re: Range- scaling faders - how to

Post by ggc » Sat Feb 18, 2017 8:11 pm

I see...

I havent gotten to that yet myself... First question would be, once known if it is a string or a table or whatever- where would we place this ?nformation... Anywhere in the scriptbox? Hmm..

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

Re: Range- scaling faders - how to

Post by AposMus » Sun Feb 19, 2017 12:16 am

ggc wrote:I see...

I havent gotten to that yet myself... First question would be, once known if it is a string or a table or whatever- where would we place this ?nformation... Anywhere in the scriptbox? Hmm..
When it comes to scripting, you will have to go through the literature. I'm busy recapping some forgotten knowledge at this point, so it's quite a task.

The thing to remember is that words like, "function", "object" , "method" , "element" etc. aren't just general verbs, nouns or adjectives, they are as specific as saying apple or pear.Getting a grip on these concepts is the key to the Macro designer in the long run.

On the Halion product page under the resources tab is the Developers link. It's a good place to start.

BTW
Also, assign "jump values" .. So out of 1-10 ' it jumps from 0 to 3 to 6 to 9...
What is your aim with this?
Cubase Pro 8.5.2
Halion 6
HSO
Padshop Pro
Dark Planet

User avatar
ggc
Senior Member
Posts: 1434
Joined: Thu Feb 17, 2011 6:17 am

Re: Range- scaling faders - how to

Post by ggc » Sun Feb 19, 2017 12:35 am

Yeah, i see what u mean..

Even your "range" parameter helped out a lot and gave me great insight..
(Your range help actually made me understand a whole lot- so thx)

I saw that zerobrane thing you had posted and looked into it.. But it didnt ring my bell atm...
I also checked the Sb dev sites... It wasnt really material to learn.. No good examples.. Not straight forward... Functions definitions spread over 11 short internet pages instead of one big list... Yadda yadda..idk..
If there was one good example per "major" thing that was actually useable in halion, that would be nice..
(Like your range example) as it stands now, it is just kinda a Lua manual/glossary etc... No hands on stuff for halion...

-The scale faders were one needed thing... I have this now thx to you...
The next thing would be "jump values"
My aim with this being: jumping from 1/4 to 1/8t to value X... To be able to have certain knobs etc jump from musically pleasing values to other nice values and not full range if it isnt needed...

Another important thing for me to know would be how to set what values are set in the object.. (1/4, 1/8 , milliseconds, db values etc.. - whatever value is needed and not only a generic numeric number)

Pretty much basic stuff.. But there are no examples specifically for halion.. Just lua gobbledigoop...(thats how i see it.. - maybe im just not looking right;) )

Aaanyway... This whole process has somewhat humbled me and i do not feel as "entitled" as i did before when i was requesting things or whatever... I see how much work is going into it and i am somewhat amazed at all the hard work steinberg has put into it all...

Meh.. Anyway... Onwards, eh? :p

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

Re: Range- scaling faders - how to

Post by AposMus » Sun Feb 19, 2017 11:23 pm

There could definitely be more examples of practical code application.

The examples in the new instrument macros are very long and confusing. It took me quite some time to figure out what they were doing and I'm still figuring out how they work.

Many of the manual examples show how the function works, but not always how they should be implemented.

Something to look out for in the Halion script function reference :

Available in: Controller, Processor. -- (When it says Controller it's a Macro / UI function, Processor is a Lua script module function. Some are available in both.)

The table/array parameter is not working as I would expect, but I'm posting about that later when hopefully, one of the Halion developers might drop by the forum.
Cubase Pro 8.5.2
Halion 6
HSO
Padshop Pro
Dark Planet

Matthias Klag
Steinberg Employee
Posts: 36
Joined: Sat Feb 23, 2013 9:33 am

Re: Range- scaling faders - how to

Post by Matthias Klag » Mon Feb 20, 2017 4:48 pm

Hi.

I'm answering to what AposMus wrote:

posting.php?mode=reply&f=269&t=113024#pr618385

The way he describes works as long as you do not use automation. The UI script is limiting the control, but the parameter in the engine still has the full range. If you assign this parameter to an automation channel it will go over the full range and I'm pretty sure this is not what you want.

There is a better way to limit the range of parameters. Instead of using the UI script, you must use the Lua Script module in the Program Tree. The basic procedure is as follows:

In the Lua Script module you define a script parameter. The change callback adjusts the engine parameter with setParameter. You can limit the range with defineParameter or with the change callback. The MacroPage control gets connected to the script parameter. If you assign an automation channel to it, it will have the correct range, because it uses the range you defined in the script. The script parameter serves as an interface between the control on the MacroPage and the engine parameter.

Here is some example code for the Lua Script module:

Code: Select all

-- limit Osc 1.Mix of the Synth Zone to a range of 0 to 30%
defineParameter('p1', nil ,0 ,0 ,100, function() onP1Changed() end)

function onP1Changed()
  this.parent:getZone():setParameter("Osc 1.Mix", p1 * 0.3) -- range is 0 to 30 %
end
Cheers,

Matthias
Matthias Klag - HALion Developer
Steinberg Media Technologies GmbH
Hamburg, Germany
Checkout Steinberg on YouTube, Twitter and Facebook!

User avatar
DodgingRain
Junior Member
Posts: 77
Joined: Tue Dec 16, 2014 4:41 am
Contact:

Re: Range- scaling faders - how to

Post by DodgingRain » Sun Aug 12, 2018 10:23 pm

To anyone else struggling with Matthias's script make sure you pay attention to the parameter. Its p1 and not pl. :oops:
Mixing, Mastering, Remixing Services
Two Cat Audio Labs, llc
https://www.twocataudiolabs.com

Paddy C
New Member
Posts: 12
Joined: Mon Aug 13, 2018 9:37 pm
Contact:

Re: Range- scaling faders - Will it work with a switch?

Post by Paddy C » Tue Nov 06, 2018 12:08 am

Hi, I've had a go at restricting the range of the "Random Pitch parameter" from 0 - 100% to 0 - 0.85% to give a nice random detune and then assigned it to a knob using :-defineParameter('paramLimit', nil ,0 ,0,0.85) this works fine (Thanks for the info) but what I really need is just the top and bottom settings (0 and 0.85%)
Question:
can I assign this to a simple button switch?
what do I have to change? :- I'm guessing it's something to with this (nil ,0 ,0,0.85)
I worked out what the last one does (0.85 = 0.85%) but what do (nil ,0 ,0,0) refer to?

thanks

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

Re: Range- scaling faders - Will it work with a switch?

Post by misohoza » Tue Nov 06, 2018 7:36 pm

Paddy C wrote:
Tue Nov 06, 2018 12:08 am
Hi, I've had a go at restricting the range of the "Random Pitch parameter" from 0 - 100% to 0 - 0.85% to give a nice random detune and then assigned it to a knob using :-defineParameter('paramLimit', nil ,0 ,0,0.85) this works fine (Thanks for the info) but what I really need is just the top and bottom settings (0 and 0.85%)
Question:
can I assign this to a simple button switch?
what do I have to change? :- I'm guessing it's something to with this (nil ,0 ,0,0.85)
I worked out what the last one does (0.85 = 0.85%) but what do (nil ,0 ,0,0) refer to?

thanks
This should answer some of your questions: https://developer.steinberg.help/displa ... Parameters
It's a numeric parameter.

But if you want a on/off switch then a boolean parameter might work better.
Try this:

Code: Select all

defineParameter("Detune", nil, false, function()detuneChanged()end)

function detuneChanged()
  if Detune then
    this.parent:getZone():setParameter("Pitch.Random", 0.85)
  else
    this.parent:getZone():setParameter("Pitch.Random", 0)
  end
end
Or if you have a program with more than one zone:

Code: Select all

defineParameter("Detune", nil, false, function()detuneChanged()end)

function detuneChanged()
  local zones = this.parent:findZones(true)
  for i, zone in ipairs(zones) do
    if Detune then
      zone:setParameter("Pitch.Random", 0.85)
    else
      zone:setParameter("Pitch.Random", 0)
    end
  end
end
Win 10 Home, 64 bit, 8 gb ram,
Cubase Pro 10.5, Wavelab Pro 9.5, Halion 6, Dorico 3,
NI Komplete 10 Ultimate, Ozone 7,
UR 44

Post Reply

Return to “Macro Page Design”

Who is online

Users browsing this forum: No registered users and 1 guest