Wednesday, 5 March 2014

Scripting

 Figure 1: Label for position the element (button or knob etc)

For me scripting is the most powerful thing in Kontakt. With the script the possible is endless. When somebody mention about script in Kontakt people start thinking it's crazy and they don't really want to mass around with it. But the downside is that they miss a lot of fun parts. You don't really have to be a programmer to do the script in Kontakt. You just have to know which command is doing what then you are good to go. Because since native instrument already done the scripting for the whole program including the presets and library all you have to do is that find out what you need for your instrument then go into Kontakt presets or library's directory find the bit you want then edit it and modify it then incorporate with your instrument and job done. Don't forget that Steve Job never invented iPhone he just known how to put a part together similarly you don't have to be a programmer to do scripting you just have to know what you want and how to put them together. So, here is some of the basic command that you can use:

make_perfview
makes the current tab visible 

set_ui_height_px(<height>)
set the height of your ui in pixels

set_script_title(<text>)
sets the name of your tab 

set_control_par_str(<ui-ID>,<control-parameter>,<value>
use this command in combination with the variables below to set the background

$INST_WALLPAPER_ID
The (fixed) ID of the instrument wallpaper

$CONTROL_PAR_PICTURE
sets the picture name

get_ui_id(<varibale>)
retrieve the numeric id of the specific ui element

on ui_control(<variable>)
UI callback, executed whenever the user changes the respective UI element

declare ui_switch $<variable-name>
creates an ui switch (button)

declare ui_label $<variable-name> (<width>,<height>)
creates an ui label, used for an adjustable background graphic

move_control(<variable>,<x-position>,<y-position>)
positions an element in the grid use it to move the babel to top left corner (0,0)

move_control_px(<variable>,<x-position>,<y-position>
to position with the exact pixels

Here, the ui stand for the user interface. In figure 1 shown that using the move_control command you can place or position you element (such as button or knob etc) and following with the number e.g: (1,4) so the 1 is the horizontal position and 4 is the vertical position. With all these basic command you can do so many thing in script editor. Also don't forget to check the KSP script manual in Kontakt you will find lots of scripting information.

Customise the User Interface

 Figure 1: Instrument Options

Figure 2: Size of the Interface in Pixels

 Figure 3: Final version of the Interface



Creating the user friendly interface is important for our instrument. We can customize our instrument either by using Kontakt instrument option or script editor. But first of all, we need to prepare the background wallpaper for the interface this can be done by using photoshop or paint in Windows or any another program. One important step we need to take extra care is that the size of the interface which is shown in figure 2 and we need to design our interface exactly the same as that otherwise our interface will mass up big time. When we done with our background wallpaper design all we need to do is click on the edit mode and then instrument option then we can upload our design into Kontakt. Base on my experience it is advisable that create a resource container and put your design into the dedicated folder and map the path to that folder so Kontakt will never miss you design. I believe it's a good way to map all our file that contain in Kontakt using the resource container in this way Kontakt will never miss finding the file. To create a resource container folder, again we can do this in the instrument option.

Adding Effects

When the building part finished and it is time to polish the piano sound. Since the goal is to achieve a simple grand piano sounding sample instrument, the main effects would be the ringing sound that the acoustic piano created therefore in my case this it part of the recording process. We did this by pressing the sustain pedal when we did the recording. So, now our piano sample already has this kind of effect. Therefore, not much of effects needed and also the plan is to script the convolution reverb so that will allow the user to select the desire reverb ( Hall, Studio, Church etc). For the instrument I only applied a little bit of compression as well as EQ ( cut off around 50 Hz unwanted frequencies that we can't really hear and cut 3 dB around 1kHz).





Velocity

To achieve realistic sounding piano sample instrument it is necessary to record more velocity layer. As I mentioned before that since I had not have enough time to do that therefore need another technique to manipulate the sound and create a different dynamic. There are so many way to do this for example: since the Kontakt already have algorithm which  stretches velocity zone automatically but the downside is that it is sound rubbish. And also if we will copy the zone then we need to take into account about the CPU consuming as well as the file size. Base on my research, the best way to manipulate the sample is to do the script. Because Kontakt has lots of built in effects and all we have to do is to script them and incorporate with our instrument. Change velocity in the figure allow the user to change the velocity which is good instead of me changing the velocity the user can have the option to change the velocity as they desire. This is the preset from Kontakt all I have to do is to tweak it a bit to suit my instrument.