# Script to only trigger release samples group at the end of a line



## Simon Ravn (Jun 14, 2011)

OK, this is probably an easy one for you scripters out there:

Say, I have a sustained instrument with release samples. But I want to do a script so that the release sample is only played, if the note is not overlapping/the next one. This will also be more realistic for strings, since you don't lift the bow off the strings until the legato line ends. Anyone?


----------



## Hannes_F (Jun 14, 2011)

Simon Ravn @ Tue Jun 14 said:


> OK, this is probably an easy one for you scripters out there:
> 
> Say, I have a sustained instrument with release samples. But I want to do a script so that the release sample is only played, if the note is not overlapping/the next one. This will also be more realistic for strings, since you don't lift the bow off the strings until the legato line ends. Anyone?



Simon, if I am not mistaken this should be exactly what SIPS 2.05 does.


----------



## Pedro Camacho (Jun 15, 2011)

Simon I have the same question!

I have my instruments made in such way that the release samples are a single kontakt instrument.

This means that I have a Kontakt Patch with the sustain / simulated legato part which is working great.

Now I only need to make sure the release sample patch (a different patch ) only plays in the very end.

I tried many ways but none work:


```
on note
    ignore_event($EVENT_ID)
end on
on release 

wait(200000)
 if $NOTE_HELD = 0
     play_note($EVENT_NOTE,$EVENT_VELOCITY,0,$DURATION_EIGHTH)
 end if

end on
```


----------



## MozillaUser (Jun 15, 2011)

Hi Simon. My solution might be a little peasant, but it works.
1. Declare your release folder as "release-triggered", like you usually do, and use it like you usually do. 
2. In the "legato" phase, where you usually stop the former note and trigger the new one, you stop that note in a way which WON'T generate an "on release" callback - that is, don't use the "note_off()" command; stop the former note by means of a "fade_out ()" command.
I hope it helps.
best --
Mozil

P.S. If you ever come to the situation where you DO need a separate "legato-triggered" release (other than the "end-triggered" group) ... that'd be a little more complicated. I use a polyphonic variable, called, say "$play_legato_ends", which I set before doing the normal script-generated "note_off" command. The "on release" callback will check that variable. If set, it will trigger the "legato-ends" group. If not, it will trigger the regular "release" group. Or something like that 
(err... "something like that" implies that I set, for both release groups, an additional start option: the "script-generated" releases will start, say, on CC53=1 , and the externally-generated" releases will start on CC53=0 . The "on release" callback will set this CC accordingly to the information given by that "$play_legato_ends" thinggie.) 
As you see, in this case the question is worded like this: "how to make the 'on release' callback feel the difference between "script-generated note_offs" and "externally-generated note_offs"


----------



## paoling (Jun 15, 2011)

I'm with the phone and so I don't have the KSP reference under my hand, but $NOTE_HELD refers to the note that triggered the event. So in an on release it has no meaning (since it would be triggered every time apart for a staccato-sustain articulation of a same note).
There's an array %KEY_DOWN of something similar that contains the switch state of the current notes. You can check it with a while loop and if some note is on, exit the callback
(brief sketch of it)

on release
while (i<128)
if KEY_DOWN(i) =1
exit
End if
inc(i)
End while
Playnote (bla bla bla)
End on


----------



## paoling (Jun 15, 2011)

Oh and you should switch on and off the groups with allow/disallow. Well, later i can post my idea.


----------



## Simon Ravn (Jun 15, 2011)

I am completely green with Kontakt scripting so I am not understanding 100% everything here, although my Amiga coding days should help It just struck me that it is a feature I would like to implement in some patches I have, and I thought it would be fairly easy to do (at least in monophonic playing).


----------



## MozillaUser (Jun 15, 2011)

Paoling, I guess your solution won't work in the real life. In the real life, in the legato part of the script, you have to generate a "stop" for the former note WHILE IT IS STILL PLAYING. - so your routine will detect a KEY_DOWN, you see. AFter you played the new note, if you suddenly release this NEW key, nothing guarantees that you actually released the former note; very often you still keep it pressed (although from your script's point of view it is already released...you stopped it in the script, remember? yet it's still pressed from KEY_DOWN's point of view), when playing fast stuff. So in this case, again, a KEY_DOWN will be there, like before, preventing you to trigger the note_off sample.
Dealing with such crap, making sure this crap won't happen, this is no trivial matter. It costed me lots of time fighting those "Murphy's law" cases.
best--
Mozil


----------



## Pedro Camacho (Jun 15, 2011)

I am just like Simon in this matter.
I am next to zero in KSP so could anyone please post an example?
Thanks!!


----------



## MozillaUser (Jun 15, 2011)

Well, please believe me, a good legato script has lots of lines of code, and I don't have the physical time to extract only the relevant lines, nor would that help you in any way. The essence of the problem would be cuted out anyway, since it resides in the lines which have to do with other stuff, not related to this topic.


----------



## paoling (Jun 15, 2011)

In script writing I usually try to follow some very basic logical things. This script will simply ignore and exit the callback if other keys are down when you release a key.
Unfortunately I can't test it, since I haven't a MIDI controller now.
This is actually more simple than what MozillaUser suggested, but I think this is a simple and smart solution that can work.
But since I imagine that this was needed for addressing the problem of Cinebrass legato and release samples, I suggest you to wait for Greg's remedy, because this can go in conflict with his scripting.


on init
declare $i
$i := 0
end on

on release
while ($i<128)
if (%KEY_DOWN[$i]=1)
ignore_event($EVENT_ID)
exit
end if
inc($i)
end while
message("Note " & $EVENT_NOTE & " released!")
wait(2000000)
message("")
end on


----------



## MozillaUser (Jun 15, 2011)

At the risk of having you hating me, Paoling...I just tested your script, and it doesn't work at all. if I use your script "as is", and I press 4 notes and I keep them all pressed, then I start releasing them one at a time, all will exibit your "NOTE X RELEASED" message, no matter if the released note was the last-played one or not.
2. you seem not to have an "on note" callback - so you have absolutely no mean to set up a "legato mode. You don't tell us how you stop the "former" note to be heard, in the missing "on note" callback.
3. As I said in my former post, you should enable only the last-played note to have a release sample enabled. If you release your last-played note while still having other former keys pressed (which, as I said, which happens all the time in the real life), this is a no-go :-(
Sorry to disapoint you. Neither will I show how smart I am, please believe me.
best--
Mozil


----------



## MozillaUser (Jun 15, 2011)

Ok, I took my time to write a primitive legato tool, like Simon wanted. It works, althought it doesn't solve the major problems. WTH, you wanted it simple.
Here it is:

on init 
declare $last_note
declare $active_id
end on

on note 
fade_out($active_id,60000,1)
$last_note := $EVENT_NOTE
$active_id := $EVENT_ID
end on

on release
if ($EVENT_NOTE = $last_note) 
exit { do nothing, let the release happen }
else
ignore_event($EVENT_ID) { no release will be played }
end if
end on

I wrote it in a hurry. I hope it's grammaticaly correct though.
best--
Mozil


----------



## paoling (Jun 15, 2011)

I can't test it since I haven't got a midi keyboard here. But you're right, there should be a fadeout($EVENT_ID, ecc.) to stop the note. The legato mode it's above the aim of this script. 

Redone (keep in mind that this is a blind work, since I can't know make it work without a controller):
on init 

declare $last_event

end on 
on note
$last_event:=$EVENT_ID
end on


on release 
{if (%KEY_DOWN[$i]=1)}
if ($EVENT_ID#$last_event)
ignore_event($EVENT_ID) 
exit
end if
message("Note " & $EVENT_NOTE & " released!") 
wait(2000000) 
message("") 
end on


(don't worry, we are only working to help our forum-mates 
I hope this will work


----------



## paoling (Jun 15, 2011)

Well I was working to this script since you posted it  So we came to the same conclusion; my script didn't use $EVENT_NOTE since IDs for "On note" and "On Release" are the same.


----------



## paoling (Jun 15, 2011)

Oh and the fade_out function it's supposed to be present in the legato program (and anyway i'd put that in the release part just before ignore_event).


----------



## MozillaUser (Jun 15, 2011)

Err... mmm ... at the risk of ... and so on  this new script of yours won't work any better. It doesn't even stop the notes, they sound 'til the end of time and a day.
Well, those are coder's problems. Not too easy a life, eh? :-(
best--
Mozil


----------



## MozillaUser (Jun 15, 2011)

paoling @ Wed Jun 15 said:


> Well I was working to this script since you posted it  So we came to the same conclusion; my script didn't use $EVENT_NOTE since IDs for "On note" and "On Release" are the same.



No chance. A note-on event has an ID, its adjacent "release event" has another :-(
The only way a note-on and a release event can communicate with each other is their "$EVENT_NOTE. This is the only common element. That's why I used it.
best wishes
Mozil


----------



## paoling (Jun 15, 2011)

MozillaUser @ Wed Jun 15 said:


> paoling @ Wed Jun 15 said:
> 
> 
> > Well I was working to this script since you posted it  So we came to the same conclusion; my script didn't use $EVENT_NOTE since IDs for "On note" and "On Release" are the same.
> ...


To me, it's wrong.. I will never post a script until properly tested :D but try this:

on init
declare $last_event
end on

on note
$last_event := $EVENT_ID
end on

on release
message("on note $EVENT_ID: " & $last_event & " - on release $EVENT ID: " & $EVENT_ID)
end on

If you read the $EVENT_ID is the same. No?? :?:


----------



## MozillaUser (Jun 15, 2011)

Paoling, believe me I spent many a night dealing with the id problem. I don't like it the way it is, but a note-on has one ID, a note-off has another even if they share the same $EVENT_NOTE. They are different events, right? Each event carries its own ID, that's the way it is, I live with it and I couldn't imagine why two different events should carry the same ID. This makes "programming a string instrument - like a guitar" a nightmare, 'coz in the real life you can pick a "G note" on the D string, and simultaneously you can pick the same "G note" on the G string. In the release handling, you don't have any mean to know which is which - since both carry the same $EVENT_NOTE. Well, <sigh> life is not easy, ey.


----------



## paoling (Jun 15, 2011)

I made the last script just to compare the IDs.. And they are the same.. to me Kontakt activates the normal groups and the releases on the note_on event but with a kind of remainder for the release to wait until a note_off command of that note. If you have a sample with a very long release(ADHSR) and you put a fade_out($EVENT_ID,1,1) in the on release callback it will be faded out; so this is another demonstration that they share the same ID. And please don't tell me sentences like "it's not an easy life, these are hard times"; i can believe your appeal to modesty, but I don't really enjoy the sound of those statements.


----------



## Big Bob (Jun 15, 2011)

> No chance. A note-on event has an ID, its adjacent "release event" has another



The only time a second 'event' is created is when the* script creates *it such as issuing a play_note in the RCB (which is often the way a release group is triggered from a script). However, the original key-down-generated note 'event' does NOT result in a new event being created by Kontakt when the key is released. The key release triggers a release callback (RCB) with the *same* 'event' id that was assigned to the original key-down note. At least that's the way it used to work :lol: 

Rejoice,

Bob


----------



## MozillaUser (Jun 15, 2011)

Paoling, I stand corrected. I was not remembering correctly my tests - since in my own scripts I used to generate notes (by play_note) - in which case it's different. And - if you re-read - when I said "well,<sigh>life is not easy", I was commenting my own long efforts to solve the problem I described. If that makes you angry, please excuse me.


----------



## paoling (Jun 15, 2011)

Ok, sorry, I misunderstood; I'm also learning to script with a constant try and error attitude; there are some strange things I'm discovering in kontakt, some (lots) of mistakes I'm doing, but I think this is the best and only way to learn and to build more "intelligent" instruments 
Thank you BB for giving us a kind of "official" word about our issue  
I'm exploring your ATFade function and it works like a charm


----------



## Pedro Camacho (Jun 15, 2011)

Still nothing works...
I have been trying myself to code this but with no luck...

Can't anyone help?


----------



## MozillaUser (Jun 15, 2011)

The short script I published here definitely does work. Do you have your groups correctly set? Do you have the group containing the release samples correctly set? (Release Trigger Mode)?
I said, it's a primitive script; but that doesn't make it not work. It works flawlessly.
If you would like a more advanced script, which works almost flawlessly and you could directly paste into your instrument, there is an example called "Solo Mode" in the "Scripts/Performance" folder of your Kontakt (at least for K2, which I'm still on). It's written by Mr. Natterer from Native Instruments and it's very good.


----------



## Pedro Camacho (Jun 15, 2011)

Well I didn't manage to put your script working.

Anyway I did my own and it WORKS! 

Please tell me what you think of it. This is my second script ever 


```
{**************************************************** 
Simple Legato Release 1.0
By Pedro Macedo Camacho
Thanks to:paoling, MozillaUser, Simon Ravn, Big Bob
Based on script by Andrew Kerestzes
****************************************************} 


on init 
    declare $i
    declare $pressed
    $i := 0 
    $pressed := 0
    declare ui_label $info (1,1)
    set_text ($info, "Legato Gap (ms):")
    declare ui_knob $Gap (0,1000,1) 
    $Gap := 70 
    make_persistent ($Gap) 
end on 

on note 
   ignore_event($EVENT_ID)
end on 

on release
    wait ($Gap *1000) 
    while ($i<128)
        if (%KEY_DOWN[$i]=1)
              $pressed := 1
            end if
            inc($i)
        end while 
        if ($pressed = 0)
             play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1)
        end if
 $i := 0
 $pressed := 0
end on
```


----------



## MozillaUser (Jun 15, 2011)

Good luck then! 
Sorry to tell you, your script doesn't work at all, Pedro. I'm affraid you didn't understand what the task is. Your "on note" callback does nothing but ignores the event - so you play a note but you hear none, coz it's ignored 
Go search for Mr. Natterer "Solo Mode Script" as I said, it works for sure.
And don't let my words discourage you. My first scripts were much worse than yours


----------



## Big Bob (Jun 15, 2011)

> Sorry to tell you, your script doesn't work at all, Pedro. I'm affraid you didn't understand what the task is. Your "on note" callback does nothing but ignores the event - so you play a note but you hear none, coz it's ignored



I hate to horn in here because I've only been casualy skimming this thread so without carefully studying it, maybe I should not intervene. However, just a casual reading tells me that each of you is trying to accomplish something similar but yet quite different in the details. And I'm sure you all know the 'devil is always in the details'. :lol: 

For example, I think that Pedro's script might work OK for what he was trying to accomplish. I went back and read his first post to this thread and noticed that he has his release samples in a *separate instrument*. Therefore, he doesn't want any notes to play from that instrument until the end of the legato phrase.

On the other hand the rest of you probably have your release samples in separate groups (which is perhaps more typical). So, maybe each of you should consider explaining your objectives a little more carefully and thoroughly. For example, are you disabling Kontakt's release sample triggering and trying to do it entirely from your scripts?

If someone gave me this problem to script, I'd first have to ask about a dozen detailed questions about such issues before I could even begin to write any code. Sometimes, the hardest part of writing a script occurs before you ever write a line of code. Namely, carefully and meticulously defining what the script needs to do. I am always rather amazed when people start writing code before the problem is specified.

Admittedly, the above is just my two-cents worth and I sincerely hope no one takes offense at what I have said.

God Bless,

Bob

EDIT: As an afterthought Pedro, since your release groups are in a separate instrument, couldn't you just increment a counter in the NCB and decrement it in the RCB? Then, when the RCB is triggered, you could check the counter and if it's zero, play the release sample. That way you could avoid the while-loop examining the whole note array.


----------



## paoling (Jun 15, 2011)

Big Bob @ Wed Jun 15 said:


> > couldn't you just increment a counter in the NCB and decrement it in the RCB? Then, when the RCB is triggered, you could check the counter and if it's zero, play the release sample.



This is what distinguish a serious and experienced programmer than a casual one (like me). The ability to see things clearly and to find the smartest solution.
You're right about writing code without examining carefully which are the problems and how to solve them. And without requesting or specifying what conditions are implied.


----------



## Pedro Camacho (Jun 15, 2011)

MozillaUser @ Wed Jun 15 said:


> on init
> declare $last_note
> declare $active_id
> end on
> ...



Mozil, 

Thank you very much for the help, but your script does not work the way it is intended for me.

Perhaps it was my fault, or Simon's, what we needed is a script, not to "legatize" the releases, which is unnatural, but to make sure the release plays completely but only in the end of the very last note of a line.

If the bow from a violin raises, even if briefly, to start another phrase, the "release tail" plays completely even if you start another line. the important is that while the bow is connected to the strings no releases happen.

Keep in mind that I have zero experience in scripting, this is my second script ever so it is not too good.

I thank you, Moz, Paoling and Big Bob for all the help because I couldn't have done this without you.

About making it better, I will try the always amazing and excellent suggestions from Big Bob.

Thank you so much!
-Pedro


----------



## Pedro Camacho (Jun 16, 2011)

Thank you Bob!!!

You suggestion makes the KSP much more fast and optimized.


```
{**************************************************** 
Simple Legato Release 1.3
By Pedro Macedo Camacho
Thanks to:paoling, MozillaUser, Simon Ravn, Big Bob
Based on script by Andrew Kerestzes
Big suggestion by Big Bob!!! Thanks!!!
****************************************************} 


on init 
	make_perfview  
    declare $i
    $i := 0 
    declare ui_label $info (1,1)
    set_text ($info, "Legato Gap (ms):")
    declare ui_knob $Gap (0,1000,1) 
    $Gap := 70 
    make_persistent ($Gap) 
end on 

on note 
   ignore_event($EVENT_ID)
   inc($i)
end on 

on release
    $i := $i -2
    wait ($Gap *1000) 
         if ($i = 0)
             play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1)
        end if
end on
```


----------



## Simon Ravn (Jun 16, 2011)

Ahhh, seems like my proposition wasn't as simple as I thought to solve. I haven't had the opportunity to try out the different offerings here but I really appreciate it. And I want to make this work somehow. I assume it makes it much easier to do, if we limit it to a monophonic line, right? The script should then also make it impossible to play multiple notes at the same time.


----------



## MozillaUser (Jun 16, 2011)

Simon Ravn @ Thu Jun 16 said:


> Ahhh, seems like my proposition wasn't as simple as I thought to solve. I haven't had the opportunity to try out the different offerings here but I really appreciate it. And I want to make this work somehow. I assume it makes it much easier to do, if we limit it to a monophonic line, right? The script should then also make it impossible to play multiple notes at the same time.



Yes Simon, you must limit it to a monophonic line. But this doesn't make it much easier to do. :-( 
You see, from your original wording I assumed you have the "make it monophonic" part of the script already done, so I'm kinda surprised now. 
There is no "official" way to limit polyphony which works exhaustively in the real life. The real life is chaotic, and so should it stay. The "official" way has to do with comparing the actual time in msec ($ENGINE_UPTIME) and the last time a note was played (you do that in the beginning of "on note" callback). If it's the same msec, the second note will be ignored. But in the real life, in most cases the second note is exactly what you actually wanted to have played; you touched the first key by mistake, "en passant". This was just a simple and obvious example; there are many more traps in the real life.
What I proposed to you in my first post (assuming you have that part already done, and assuming you have already the release samples grouped in a single group) was to replace the "note_off(xxx)" command which you should already have had, with a "fade_out(xxx)" command, which would stop the former note, but avoid generating a release. This is not complicated, as Paoling seemed to suggest; this is rather the simplest thing to be done. Afterwards, I took my time and posted the whole simple script (I posted it with shame, 'cause although doing exactly what you need, it won't work nicely in the real life. But as I said, none of the scripts proposed here AND ELSEWHERE - including Josef Natterer's one, which I proposed - works very nicely in the real life). 
So, if you want a script which works for your purpose - no matter how it works, but it does - you can copy and paste my script, with no further troubles. 
But there's one thing that I know for sure: very soon, you'll discover one bad thing or another in the way my (or any other) simple script does what it does. And in that moment, you'll start to RTFM :-; and do your own scripting.
Good luck and have fun,
Mozil

P.S. for Big Bob


> As an afterthought Pedro, since your release groups are in a separate instrument, couldn't you just increment a counter in the NCB and decrement it in the RCB? Then, when the RCB is triggered, you could check the counter and if it's zero, play the release sample. That way you could avoid the while-loop examining the whole note array.


Hi BB. I don't want to correct you, nor to show my cleverness. Incrementing and decrementing a counter although perfect in an ideal world, won't work in the real life. At least, that is what I found out in my experiments. In the real life, nothing guarantees that when releasing the "last note", it's the only "still pressed key". Very often, you didn't release the "former key" yet. In which case the counter won't be decremented to 0, you see. 
greets and keep on helping us, 'cause you've always been a great help for me and for others.
Mozil


----------



## Pedro Camacho (Jun 16, 2011)

@Big Bob

MozillaUser is right. After making the second script with your suggestion it worked like a charm. What I forgot is that I am using another script to block events depending on CC1 value a velocity value.

With this in mind, what happened is that sometimes I got a RCB first then a NCB, which screw the thing.

So perhaps I will stick for now with the "while" method. Not elegant, but works.
(unless you have another great suggestion!!)

Bottom line is, I really thank you all for the suggestions which are making me want to learn more and more KSP.


So Simon, I would suggest you do use my simple script. Just make sure you have a patch with the release samples alone using the same midi channel as your legato instrument.



```
{****************************************************
Simple Legato Release 1.0
By Pedro Macedo Camacho
Thanks to:paoling, MozillaUser, Simon Ravn, Big Bob
Based on script by Andrew Kerestzes
****************************************************}


on init
    declare $i
    declare $pressed
    $i := 0
    $pressed := 0
    declare ui_label $info (1,1)
    set_text ($info, "Legato Gap (ms):")
    declare ui_knob $Gap (0,1000,1)
    $Gap := 70
    make_persistent ($Gap)
end on

on note
   ignore_event($EVENT_ID)
end on

on release
    wait ($Gap *1000)
    while ($i<128)
        if (%KEY_DOWN[$i]=1)
              $pressed := 1
            end if
            inc($i)
        end while
        if ($pressed = 0)
             play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1)
        end if
 $i := 0
 $pressed := 0
end on
```
]


----------



## Big Bob (Jun 16, 2011)

> @Big Bob
> 
> MozillaUser is right. After making the second script with your suggestion it worked like a charm. What I forgot is that I am using another script to block events depending on CC1 value a velocity value.



Doesn't this merely reinforce my statement that 'the devil is always in the details' :lol: 

For example, are you guys contented with a purely monophonic playing mode or are you also trying to play chords? This matters a lot because when both overlapped legato playing and chords are in the equation, it forces the script to use a compromise setting for a 'gate time' interval to distinguish between legato-connected fast runs and sloppy (unintentionally-apregiated) chords.

If you are content with pure monophonic lines, the problem is simpler but far from trivial. As MozillaUser has so astutely pointed out, imperfect playing techniques have to be considered. Worse than that, Kontakt's queuing system is far from perfect. There are always situations where callbacks can be triggered in the 'wrong' order. 

With all that being said, my suggestion of a note counter was based on the fact that you seemed to be happy with triggering the release sample after you verified that the Key-Down array was depleted. For that simple situation, an up-down counter should do as well. Mozilla's concern about not triggering the release sample when you haven't lifted all your fingers off the keys yet implies that he still wants to trigger the release sample under those conditions. Strictly speaking, if there is still a key down, the release sample *shouldn't be triggered*. Moreover, under these conditions, reading the Key-Down array will not fare any better. But, again, the way the script behaves under these conditions needs to be specified in advance.

And, Pedro, I'm not sure why your example shows the counter being incremented by one in the NCB and decremented by two in the RCB? I'm also not clear on this 'other' script you have now alluded to and in precisely what way it 'gums up the works'. :? I think that so far this whole thread is living proof that more thought should be put into specifying the problem to be solved. There is far too much detail that has not been expressed or thought about.

In a really detailed specification, one should say exactly what one wants the script to do under every conceivable situation that can be anticipated. For example, what do you want to do about fluffed (transient) notes or when K4 messes up, what steps should the script take to recover, etc?

However, I do agree with the general sentiment expressed in this thread that there is no better way to 'get your feet wet' with scripting than with trying to do something challenging. And, what you are trying to do certainly qualifies for that so, I wish each of you a happy and musical outcome. o/~ 

Rejoice,

Bob


----------



## Pedro Camacho (Jun 16, 2011)

Well for some reason, with my keyboard (that plays note on and note off messages) there is a NCB when I release a key. So I get a NCB when I press the key AND a when I release the key I get a NCB and a RCB (wierd?)


Here is what I wanted:

1 - the instrument only contains Release Samples
2- Play a legato line (single melodic line) and make sure the release only plays and the final note in each music phrase
3 - have a very short delay to compensate imperfect legato (max: 10ms ?)

No need for chords.

are these enough details?
I would love to see what would be the solution from a pro scripter like you Bob.


Thank you so much in advance.


----------



## MozillaUser (Jun 16, 2011)

Excuse me for answering before BB does, but...as I happen to be here and BB not...
I assume the NCB which appears when releasing a note does so because you wanted it like that, Pedro  What do you think that "play_note" statement which you placed in the RCB does? Do you want it to work, yet not deliever a NCB ? 
I propose a test for you. Play the C note. Hold it. While holding it, now play a D. Hold it as well. While holding it, release now the C note (as you see, in this operation, the C is not the "last-pressed" note.) Does it still deliever a NCB? 
If yes, there's definitely something wrong with your script. 
If not, then the script works as you wanted it. You wanted that releasing the last-played note plays a note (in this case, your release sample)
best--
Mozil

P.S. EDIT: Your phrasing was: "2- Play a legato line (single melodic line) and make sure the release only plays and the final note in each music phrase". Are you sure you want exactly this? How do you want this instrument play the legato notes without containing them, Pedro?


----------



## Big Bob (Jun 16, 2011)

To be honest about it Pedro, I haven't the faintest idea of how I would try to script this yet :lol: 

Maybe we should sort of start over from square one (or since we're dealing with computers, maybe square zero would be more appropriate 8) ).

Here's a couple of clarifications I would like made.

1. Is it true that your release samples are all in one instrument and that only release samples are in that instrument? If the foregoing is true, then I presume you are playing your legato phrase with another instrument (I suppose set to the same MIDI channel) with its own script? Please clarify this aspect of the problem because you and MU seem to be going round and round about this and to me it seems like he's talking about apples and you are talking about oranges. Admittedly both are fruit but they're also quite different, no? :lol: 

2. You still haven't indicated anything about the 'other' script you alluded to a few posts back where you indicated that there was some interaction with CC and velocity involved with killing or generating other notes, etc. What is this all about? Is this 'other' script in the legato instrument or in the release-sample instrument, etc?

3. What is your keyboard/MIDI setup? You will definately have to explain why your keyboard triggers both a note-on and note-off when you release a key. Are you saying that this is simply some oddity of your keyboard? If so, I think I would suggest finding out why this is so and correcting that first. 

4. Could you also briefly explain why you have chosen to put all your release samples in a separate instrument? When you do this, the script that triggers them has no direct communication with the script handling the legato processing other than via the common denominator of the MIDI input stream via K4's multiscript. This may be somewhat of a handicap because the release script has to operate mostly on assumptions about what the other script is doing. On the other hand, I can see where it might have certain advantages also.

5. No one has yet mentioned the sustain pedal and how you might want it to affect things. For example, if you play a series of short notes but with the pedal down, does your legato script treat the notes as overlapping? If so, then the legato phrase doesn't end until all keys are up *and* the pedal is released?

I'm beginning to wonder if maybe I should just silently bow out of this because I might be doing more harm than good :lol: 

Rejoice,

Bob


----------



## Tod (Jun 16, 2011)

Big Bob @ Thu Jun 16 said:


> I'm beginning to wonder if maybe I should just silently bow out of this because I might be doing more harm than good :lol:
> 
> Rejoice,
> 
> Bob



Hey my friend,

Please don't, I've been following this thread since it started wondering how it might turn out. I made a script quite a few years back that dealt with release tails while playing legato, only it wasn't to keep them from playing, it was to make sure that the correct release tail went with the correct note.

It was with EW-Gold using keyswitches where I set up the instrument to use different controllers for each note that was overlapped. The thing I remember about it is that it was one of most difficult scripts I ever made. Well, barring the script for my steel guitar that you so graciously helped me with that was indeed the most difficult and without your help, I doubt I would have managed.

Heh heh, I have a feeling you already have an idea how to do this. I personally don't like the idea of separtateing the release tails into another instrument. I'm not sure what Simon had in mind but a legato instrument is a legato instrument and under normal conditions only has a single line. Maybe you could set the criteria and go from there. That is if you have the time.

God bless you too Bob, you're one of a kind..


----------



## MozillaUser (Jun 17, 2011)

Of coarse. Big Bob, we all love and respect you, nobody showed any trace of disrespect. You really have no reason to leave this thread.
That being said...I'd bet any amount of money that you already know the answers to the questions you raised for Pedro. More than that, I'd bet any amount of money that you already know that in fact, you shouldn't need to raise those questions  
...and I'd win both bets 
greets
Mozil

@ Tod


Tod @ Thu Jun 16 said:


> I'm not sure what Simon had in mind but ...


Simon was the original topic starter, and he stated very clearly what he had in mind: he has an instrument containing sustained samples (most probably already grouped together in one or more groups) and release samples (again, most probably grouped together and most probably their group is already "release-triggered").
He didn't explicitely say that he can play them in normal, polyphonic mode and the releases kick in as they should, and everything is ok, but this was obvious for me.

What he wanted was to play them in legato mode, with a special condition (...well, not really special, in fact it's a reasonable and obvious condition): when playing a legato phrase, no note but the last-played note should trigger a release sample when released. 
I guess he stated pretty clearly what he wants. 
greets,
Mozil

Late edit: 
P.S. Please disregard the part where I talk about Simon. The more I re-read his posts, each time my statement "he said clearly" vanishes more and more. So, the last state of thoughts is: I might be possibly wrong about this.
You know... he said everything he said  so we all assumed he wants a legato patch. Yet he never said that explicitely. He was implying subliminally this, when giving his example: "when a violin plays legato" - but he never said black on white "I want to do a LEGATO patch where the release etc etc".
So we all tried to help him taking this assumption for granted. We all were possibly wrong. Maybe he wants to keep it polyphonic (that is, he can simulate monophony by carefully lifting off his fingers WHEN HE CHOOSES TO DO SO) - but wants that no other note than the last one triggers its release sample. Who am I to tell him "man, ha! ha! ha! nobody does that, it's so funny! it won't sound good! forget about it!" Au contraire, the more I think about it, the more reasons I find to call his possible intentions "not bad, even shrewd!"
Even his last intervention ... where he says "ahaaaa! so it's complicated! It would be better to stop the former notes, you say?" etc - which again I took for granted that he "didn't know what a legato patch is, now he knows, yes, that's what he wanted, a legato patch" ... even here he didn't state that explicitely. The more I re-read that post, the more reasons I find to read it this way: "Aha, so it's complicated FOR YOU! Oh my, i'll accept a legato patch too, what can I do? - although my intentions were not exactly to create a legato patch. All I wanted was to let the release happen only by the last-played note".

So... there's nothing left for me but to fully agree with Bob. Guys, state your goals as clear as you can.
And...Simon, even if in fact this wasn't your intention, I'll go right now and implement this mode for my strings patches. "Monophonic-by-demand, without changing mode"  Thanks for the brilliant idea which you possibly, but not surely, had


----------



## Pedro Camacho (Jun 17, 2011)

Big Bob @ Thu Jun 16 said:


> 1. Is it true that your release samples are all in one instrument and that only release samples are in that instrument?


Yes!



> If the foregoing is true, then I presume you are playing your legato phrase with another instrument (I suppose set to the same MIDI channel) with its own script?


Exactly, the other instruments is using SIPS 1.5 (Sonic Implants Orhestra)



> 2. You still haven't indicated anything about the 'other' script you alluded to a few posts back where you indicated that there was some interaction with CC and velocity involved with killing or generating other notes, etc. What is this all about? Is this 'other' script in the legato instrument or in the release-sample instrument, etc?



This script is on the release sample instrument and on the Legato Instrument.
Basically what it is doing is just:
"IF CC1 =0 don't play anything, if CC1 >0 play the instrument normally"



> 3. What is your keyboard/MIDI setup? You will definately have to explain why your keyboard triggers both a note-on and note-off when you release a key. Are you saying that this is simply some oddity of your keyboard? If so, I think I would suggest finding out why this is so and correcting that first.


Yes it is strange, don't know what's going on here, yet! The Midi is a Novation 61 SL ..



> 4. Could you also briefly explain why you have chosen to put all your release samples in a separate instrument?


Simply because the legato instrument without Release Samples is already premade by Sonic Implants and working well.



> When you do this, the script that triggers them has no direct communication with the script handling the legato processing other than via the common denominator of the MIDI input stream via K4's multiscript. This may be somewhat of a handicap because the release script has to operate mostly on assumptions about what the other script is doing. On the other hand, I can see where it might have certain advantages also.


Yep no communications. I understand the problem, because if I increase the "legato Gap" too much, to compensate a lousy playing it will make the Release sound too late and artificial. Luckily I am a pianist so I only need at most 10ms of "legato gap" so I only delay the release by those 10ms which is almost unnoticeable.



> 5. No one has yet mentioned the sustain pedal and how you might want it to affect things. For example, if you play a series of short notes but with the pedal down, does your legato script treat the notes as overlapping? If so, then the legato phrase doesn't end until all keys are up *and* the pedal is released?


I am not using Sustain Pedal (CC64) at all under any circustance.




> I'm beginning to wonder if maybe I should just silently bow out of this because I might be doing more harm than good :lol:


Nooooo!! For me you are THE reference in KSP so please don't... really...


Thank you so much to you and everyone,
-Pedro


----------



## Big Bob (Jun 17, 2011)

Hi Pedro,

Now you're starting to get 'the swing of things' and a much clearer picture of the objective is emerging. Emerging but, not quite there yet :lol: 

Regarding your 'other' script with CC1 control, if it's that simple, could you please post it? I need to know just how you are accomplishing "don't play anything' and whether this 2nd script precedes or follows the 'release-trigger' script?

Next, how is your release sample instrument set up? Does it use Kontakt's release trigger mechanism or do you have that disabled (both in K4 and in your script)? I have so far presumed that you have disabled K4's release trigger handling and plan to trigger the release samples in the RCB with play_note calls. Is this correct? If so, are the release samples one-shot or are they looped and therefore simply relying on envelope decay to fade out. This of course affects the 4th parameter required for play_note and whether or not any follow up note-off needs to be provided.

Finally, we need to resolve the double triggering problem with your keyboard and either eliminate it or fully characterize it. First off, are you running K4 standalone or as a plugin? If the latter, maybe your host is causing the extra note-ons because of some kind of MIDI thru setting? In any case, you need to run some experiments regarding this situation. Maybe you can start by loading a new, empty, default instrument and then load the MIDI monitor script. Alternatively, maybe you have some other MIDI analyzer program you can use to determine what is going on with your keyboard's output (with and without your host), etc. I wouldn't even begin to suggest how to write a script until I understand why you are getting these extra note-ons.



> So... there's nothing left for me but to fully agree with Bob. Guys, state your goals as clear as you can.



Hey Mozil, always glad to have another convert :lol: I especially enjoyed your recap of Simon's posts starting with it being perfectly clear and then, like pealing an onion, the more you peal the muddier it gets :? 

And please believe me everyone, I'm not trying to pick on anyone or belittle what any of you are trying to do. Rather, I'm trying to emphasize the importance of carefully thinking out the problem first and then trying to communicate it unambiguously to others.



> God bless you too Bob, you're one of a kind..



Hey Tod, thanks for your always kind exhortations, but, it's probably a good thing that I'm 'one of a kind' because I don't think the world could stand any more like me :lol: 

Rejoice,

Bob


----------



## Pedro Camacho (Jun 17, 2011)

Big Bob @ Fri Jun 17 said:


> Hi Pedro,
> 
> Now you're starting to get 'the swing of things' and a much clearer picture of the objective is emerging. Emerging but, not quite there yet :lol:



Hurray!!



> Regarding your 'other' script with CC1 control, if it's that simple, could you please post it?




```
{*****************************************} 
{************* Control V1.1 **************} 
{******** By Pedro Macedo Camacho ********} 
{*****************************************} 



on init  
   make_perfview  
   declare ui_value_edit $CCnum(0,127,1) 
   declare ui_value_edit $CCval(0,127,1)                                                  
   declare ui_label $labelCCnum(1,1) 
   declare ui_label $labelCCval(1,1)    
   declare ui_button $LearnCC                    
   $CCnum := 1 
   $CCval := 1  
   set_text($labelCCnum, "CC number") 
   set_text($labelCCval, "CC value")    
   move_control($LearnCC, 1, 3) 
   move_control($CCnum, 1, 2) 
   move_control($CCval, 2, 2)  
   declare ui_value_edit $KEYval(0,127,1)                                                   
   declare ui_label $labelKEYval(1,1)    
   declare ui_button $LearnVEL                    
   $KEYval := 0  
   set_text($labelKEYval, "CC value")    
   move_control($LearnVEL, 3, 3)  
   move_control($KEYval, 3, 2)   
   message("") 
end on 

on note 
 if ($CCval > 0)
    if (%CC[$CCnum] < $CCval)
      ignore_event($EVENT_ID)
    end if
 end if
 if ($KEYval > 0)
    if ($EVENT_VELOCITY < $KEYval)
      ignore_event($EVENT_ID)
    end if
 end if
 if ($LearnVEL = 1) 
      $KEYval := $EVENT_VELOCITY 
      $LearnVEL := 0 
      message("Controller learned!") 
      wait(1500000) 
      message("") 
      exit 
   end if 
   message($EVENT_VELOCITY)
end on

on ui_control($LearnCC) 
   if ($LearnCC = 1) 
      message("Move a controller to select it...") 
   else 
      message("") 
   end if 
end on 

on controller    
   if ($LearnCC = 1) 
      $CCnum := $CC_NUM 
      $LearnCC := 0 
      message("Controller learned!") 
      wait(1500000) 
      message("") 
      exit 
   end if 
end on

on release
    message($EVENT_VELOCITY)    
    
end on
```



> Next, how is your release sample instrument set up? Does it use Kontakt's release trigger mechanism



Yes it has the K4 button "Release Trigger" turned on.




> or do you have that disabled (both in K4 and in your script)? I have so far presumed that you have disabled K4's release trigger handling and plan to trigger the release samples in the RCB with play_note calls. Is this correct?


Nope it is enabled (if I turn it of, for some reason, nothing plays).
The release samples are one-shot



> Finally, we need to resolve the double triggering problem with your keyboard and either eliminate it or fully characterize it. First off, are you running K4 standalone or as a plugin?



Plugin


I will fix the extra note offs, don't worry! 



Thank you so much for your patience!


----------



## Big Bob (Jun 17, 2011)

Hi Pedro,

Thanks for posting your 'other' script but, unfortunately, you didn't answer my question as to whether you have been putting this script ahead or behind the release-trigger script you are writing. My guess is that you have been putting it ahead but I prefer not to guess :lol: 

Since the presence of this additional script could well add some nasty complications, I'll probably end up suggesting that you combine its function with the release-trigger and roll them into one script. The potential for trouble here revolves around what I call 'orphaned events'. I don't know if you ever read my little report on Note/Release callbacks or not, so I'm going to attach it to this post. I hate to make you wade through all the gory details of this little pdf but you may want to read the last paragraph on the bottom of page 8 (section 2.5) because it could rear its ugly head for your project. Note I said 'it could' because when it comes to Kontakt's NCB/RCB triggering behavior I'm never very sure of anything :lol: 

Now, as to your assurance that you will 'solve' the double note-off keyboard issue, I'm glad to hear it but, in the meantime, what kind of behavior should I assume when trying to suggest a way to script this? Do you want me to assume that the problem doesn't exist? If I assume that, then how will you test any kind of script design until it actually is fixed?

Finally, regarding Release Trigger on for your release groups, let me first refresh my memory about all the gory details of why you don't want to do that. But, I'm almost positive I will suggest you disable that K4 function and have your script handle the triggering itself. I'll get back to you on this after I try a few things to prod my old brain. :roll: 

But, in the meantime, since you say your release samples are one-shot (as opposed to looped), you will probably want to trigger them using play_note(n,v,0,0) ie with the 4th parameter set to zero (meaning play the sample to completion)? I notice in your script you were using -1 for the 4th parameter which to me doesn't make too much sense. -1 means play the sample until the 'parent note' that caused the callback is released (which in your case it already has since you are triggering from the RCB) :? .

To be continued ..... 

Bob


----------



## Big Bob (Jun 17, 2011)

Hi Pedro,

Does your release sample instrument only have one group? If not, how are you activating the correct group?, etc etc. Since you haven't yet said anything about this, I have been presuming that you only have one release-sample group. Is this correct?

Bob


----------



## Big Bob (Jun 17, 2011)

Hi Pedro,

Since I really would like to finish up my involvement in this, I'm going to assume that your release samples are all in one group and that you can get your keyboard situation working normally. If you turn off the Release Trigger button, I think the following script might do the job for you.

*on init*``
``make_perfview``
``*declare* ui_label $labelCCnum(1,1)
````set_text($labelCCnum, "CC number")
````move_control($labelCCnum,3,1)
``*declare* ui_value_edit $CCnum(0,127,1)
````$CCnum := 1 
````move_control($CCnum, 3, 2) 
``*declare* ui_button $LearnCC``
````move_control($LearnCC, 3, 3) 
``*declare* ui_label $labelCCval(1,1)
````set_text($labelCCval, "On/Off Threshold")
````move_control($labelCCval,4,1)
``*declare* ui_value_edit $CCval(0,127,1)``````````````````````````````````````````````````
````$CCval := 1 
````move_control($CCval, 4, 2) 
``*declare* ui_label $labelKEYvel(1,1)````````
````set_text($labelKEYvel, "Vel value")
````move_control($labelKeyvel,5,1)````````````````````
``*declare* ui_value_edit $KEYvel(0,127,1)````````````````````````````````````````````````````
````$KEYvel := 0 
````move_control($KEYvel, 5, 2)
``*declare* ui_button $LearnVEL````````````````````
````move_control($LearnVEL, 5, 3)``
``*declare* ui_label $info (1,1) 
````set_text ($info, "Legato Gap (ms):")
````move_control($info,1,1) 
``*declare* ui_knob $Gap (0,1000,1) 
````$Gap := 70
````move_control($Gap,1,2)
````
``*declare* *const* $NO_RELEASE := 1234
``*declare* $keys_down 
``*declare* polyphonic $note_status```
``message("") 
*end on* 

*on note*
``inc($keys_down)
``ignore_event($EVENT_ID)
``*if* ($LearnVEL = 1) 
````$KEYvel := $EVENT_VELOCITY 
````$LearnVEL := 0
````message("") _{ erase prompting msg }_
``*end if* 
``*if* (%CC[$CCnum] < $CCval *or* $EVENT_VELOCITY < $KEYvel)
````$note_status := $NO_RELEASE
``*end if*
*end on*

*on release*
``dec($keys_down)
``*if* ($keys_down = 0 *and* $note_status # $NO_RELEASE)
````play_note($EVENT_NOTE,$EVENT_VELOCITY,0,0)````
``*end if*
*end on*

*on controller*````
``*if* ($LearnCC = 1) 
````$CCnum := $CC_NUM 
````$LearnCC := 0
````message("")``_{ erase prompting msg }_
``*end if* 
*end on* 

*on ui_control*($LearnCC) 
``message("Move a controller to select it...") 
*end on* 

*on ui_control*($LearnVEL)
``message("Hit key with desired threshold velocity")
*end on*


I don't really see any reason why the up/down counter idea I suggested a while back shouldn't work for this application, so that's what I used to detect the end of the played phrase. The only thing that can mess this up is if Kontakt messes up in some way so that the number of NCB and RCBs don't remain balanced. This shouldn't really happen but with Kontakt, one can never quite be sure. The loose coupling between this script and your legato script pretty well precludes any more sophisticated things like 'fluff' note detection, etc.

I think combining the two scripts is a safer way to code this but here again, I had to make certain assumptions about what you are trying for. I presume you intended your first script (which probably was in an earlier slot) to act as a sort of filter for lower-velocity notes so that if a phrase ends on a low-velocity note you don't want to play the release sample. Similarly, when you manually lower the assigned CC below some threshold, you also want to inhibit triggering the release sample. 

What you have to be careful with here is that such threshold detection conditions don't change between the NCB and RCB for any given note. For example, you could play and hold a note that has a velocity above threshold, then, while you are still holding the note you could change the velocity threshold (by hitting and releasing another note). Now, when you finally release the originally-above-threshold note and the RCB triggers, the velocity may now be below the new threshold setting. This kind of thing shouldn't bother you too much in this specific application but generally you have to watch out for such things. So, I coded this example to show you one way to protect from changing conditions between the NCB and RCB. I simply used a polyvar to flag any NCB note that 'currently qualifies' as a note that shouldn't trigger a release sample. Since polyvar values remain tied to each specific note, when the polyvar is read in the RCB, it can tell you whether or not to trigger the release sample. Therefore, in addition to keys_down = 0, the note_status polyvar must NOT be indicating NO_RELEASE.

Please let me know if this works out OK for you.

Rejoice,

Bob


----------



## MozillaUser (Jun 17, 2011)

Sorry to mix in your nice discution. Bob, Pedro says his release group is "release-triggered". I guess he's mistaken.
You see, I tested his script, without inspecting it very carefully. I created a patch containing a "notes" group, and a "releases" group; the "releases" group was set to be "release-triggered", the "notes" group obviously not.
I played some legato notes; as expected, no note was to be heard ( his "on note" callback contains just one line, "ignore this event". )
Neither releasing any of the "old notes" did produce a sound. Again, as expected. this part of the script was working ok.
Now, look here: when releasing the "last-played note", a sample was triggered. This sample was NOT the release sample ( which he states to have set in "release-triggered mode") but a regular note.
If his release group is release-triggered ( as he states), his script never triggers it.
Now I looked to his script....and see this: he really tries to trigger a "release-triggered" note by means of a "play_note" command. No wonder it triggered my regular note.
My 2 pence
best--
Mozil


----------



## Big Bob (Jun 17, 2011)

> Now I looked to his script....and see this: he really tries to trigger a "release-triggered" note by means of a "play_note" command. No wonder it triggered my regular note.
> My 2 pence
> best--
> Mozil



Hi Mozil,

Yes indeed, sometimes things appear to work but for the wrong reason :lol: 

But, I think I addressed all your issues with the script I posted. You'll note that I told Pedro to turn off the Release Trigger button (if he didn't have it on, I don't really care just so it's off when he runs my script :lol: ). You will also note that I changed the 4th parameter of play_note to 0. If his release sample is really a one-shot, short sample this will do the trick. If he's mistaken about that and it's really a looped and run forever sample, he'll know about that soon enough too as he scrambles for the panic button :lol: 

Now, I notice you continue to mention that his NCB contains only an ignore_event and while this may seem peculiar on the surface, it's really all right in his situation. Remember that he is driving another Instrument (on the same MIDI channel) which contains some SIPS variant and therefore that instrument is providing the sounds during the legato phrase. So, he only wants this script (which is in another instrument) to trigger a release sample when he releases the last note of the legato phrase.

I'm not quite sure why he also wants to delay the release-sample trigger but apparently the instrument already has some noticeable tailing after the release and I guess it pieces it together more musically if he waits a little before playing the release sample.

The fact that he also was putting his little filter script in an earlier slot may have contributed to the confusion because it also contained ignore commands and there is always the distinct possibility that this can cause unexpected failure to trigger the RCB in the next script slot under certain conditions. I haven't really rechecked K4 to see if NI has finally corrected some of these strange NCB/RCB triggering problems that were driving us crazy with K2.2 so, just to be on the safe side, I suggested merging the two scripts. I think it's cleaner that way anyway.

So, onward and upward I hope!

Bob


----------



## MozillaUser (Jun 18, 2011)

> Now, I notice you continue to mention that his NCB contains only an ignore_event and while this may seem peculiar on the surface, it's really all right in his situation.



Yet I said:



> I played some legato notes; as expected, no note was to be heard ( his "on note" callback contains just one line, "ignore this event". )


Where did I say it's peculiar? you didn't notice my words "as expected"? His script worked ok. I only said he was telling you "the release trigger is turned on", which couldn't have been true.
But in fact, I start to wonder why do I care about all this.



> But, I think I addressed all your issues with the script I posted.


I have no issues, Bob. My own legato scripts work best, completely and right. If you refer to the issues I've raised during this topic (not that I personally have them, as I said) - no, your script didn't address any. It doesn't always play the release samples on releasing the last-pressed note, because you keep believing that incrementing/decrementing the counter is the best solution. Yet it's the worse, and the most irelevant solution. You wouldn't even need a counter. You would only need to set/reset a variable, since when playing a correctly-implemented normal legato script (I say "normal", because some "special" legato modes do exist, which are not relevant to this topic), this variable can have two values only: value=0 (after releasing the last-played note), and value=1 at NCB time for no matter which kind of key was played (be it the last note or the former note/notes) - and in no respect with the number of keys you play. Your only goal should be "give a release sample to the last-played key (should I stress that "last-played" refers to the note-on absolute time, not to the note duration?), and don't give a release sample to any other key", period. Yet your script fails to do that, my friend.

Now, if you don't refer to your script (addressing "my" issues) but to yourself (addressing "my" issues during the conversation on this topic) - you didn't address them either. When you seemed to address them, in fact you thought you understood the issue, but actually you didn't. I was not necessarely talking about "poor-playing issues which have to be considered". One can have very good reasons to keep the keys down - yet you still have to let the last-played note, by its own release time, have the release sample being played.
But as I said, these are your problems, not mine; who am I to correct you?
Since I seem to bore you, I excuse myself for boring you once again, and I swear it was the last time I ever bored you.
best--
Mozil


----------



## paoling (Jun 18, 2011)

Well, instead of scripts, I think it should be best to exchange patches. I don't know but it is clear that, as BB said, it mainly depends not by how the script is written, but how the script is thought in relation to the group structure of the instrument. This is my little sorrow about addressing other people' scripts and saying: "this is completely wrong". Wrong in releation to what..? My little mistake in writing those examples was to assume that those examples could be useful for someone who could modify them with little effort to make them work for his own use. But maybe something of what I've written was useful to help Pedro in writing his second script


----------



## Pedro Camacho (Jun 18, 2011)

Big Bob:

One word: P-E-R-F-E-C-T !!!!!

You are the best 

Script works like a charm and does more than everything I would ever need.

Thank you so much.

With deep Respect,
-Pedro


----------



## Big Bob (Jun 18, 2011)

Thanks Pedro, I'm glad it does the job for you. But it saddens me that, in spite of my best efforts to not 'step on anyone's toes', I nevertheless seemed to 'ruffle' a few feathers. :( 



> But as I said, these are your problems, not mine; who am I to correct you?
> Since I seem to bore you, I excuse myself for boring you once again, and I swear it was the last time I ever bored you.



Mozil, I am truly sorry that anything I said should get you this riled up. I could prolong this by addressing each accusation you made against me but what purpose would it serve. I would rather just say I'm wrong and you're right. But has it ever even occured to you that I was trying to help Pedro achieve what he wanted not what you wanted him to want? 

I know you probably won't believe this when I tell you I was just trying to help equalize what each of you were saying because it was clear to me that there was a disparity of mutual understanding. And, not without cause because none of you were listening to each other carefully enough and there was a distinct lack of detail being provided. This was causing each of you to make assumptions about the missing information and each of you made different assumptions. I realize now that I blundered into 'a hornet's nest', but, sometimes that's the way life is. :lol: 



> Well, instead of scripts, I think it should be best to exchange patches. I don't know but it is clear that, as BB said, it mainly depends not by how the script is written, but how the script is thought in relation to the group structure of the instrument. This is my little sorrow about addressing other people' scripts and saying: "this is completely wrong". Wrong in releation to what..? My little mistake in writing those examples was to assume that those examples could be useful for someone who could modify them with little effort to make them work for his own use. But maybe something of what I've written was useful to help Pedro in writing his second script



Hey Paoling, my sentiments exactly. It's one thing to say 'that isn't the way I would approach the problem' and quite another to say 'that's wrong'. My whole motivation in entering this thread was to point out the necessity for clearly defining requirements in an unambiguous way. 

BTW I haven't had a chance yet to look at your NI slider stuff, I'll try to get back with you later today about that.

Rejoice,

Bob


----------



## Pedro Camacho (Jun 18, 2011)

Big Bob @ Sat Jun 18 said:


> I nevertheless seemed to 'ruffle' a few feathers. :(



I think it is impossible to please everyone.

Anyway, with your amazing script (thanks again) and a couple more of mine I completely rescripted the old Sonic Implants Trumpets.

[mp3]http://www.musicbypedro.com/0000_upload/Trumpets_Test.mp3[/mp3]
(lousy realtime keyboard playing. No KS's, just keyboard and expression pedal for CC1.


----------



## Big Bob (Jun 18, 2011)

Thanks Pedro, I needed a little 'Indiana Jones' to brighten my day :lol: 



> I think it is impossible to please everyone.



Amen to that!

God Bless,

Bob


----------



## Mr. Anxiety (Jun 19, 2011)

In the interest of respect for a much revered participant to all of our lives, speaking of Big Bob, I must say that MozillUser is just out of line with his last comments to Big Bob. Not only do they not really make sense, but he seems to be picking the proverbial forum fight that we see from time to time here.

MozillUser, you need to chill out and not interpret Big Bob's comments as some sort of personal attack. He's not going there and all both of you are trying to do is solve the OP's dilemma, that's it. So keep it objective please.

Thanks,

Mr A


----------



## Mr. Anxiety (Jun 19, 2011)

Hey Pedro,

How about posting your patch(es) for the Sonic Implants Trumpets, so we can take a peek at what you're doing with the scripts?

Just save them without the samples.

Thanks,

Mr A


----------



## MozillaUser (Jun 19, 2011)

Mr. Anxiety @ Sun Jun 19 said:


> In the interest of respect for a much revered participant to all of our lives, speaking of Big Bob, I must say that MozillUser is just out of line with his last comments to Big Bob. Not only do they not really make sense, but he seems to be picking the proverbial forum fight that we see from time to time here.
> 
> MozillUser, you need to chill out and not interpret Big Bob's comments as some sort of personal attack. He's not going there and all both of you are trying to do is solve the OP's dilemma, that's it. So keep it objective please.
> 
> ...



I'm completely chilled out, Mr. Anxiety. Never been otherwise. I'm not angry at Bob in any way. My respect for him hasn't diminished a bit. I sincerely believe he felt bored by my posts (I read his phrase "I thought I have addressed all your isues" (which, by the way, was not correct, because he didn't address any of my issues) as a very polite dismisal, like "I thought I'm done with you" - so I had nothing left but to think he feels bored, and I try not to bore him anymore. That's not "picking up a fight", that's rather "trying to avoid a fight", Mr. Anxiety.
I didn't intend to attack him personaly, and if you felt that, I excuse myself for not being clear enough.
Now, about your "your last comments do not make any sense"... I don't much agree with that. Maybe they don't make sense to you, for reasons having to do with your understanding abilities, but in the future, please stop making this kind of statements, 'cause I will take them as personal attacks.
greets,
Mozil

@ Pedro
Pedro, even if you don't like me a lot, I hope you will accept my congratulations for your Pirate Song. I don't hesitate to call it "genial". Even now as I write this, one day after listening to that song, I still feel laughter contractions in my stomach. Great, man.


----------



## Pedro Camacho (Jun 19, 2011)

MozillaUser @ Sun Jun 19 said:


> @ Pedro
> Pedro, even if you don't like me a lot,



I don't?  I do man, I think you were very helpful too in the whole thread!!




> I hope you will accept my congratulations for your Pirate Song. I don't hesitate to call it "genial". Even now as I write this, one day after listening to that song, I still feel laughter contractions in my stomach. Great, man.



haha! Cause I fight and I kill and I cheat everyday? 
Thanks man!


----------



## Pedro Camacho (Jun 19, 2011)

Mr. Anxiety @ Sun Jun 19 said:


> How about posting your patch(es) for the Sonic Implants Trumpets, so we can take a peek at what you're doing with the scripts?



Sure man! As soon as I get the whole thing done (the whole Brass) I will post a download link. They are miles ahead SI's K4 scripting, imo.


----------



## MozillaUser (Jun 19, 2011)

Pedro Camacho @ Sun Jun 19 said:


> haha! Cause I fight and I kill and I cheat everyday?
> Thanks man!


Nooo  (short answer following 'Cause the song itself (not only its text) is so humorous, and it happens to mirror my favorite kind of being humorous.

(Long answer following) You see, Pedro...I'm not bad a composer too, and as such, I deal since ages with a theoretical problem, which I still don't have an answer: How to be humorous BY MEANS OF MUSICAL NOTES? (because 99.99% of people would answer this question by saying "just play bad!" or "just play wrong!" or "just don't tune your guitar"). Yet you're being humorous BY MEANS OF THE NOTES YOU COMPOSED, without playing bad, without playing wrong, and absolutely in tune. I never met a man at your age doing that so successfully. Respectz


----------



## Pedro Camacho (Jun 19, 2011)

MozillaUser @ Sun Jun 19 said:


> I deal since ages with a theoretical problem, which I still don't have an answer: How to be humorous BY MEANS OF MUSICAL NOTES?



Please link me your website, I would love to hear your music too.

Anyway after learning for years composition, harmony, counterpoint and orchestration, in one of the best music Conservatoires with some of the best masters in each field, I realized theory is the least you should worry about.

You have to learn it, sure, but then evolve into your own ground.

I don't know what makes a music good or bad, humorous or epic. Proper orchestration makes it easier but at all costs don't learn clichés. Just do what you feel you that should done.


----------



## MozillaUser (Jun 19, 2011)

check your private messages.


----------



## paoling (Jun 19, 2011)

Pedro Camacho @ Sun Jun 19 said:


> MozillaUser @ Sun Jun 19 said:
> 
> 
> > I don't know what makes a music good or bad, humorous or epic. Proper orchestration makes it easier but at all costs don't learn clichés. Just do what you feel you that should done.



Sometimes to achieve a very comical effect you just have to exaggerate some overused cliches; like Prokofiev in his Classical Symphony 
Anyway MozillaUser made me curious; where I can find your Pirate piece?

Paolo


----------

