You don’t have to know how Kontakt sampler (or any other sampler) works in order to make your own music. But some people may be interested in this craft, so I decided to write an article on how Kontakt works. While I focus on Kontakt, all samplers work in similar way. In this article we’ll take a look at the basics of Kontakt and its instrument panel, the basics of scripting to get the idea, and I will also give you a link to some great tutorials about Kontakt scripting.
By the way, this isn’t a practical tutorial, but an overview – I explain how Kontakt generally works, and how Kontakt instruments are made. Then I make some recommendations to people who want to learn how to make Kontakt instruments.
How Does Kontakt Sampler Works?
How does a sampler works? Any sampler is a computer program that allows us to load instruments from libraries and play these instruments to create music. I talked a bit about how Kontakt works in my “How to Make Epic and Orchestral Music” course, part 3. Today, let’s take a quick look at some more details that will be useful for people who want to make their own Kontakt instruments.
The following picture shows Kontakt 5 player with a loaded instrument – Olympus Choir Micro by Soundiron – I’ve loaded “Full Ensemble” patch.
Notice a list of various patches (which sometimes are called “instruments”) on the left, under “Olympus Micro Choir” graphical banner (which actually tells us this is an official Kontakt library). You can see “Full Ensemble” there (highlighted), Divisi Men, Divisi Women and so on, with an .nki extension. These patches are built as separate files and can be found in the instrument’s folder on your hard drive, like the picture below shows.
Each of these patches contains computer code – special Kontakt scripting language that tells the sampler what to do. When you click the tool icon on the left of the patch’s name, you will see the properties of the patch (its “edit mode”). Kontakt instrument developers use this panel to develop the instrument. Here you can add various FX plugins such as EQ, or reverb, set modulation settings and so on.
On the image above notice the upper row of buttons:
- Instrument Options – Here you can set basic settings for the instrument. You can add various plugins, or set the modulation (attack, delay, release) of samples etc.
- Group Editor – Here you can edit various groups of samples. Groups are categories, to which you assign samples – actual recordings of the notes played by the instrument. Then, with scripting, you can control these groups. These groups are used for scripting and playback purposes.
- Mapping Editor – Here you can assign audio files (recorded sounds of the instrument you’re sampling) to the keys of a piano roll, and even various velocities.
- Wave Editor – Here you can edit the wave form of each individual sound mapped to a key. You may edit the wave form, and set the part of the sound sample to loop. This is where you make long sustained notes ;).
- Script Editor – And here you can actually write the code, using Kontakt scripting language. The script has two functions: it’s used to build dedicated interface of the instrument, and it controls the instrument’s behavior.
The picture below shows an example of a simple Kontakt test script.
Kontakt Script is a normal programming/scripting language. It uses functions, callbacks, variables and constants, and some math, to tell the computer what to do with groups and recorded sounds (samples). The sounds are recorded and edited, and then each sound is mapped for a specific key, and specific velocity. Thus, a Kontakt instrument can use hundreds or even thousands of high quality sounds. This is the reason instrument libraries can be anywhere between 1 GB and 100 GB in size.
All right – how all of this works together?
When you load the patch, the patch’s “graphical interface” already contains a lot of information – it tells Kontakt where the samples are on the hard drive, what plugins must be loaded as inserts or sends, how modulation is set, and how the patches are mapped to piano keys.
When you press the key, the script takes over – it looks what key you pressed, and searches the code to look for a callback for this particular action. Once the callback code is found, inside it are instructions that tell the sampler what to do next: usually the callback tells the sampler to play the sound mapped for this particular key. But the callback can also tell the sampler to play a release recording, or initiate a legato transition recording, or choose a proper recording based on a velocity of the key being pressed.
For example, if you load a strings library, the patch will tell the sampler where the sounds are, how are they mapped and where the scripts are. As you play a note, the sampler looks for the script, and the script looks at the key being pressed. Then it looks for a piece of code that tells it what to do – then plays the sound that has been mapped for the key being pressed. When the key is released, the script looks for the code to tell the sample what to do next.
Go ahead and load some Kontakt patches yourself, and switch between various tabs mentioned earlier. While groups, mapping and wave editor will be freely accessible and ready for you to take a look, the script tab may be hidden.
The above picture shows a script tab selected – it shows an interface of the instrument (without the background image). The “Edit” button in the bottom left corner would normally display the script, but it won’t. This is because most Kontakt instruments are locked and/or encoded. Developers do this to protect their intellectual property.
Locked means you need a password to display the script. Encoded means the script itself is displayed in a completely unreadable form. Developers do this to protect their own code from stealing.
Go ahead and check some your instruments – maybe one of the smaller, more independent ones will have an open code and you’ll be able to see how it looks like.
How a Kontakt Instrument is Made
How a Kontakt instrument is made, generally speaking?
First you need an idea – what instrument do you want to build?
Let’s say you want to sample a flute. First, you need to define the scope of the project. For example, you want the instrument to play sustain notes, short staccato notes, have true legato transitions. You need to set up your studio and record the instrument – or hire a flute player, rent a studio space, recording engineer and so on. Then you need to record the samples. You need to record all the notes the flute can play – and you need to record them multiple times, so you can create round robin for your Kontakt instrument (randomize the notes being played to avoid machine gun effect). Then you need to record all the staccato articulation. And then you need to record all the smooth transitions between each of the notes to program true legato later. And then you need to repeat all of this a couple of times to record all the samples with multiple dynamics.
Now you have your samples recorded. You need to take them back to your studio and process them. Samples must be cleared and sometimes EQ-ed. You need to cut them, so you have separate “core” of sustain notes to loop, and you also need the attacks and releases, too. You need to process the legato samples and staccato samples. And then, once the post-processing is done, you need to load everything to Kontakt and map the instruments – assign every single sample to proper piano key, and proper velocity.
And then you need to start coding – you need to write a rather large script that will control how these samples are played. This requires a lot of coding and testing. In the meantime, you need to design the interface (or hire someone to do this).
That’s a lot of work. If you ever wondered why virtual instruments are so expensive, here’s your answer. A single person can create simple instruments, but for bigger projects, a lot of people must be hired and paid. And this is reflected in library’s price.
If you want to start building Kontakt instrument, start with something simple, like drum library, or sound design collection without any legato transitions. Then, as you learn more and more, try to build an instrument with true legato transitions. But how to actually build these instruments?
How to Learn Kontakt Scripting and Building Kontakt Instruments
This article is not a tutorial in making Kontakt instruments – a tutorial such as this would take an entire book, or a series of long videos, which (videos) has already been done on Xtant Audio, which I recommend to everyone who wants to learn how to build Kontakt instruments.
Xtant Audio has a series of tutorials teaching how to make Kontakt instruments, from building very basic patches to scripting legato instruments. Check it out – and no, this isn’t an affiliate link :).
But even with the videos, you will need to do some reading.
Kontakt’s developers, Native Instruments, provide manuals which you should read if you want to develop your own instruments:
- Main Kontakt Manual – this will teach you how to use Kontakt sampler with all its FX plugins, tools and tricks :).
- Kontakt Scripting Language Reference Guide – this is a language reference. It lists all scripting functions, variables and constants that a computer programmer needs to know.
There’s no need to sugar coat it – building Kontakt instruments require you to know how to code. If you already have some experience with coding, and you know what functions or variables are, then learning Kontakt scripting will be easier. If you don’t know these terms, and you never coded anything before in your life, I suggest you head to CodeAcademy, then pick up one of their courses, like Java, C# or Python – these are rather simple languages and they will teach you the basics of coding. Kontakt doesn’t use these languages, but the basic ideas (functions, variables etc.) are common throughout all programming languages.
How to Publish Kontakt Instrument
Once you’re done with production, how do you publish your instrument? Well, you can simply release it – pack all the files into a ZIP or RAR package, and make it downloadable on your website, or sell it through your website, just like that.
If you want to make the instrument an official Kontakt library, though, you need to contact Native Instruments and they will explain to you how to their license system works – you will have to pay some money, and then you will be able to sell the instrument as an official library, with it showing in library’s tab in Kontakt sampler, locked script section and so on. This isn’t mandatory. If you don’t want your instrument to be “official”, you can simply encode the scripts so they’re unreadable, and you can even use some tricks to make the “edit script” button unclickable. Xtant Audio has some tips on this matter.
While this article wasn’t practical, I hope I gave you the general idea about building Kontakt instruments – with these few resources I linked here you should be able on your way to becoming Kontakt instrument developer :).
If you have any questions or suggestions to improve this article, please let me know in the comments below.