Engine Parameter Commands
get_mod_idx()
| |
---|---|
Returns the slot index of an internal modulator or external modulation slot | |
| The index of the group |
| The name of the internal (LFO, envelope, step modulator...) or external (velocity, key position, mono aftertouch...) modulator. Each modulator has a predefined name, based on its type. This name can be changed when the Script Editor's text edit area is opened, then right-clicking on the modulator. |
Examples
on init declare $grp_idx := 0 declare $env_idx $env_idx := get_mod_idx($grp_idx, "VOL_ENV") declare ui_knob $Attack (0, 1000000, 1) $Attack := get_engine_par($ENGINE_PAR_ATTACK, $grp_idx, $env_idx, -1) set_knob_unit($Attack, $KNOB_UNIT_MS) set_knob_label($Attack, get_engine_par_disp($ENGINE_PAR_ATTACK, $grp_idx, $env_idx, -1)) end on on ui_control ($Attack) set_engine_par($ENGINE_PAR_ATTACK, $Attack, $grp_idx, $env_idx, -1) set_knob_label($Attack, get_engine_par_disp($ENGINE_PAR_ATTACK, $grp_idx, $env_idx, -1)) end on
Controlling the attack time of the volume envelope of the first group. Note: the envelope has been manually renamed to "VOL_ENV"
on init declare $count declare $mod_idx $mod_idx := get_mod_idx(0, "VEL_VOLUME") declare ui_slider $VelAmt (0, 1000000) if ($mod_idx # $NI_NOT_FOUND) $VelAmt := get_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY, 0, $mod_idx, -1) end if make_persistent($VelAmt) end on on ui_control ($VelAmt) $count := 0 while($count < $NUM_GROUPS) $mod_idx := get_mod_idx($count, "VEL_VOLUME") if ($mod_idx # $NI_NOT_FOUND) set_engine_par($ENGINE_PAR_MOD_TARGET_INTENSITY, $VelAmt, $count, $mod_idx, -1) end if inc($count) end while end on
Creating a slider which controls the velocity to volume modulation intensity of all groups, if they exist
See Also
get_target_idx()
| |
---|---|
Returns the modulation target slot index of an internal modulator | |
| The index of the group |
| The slot index of an internal modulator (LFO, envelope, step modulator...). Can be retrieved with |
| The name of the modulation target slot. Each modulation target slot has a predefined name, based on its type and the parameter it targets. This name can be changed when the Script Editor's text edit area is opened, then right-clicking on the modulation target slot. |
Examples
on init declare $mod_idx declare $target_idx $mod_idx := get_mod_idx(0, "FILTER_ENV") $target_idx := get_target_idx(0, $mod_idx, "FILTER_ENV > CUTOFF") declare ui_knob $FilterEnv (-1000, 1000, 10) set_knob_unit($FilterEnv, $KNOB_UNIT_PERCENT) make_persistent($FilterEnv) end on on ui_control ($FilterEnv) if ($mod_idx # $NI_NOT_FOUND and $target_idx # $NI_NOT_FOUND) set_engine_par($ENGINE_PAR_MOD_TARGET_MP_INTENSITY, 500000 + ($FilterEnv * 500), 0, $mod_idx, $target_idx) end if end on
Controlling the envelope to filter cutoff modulation amount in the first group. Note: the filter envelope has been manually renamed to "FILTER_ENV", and the target to "FILTER_ENV > CUTOFF".
See Also
get_engine_par()
| |
---|---|
Returns the value of a specific engine parameter | |
| Specifies the engine parameter by using one of the built in engine parameter variables. |
| The index (zero-based) of the group in which the specified parameter resides. If the specified parameter resides on an Instrument level, enter -1. |
| The slot index (zero-based) of the specified parameter. It applies only to group/instrument effects, modulators and modulation intensities. For group/instrument effects, this parameter specifies the slot in which the effect resides (zero-based). For modulators and modulation intensities, this parameters specifies the index which you can retrieve by using:
For all other applications, set this parameter to -1. |
| For instrument effects, this parameter distinguishes between:
For buses, this parameter specifies the actual bus:
For internal modulators, this parameter specifies the modulation slider which you can retrieve by using:
For Step Modulator, this parameter specifies the step whose value is to be retrieved by using For all other applications, set this parameter to -1 |
Examples
on init declare $i declare ui_label $label (2, 6) set_text($label,"Release Trigger Groups:") while ($i < $NUM_GROUPS) if (get_engine_par($ENGINE_PAR_RELEASE_TRIGGER, $i, -1, -1) = 1) add_text_line($label, group_name($i) & " (Index: " & $i & ")") end if inc($i) end while end on
Output the name and index of release trigger group
on init declare ui_label $label (2, 6) declare ui_button $Refresh declare $i declare !effect_name[128] !effect_name[$EFFECT_TYPE_NONE] := "None" !effect_name[$EFFECT_TYPE_PHASER] := "Phaser" !effect_name[$EFFECT_TYPE_CHORUS] := "Chorus" !effect_name[$EFFECT_TYPE_FLANGER] := "Flanger" !effect_name[$EFFECT_TYPE_REVERB] := "Reverb" !effect_name[$EFFECT_TYPE_DELAY] := "Delay" !effect_name[$EFFECT_TYPE_IRC] := "Convolution" !effect_name[$EFFECT_TYPE_GAINER] := "Gainer" while ($i < 8) add_text_line($label, "Slot: " & $i + 1 & ": " & ... !effect_name[get_engine_par($ENGINE_PAR_SEND_EFFECT_TYPE, -1, $i, -1)]) inc($i) end while end on on ui_control ($Refresh) set_text($label, "") while ($i < 8) add_text_line($label, "Slot: " & $i + 1 & ": " & ... !effect_name[get_engine_par($ENGINE_PAR_SEND_EFFECT_TYPE, -1, $i, -1)]) inc($i) end while $Refresh := 0 end on
Output the effect types of all eight send effect slots
See Also
Module Status Retrieval
get_engine_par_disp()
| |
---|---|
Returns the displayed string of a specific engine parameter | |
| Specifies the engine parameter. |
| The index (zero-based) of the group in which the specified parameter resides. If the specified parameter resides on an Instrument level, enter -1. |
| The slot index (zero-based) of the specified parameter. It applies only to group/instrument effects, modulators and modulation intensities. For group/instrument effects, this parameter specifies the slot in which the effect resides (zero-based). For modulators and modulation intensities, this parameters specifies the index which you can retrieve by using:
For all other applications, set this parameter to -1. |
| This parameter applies to instrument effects and to internal modulators. For instrument effects, this parameter distinguishes between:
For buses, this parameter specifies the actual bus:
For internal modulators, this parameter specifies the modulation slider which you can retrieve by using:
For Step Modulator, this parameter specifies the step whose value is to be read by using For all other applications, set this parameter to -1 |
Examples
on init declare $i declare ui_label $label (2, 6) set_text($label, "Group Volume Settings:") while ($i < $NUM_GROUPS) add_text_line($label, group_name($i) & ": " & get_engine_par_disp($ENGINE_PAR_VOLUME, $i, -1, -1) & " dB") inc($i) end while end on
Query the group volume settings in an instrument
get_voice_limit()
| |
---|---|
Returns the voice limit for the Time Machine Pro mode of the source module | |
| The voice type, can be one of the following:
|
Examples
on init declare ui_label $label (3, 2) add_text_line($label, "Standard Voice Limit: " & get_voice_limit($NI_VL_TMPRO_STANDARD)) add_text_line($label,"HQ Voice Limit: " & get_voice_limit($NI_VL_TMPRO_HQ)) end on
Displaying TM Pro voice limits
See Also
output_channel_name()
| |
---|---|
Returns the channel name for the specified output | |
| The number of the output channel (zero-based, i.e. the first output is 0) |
Examples
on init declare $i declare ui_menu $menu add_menu_item($menu, "Default", -1) $i := 0 while ($i < $NUM_OUTPUT_CHANNELS) add_menu_item($menu, output_channel_name($i), $i) inc($i) end while $menu := get_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, 0, -1, -1) end on on ui_control ($menu) set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL,$menu, 0, -1, -1) end on
Mirroring the output channel assignment menu of the first group
See Also
General: $NUM_OUTPUT_CHANNELS
, $ENGINE_PAR_OUTPUT_CHANNEL
set_engine_par()
| |
---|---|
Control various KONTAKT parameters and buttons | |
| The engine parameter to be modified, e.g. |
| The value to which the specified parameter is set. The range of values is always 0 to 1000000, except for switches in which case it is 0 or 1. |
| The index (zero-based) of the group in which the specified parameter resides. If the specified parameter resides on an Instrument level, enter -1. Buses and Main FX also reside on Instruments level, so you must set <group> to -1 if you want to address a bus. |
| The slot index (zero-based) of the specified parameter. This applies only to group/instrument effects, modulators and modulation intensities. For group/instrument effects, this parameter specifies the slot in which the effect resides (zero-based). For modulators and modulation intensities, this parameters specifies the index which you can retrieve by using:
For all other applications, set this parameter to -1. |
| This parameter applies to instrument effects and to internal modulators. For instrument effects, this parameter distinguishes between:
For buses, this parameter specifies the actual bus:
For internal modulators, this parameter specifies the modulation slider which you can retrieve by using:
For Step Modulator, this parameter specifies the step whose value is to be changed by using For all other applications, set this parameter to -1 |
Examples
on init declare ui_knob $Volume (0, 1000000, 1000000) end on on ui_control ($Volume) set_engine_par($ENGINE_PAR_VOLUME, $Volume, -1, -1, -1) end on
A knob controls the instrument volume
on init declare ui_knob $Freq (0, 1000000, 1000000) declare ui_button $Bypass end on on ui_control ($Freq) set_engine_par($ENGINE_PAR_CUTOFF, $Freq, 0, 0, -1) end on on ui_control ($Bypass) set_engine_par($ENGINE_PAR_EFFECT_BYPASS, $Bypass, 0, 0, -1) end on
Controlling the cutoff and bypass button of any filter module in the first slot of the first group
on init declare ui_knob $Knob (-1000, 1000, 10) declare $mod_idx $mod_idx := get_mod_idx(0, "FILTER_ENV") declare $target_idx $target_idx := get_target_idx(0, $mod_idx, "ENV_AHDSR_CUTOFF") end on on ui_control ($Knob) set_engine_par($ENGINE_PAR_MOD_TARGET_MP_INTENSITY, $Knob * 1000, 0, $mod_idx, $target_idx) end on
Controlling the filter envelope amount of an envelope to filter cutoff modulation in the first group. Note: the filter envelope has been manually renamed to "FILTER_ENV".
on init declare ui_knob $Vol (0, 1000000, 1000000) end on on ui_control ($Vol) set_engine_par($ENGINE_PAR_VOLUME, $Vol, -1, -1, $NI_BUS_OFFSET + 15) end on
Controlling the amplifier volume of 16th bus
set_voice_limit()
| |
---|---|
Sets the voice limit for the Time Machine Pro mode of the source module | |
| The voice type, can be one of the following:
|
| The voice limit of the Time Machine Pro mode |
Remarks
Changing voice limits is an asynchronous operation. This means, that one cannot reliably access the newly allocated voices immediately after instantiation. To resolve this, the
set_voice_limit()
command returns an$NI_ASYNC_ID
and triggers theon async_complete
callback.
Examples
on init declare $change_voices_id declare ui_value_edit $Voices (1, 8, 1) make_persistent($Voices) end on on ui_control ($Voices) $change_voices_id := set_voice_limit($NI_VL_TMPRO_STANDARD, $Voices) end on on async_complete if ($NI_ASYNC_ID = $change_voices_id) message("New TMPro Std Voice Limit: " & get_voice_limit($NI_VL_TMPRO_STANDARD)) end if end on
Changing TM Pro voice limits