Prerequisites
- A Program with a Lua Script module and a Synth zone.
- A macro page with a value box.
Defining a Parameter for MIDI Notes
The following example assumes that you want to split the MIDI keyboard with a split key.
Copy the following code to the Lua Script module.
-- Get a parameter definition of a MIDI note parameter, e.g., the LowKey parameter of the parent layer. local paramDef = this.parent:getParameterDefinition("LowKey") -- Define a SplitKey parameter with this parameter definition. -- By using the parameter definition of the LowKey parameter, the script parameter will act the same. defineParameter("SplitKey", "Split Key", paramDef, function() onSplitKeyChanged() end) function onSplitKeyChanged() print(SplitKey) end
- Connect the script parameter to the value box on the macro page.
The SplitKey parameter will act like any MIDI note parameter in HALion: The value box displays the name of the MIDI note and you can enter values as MIDI note number, MIDI note name, or by playing the key on your MIDI keyboard.
3 Comments
Matthias Klag
Sabine Pfeifer: Ready for proof read. Thanks!
Sabine Pfeifer
Matthias Klag : schau mal, ich war mit der Formulierung nicht glücklich ... ist das so richtig?
Sabine Pfeifer
proofread done