How to: Switch between LAYERS using MIDI CC with KEY SWITCH REMOTE

Post general topics related to HALion 6 and HALion Sonic 3 here.
Post Reply
roger-s.
Member
Posts: 273
Joined: Mon Dec 20, 2010 9:52 am
Contact:

How to: Switch between LAYERS using MIDI CC with KEY SWITCH REMOTE

Post by roger-s. »

Hello!

I am trying to figure out how to switch between Layers using a MIDI controller. I already made it work with Key Switches, but if I want to use lets say 50 different layers, I would lose 4 octaves of keyboard range only for keyswitches, so it seems not to be a viable solution.

However, a MIDI controller can have 127 positions, so it seems logical to use a MIDI controller to select one of the 50 layers. But I seem to be missing something, as I am unable to make appear the layers in the Key Switch Remote window.

layer switch with MIDI CC.png
(48.9 KiB) Not downloaded yet

Is this a malfunction? If so, has it been fixed in HALion 6.3 ( I am still on 6.2)?
Or is it my mistake?

Any idea how to solve this?

All the best.

Roger
Steinberg Training Center FAMA Foco Audio & Music A. , Mexico City

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

Re: How to: Switch between LAYERS using MIDI CC with KEY SWITCH REMOTE

Post by misohoza »

Hi Roger,

You need to set up key switches first. Then they should appear in Key Switch Remote module.
Key Switch Remote.png
(357.7 KiB) Not downloaded yet
However in your case it would probably defeat the purpose because you would have both the key switches and a midi cc doing the same thing. So you don't save any keyboard range.

You could try using a script to select a layer to play. This can be mapped to a specific midi cc.
Key Switch Remote 2.png
(349 KiB) Not downloaded yet

Code: Select all

layers = this.parent:findLayers()
layerNames = {}

for i = 1, #layers do
  layerNames[i] = layers[i].name
end

defineParameter("LayerSelect", nil, 1, layerNames)
defineParameter("RemoteCC", nil, 1, 0, 127, 1)

function onNote(event)
  playNote(event.note, event.velocity, -1, layers[LayerSelect])
end

function onController(event)
  if event.controller == RemoteCC then
    this:setParameterNormalized("LayerSelect", event.value / 127)
  else
    postEvent(event)
  end
end
Just reload the script each time you make any changes (add or remove layers).
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

roger-s.
Member
Posts: 273
Joined: Mon Dec 20, 2010 9:52 am
Contact:

Re: How to: Switch between LAYERS using MIDI CC with KEY SWITCH REMOTE

Post by roger-s. »

Hi Misohoza!

This forum really wouldn´t be the same without you.

I inserted the LUA script you posted ( I don´t have a clue how LUA works, so this was my first time LUAing...) and it worked right away. So thank a lot for your help.

The only thing I noticed is that the layer change is not realtime, but becomes effective with the next Note-on. While the layer change is correctly indicated inside the parameter list, it does sound until the next note-on. I guess this is for saving RAM and resources, because otherwise having for example 8 layeres, HALion would have to play those eight layers all the time, while sounding only one, let alone if I´d manage more layeres...

Or change the purpose from Switching to crossfading...
I´ll edit the your script and give a lecture to the HALion script information at steinberg.help.

Thank a million again for your help.
Steinberg Training Center FAMA Foco Audio & Music A. , Mexico City

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

Re: How to: Switch between LAYERS using MIDI CC with KEY SWITCH REMOTE

Post by AposMus »

If you don't need access to the layer names then here is another way of doing it in the attached preset.

You don't need the key switch remote at all. Trick is to set Trigger note to Held Notes.
This is set up to change layers at 50% mod wheel position. You can obviously just set your own controller and use the range setting to set conditions for layers.
This will do real time switching.

Real time is possible with scripting too though.
Attachments
Layer Select By Mod Wheel.zip
(6.69 KiB) Downloaded 46 times
Cubase Pro 8.5.2
Halion 6
HSO
Padshop Pro
Dark Planet

roger-s.
Member
Posts: 273
Joined: Mon Dec 20, 2010 9:52 am
Contact:

Re: How to: Switch between LAYERS using MIDI CC with KEY SWITCH REMOTE

Post by roger-s. »

Hello Aposmus!

Thanks for uploading your example. I will check it out in the next days.
All the best.

Roger
Steinberg Training Center FAMA Foco Audio & Music A. , Mexico City

Post Reply

Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest