Page 1 of 1

Switch isn't switching

Posted: Thu Feb 22, 2018 6:51 pm
by rmjmusic
I have a Vintage Compressor connected to my macro page. I have a simple switch on my macro page to toggle the "Punch" parameter on/off. If I press the switch, I can see in HALion 6 "Punch" getting toggled on/off but on my macro page the switch isn't switching. I've tried this with a bunch of different switches but I get the same result. I've also tried copying another switch that is working correctly on my macro page and assigning it this function but it still doesn't work correctly.

Any one else come across something like this?

Thanks,
rmjmusic

Re: Switch isn't switching

Posted: Fri Feb 23, 2018 12:40 am
by misohoza
rmjmusic wrote:
Thu Feb 22, 2018 6:51 pm
I have a Vintage Compressor connected to my macro page. I have a simple switch on my macro page to toggle the "Punch" parameter on/off. If I press the switch, I can see in HALion 6 "Punch" getting toggled on/off but on my macro page the switch isn't switching. I've tried this with a bunch of different switches but I get the same result. I've also tried copying another switch that is working correctly on my macro page and assigning it this function but it still doesn't work correctly.

Any one else come across something like this?

Thanks,
rmjmusic
You're right.

It's probably because the Vintage Compressor attackmode (Punch) parameter is integer with values 1 and 2 while the switch expects values 0 and 1. The weird thing is it that clicking on the macro page switch does change the value of the parameter but you can't tell what's the state of the parameter.

You could work around this by creating a simple UI script that would work like interface between the switch and the parameter.

Code: Select all

defineParameter("PunchValue", nil, 1,1,2,1, function() punchValueChange() end)
defineParameter("PunchSwitch", nil, 0,0,1,1, function() punchSwitchChange() end)

function punchValueChange()
  PunchSwitch = PunchValue - 1
end

function punchSwitchChange()
  PunchValue = PunchSwitch + 1
end
Connect the attackmode parameter of the compressor to "PunchValue" and the switch to "PunchSwitch".
Punch 1.png
(373.43 KiB) Not downloaded yet
Punch 2.png
(365.62 KiB) Not downloaded yet

Re: Switch isn't switching

Posted: Tue Feb 27, 2018 3:02 am
by rmjmusic
Got yah. Thanks for your help! I don't think I would have ever figured that out on my own! I'll have to make this adjustment.

Thanks again,
rmjmusic