Sub Preset switching breaks functionality of script.

Post topics about HALion scripting.
Post Reply
rmjmusic
New Member
Posts: 49
Joined: Thu Jan 04, 2018 3:22 am
Contact:

Sub Preset switching breaks functionality of script.

Post by rmjmusic »

I've linked together the Bypass of multiple mod matrix rows via script and it works as expected. My script also includes callback so when I switch subpresets it copies/pastes zone settings. This works too. However, on the macro page, the switch I have attached to the script to bypass multiple mod matrix rows no longer works after a sub preset is switched. This doesn't create any script errors and everything appears healthy, it just no longer functions. You can see in HALion 6 that the Bypass function works and when you change sub presets that the mod matrix was copied correctly but the function no longer works.

I've created an exported library capable of demonstrating what I'm experiencing.

Link to library: https://1drv.ms/u/s!AmKjBuZbRzYTg79JI2N ... w?e=AjjcEj

Any help is much appreciated!

Thanks!
Cubase Pro 10.5
Cubase Pro 10
HALioin 6
Windows 10 Pro 64bit
Mac OS 10.13.6

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

Re: Sub Preset switching breaks functionality of script.

Post by misohoza »

Hi rmjmusic,

The fix is quite simple. Just move the bypassLink variable inside the callback function. Otherwise it refers to a zone that was found when the script loads. But the zone changes when you load new layer preset.

Code: Select all

--LFO BYPASS LINKS


function onLFOBypassChanged()
  local bypassLink =   this.parent:getLayer():getZone()
  if LFOBYPASSLINK == true then
    bypassLink:getModulationMatrixRow(1):setParameter(655370, false)
    bypassLink:getModulationMatrixRow(2):setParameter(655370, false)
    bypassLink:getModulationMatrixRow(3):setParameter(655370, false)
    bypassLink:getModulationMatrixRow(4):setParameter(655370, false)
  else
    bypassLink:getModulationMatrixRow(1):setParameter(655370, true)
    bypassLink:getModulationMatrixRow(2):setParameter(655370, true)
    bypassLink:getModulationMatrixRow(3):setParameter(655370, true)
    bypassLink:getModulationMatrixRow(4):setParameter(655370, true)
  end
end

defineParameter( "LFOBYPASSLINK", "LFO Bypass Link", true, onLFOBypassChanged)

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

rmjmusic
New Member
Posts: 49
Joined: Thu Jan 04, 2018 3:22 am
Contact:

Re: Sub Preset switching breaks functionality of script.

Post by rmjmusic »

Big thanks, misohoza! You never fail. It works.
Its nuances like this in the scripting that reveal to me how much I still have to learn. Thank you again!
Cubase Pro 10.5
Cubase Pro 10
HALioin 6
Windows 10 Pro 64bit
Mac OS 10.13.6

Post Reply

Return to “Halion Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest