Week 4: Going off Script
This week I implemented the Musser Vibes into Kontakt and began to learn the custom scripting process!
After the past several weeks I have really gotten the hang of sample editing work-flow in Reaper. At the onset of the project I was taking around 2 hours to fully edit and render about 20 minutes of the sample audio. Now, from importing the original audio to exporting the samples takes around 30-45 minutes. This increased efficiency is largely thanks to simply becoming more familiar with the shortcuts and actions available to me in Reaper. I sometimes find myself accidentally trying to use Reaper shortcuts in Pro Tools now! The most labor intensive part of the editing process remains the labeling of chopped-up audio “items” so that they export in a naming convention that can be easily deciphered and auto-mapped in Kontakt. There are ways to program custom actions and scripts in Reaper that would allow me to use a tuner plugin to detect the note names and auto-label each clip as such. Unfortunately, this is a bit beyond my scripting capabilities at the moment.
Speaking of scripting, this week I took my first look at the in-program script editor in Kontakt. Within each Kontakt instrument there are a number of edit windows, the Group Editor allows you to assign names and numbers to the groups of imported notes. The Mapping editor allows you to map samples to MIDI keyboard inputs and stretch a single sample to cover a multitude of different keys (in which case the sample is pitch-shifted chromatically from the “root note”.) The wave editor allows you to edit the original audio of each sample. Finally, the scripting editor allows you to program custom UIs, controllers, and events into the instrument.
I had two basic scripting goals this week:
Create the backbone for a custom UI starting off with a custom background image (even if the image is a placeholder.)
Create a switch to allow the player the ability to swap between the two set of mallets I recorded.
To create a custom background I first had to create a “performance view.” Normally when a default or new Kontakt instrument is created the interface looks like this:
Something so plain is not terribly conducive to creative music production let alone user-friendly. The scripting to create a performance view is as follows:
The “on init” is a callback that executes whenever the instrument is opened or “initialized.” The subsequent lines tell Kontakt to simply create a performance view for the instrument that is a certain height. The message command is left blank to refresh the message area at the bottom from any prior instrument messages. Once the performance view was created, adding a custom background was as simple as adding an image to the “resources” folder of the instrument and and setting that as the background in a dialog box.
Creating a working switch was a bit more complicated.
As to not get overly technical instead of going step-by-step here I’ll show you the code that created the switch, and the code that makes it a functional mallet selector and describe a bit about how it works:
The first several lines starting with “declare ui_switch $Malletswitch” create the switch and name it , while displaying “Soft Mallets” as the default text the user sees.
Next “on ui_control ($Malletswitch)” switched the displayed text from “Soft Mallets” to “Hard Mallets” depending on the current state of the switch.
Finally “on note” activates each time a note is played and looks at the state of the switch. If the switch is off (0) it will mute or “disallow” any of the hard mallet groups from playing. If the switch is on (1) the soft mallet groups will be muted, playing only the hard mallet groups.
Here’s a clip of a simple chord progress being played by the instrument with the different mallets- made possible with just one click!
Thanks so much for reading and listening! Until next time,
Eli Shapiro