What's new

Mute each key individually

kerubin76

Member
I'm building a drum rack based on loops. In the interface, there will be a button to mute each key individually (each key has its own bypass button). How could I achieve this? I have the option of putting all the loops in the same group or putting each loop in a new group, but I'm not sure which option would be better for making the script simpler. I thought about collecting the play_note of each key into an event and then using change_vol to mute each event, but it doesn't work.
 
Off the top of my head I would be thinking different groups for different loops.

This gives you individual ADSR envelopes for each group, and you can use the UI controls to control the group amplifier volume using ksp scripting.

One possibility is to use ksp to set the group volume to zero; this will mute the loop but will still play the sample, thus using up voices in the instrument. If you want it to not play the sample at all, you may need to use the disallow_group command to have the script completely ignore the group when notes are pressed.

It's been a little while since I was in the thick of Kontakt programming, but that would be my first thought.
 
An array to track the buttons and a loop to check them in the note callback
The logic is - a note is pressed, you check the number of the note against the index in the array which will point to the ui_id of that button, you can check if the CONTROL_PAR_VALUE of that ui_id is on or not and then run the code to play or not depending on it.
 
Top Bottom