Welcome to Part 3 of our Kontakt Workflow series! This post will cover additional ways you can optimize CPU and RAM usage within Kontakt, as well as features such as RAM Purge, batch resaving and NCW compression.
Read Part 1 – Click Here!
Read Part 2 – Click Here!
CPU Usage Revisited
You may recall from our previous guide that Kontakt can eat up a lot of CPU with high polyphony and disk streaming (DFD). You already know that tweaking disk streaming, audio interface buffer length, and multicore options can help improve performance. However, there are other factors that can eat up CPU as well.
Generic Warning: When editing any of your Kontakt instruments, be sure to save your edited versions as NEW copies so you can always return to or restore the original library versions!
Group & Instrument Effects: Kontakt comes replete with a variety of useful effects, ranging from reverbs and EQs to new additions like the Transient Master and Feedback Compressor. These things can quickly eat up CPU, particularly at a “group” level. Whereas Instrument effects have one instance per patch, Group FX can rapidly multiply; an instrument with 200 groups and a simple lowpass filter in each is actually running 200 SEPARATE filter instances!
If you’re sure you don’t need certain FX in your instrument, open it up with the wrench icon, then go to the Group Editor, select “Edit All Groups” and scroll down. You should see both the group effects (“Group Insert FX”) and then the Insert Effects on the instrument level underneath. You may also want to check the Send Effects as well.Below: Editing FX for an instrument. Use BYPASS mute FX, or the X in the upper right of each icon to delete.
RAM Usage Revisited
Just as with CPU performance, there are some additional factors that can cause your memory usage to balloon dramatically. Thankfully, there are some relatively easy fixes available.
Database Size: Now, don’t get us wrong – the database is a great tool, as we described in part 1, for organizing your samples into a simple, searchable catalog. However, for every instrument you add to the Database, Kontakt itself takes up a little bit more RAM in your DAW. If you have a particularly large database you may be adding 100mb or even more per instance. It may then be wise to slim down the database if you have lots of instruments & patches that go largely unused.Below: Database options in Kontakt. REMOVE the stuff you don’t use, and make sure option #2 is UNCHECKED.
Instrument Max Voices: More active voices (polyphony) increases CPU usage. That makes sense. But did you know that the MAX voices setting for any given instrument in Kontakt actually uses up RAM even with no voices being played? To delve into this further, check out the Monitor tab in the Kontakt browser, and then the Engine subtab.Below: Looking under-the-hood at Kontakt’s memory usage.
Here you can see Kontakt’s memory usage broken down into four categories.
Object Memory is allocated for the Database as well as all of your instruments, and all the modules within those instruments (effects, modulators, etc.)
Sample Memory is used by the actual audio within each instrument. More samples, longer samples, and higher bitrate/samplerate audio will increase this.
Voice Memory is largely based on things like modulators and FX within your instrument, and, most importantly, multiplies based on # of max voices!
DFD Voice Memory is used when notes are played and audio is streamed from the disk.
But wait – what about that number displayed on the instrument itself?Below: This number is only PART of the story…
As it turns out, the displayed memory usage here only refers to the Sample Memory being used. It does not take into account other factors. This is an important distinction for many newer, complex Kontakt instruments like our Celestia: Heavenly Sound Design collection. The Celestia patch pictured is using 113.87mb of Sample Memory, and 133.27mb of Voice Memory.Below: The best way to reduce RAM for complex instruments!
This being a mono bass instrument, we can switch the max voices to something much lower, like 4. Doing so dramatically reduces the Voice Memory – from 133.27 to 4.16mb! But the opposite can also happen. Going from 128 to an excessive 512 max voices balloons the memory use to 520mb.
Not all instruments are affected so drastically by Max Voices. Simpler patches with fewer groups, effects, and modulators will likely eat up less Voice Memory to begin with. Nonetheless, it’s always a wise idea to first observe how many voices you need and then, based on that, reduce max voices where possible. You can also tinker in patches and remove unused FX – particularly group FX – if you know they’re not needed, as this can reduce RAM use as well. Just remember to save backups!
CPU Profiling Mode
If you’re having trouble determining what instruments – or what components within those instruments – is eating up all your processing power, simply select the CPU Profiling Mode option in the Monitor -> Engine tab. With this option activated, each instrument loaded into Kontakt will show a CPU usage % in the title of the instrument.Below: With CPU Profiling activated, a patch in Celestia.
By opening any given instrument, you can get even more granular by seeing CPU usage for specific filters, modules, and effects. For example, in the image below, we’ve loaded an instrument currently using the “tm pro” voice mode (allowing for high-quality time and pitch shifting) with a few notes of polyphony. Disabling HQ mode, changing the playback mode to ‘sampler’, or switching HQI from “perfect” to “standard” will all reduce the CPU usage considerably.Below: A Celestia patch in TM Pro mode.
Note that HQI (high quality interpretation) is only relevant for sampler & DFD modes, and that if you change the setting to lower quality, you may want to change it back before rendering time.
The RAM Purge
When dealing with very large patches, such as heavily multisampled orchestral instruments, all of the above tweaks may not make nearly as much of an impact as using Kontkat’s purge function. The purpose of purging samples is to save memory by only loading samples into memory that are actually used. It’s a simple concept: why should you load 500mb of french horn samples covering 2 octaves when you only need one note?
There are a few ways you can use this feature, but the simplest way is as follows. Load the instrument you want to use, then write your MIDI notes as normal. Once you’re done, go to the Purge menu and select reset markers. Then, play your part from start to finish. What will happen is that Kontakt ‘marks’ or flags every sample actually used in the part. Then, simply hit update sample pool and all UNUSED samples (i.e. those not played in your part) will be dropped. You’re done!
Another approach, which may be more relevant for libraries with lots of random variation (round robin, zone transposition, etc) is to select purge all samples option first and then simply play. Samples will then be dynamically loaded into RAM as they are triggered. You can always hit reload all samples to return the patch to normal.Below: You can also use purging at a global level by using the “Purge” button in the Kontakt top toolbar.
At some point, you’ve probably encountered an error popup in Kontakt saying that you’re missing samples. It’s a minor annoyance that is easily resolved by going to “Browse for folder” and selecting where the samples for that patch are located.Below: Samples missing from a VOCALISA patch.
This minor annoyance can turn into a real time-waster if you have dozens or even hundreds of patches from a library, all of which have missing samples. Luckily, there’s a way to get around it – the “Batch Resave” feature. Here’s how it works.
Step 1: BACK UP the instruments you want to resave.
Step 2: Go to the Files menu and hit Batch Resave. Select “YES” at the dialog popup. Note that you do not need any patches loaded in Kontakt for this to work.
Step 3: In the “Browse for Folder” popup, select the folder of NKI/NKM instruments that you want to batch resave.
Step 4: A dialog should pop up displaying ALL missing samples for instruments in that folder. At the bottom, make sure “Allow alternate file types” is checked (this will check for both WAV and NCW), and then use the “Browse for folder” option to select the appropriate Samples folder where your WAV/NCW samples are stored for that library.
Step 5: You’re done! All of the patches are resaved in-place. Simply go to their folder and load them again, and you’ll be good to go.
Besides fixing “missing sample” errors, we’ve also heard anecdotal evidence suggesting that doing a batch resave can help speed up load times. There’s really no harm in doing it, so make use of this feature whenever you can!
In 2011, Native Instruments introduced the “NCW” compression format. NCW files are losslessly compressed from WAV or AIFF files, saving up to 50% memory both on your hard drive and in active memory when the samples are loaded. This is a remarkable technology with virtually no downsides, and you can make use of it with your own Kontakt instruments easily. For this, we’ll be exploring the Collect samples / Batch compress function, available in the Files menu.Below: The Batch Compress dialog.
Here’s the step by step process – once again, back up your files first.
Step 1: Click on Collect Samples / Batch Compress in the Files menu. You don’t need any patches loaded.
Step 2: Under Source Folder, select the folder of Instruments you’d like to use NCW compression. Any WAV samples used in those NKI/NKM instruments will be converted to NCW.
Step 3: For Destination Folder, create a new folder called something like “My Library (NCW)” and put it wherever you want. When the process is complete, this folder will contain both the Instruments and the NCW files.
Step 4: We recommend selecting the “Collect Samples and create new destination folder” option. Also, make sure “Lossless compressed NCW” is selected for Destination Sample Format, although you CAN convert the other way if you want.
Step 5: Press “Convert”, and then wait. This can take quite awhile depending on the size of the sample pool you’re converting.
Step 6: Once complete, go to the new folder you created. You should see two subfolders: Collected Samples and Instruments. You can move these wherever you want; however if you converted a commercial Kontakt library, be aware that you may be missing various data and resource files. You may want to move these samples + instruments back to their original locations, and you may need to do a batch resave to make sure everything is properly hooked up.
Overall, NCW compression is almost universally the best option for minimizing resource usage of Kontakt instruments. There are only two potential reasons not to use it. One is if you want to use the WAV samples directly in your DAW – for example, drum loops, cinematic impacts, etc. However, if you have the hard drive space available, just keep both NCW & WAV versions so you can use WAV in your DAW, and NCW in Kontakt.
Another potential reason is highly anecdotal, but some users have reported that NCW files cause longer load times in their Kontakt installation. The veracity of this claim is definitely up for debate, but it’s worth noting here in case you’ve experienced similar issues.
Thank you for reading this guide! We hope that if you enjoyed it, you’ll share it with your friends and give us feedback on what you’d like to see next.
Read Part 1 – Click Here!
Read Part 2 – Click Here!