How to Assign CC to Macro Page knob ?

Hi. Do you have any idea how to make a connection of a CC (modwheel for instance) with a knob in macro page ?
I assigned some CCs to different parameters in Modulation Matrix. But when I change those values from MIDI controller it would be nice to see that knobs on macro page do the same. I know I can MIDI learn but it doesn’t save that connection in patch itself. So when I close Halion and open that patch again it doesn’t work.

I also found I can assign QC to Macro Page knob but again I can’t permanently assign CC to specific QC.
Thank You for any advice.

I’ve used a LUA script combined with a CC Mapper module to get a similar effect before.

I wanted a macro knob that would send the desired effect of a given CC down-stream if tweaked in HALion with a mouse, and would also dance about, show some numbers, and show me what my keyboard or sequencer is doing in real time.

In this case I have a little heads up display for showing expression volume, and vibrato controllers that might stream into HALion. I wanted to be able to select from a few controller types using pop-ups. I also put dancing dials (the small ones that if you click on them a fader pops up and is a little easier to work with using a mouse).

Simple enough so far…all we’re doing is changing some stuff around in a bog standard HALion CC MAPPER module with the pop-ups, and displaying some numbers. Pop Up menus allow me to change the incoming CCs HALion should be listening for routed into sources 130 and 131 of a CC Mapper module, which are ultimately linked up to do expression volume for an entire Master/Parent Layer, and some lfo stuff for faking vibrato effects.

I also wanted it to be functional if the user tweaked the little knobs in the HALion Macro directly using a mouse. So I needed a kludge. A few custom parameters…and a function that will generate and transmit the proper CC if the user uses the HALion macro knob directly.

If I turn the macro knob in H6…how do I generate a CC for the CC MAPPER to detect?

So…I defined some new Parameters in HALion via LUA. expCC and vibCC allow me to change the preferred controller via the popup. Expression and Vibrato parameters are kept up to date, and the script generates the relevant CC and sends it down the pipeline.

In this case, expCC, Expression, vibCC, and Vibrato are my new ‘custom parameters’.

Aside; (In another script inside the macro itself, I also use parameters expression/vibrato [notice lower case in first character]…so I could provide simple lists of controller names in the pop-up, and limit the pop up to a few of them, instead of the user getting barraged by a huge pop up with 128 plain numbers. Scripts embedded into a macro itself, only show up inside the macro, where as scripts entered as a LUA module can post parameters that anything in the HALion instance can use. As for demonstrating methods to set up your own universal parameters…see the LUA script below.)

-- Some stuff for monitoring/changing what ultimately pipes into the CC Mapper MidiModule via the macro editor
-- Defining these in a LUA script allows them to show up in the Macro editor for binding/linking.

-- Here I craft the ability to change whatever incoming CCs will adjust the dynamics and vibrato.
defineParameter("expCC", nil, 1, 0, 146, 1, function() expMap() end)
defineParameter("vibCC", nil, 2, 0, 146, 1, function() vibMap() end)

-- After defining them, I grab the current values set in the CC Mapper during initialization so the Macro should be in sync with it all.
-- Inside the Macro itself, I have another script that limits the controller choices, and throws up more user friendly information in the pop-up selectors in my preferred order.
theMap = this.parent:getMidiModule("CC Mapper")
expCC = theMap:getParameter("CC130.Source")
vibCC = theMap:getParameter("CC131.Source")
function expMap()
  theMap:setParameter("CC130.Source", expCC)
function vibMap()
  theMap:setParameter("CC131.Source", vibCC)

-- Establish and Track the "Expression" parameter.
-- I need something to generate the CC event our mod matrix is expecting if the user tweaks the control in the HALion macro page.

defineParameter("Expression", nil, 0, 0, 127, 1, function() exp() end)

-- Post the "Expression" parameter value as a valid CC event.
-- Shouldn't do anything unless the macro knob is manipulated with the mouse.

function postExp()
  controlChange(expCC, Expression)
function exp() 
    runSync(postExp, 1)

-- Define and track the "Vibrato" parameter.
defineParameter("Vibrato", nil, 0, 0, 127, 1, function() vib() end)

-- Post the "Vibrato" parameter...
-- Shouldn't do anything unless the macro knob is manipulated with the mouse.

function postVib()
  controlChange(vibCC, Vibrato)
function vib() 
    runSync(postVib, 2)

-- If either of our CCs set in the pop up selectors come down the pipe line, update the parameter value so it shows up in the Macro properly.
-- Naturally, the CC should pass on down the pipeline into our CC Mapper where it works its magic.

function onController(event)
  if event.controller == vibCC then
    Vibrato = event.value
  if event.controller == expCC then
    Expression = event.value

After doing that…I can get the Expresion, expCC, Vibrato, and vibCC parameters into the Macro Editor, where I can bind macro elements. Macro elements can then monitor/change these parameters as desired.

So…instead of binding the knob directly to a live/existing HALion Parameter, I bound them to my Custom defined Parameters, my LUA script generates and bounces the relevant CC on down the pipeline as required. That way…if I crank the knob in HALion…the script generates a CC and it works. If I move the actual mod-wheel on my keyboard, the Expression parameter is simply updated and shows up in the Macro, and forwarded down the pipeline.

Note, there’s probably better ways to do this, such as figuring out where the parameter for the virtual mod wheel in HALion is, and simply duplicating a knob for that. At the time I did this I had no clue how to track that parameter down, PLUS, I wanted the ability to change it to something else with the pop-up (I.E. Use CC11 Expression Volume instead of CC1 mod wheel for dynamic control)…and didn’t feel like adding special code just to sync my little knob/display to the virtual mod wheel IF it’s the CC chosen (might do that later).

In retrospect, I probably didn’t need to define expCC and vibCC either. I probably could have simply linked up directly with CC130.Source, and CC131.Source in my Midi Mapper. At the time I was also learning how to do this stuff, and build the pop ups that limit controller choices and provide controller names, so I ended up doing it that way. Oh well, it works.

Point is…it’s worth it to learn a little LUA. I had very good luck with people helping me out in the HALion LUA Scripting forum.