# Script turning off Release Triggers - How???



## Hans Adamson (Apr 16, 2007)

Can a script turn off release triggers?

I have tried "disallow_groups" and also "_set_engine_par($ENGINE_PAR_RELEASE_TRIGGER, 0, $RS_group, -1, -1)" - but can't make it work...:(

Any suggestions?

Thanks


----------



## Thonex (Apr 16, 2007)

yes.

If (say) a release trigger group is on group 6 (which is actually group 5 in KSP) then doing a disallow_group (5) command should do the trick.

Let me know if this helps.

Cheers,

T


----------



## Hans Adamson (Apr 16, 2007)

I don't know what I am doing wrong, but the disallow_group command is not working on the release samples groups for me. If it should work, I must find out what I am doing wrong...


----------



## Hans Adamson (Apr 16, 2007)

I can do _disallow_group($ALL_GROUPS)_ and only the regular notes are muted, not the release samples groups???


----------



## Big Bob (Apr 16, 2007)

Hi Hans,

I don't think allow/disallow groups will work when the Release Trigger button is engaged in the Source module. I think you have to either dis-engage the Release Trigger button (for the release group) or alternatively, put the compiler directive:


```
SET_CONDITION NO_SYS_SCRIPT_RLS_TRIGGER
```

in the ICB (initialization callback). Unfortunately, this method cannot be made conditional at runtime since it's handled by the pre-processor. What this means is that you can't enclose the directive in an 'if-end if' set at runtime. 

I'm not sure if you can disable the release trigger via engine parms or not, Nils would probably know though.

God Bless,

Bob


----------



## Hans Adamson (Apr 16, 2007)

8)


----------



## Hans Adamson (Apr 16, 2007)

Big Bob @ Mon Apr 16 said:


> Hi Hans,
> 
> I don't think allow/disallow groups will work when the Release Trigger button is engaged in the Source module. I think you have to either dis-engage the Release Trigger button (for the release group) or alternatively, put the compiler directive:
> 
> ...


Thanks Bob,

I wonder if I can use that in a ui_control callback at runtime without an 'if-end if'?

I'll try it and see what happens.


----------



## Big Bob (Apr 16, 2007)

> I wonder if I can use that in a ui_control callback at runtime without an 'if-end if'?



If you mean that you want the directive to operate only when the ui_control callback is triggered, I don't think so because compiler directives only execute in a pre-pass before the ICB executes.

Sorry I can't be more help.

Bob


----------



## Hans Adamson (Apr 16, 2007)

Here's what I did:

I used _set_engine_par to set the group volume to zero for the Release samples, which of course doesn't improve the polyphony. .. I was struggling for the longest time to make it work, until I finally discovered that I had two callbacks for that variable and that's why nothing I created in the second callback worked. Consolidating the callbacks made it all work.

Maybe it can help someone in a similar situation (like Arlo Guthrie said)...


----------



## gmet (Apr 17, 2007)

I had a go at this some time back:

http://vi-control.net/forum/viewtopic.php?t=5046

Hope it helps


----------



## gmet (Apr 17, 2007)

Hans,

You need to set the number of release groups and then select those groups in the drop down menus. There has always been a problem in K2 with release samples and I found that playing about with the release trigger time (ms) fixed most problems. I seem to remember that there was a problem with either setting it to '1' or '0' - although I cant remeber which!

Justin


----------



## kotori (Apr 19, 2007)

Hi Hans,
Here's a little script I put together which let's you toggle release samples using a UI button. Maybe it can give you some ideas:

*on init*
``*declare* ui_button release_on 
``SET_CONDITION(NO_SYS_SCRIPT_RLS_TRIG)
*end on*

*function* allow_or_disallow_release_groups(allow)
``_(* allows or disallows all release groups *)_
``*declare* group
``*for* group := 0 *to* NUM_GROUPS-1
````*if* _get_engine_par($ENGINE_PAR_RELEASE_TRIGGER, group, -1, -1) = 1``_{ if release group }_
``````*if* allow = 1
````````allow_group(group)````````
``````*else*
````````disallow_group(group)
``````*end if*``````
````*end if*
``*end for*
*end function*

*on note*``
``_{ allow only normal groups }_
``allow_group(ALL_GROUPS)
``allow_or_disallow_release_groups(0)``````
``_{ reset release trigger counter }_
``_reset_rls_trig_counter(EVENT_NOTE)
*end on*

*on release*``
``*if* release_on = 1
````_{ allow only release groups }_
````disallow_group(ALL_GROUPS)``
````allow_or_disallow_release_groups(1)````
````_{ play release sample }_
````play_note(EVENT_NOTE, EVENT_VELOCITY, 0, -1)
``*end if*
*end on*

Cheers,
Nils


----------



## Hans Adamson (Apr 19, 2007)

Thanks Nils,

Appreciate you taking the time!

I haven't seen this construction before:

_function allow_or_disallow_release_groups(allow) 

if allow = 1 _

Are you defining your own function? Is there a place where I can read about it?

Thanks again


----------



## tfishbein82 (Apr 19, 2007)

Thanks Nils. I always wanted a script that does exactly that. Hmm... that sounds cheesy and insincere.

Oh well, it may sound cheesy, but I assure you it's sincere. :D


----------



## kotori (Apr 19, 2007)

@Hans: Yes, this is a feature of my script editor and there's some additional information http://nilsliberg.se/ksp/using_functions.py (here). To use it you paste the script into the script editor, press F5 and then paste the resulting compiled script (which is automatically placed on the clipboard) into Kontakt and press the Apply button in Kontakt.

Nils


----------



## Hans Adamson (Apr 19, 2007)

Very good Nils! 

So it is like a macro for KSP functions?

And your script (above) must be compiled by your editor before using in Kontakt?

Thanks


----------



## kotori (Apr 19, 2007)

Hans Adamson @ Thu Apr 19 said:


> Very good Nils!
> 
> So it is like a macro for KSP functions?
> 
> ...



Exactly.


----------



## Hans Adamson (Apr 19, 2007)

Thanks Nils.

You're a genious as usual!! 8)


----------



## bobby (Apr 21, 2007)

Hi Nils,

First Off Thank you for all you great work & talent giving us scripts & your Editor.

they really are great. 

I am very new, ( 2 weeks), to KSP so I have a few questions for you, if that’s okay.

the first few related to this release triggers script.

I have noticed that it works very well, except it seems to Change in the release triggers volumes. For example, the Rel Triggers are "sometimes” louder , once I have run the script.

is there some kind of volume that gets lost or changed when this script is run.???


Is there a way , to make it default to what ever the state of the release triggers are. I know make_persistent , but not sure if it will work with this.?

3- is there a way to control the release and or volume of the envelopes of the release trigger groups Only ?? So I can adjust them with a MIDI CC

4- , pertaining to your great little editor.

I have noticed it compiles without the := just =, for variables,

So when I run it in KSP, I get an error?

And a feature suggestion.

It would be very helpful, I think, so be able to colour code the same variables.

For example :

$variable1

$variable2

$variable3

So I could say Make all $varialblex RED, etc etc

Thank you again for all your help, and the EXCELENT Script editor.

All the Best
Bobby


----------



## kotori (Apr 22, 2007)

[quote:d75b25a8e9="bobby @ Sun Apr 22, 2007 02:26"]the first few related to this release triggers script. I have noticed that it works very well, except it seems to Change in the release triggers volumes. For example, the Rel Triggers are "sometimes” louder , once I have run the script. 

is there some kind oòÈt   WQ9Èt   WQ:Èt   WQ;Èu   WQ<Èu   WQ=Èu   WQ>Èu   WQ?Èu   [email protected]Èu   WQAÈu   WQBÈu   WQCÈu   WQDÈu   WQEÈu   WQFÈu   WQGÈu   WQHÈu   WQIÈu   WQJÈu   WQKÈu   WQLÈu   WQMÈu   WQNÈu   WQOÈu   WQPÈu   WQQÈu   WQRÈu   WQSÈu   WQTÈu   WQUÈu   WQVÈu   WQWÈu   WQXÈu   WQYÈu   WQZÈu   WQ[Èu   WQ\Èu   WQ]Èu   WQ^Èu   WQ_Èu   WQ`Èu   WQaÈu   WQbÈu   WQcÈu   WQdÈu   WQeÈu   WQfÈu   WQgÈu   WQhÈu   WQiÈv   WQjÈv   WQkÈv   WQlÈv   WQmÈv   WQnÈv   WQoÈv   WQpÈv   WQqÈv   WQrÈv   WQsÈv   WQtÈv   WQuÈv   WQvÈv   WQwÈv   WQxÈv   WQyÈv   WQzÈv   WQ{Èv   WQ|Èv   WQ}Èv   WQ~Èv   WQÈv   WQ€Èv   WQÈv   WQ‚Èv   WQƒÈv   WQ„Èv   WQ…Èv   WQ†Èv   WQ‡Èv   WQˆÈv   WQ‰Èv   WQŠÈv   WQ‹Èv   WQŒÈv   WQÈv   WQŽÈv   WQÈv   WQÈv   WQ‘Èv   WQ’Èv   WQ“Èv   WQ”Èv   WQ•Èv   WQ–Èv   WQ—Èw   WQ˜Èw   WQ™Èw   WQšÈw   WQ›Èw   WQœÈw   WQÈw   WQžÈw   WQŸÈw   WQ Èw   WQ¡Èw   WQ¢Èw   WQ£Èw   WQ¤Èw   WQ¥Èw   WQ¦Èw   WQ§Èw   WQ¨              òÈw   WQªÈw   WQ«Èw   WQ¬Èw   WQ­Èw   WQ®Èw   WQ¯Èw   WQ°Èw   WQ±Èw   WQ²Èw   WQ³Èw   WQ´Èw   WQµÈx   WQ¶Èx   WQ·Èx   WQ¸Èx   WQ¹Èx   WQºÈx   WQ»Èx   WQ¼Èx   WQ½Èx   WQ¾Èx   WQ¿Èx   WQÀÈx   WQÁÈx   WQÂÈx   WQÃÈx   WQÄÈx   WQÅÈx   WQÆÈx   WQÇÈx   WQÈÈx   WQÉÈx   WQÊÈx   WQËÈx   WQÌÈx   WQÍÈx   WQÎÈx   WQÏÈx   WQÐÈx   WQÑÈx   WQÒÈx   WQÓÈx   WQÔÈx   WQÕÈx   WQÖÈx   WQ×Èx   WQØÈx   WQÙÈx   WQÚÈx   WQÛÈx   WQÜÈx   WQÝÈx   WQÞÈx   WQßÈx   WQàÈx   WQáÈx   WQâÈx   WQãÈx   WQäÈx   WQåÈx   WQæÈx   WQçÈx   WQèÈx   WQéÈx   WQêÈx   WQëÈx   WQìÈx   WQíÈy   WQîÈy   WQïÈy   WQðÈy   WQñÈy   WQòÈy   WQóÈy   WQôÈy   WQõÈy   WQöÈy   WQ÷Èy   WQøÈy   WQùÈy   WQúÈy   WQûÈy   WQüÈy   WQýÈy   WQþÈy   WQÿÈy   WR Èy   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WR	Èz   WR
Èz   WRÈz   WRÈz   WR Èz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WRÈz   WR              òÈz   WRÈ{   WRÈ{   WRÈ{   WRÈ{   WRÈ{   WR È{   WR!È{   WR"È{   WR#È{   WR$È{   WR%È{   WR&È{   WR'È{   WR(È{   WR)È{   WR*È{   WR+È{   WR,È{   WR-È{   WR.È{   WR/È{   WR0È{   WR1È{   WR2È{   WR3È{   WR4È{   WR


----------



## gmet (Apr 22, 2007)

kotori @ 22nd April 2007 said:


> Hi Justin
> It seems to be working fine on my computer. Do you think you could provide some instructions of how to reproduce it?



Hi Nils,

Will do when I get back home (I am currently òÈ‰   WWÈ‰   WWŽÈ‰   WWÈ‰


----------

