KONTAKT - Modulator amount slider not show semitone range using $ENGINE_PAR_INTMOD_INTENSITY

VST, AU, AAX, CLAP, etc. Plugin Virtual Instruments Discussion
Post Reply New Topic
RELATED
PRODUCTS
Kontakt

Post

Hi

This script use $ENGINE_PAR_INTMOD_INTENSITY for control the amount intensity of a modulator (PB_PITCH) on the source section, but it returns percent values. What is the value for set that correctly?
$test/80000 gives 12 st but the knob moves within a range of 0-12, not -12 to 12, and if the knob min is set to -1000000 (which I'll like to keep to 0), when the knobs is around 6 st, the invert button turns on.
$ENGINE_PAR_MOD_TARGET_INTENSITY gives that value, but I'll prefer not use it since doesn't show the "-" on the negative values , add it needs to add the line $MOD_TARGET_INVERT_SOURCE and set the knob range to -1000000 as knob min.

Code: Select all

on init
    declare $count
    declare ui_knob $test (0,1000000,1)
		set_knob_unit($test,$KNOB_UNIT_ST)

	declare $mod_idx
		$mod_idx := find_mod(0,"PB_PITCH")
    	$test := get_engine_par($ENGINE_PAR_INTMOD_INTENSITY,0,$mod_idx,-1)
		set_knob_label($test, get_engine_par_disp($ENGINE_PAR_INTMOD_INTENSITY, 0, $mod_idx, -1))
end on

on ui_control ($test)
	set_engine_par($ENGINE_PAR_INTMOD_INTENSITY,$test, 0, $mod_idx, -1)
	set_knob_label($test, get_engine_par_disp($ENGINE_PAR_INTMOD_INTENSITY, 0, $mod_idx, -1))
end on

Cheers
Last edited by hellishvictor on Thu Apr 25, 2019 5:24 pm, edited 1 time in total.

Post

INTMOD_INTENSITY will always return % values, that's how it works internally. You can indeed use MOD_TARGET_INTENSITY to show the pitch value and add the minus for negative values yourself. There is no need to set the knob range down to -1000000 at all, you can keep using INTMOD_INTENSITY to set the engine par, and just use MOD_TARGET_INTENSITY to retrieve the display value.

Code: Select all

on init
    declare !sign[2]
    !sign[1] := "-"

	declare ui_knob $Mod (0, 1000000, 1)

	$Mod := 500000
	set_knob_defval($Mod, 500000)
	set_knob_unit($Mod, $KNOB_UNIT_ST)

	make_persistent($Mod)
end on

on persistence_changed
    set_knob_label($Mod, !sign[get_engine_par($MOD_TARGET_INVERT_SOURCE, 0, find_mod(0, "PB_PITCH"), -1)] & get_engine_par_disp($ENGINE_PAR_MOD_TARGET_INTENSITY, 0, find_mod(0, "PB_PITCH"), -1))
end on

on ui_control ($Mod)
    set_engine_par($ENGINE_PAR_INTMOD_INTENSITY, $Mod, 0, find_mod(0, "PB_PITCH"), -1)
    set_knob_label($Mod, !sign[get_engine_par($MOD_TARGET_INVERT_SOURCE, 0, find_mod(0, "PB_PITCH"), -1)] & get_engine_par_disp($ENGINE_PAR_MOD_TARGET_INTENSITY, 0, find_mod(0, "PB_PITCH"), -1))
end on

Post

Thank you !

Post Reply

Return to “Instruments”