I've created a script (starting from the script "Humanizer" from Kontakt's preset factory) that allow to set different values to each group. It works great, except when its on a instrument which notes triggers two or more groups at the same time, like on the drum kit "Vintake Kit" of the NI Factory content (or any other multi layer with overheads and room). On that drum kit, it only happen with notes C1 and D1, since those are the only ones that triggers two groups at once (group 0 "bass drum 1" and group 1 "bass drum 3" for the bd, and group 2 "snare 1" and group 11 "snare 2" for the snare). If the shift key is pressed while moving a knob, the script applies the value to all the groups, and then the snare or the bass drum sound wrong, like when two samples of the same sound are played in unison
Here's the script:
Code: Select all
on init
make_perfview
declare $count
declare ui_knob $group (0,$NUM_GROUPS-1,1)
set_control_par_str(get_ui_id($group),$CONTROL_PAR_TEXT, group_name($group))
make_persistent($group)
read_persistent_var($group)
declare %human_gtime[128]
make_persistent(%human_gtime)
read_persistent_var(%human_gtime)
declare ui_knob $hum_time(0,100,1)
set_text($hum_time,"Timing")
make_persistent($hum_time)
read_persistent_var($hum_time)
declare %human_gvel[128]
make_persistent(%human_gvel)
read_persistent_var(%human_gvel)
declare ui_knob $hum_vel(0,100,1)
set_text($hum_vel,"Velocity")
make_persistent($hum_vel)
read_persistent_var($hum_vel)
declare %human_gtune[128]
make_persistent(%human_gtune)
read_persistent_var(%human_gtune)
declare ui_knob $hum_tune(0,100,1)
set_text($hum_tune,"Tuning")
make_persistent($hum_tune)
read_persistent_var($hum_tune)
declare %human_gvol[128]
make_persistent(%human_gvol)
read_persistent_var(%human_gvol)
declare ui_knob $hum_vol(0,100,1)
set_text($hum_vol,"Volume")
make_persistent($hum_vol)
read_persistent_var($hum_vol)
declare $new_time
declare $new_vel
declare $new_tune
declare $new_vol
declare $new_event
declare $shift
end on
on note
$count := 0
while ($count < num_elements(%GROUPS_AFFECTED))
ignore_event($EVENT_ID)
$new_time := random(0,%human_gtime[%GROUPS_AFFECTED[$count]] * 1000)
$new_vel := $EVENT_VELOCITY + (random(-127,127) * %human_gvel[%GROUPS_AFFECTED[$count]] / 200)
$new_tune := random(-1000,1000) * %human_gtune[%GROUPS_AFFECTED[$count]]
$new_vol := random(-60,60) * %human_gvol[%GROUPS_AFFECTED[$count]]
if (in_range($new_vel,0,127))
$new_vel := $new_vel
else
if ($new_vel > 127)
$new_vel := 127
end if
if ($new_vel < 1)
$new_vel := 1
end if
end if
wait($new_time+1)
$new_event := play_note($EVENT_NOTE, $new_vel, 0, -1)
change_tune($new_event, $new_tune, 1)
change_vol($new_event, $new_vol, 1)
inc($count)
end while
message("")
end on
on ui_control($group)
$hum_time := %human_gtime[$group]
$hum_vel := %human_gvel[$group]
$hum_tune := %human_gtune[$group]
$hum_vol := %human_gvol[$group]
set_control_par_str(get_ui_id($group),$CONTROL_PAR_TEXT, group_name($group))
end on
on ui_control($hum_time)
$shift := get_control_par(get_ui_id($hum_time),$CONTROL_PAR_KEY_SHIFT)
if ($shift = 1)
$count := 0
while ($count < $NUM_GROUPS)
%human_gtime[$count] := $hum_time
inc($count)
end while
else
%human_gtime[$group] := $hum_time
end if
end on
on ui_control($hum_vel)
$shift := get_control_par(get_ui_id($hum_vel),$CONTROL_PAR_KEY_SHIFT)
if ($shift = 1)
$count := 0
while ($count < $NUM_GROUPS)
%human_gvel[$count] := $hum_vel
inc($count)
end while
else
%human_gvel[$group] := $hum_vel
end if
end on
on ui_control($hum_tune)
$shift := get_control_par(get_ui_id($hum_tune),$CONTROL_PAR_KEY_SHIFT)
if ($shift = 1)
$count := 0
while ($count < $NUM_GROUPS)
%human_gtune[$count] := $hum_tune
inc($count)
end while
else
%human_gtune[$group] := $hum_tune
end if
end on
on ui_control($hum_vol)
$shift := get_control_par(get_ui_id($hum_vol),$CONTROL_PAR_KEY_SHIFT)
if ($shift = 1)
$count := 0
while ($count < $NUM_GROUPS)
%human_gvol[$count] := $hum_vol
inc($count)
end while
else
%human_gvol[$group] := $hum_vol
end if
end on