Halion 7 Macro Page: Absolute Values for ENV-Attack?

Hello there,

I would like to add the attack time of an envelope to a knob on a Halion 7 Macro Page as an absolute value, not as a percentage value as it happens when I simply assign it. It would be even better if I could specify this absolute value not as msec, but synced to the tempo of the Project as 1/16, 1/8, 1/4 etc. Is this possible, and if so - how?

Thank you in advance and have a nice day

Possible but not very straightforward. The whole envelope can be set with a single parameter called EnvelopePoints. You need to calculate the attack time in seconds at 120 bpm.

zone = this.parent:getZone()
envelopePoints = zone:getParameter("Amp Env.EnvelopePoints")
zone:setParameter("Amp Env.Sync", true)

attackParameter = {
	{name = "1/16",	value = 0.25},
	{name = "1/8",	value = 0.5},
	{name = "1/4",	value = 1},

attackParameterNames = {}
for i = 1, #attackParameter do
	attackParameterNames[i] = attackParameter[i].name

defineParameter("Attack", nil, 1, attackParameterNames, function() attackChanged() end)

-- 0.5 seconds = quarter note
function attackChanged()
	envelopePoints[2].duration = 0.5 * attackParameter[Attack].value
	zone:setParameter("Amp Env.EnvelopePoints", envelopePoints)


Attack Knob.vstpreset (8.8 KB)

1 Like

Oh, thank you very much :grinning:
However, I’m afraid I’m too much of a beginner to understand it all. Right now I don’t even know exactly how to include this code and what to do with the AttackKnob.vstpreset, but I’ll try to get into it :smile: :smile:.
Thank you so much.

I loaded the preset and so got the AttackKnob into the MP Designer. And there I can see how it adjusts the attack time of the envelope. I think, I can work with that further :+1:

Once again, many, many thanks.