The set_engine_par() command is used to control or set almost any engine parameters like volume, pan, tune, fx, lfo’s, envelopes and more. So wiht this command we actually control Kontakt via our custom UI. So set_engine_par() is mostly used in combination with the on ui_control callback whenever we use custom knobs or buttons to control Kontakt’s FX, Modulators or any other engine parameter.
here goes the engine parameter variable. All engine parameter variables start with the prefix “$ENGINE_PAR_”
We use the $ENGINE_PAR variables like an address to tell Kontakt what to control at all. The variable $ENGINE_PAR_VOLUME for example addresses all volumes (see image). Via group, slot, generic we define which specific volume we like to address .. read more below.
There are many many engine parameter variables and you find them all listed in your KSP reference guide under “Engine Parameter Variables”.
here goes the value we “send” to the engine. In most cases it’s any integer between 0 to 1000000. Kontakt translates this value into any engine specific value. So 0 would set the Volume to -inf and 1000000 sets the volume to +12.0 dB any other value can in this case produce decimals like 6.3 dB.
Or another example: with $ENGINE_PAR_PAN, 0 would be the very left and 1000000 the very right
this is also part of the addressing. This time it tells Kontakt at which level the engine parameter should be addressed.
Any value >= 0 addresses a group we have created (inside the groups tab). It’s also any brownish area inside the edit mode. Whereas the value represents the group’s index. So “3” would be group idx 3 (which is actually our 4th group since the index starts at 0: group 1 = idx 0).
LFOs or Envelopes are also on a group level
-1 addresses an Instrument FX or the Busses. It’s all white or light-gray areas. (see image below).
addresses the slot in which an FX resides. It can also address a modulator.
When a slot is not needed we set it to -1 e.g. with any engine parameters on an instrument level like the Volume or Pan
“0 – 7” to address an FX slot. There are always 8 slots on each level (group, bus or instrument level), starting with zero. So if we want to set a parameter in the first FX slot, the slot value would be “0”.
find_mod() if we want to address LFOs, Envelopes or other modulators.
-1 for any other application like the Volume.
this final parameter is rather generic. It is used to help addressing the Send FX module, Insert FX modules, modulators, any parameter inside buses.
Set it to -1 for any other parameters outside FX, modules or buses like vol, pan, tune..
1 for insert FX
0 for send FX
$NI_BUS_OFFSET + [0-15] to address the paramters inside buses. $NI_BUS_OFFSET is a variable given by Kontakt. You simply need to add the bus number then. Like “$NI_BUS_OFFSET + 0” addresses the first bus.
find_mod(<group-idx>,<mod-name>) If we want to address LFO’s or Envelopes or other modulators we need the find_mod() command which will fin the right generic mod index for us by the mod name you have given.
-1 for any other applications like Volume or Pan (outside buses)
this button bypasses all instrument insert FX in any slot.
on init declare ui_switch $bypass declare $count make_perfview end on on ui_control($bypass) $count := 0 while ($count < 8) set_engine_par($ENGINE_PAR_EFFECT_BYPASS,$bypass,-1,$count,-1) inc($count) end while end on
Volume Knob (all groups)
this knob changes the volume of all groups simultaneously
on init declare ui_knob $volume(0, 1000000,10000) declare $count make_perfview end on on ui_control($volume) $count := 0 while ($count < $NUM_GROUPS) set_engine_par($ENGINE_PAR_VOLUME,$volume,$count,-1,-1) inc($count) end while end on
Volume Knob (main Volume)
this knob changes the main volume of our instrument
on init declare ui_knob $volume(0, 1000000,10000) declare $count make_perfview end on on ui_control($volume) set_engine_par($ENGINE_PAR_VOLUME,$volume,-1,-1,-1) end on
Volume Knob (Bus 1)
this knob changes the volume of bus 1
on init declare ui_knob $volume(0, 1000000,10000) declare $count make_perfview end on on ui_control($volume) set_engine_par($ENGINE_PAR_VOLUME,$volume,-1,-1,$NI_BUS_OFFSET + 0) end on
Attack Rate – AEG
this knob controls the Attack rate of the default AEG of the first group (with index 0).
on init declare ui_knob $Attack (0,1000000,100) end on on ui_control ($Attack) set_engine_par($ENGINE_PAR_ATTACK,$Attack,0,find_mod(0,"ENV_AHDSR"),-1) end on
We are sorry that this post was not useful for you!
NOTE: highly negative votes may be removed without any reasonable given feedback!
Tell us how we can improve this post?