Guga Bernardo
04-11-2005, 08:35 PM
This is the KSP script that creates the note repetition effect like in VSL, by making key switch automatic in the SAM horns staccato patch.
The idea of creating automatic keyswitches for instruments that support this feature came to my mind yesterday, beucause I never liked very much to create repetition effects using keyswitches. This script solves this problem by making it all automatic. :)
The UI offers only three options:
Rotate_Mode: The keyswitches are rotated in the same order as they appear in the keyboard. For SAM horns Keyswitch staccatos, the first keyswitch is controled by the Lowest C in an 88 keyboard. Thus the rotate mode will play C#, D, D# and then go back to C again.
Random_Mode: The keyswitches are rotated randomically. The script already prevents two identical keyswitches to occur in a sequence by accident. Thus, if the fist keyswitch is a C the next can only be C#, D and D#. All automatic.
The default mode is Rotate.
Firstnote: The default value is 24, wich corresponds to the lowest C note in my 88 note keyboard. This note is also the first keyswitch note available in the SAM Horns Keyswitch Staccato patch, and as long the keyswitches respect the same pattern, you can use this script in other instruments as well by changing the number 24 into whatever is the first keyswitch for repeated notes.
You should not change this value, unless you wish to adapt this script to others SAM instruments (trumpets, trombones) or patches!!!
Here we go:
1 - Import SAM H KEY - Staccatos (c) into Kontakt 2.
2 - Click on edit instrument
3 - Open the Script Editor
4 - Click on Edit
5 - Paste the following code.
on init
declare $rotate
declare $newrotate
declare ui_button $Rotation_Mode
declare ui_button $Random_Mode
declare ui_value_edit $firstnote (0, 120,1)
$firstnote:=24
$Rotation_Mode:=1
$Random_Mode:=0
make_persistent($rotate)
make_persistent($Rotation_Mode)
make_persistent($Random_Mode)
end on
on ui_control($Rotation_Mode)
$Random_Mode:=0
$Rotation_Mode:=1
end on
on ui_control($Random_Mode)
$Random_Mode:=1
$Rotation_Mode:=0
end on
on note
if($Rotation_Mode=1)
message($rotate)
play_note($firstnote+$rotate,$EVENT_VELOCITY,0,-1)
$rotate:=$rotate+1
if($rotate>3)
$rotate:=0
end if
end if
if($Random_Mode=1)
while($newrotate = $rotate)
$newrotate:=random(0,3)
end while
$rotate := $newrotate
message($rotate)
play_note($firstnote+$rotate,$EVENT_VELOCITY,0,-1)
end if
end on
6 - Save the patch.
Enjoy! :D
The idea of creating automatic keyswitches for instruments that support this feature came to my mind yesterday, beucause I never liked very much to create repetition effects using keyswitches. This script solves this problem by making it all automatic. :)
The UI offers only three options:
Rotate_Mode: The keyswitches are rotated in the same order as they appear in the keyboard. For SAM horns Keyswitch staccatos, the first keyswitch is controled by the Lowest C in an 88 keyboard. Thus the rotate mode will play C#, D, D# and then go back to C again.
Random_Mode: The keyswitches are rotated randomically. The script already prevents two identical keyswitches to occur in a sequence by accident. Thus, if the fist keyswitch is a C the next can only be C#, D and D#. All automatic.
The default mode is Rotate.
Firstnote: The default value is 24, wich corresponds to the lowest C note in my 88 note keyboard. This note is also the first keyswitch note available in the SAM Horns Keyswitch Staccato patch, and as long the keyswitches respect the same pattern, you can use this script in other instruments as well by changing the number 24 into whatever is the first keyswitch for repeated notes.
You should not change this value, unless you wish to adapt this script to others SAM instruments (trumpets, trombones) or patches!!!
Here we go:
1 - Import SAM H KEY - Staccatos (c) into Kontakt 2.
2 - Click on edit instrument
3 - Open the Script Editor
4 - Click on Edit
5 - Paste the following code.
on init
declare $rotate
declare $newrotate
declare ui_button $Rotation_Mode
declare ui_button $Random_Mode
declare ui_value_edit $firstnote (0, 120,1)
$firstnote:=24
$Rotation_Mode:=1
$Random_Mode:=0
make_persistent($rotate)
make_persistent($Rotation_Mode)
make_persistent($Random_Mode)
end on
on ui_control($Rotation_Mode)
$Random_Mode:=0
$Rotation_Mode:=1
end on
on ui_control($Random_Mode)
$Random_Mode:=1
$Rotation_Mode:=0
end on
on note
if($Rotation_Mode=1)
message($rotate)
play_note($firstnote+$rotate,$EVENT_VELOCITY,0,-1)
$rotate:=$rotate+1
if($rotate>3)
$rotate:=0
end if
end if
if($Random_Mode=1)
while($newrotate = $rotate)
$newrotate:=random(0,3)
end while
$rotate := $newrotate
message($rotate)
play_note($firstnote+$rotate,$EVENT_VELOCITY,0,-1)
end if
end on
6 - Save the patch.
Enjoy! :D