# A little question...



## nlundberg (Feb 10, 2010)

... how do I change the tuning of a release sample?



> on init
> declare ui_button $doubled
> declare ui_knob $detune (0,50000, 1000)
> declare ui_knob $delay (1,1000000, 1000)
> ...



I just can not get a hold of the release sample and pitch it back down. Can anybody give me a hint please?

Best,
Nicklas.


----------



## gmet (Feb 10, 2010)

This was covered a while back:

http://www.vi-control.net/forum/viewtop ... ht=#178475



Justin M @ 26th September 2009 said:


> Here is a way of finding the release groups:
> 
> 
> > *on init*
> ...


----------



## nlundberg (Feb 10, 2010)

Great, I will check it out. Thanks.


----------



## nlundberg (Feb 11, 2010)

Hi,

for some reason I never got your script to work, probably because I do not understand the code that well. But suddenly my script seems to work, in a way. There is no false note, but I suspect that there is only one release note. I can live with that.

But I really like to get more help with the script. I have it in the last script slot, after SIPS2. CC65 is used to turn legato mode on and off, and I am trying to turn on and of doubling with the same CC. CC65 is toggled with a polyphonic script that you and Bob helped me out with a while ago. So PolyOnOff, SIPSart, SIPSlegato and this, Doubling.

So it turns on and off right, but notes get cut off. BUT, if I instead toggle with CC127, the CC SIPS use for switching groups, the the notes sounds loud and clear! But then I do not get doubling on staccato notes; it does not toggle right.



> on init
> SET_CONDITION(NO_SYS_SCRIPT_RLS_TRIG)
> declare ui_button $doubled
> declare ui_knob $detune (0,50000, 1000)
> ...



I am very thankful for help, I hope I will get to a level soon where I can help out too!

Best,
Nicklas


----------



## gmet (Feb 11, 2010)

Just be careful, not only with the order of scripts, but the CCs used. I believe 127 is already used by SIPS which is why you probably get funny results - I don't know SIPS 2 that well but check the user guide.

Try experimenting with the order of scripts; it looks like this script might work better before SIPS, so that SIPS adjusts your altered notes, rather than this script trying to alter the output of SIPS (if that makes sense).

If you let me know what you are trying to achieve then I can try and help you as it might all work better in one script.

i.e. what you mean by doubled, polyphonic etc.

Justin

btw - the problem with your first post is that the script was trying to alter the 'note off' rather than the release sample (two different things).

Another thing is that SIPS (legato particularly) is designed to work with a single note (i.e. monoponic) and wont work with several (polyphonic or doubled) notes.


----------



## nlundberg (Feb 11, 2010)

> I believe 127 is already used by SIPS


-It is, and it was just a test. I.e when SIPS send a cc (that is for controlling the instrument groups) to the following "Doubling" script it works (I "sneak borrow" it). If I send a CC from the script before and thru SIPS notes get cut off.



> Try experimenting with the order of scripts


- I think I got it right. The "poly" script has a gate which sends cc if two notes (or more) are depressed at the same time, and the cc goes to SIPS and tells it to bypass legato mode. That works fine (well not really, I get insane amounts of stuck notes, but thats another story).



> i.e. what you mean by doubled, polyphonic etc.


-By doubling I mean ensemble effect, and by PolyOnOff I mean the script that switch between legato (mono) and not (divici).


Now my nifty doubling script is supposed to come after SIPS since it switches on if SIPS is in legato mode and adds another (pitch shifted) unison note. This way, if it works, I will have for example a clarinet duo playing divici with one voice each if two keys are depressed, and unisono (with two voices) if one key is depressed. I have also added a short fade in for the added note, and this way you will have the legato effect still. 
It sounds good when it works, but notes get cut off.

So about merging the scrips, I am all for it, but SIPS legato will get messed up if you send a doubled note before it.

Btw, I tried to use your new script, it seems great, but the gate and SISP did not seem to like each other. Also since I have more scripts (merged) in the mix, disabled now, I want to use as simple scripts as possible.

This is the thread where you helped me out before:

http://vi-control.net/forum/viewtopic.p ... +polyphony

Nicklas.


----------



## gmet (Feb 11, 2010)

Nicklas,

Your problem with hung notes is probably caused by the fact that Kontakt cannot mindread - i.e. it will only recognise a faster/slower note as the second note is played.

Also you cannot simply double the output of SIPS as the magic (note bending) is done inside the script; doubling the output will not achieve a doubled legato instrument.

I'm sorry to inform you that what you are asking for is probably impossible or far too complicated/time consuming to be a viable solution.

Sorry,

Justin


----------



## nlundberg (Feb 12, 2010)

Justin,

I can nothing but respect your opinion, but I would still like to comment on your last reply...  Probably I am confusing you by bad descriptions of the problem.



> Your problem with hung notes is probably caused by the fact that Kontakt cannot mindread - i.e. it will only recognise a faster/slower note as the second note is played.


-I do not understand what you mean. I use a version of Bobs pretty simple MonoPolyGate script and here is the problem: 
If I play by hand it works flawless, but if I sequence from Sibelius (which you use also?) I get stuck notes whenever two ore more notes are played at the same time. This is because Sibelius send out the notes on the exact same tick (time) and as I heard the Kontakt script engine gets confused if it receives two notes at the exact same time (which is insanely bad). So what I have to do now is to edit every chord as to have "live" starting position, +5 ticks for every note. Not fun.  
Do you know a solution for this, and do you experience the same thing with Sibelius?



> Also you cannot simply double the output of SIPS as the magic (note bending) is done inside the script; doubling the output will not achieve a doubled legato instrument.


-I know, it was never my intention to get the legato effect on _both_ voices. The legato effect is only on the original note, but the second voice gets faded in right after the bend, and thus the perceived effect is that there is a bend on both notes (or that the players have different bending; even better). It sounds pretty good actually.

And as for the solution it would probably be to hack SIPS in some way, so yes, it sounds complicated, but by no means impossible. It is just about getting a cc arriving without getting disturbed. Otherwise the script is done.

So long story short, do you have any suggestions on how to make Kontakt not get stuck with the MonoPolyscript?

Kind regards,
Nicklas.


----------



## gmet (Feb 12, 2010)

Here is a script that turns SIPS on and off (depending on whether it is a chord or a single note) and offsets the 'note on' (fixed or random amount) to avoid stuck notes. This needs to go before SIPS:



> *on init*
> ``*declare* ui_knob $Note_On (0,1000000,1000000)``_{in ms}_
> ``$Note_On := 020000
> ``make_persistent ($Note_On)
> ...


----------



## nlundberg (Feb 12, 2010)

Wow, thanks a lot Justin!

But it only works if you set "Note On" to 0. If it is anything greater the cc does not get sent away. So it seems as if the "wait" value is anything larger than 1 the cc does not send away right. 

Maybe it has something to do with the ignore_event command? I am very insecure when it comes to event handling, I really do not know.

N.

Ps. What do you mean by: {+1 for Legato CC} ?


----------



## gmet (Feb 12, 2010)

The '+1 for legato CC' is from the other post where Bob suggested:

_The problem boils down to the fact that K2/K3 doesn't act on the set_controller calls until the callback is dismissed. But by then it is too late because the note-on event will then go through first. The above code may work out for you because it essentially holds the note for at least 1 microsecond to allow the CC event to go through first. _

So - even if the dial is set to '0' this script still waits 1 microsecond.

Also in Sibelius there is an option to send 'note ons' (or was it 'note offs'!?) for all notes (in preferences) - it might be worth experimenting with this.

Justin


----------



## gmet (Feb 12, 2010)

OK - here is one tried and tested with Sibelius and Kontakt and SIPS (although v1.5). This should solve all your pre-SIPS triggers and hung notes problems.



> *on init*
> ``*declare* ui_knob $Note_On (0,1000000,1000000)``_{in ms}_
> ``$Note_On := 020000
> ``make_persistent ($Note_On)
> ...


----------



## nlundberg (Feb 13, 2010)

Oh My God! You made it! Thank you so much! You are saving me from daily frustration and headaches. It works great. And I had almost lost faith in KSP...

And as a bonus my now named Duo script seems to work. It works flawless on my clarinet, but not on my basson... I have not had time to check it carefully, but I assume the basson patch is messed up.

Here it is:


> on init
> set_script_title("Duo")
> 
> SET_CONDITION(NO_SYS_SCRIPT_RLS_TRIG)
> ...



The $mod_cc is for a cc modulated by speed coming from another script. Once I polish it I will also post that.

Thanks!


----------



## gmet (Feb 13, 2010)

Nicklas,

If you ket me know exactly what you are trying to achieve with the duo script I will do it for you. You will, however, have to wait for a week or so as I am just off to my farm on France to chill for a bit (no TV, internet or phone - excellent!)

Au revoir

Justin


----------



## nlundberg (Feb 13, 2010)

Monsieur,

Doubled (duo ensemble effect) when legato or staccato, single note, and when chord just normal.

I will post in a week or so then.

Bon voyage!


----------



## gmet (Feb 21, 2010)

This is basically a script based on J Bacal's 'Ensemble Maker' with up to 3 voices to go after SIPS:



> *on init*
> ``*declare* polyphonic $voice_1
> ``*declare* polyphonic $voice_2
> ``*declare* polyphonic $voice_3``
> ...


----------



## nlundberg (Feb 24, 2010)

Welcome back Justin,
I hope it was relaxing, your stay at the farm.

Thanks a lot, but on my system it does not work. The chord/single note button toggles but no extra notes is heard (and the voice count stays the same). When playing legato I get a script warning: wrong time parameter in wait statement!

Do you know what the problem might be?


----------



## gmet (Feb 24, 2010)

Nicklas,

It works fine here. Are you sure you have checked:

1. CC# is the same as the first script and SIPS Mode CC#
2. Sampled is set to the correct amount otherwise it will trigger the same sample.
3. Voices is set to 2 or more
4. The order of scripts is correct (first script, SIPS, then this script) and you have no other scripts running.


----------



## gmet (Feb 24, 2010)

OK, I have simplified it a bit and got rid of the errors:



> *on init*
> ``*declare* polyphonic $voice_1
> ``*declare* polyphonic $voice_2
> ``*declare* $temp_voice
> ...


----------



## nlundberg (Feb 24, 2010)

Hmm. The new one is not working either, but the error message is gone.



> 1. CC# is the same as the first script and SIPS Mode CC#


-Yes, the last script toggles right (single note/chord)


> 2. Sampled is set to the correct amount otherwise it will trigger the same sample.


-I have one sample per key so I assume I should have set it to 1. But I tried the others as well without success.


> 4. The order of scripts is correct (first script, SIPS, then this script) and you have no other scripts running.


1. The gate script above.
2. SISP Art
3. SIPS Legato
4. This ensemble script

I have also checked so I do not have any voice groups on, and I have set the instrument max voices to 32.


----------



## gmet (Feb 24, 2010)

Nicklas,

I have just tried them both with SIPS v2 and no problems. There must be something you have missed - keep trying! (Which CC# are you using and are you sure it is not used by something else?)


----------



## nlundberg (Feb 24, 2010)

I guess that is good news. 

I will get back at it tomorrow.


----------



## nlundberg (Feb 25, 2010)

Hi,

if I play with the SIPS legato script enabled and "Spread" all to the right, I hear a single voice ($voice_1)from the right when playing a single note.

But if I disable the legato script I get a note played one semitone lower (Sampled=1) on the left ($voice_2), on both chords and single notes.

I use CC117 for switching.

The legato script works fine, while enabled.

I also tried to make a new instrument with only one group enabled, another with just one normal, one inside, and one release group, but it does not work.

Are you using SIPS205? And how is your instrument configured?

I suspect this has to do with groups.

Best,

Nicklas.


----------



## gmet (Feb 25, 2010)

I very much suspect this has to do with groups; am I right in assuming you have to change something with SIPS 2? The point is that I don't use SIPS 2 at all so I'm afraid I can't invest too much more time in this.

Justin


----------



## nlundberg (Feb 26, 2010)

I understand that; you have been extremely helpful.

But could you please tell me what version of SIPS and configuration you have when it is working fine for you?


----------



## gmet (Feb 26, 2010)

I use SIPS 1.5; just never got round to updating my setup to version 2. I should however mention that I am not using the scripts I did for you; I have all my own custom scripts.

Regards,

Justin


----------

