How to Create a Kontakt 7 Instrument (Part 3) - Switcheroo

Welcome to the third installment of my multi-part series about how to engage in the beautiful pursuit of building your own instruments, effects, and plugins in the Kontakt Script Processor (KSP).

Prerequisites

This tutorial continues from the second installment of this multi-part series. So, if you have not followed the instructions in our previous installments, best to backtrack and complete those steps. Further, this tutorial requires a full version of Kontakt. Likely, Kontakt 5 or later is fine. However, screenshots in this tutorial are of Kontakt 7.

Getting Started

Continuing from where we left off, please ensure that the following starter code is in place in the scripting window:

```
{this always runs when the script starts}
on init

  {set the basics of the UI, setting the height at 213 and width at 720}
  make_perfview
  set_ui_height_px(213)
  set_ui_width_px(633)

  {declare a variable called $switch that is tied to a button. Set that switch to on }
  declare ui_switch $switch
  $switch := 1

end on

{this runs when the ui_control called $switch is changed}
on ui_control($switch)

  if($switch = 1)
    message("it's on!")
  else
    message("it's off!")
  end if
end on
```

Ensure that the script functions by clicking Apply. Upon clicking Apply followed by clicking switch you should see it's on! or it's off! appearing in the status bar / console at the bottom of the screen.

Step One - Buttons and More Buttons

Step Two - Toggle Time

Step Three - The State of Things

Step Four - Your First Function

Congratulations

You have now finalized the physical interface of your first Kontakt instrument. It could be tempting to get lured in by graphical interfaces, prototyping backgrounds and button layouts in specialized software. However, my recommendation is to keep things simple for the time being. Focus on function over aesthetics for a short while.

The tutorial to follow will allow you to finally produce something musically interesting.

Copyright © 2022 THI. All rights reserved. gelvinwhite.com is operated by THI.

Native Instruments®️ and Kontakt®️ are registered trademarks of Native Instruments GmbH. We have no affiliation with Native Instruments.

kontakt7