Edit Envelope Curve Value

Use this forum to post about your macro page designs in HALion 6
Post Reply
KlingKlong
New Member
Posts: 2
Joined: Fri Aug 19, 2016 9:11 pm
Contact:

Edit Envelope Curve Value

Post by KlingKlong » Mon Oct 15, 2018 2:00 am

I would like to modify the curve value of a filter envelope node of a synth Zone in Halion 6. The ultimate goal is to be able to assign the envelope value to a midi controller. It is straightforward to add an envelope editor or curve editor to my macro page, which allows me to modify the envelope node points and its various values by mouse on the macro page itself. But that does not allow me to modify the value of a curve (or other values of a given node) by a quick control or by a midi cc.

So I tried to assign the curve value to a slider on my macro page which I could then in turn easily assign to a midi controller. I tried it via the envelope editor on the macro page and by guessing how to access the original filter Parameters directly (similar to DCAAttOffset for example). The problem is, that I could not figure out how to address the curve value of a node. Obviously, I can have multiple nodes, so I would have to write something like @index:0/@curve as the value of my slider. But the information on https://developer.steinberg.help/displa ... rve+Editor is not enough for me to get it to work.

Once again, I obviously need to address a value in an array of variables, where the array contains essentially the nodes of an envelope. (The solution should not only work for the curve value but also for the level and time value of a node.)

Any help would be greatly appreciated. A working example would be perfect.

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

Re: Edit Envelope Curve Value

Post by misohoza » Tue Oct 16, 2018 12:09 am

Hi KlingKlong,
So I tried to assign the curve value to a slider on my macro page which I could then in turn easily assign to a midi controller. I tried it via the envelope editor on the macro page and by guessing how to access the original filter Parameters directly (similar to DCAAttOffset for example). The problem is, that I could not figure out how to address the curve value of a node.
You can't do it directly because Halion handles all envelope nodes and their curve, level and time values from a single parameter called EnvelopePoints. It is possible to change those via scripting. So you could create a script parameter that would control curve of a specific envelope node and attach that to a macro page slider. You can find some info about envelope points array here: https://developer.steinberg.help/displa ... elopePoint

So you could try something like this to control some parameters of filter envelope (assuming you have a program with a single synth zone):

Code: Select all

zone = this.parent:getZone()
filterEnvPoints = zone:getParameter("Filter Env.EnvelopePoints")
filterSustainIndex = zone:getParameter("Filter Env.SustainIndex")


function setFilterEnvelopePoints()
  filterEnvPoints[2].duration = FilterAttack/1000
  filterEnvPoints[2].curve = FilterAttackCurve/10
  filterEnvPoints[filterSustainIndex].duration = FilterDecay/1000
  filterEnvPoints[filterSustainIndex].curve = FilterDecayCurve/10
  filterEnvPoints[filterSustainIndex].level = FilterSustain/100
  filterEnvPoints[#filterEnvPoints].duration = FilterRelease/1000
  filterEnvPoints[#filterEnvPoints].curve = FilterReleaseCurve/10
  zone:setParameter("Filter Env.EnvelopePoints", filterEnvPoints)
end

defineParameter("FilterAttack", nil, 0,0,30000,1, setFilterEnvelopePoints)
defineParameter("FilterAttackCurve", nil, 0,-10,10, setFilterEnvelopePoints)
defineParameter("FilterDecay", nil, 250,0,30000,1, setFilterEnvelopePoints)
defineParameter("FilterDecayCurve", nil, -10,-10,10, setFilterEnvelopePoints)
defineParameter("FilterSustain", nil, 100,0,100,1, setFilterEnvelopePoints)
defineParameter("FilterRelease", nil, 200,0,30000,1, setFilterEnvelopePoints)
defineParameter("FilterReleaseCurve", nil, -10,-10,10, setFilterEnvelopePoints)

--get initial values
function getFilterEnvPoints()
  filterEnvPoints = zone:getParameter("Filter Env.EnvelopePoints")
  FilterAttack = filterEnvPoints[2].duration*1000
  FilterAttackCurve = filterEnvPoints[2].curve*10
  FilterDecay = filterEnvPoints[filterSustainIndex].duration*1000
  FilterDecayCurve = filterEnvPoints[filterSustainIndex].curve*10
  FilterSustain = filterEnvPoints[filterSustainIndex].level*100
  FilterRelease = filterEnvPoints[#filterEnvPoints].duration*1000
  FilterReleaseCurve = filterEnvPoints[#filterEnvPoints].curve*10
end

getFilterEnvPoints()
This approach has some drawbacks though. Script parameters work by changing Halion engine parameters. But it doesn't work the other way around. When you add another node or change some values directly in zone editor the script won't pick up the changes. So your macro page may be showing values that don't reflect the changes you made in the editor. And in case of adding new nodes the script might be controlling different node than you might expect. That's something to be aware of.

I've attached two presets. One with the same script as above. The other has a simple ui script that tries to address the changes of parameters from the zone editor. It's not the best implementation though. You might notice some erratic behaviour.
Filter Env.zip
(13.43 KiB) Downloaded 46 times
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 “Macro Page Design”

Who is online

Users browsing this forum: No registered users and 1 guest