d.healey
Libre Wave
Is it possible, via KSP, to change the MIDI CC assigned to a modulator?
It is not possible if you are talking about the External Source CC# setting. Anyway you can use a workaround which can do something similar. Imagine you have set the Midi CC# in the modulator to some "Dead CC#" let say CC110. Later you can construct a filter which will block any physical CC110 messages.Is it possible, via KSP, to change the MIDI CC assigned to a modulator?
on init
make_perfview
declare const $dead_cc := 110 {This is the Dead CC# set as External Source in the modulator}
declare ui_value_edit $CC_num(1, 127, 1)
set_text($CC_num,"CC#")
make_persistent($CC_num)
end on
on controller
if ($CC_NUM=$dead_cc)
ignore_controller
else
if ($CC_NUM=$CC_num)
set_controller($dead_cc,%CC[$CC_num])
end if
end if
end on
It is not possible if you are talking about the External Source CC# setting. Anyway you can use a workaround which can do something similar. Imagine you have set the Midi CC# in the modulator to some "Dead CC#" let say CC110. Later you can construct a filter which will block any physical CC110 messages.Is it possible, via KSP, to change the MIDI CC assigned to a modulator?
You will need a condition assigner UI box where you will set the wished External CC#.
So, if you set that box to say CC1 then CC1 will be transformed to the dead # set in the modulator i.e CC110. If you set the UI box to CC11 it will be transformed to CC110 etc. All non-matching CC# will pass thru unless the physical CC110 which is ignored in the script. Here is my prototype below:
Code:on init make_perfview declare const $dead_cc := 110 {This is the Dead CC# set as External Source in the modulator} declare ui_value_edit $CC_num(1, 127, 1) set_text($CC_num,"CC#") make_persistent($CC_num) end on on controller if ($CC_NUM=$dead_cc) ignore_controller else if ($CC_NUM=$CC_num) set_controller($dead_cc,%CC[$CC_num]) end if end if end on
Regards,
R4
1) How do you implement 'MIDI LEARN' when right clicking the UI box?
Hi,Instead of a CC modulator, use a Constant modulator, then modulate the modulation amount of that modulator in controller callback.
As mk282 pointed some UIs like ui_menu, ui_value_edit can not be learned. I show a demo using ui_value_edit box in my script example above but you can replace it with say an ui_knob or with a slider assigned to some custom UI box image etc.1) How do you implement 'MIDI LEARN' when right clicking the UI box?
Also, I'd like to do the inverse of that and if the user wants to right-click the knob for 'MIDI LEARN', I'd like for that new CC# to show up in the ui_value_edit box.
Also, I'd like to do the inverse of that and if the user wants to right-click the knob for 'MIDI LEARN', I'd like for that new CC# to show up in the ui_value_edit box.
Sorry, but unfortunately this will not be possible. Kontakt's MIDI learn functionality is not accessible to KSP at all, so there's no way to find out to which CC was the control linked via Kontakt's built in MIDI learn feature.
Is there a way to retrieve the MIDI CC# controlling a knob after it's been moved?
Hi Casey,So the only way to do this reliably is disregard the built-in MIDI learn, and do your own.
on init
message("")
set_ui_height_px(65)
make_perfview
declare ui_value_edit $cc_assign(0, 127, 1)
set_control_par(get_ui_id($cc_assign),$CONTROL_PAR_WIDTH,58)
set_text($cc_assign,"CC#")
move_control_px($cc_assign,100,20)
make_persistent($cc_assign)
declare ui_switch $Learn
set_control_par(get_ui_id($Learn),$CONTROL_PAR_FONT_TYPE,3)
set_text($Learn,"L")
set_control_par(get_ui_id($Learn),$CONTROL_PAR_WIDTH,18)
move_control_px($Learn,158,20)
declare ui_knob $Test(0, 127, 1)
make_persistent($Test)
move_control_px($Test,200,10)
end on
on ui_control($Learn)
while ($Learn=1)
set_text($Learn,"L")
set_control_par(get_ui_id($Learn),$CONTROL_PAR_FONT_TYPE,2)
wait(250000)
set_control_par(get_ui_id($Learn),$CONTROL_PAR_FONT_TYPE,3)
wait(250000)
end while
end on
on controller
if ($Learn=1)
$cc_assign := $CC_NUM
$Learn := 0
end if
if ($cc_assign=$CC_NUM)
$Test := %CC[$cc_assign]
end if
end on
on init
message("")
set_ui_height_px(65)
make_perfview
{Layer CC value box}
declare ui_value_edit $layerCC(0, 127, 1)
set_control_par(get_ui_id($layerCC),$CONTROL_PAR_WIDTH,58)
set_text($layerCC,"CC#")
move_control_px($layerCC,200,10)
make_persistent($layerCC)
{Layer learn switch}
declare ui_switch $layerLearn
set_control_par(get_ui_id($layerLearn),$CONTROL_PAR_FONT_TYPE,3)
set_text($layerLearn,"L")
set_control_par(get_ui_id($layerLearn),$CONTROL_PAR_WIDTH,18)
move_control_px($layerLearn,200,30)
{Layer Knob}
declare ui_knob $layerKnob(0, 127, 1)
make_persistent($layerKnob)
set_text($layerKnob,"Layers")
move_control_px($layerKnob,110,10)
{Dynamic CC value box}
declare ui_value_edit $dynCC(0, 127, 1)
set_control_par(get_ui_id($dynCC),$CONTROL_PAR_WIDTH,58)
set_text($dynCC,"CC#")
move_control_px($dynCC,400,10)
make_persistent($dynCC)
{Dynamic learn switch}
declare ui_switch $dynLearn
set_control_par(get_ui_id($dynLearn),$CONTROL_PAR_FONT_TYPE,3)
set_text($dynLearn,"L")
set_control_par(get_ui_id($dynLearn),$CONTROL_PAR_WIDTH,18)
move_control_px($dynLearn,400,30)
{Dynamic Knob}
declare ui_knob $dynKnob(0,1000000, 1)
make_persistent($dynKnob)
set_text($dynKnob,"Dynamics")
move_control_px($dynKnob,310,10)
set_knob_unit($dynKnob,$KNOB_UNIT_HZ)
end on
on ui_control($layerLearn)
while ($layerLearn=1)
set_text($layerLearn,"L")
set_control_par(get_ui_id($layerLearn),$CONTROL_PAR_FONT_TYPE,2)
wait(250000)
set_control_par(get_ui_id($layerLearn),$CONTROL_PAR_FONT_TYPE,3)
wait(250000)
end while
end on
on ui_control($dynLearn)
while ($dynLearn=1)
set_text($dynLearn,"L")
set_control_par(get_ui_id($dynLearn),$CONTROL_PAR_FONT_TYPE,2)
wait(250000)
set_control_par(get_ui_id($dynLearn),$CONTROL_PAR_FONT_TYPE,3)
wait(250000)
end while
end on
on ui_control($dynKnob)
{Connect to LP Filter}
set_engine_par($ENGINE_PAR_CUTOFF,$dynKnob,-1,0,1)
set_knob_label($dynKnob,get_engine_par_disp($ENGINE_PAR_CUTOFF,-1,0,1))
end on
on controller
if ($layerLearn=1)
$layerCC := $CC_NUM
$layerLearn := 0
end if
if ($layerCC=$CC_NUM)
$layerKnob := %CC[$layerCC]
end if
if ($dynLearn=1)
$dynCC := $CC_NUM
$dynLearn := 0
end if
if ($dynCC=$CC_NUM)
$dynKnob := %CC[$dynCC]
end if
end on
if ($dynLearn=1)
$dynCC := $CC_NUM
$dynLearn := 0
end if
if ($dynCC=$CC_NUM)
$dynKnob := %CC[$dynCC] * 7874
set_engine_par($ENGINE_PAR_CUTOFF,$dynKnob,-1,0,1)
set_knob_label($dynKnob,get_engine_par_disp($ENGINE_PAR_CUTOFF,-1,0,1))
end if
end on
Hey Casey, I'm Casey. Nice to meet you!
you just need a couple more lines and you're there. You didn't set the destination for the controller in Raptor4's template, also you have to scale the knob and midi values on one end.
Try adding these changes to the Controller CB.
Code:if ($dynLearn=1) $dynCC := $CC_NUM $dynLearn := 0 end if if ($dynCC=$CC_NUM) $dynKnob := %CC[$dynCC] * 7874 set_engine_par($ENGINE_PAR_CUTOFF,$dynKnob,-1,0,1) set_knob_label($dynKnob,get_engine_par_disp($ENGINE_PAR_CUTOFF,-1,0,1)) end if end on
First post on the forums. Hope it's useful. Big fan of the community here, you guys are amazing.
. I however did not know you had to set_engine_par and knob_label again.
In this example of a user defined CC# for both knobs, is it still safe to use the $dead_cc idea to control my modulators, or is there another way I should approach this last step?