Scripting Drum Outputs in Kontakt, while keeping GUI functions.

Hey everyone, this is my second post here, as I accidentally answered my first post about this topic, which seems to have not made post appear any further within new discussion boards.
I'm trying to create a drum plugin, based on some sample I have recorded for a uni project. This is my first time ever scripting anything, and I have been following an online video guide by Steven O'Connoll, as I believe he is associated with my uni. I have written out a base script, then tried to further refine it with Claude AI. This has been a bit of a flawed method of writting a script, but I don't know what else to do.
Anyway, on to what I'm trying to do. I want to be able to route my drum outputs, via the GUI, whilst still having my effects work, as they sit on the insert effects section. It seems like I won't be able to do this, as I have my samples going into groups, then to busses, then into the insert effects section.
I want to have my drums to be able to be routed into multitracks, like it is possible with GGD kits. Forgive me If I am making dumb mistakes here, I just don't really know what I'm doing.
I'll send through the old script I wrote in it's entirety, the current script that I wrote with AI, and some images of the GUI, and backend.
Thanks for the help 🙂.
Comments
-
on init declare $i { Declare variable $i, which will be used as a counter in the loop } end on function set_outputs $i := 0 { Initialize $i to 0, starting from the first group } while ($i<$NUM_GROUPS) { Loop through all available groups, stopping when $i reaches $NUM_GROUPS } set_engine_par($ENGINE_PAR_OUTPUT_CHANNEL, $NI_BUS_OFFSET + $i, $i, -1, -1) { Assign each group ($i) an output channel. The channel is determined by $NI_BUS_OFFSET + $i } inc($i) { Increment $i by 1 to move to the next group in the next loop iteration } end while end function on persistence_changed call set_outputs { Call set_outputs when the instrument is reloaded to reapply output settings } end on
With your group structure (as shown in the PDF), the above script automatically routes each group to its own bus in order, starting from the first group (0). Everything is wrapped inside a function, making it easy to call whenever needed, in this case, every time the instrument loads. Note that there are 16 busses in total, so you can keep on adding groups (up to 16 with that script) and the script will automatically route them accordingly.
0 -
Thank you for your help, theodorech.
Using the script you have here, what do I need to put into my script, and where?0 -
In the on init section of your code, declare the $i variable (if it's already declared). Then, add your function after the on init block (each section ends with end on). After your functions, include the on persistence_changed part (just double check that you haven’t already declared a persistence callback).
0
Categories
- All Categories
- 18 Welcome
- 1.6K Hangout
- 66 NI News
- 858 Tech Talks
- 4.4K Native Access
- 17.5K Komplete
- 2.1K Komplete General
- 4.6K Komplete Kontrol
- 6.1K Kontakt
- 1.6K Reaktor
- 398 Battery 4
- 887 Guitar Rig & FX
- 450 Massive X & Synths
- 1.4K Other Software & Hardware
- 6.1K Maschine
- 7.8K Traktor
- 7.8K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators