# Different release groups for Sustain Pedal on/off



## KrisY (Jan 21, 2019)

Greetings KSP:ers. 

I have an issue with release samples. My need is to have *different release groups triggered based on wether or not the sustain pedal was pressed*, at the time of the release.

_Prelude: Note-off events are triggered upon the release of a note, the release of a key. But in the case of the sustain pedal being pressed down the note-off event is delayed until the sustain pedal gets released (going from pressed down to up, or a Midi CC64 message of 0-63. My instrument has 2 sets of recordings. One set for sustained notes with the sustain pedal off and one more set for when the pedal is pressed down/on. _

So, I have one group of release samples that correspond to the sustained notes with the sustain pedal off. But then I want to trigger a different group of release samples for the sustained notes with the sustain pedal active, or the CC64 at 64-127. 

Now, the groups of release samples cannot be used for both sustain pedal on samples and for sustain pedal off samples. As I mentioned before, these are different recordings with vastly different lengths. So, the release volumes at the time of the note-off message will produce either a too low or to high volume. 

Notes need to be tied to their corresponding cc64 value at the time of the note-on event. Otherwise the note-off event will trigger both groups, I think. 

I thought that I could just simply include 2 groups of release samples, then just set one to trigger at CC64 = 0-63, then the other to trigger at CC64 = 64-127. But that was not the case. And why should it be? The value of Midi CC64 is always at 0 when the sustain pedal is released. That´s kind of what the whole deal is. To take the CC value from above 64 to below 63. To 0 in fact. 

So the CC64 base value for triggering release groups seems impossible in Kontakt, without some scripting. 

One way is to use disallow/allow groups, but that will not work because of the fact that one individual note could be triggered without the sustain pedal pressed, making that individual note correspond to the “pedal off” release group. Then right after, the pedal is pressed down. Now another note will be triggered from the “pedal on” set of sustained note, that is going to have to play a release note from the “pedal on” release group. How do I do that? 

How do I tie 2 groups together, one sustained notes group (note-on), and one release group (note-off) ?? 

Some KSP components I think it will include:
- EVENT_ID
- CC_TOUCH
- set_event_mark (event groups, could be used to group sustained/release samples?)

Similar threads and stuff (or with common denominators):
https://www.native-instruments.com/...nly-certain-notes-groups.322404/#post-1598475
https://vi-control.net/community/threads/about-sustain-pedal-script.52398/#post-3945067

*My own recent thread* on this (_trying to clarify more in this one_):
https://vi-control.net/community/th...ustain-pedal-or-cc64-on-and-off-events.78891/

Thanks for any help.


----------



## EvilDragon (Jan 22, 2019)

Why did this need a new thread?


----------



## KrisY (Jan 22, 2019)

EvilDragon said:


> Why did this need a new thread?



Well it was explained in the previous, but less clearly. This one I think, is more on point, in the initial message/question.


----------



## KrisY (Jan 26, 2019)

Seems like there is a way to group events together using MARKs, and then use group allow functions through events via the "set_event_par_arr()". Will this work? 

I need to allow specific events, not groups, based on where and how they are triggered.


----------



## EvilDragon (Jan 27, 2019)

You could definitely try that.


----------

