# UPDATED -- New Percussion Tuner Script with user Presets



## Thonex (Jun 3, 2006)

*UPDATED -- I got rid of that pesky warning and added CC control to scroll through presets and load them into memory so your sequencer can do that for you... in the course of a score and whatnot. *

CC 111 lets you scroll through the 5 presets and CC 110 (at a value of 127) lets you load that preset into memory.

Also, now when a note is played, it shows you the velocity... and not just a note on/off.... more visually accurate and pleasing.

[end of update]




Hi Guys,

Here is a little script that I put together because I so often need to tune percussion down.... a lot (like octaves sometimes) to get really cool fx that work well in drama and atmospheric scores... but it's always a pain to program the tuning of the notes.. and then you forget what got tuned and what didn't... and... well.. that's why I wrote this script.

This allows you to tune anywhere between +/- 3 octaves on any note or group of notes in an 88 key range.

You can tune 1 note at a time... or by Key range (Low/Hi note) or by just drawing it in the Tuning Table.

Oh... I forgot to mention... when transposing using your controller keyboard... when the "transpose" button lights up... the interval is set to how much above or below *middle C*you play the next note.

First you click on "Choose Note"... then you play a note... then you'll see "Transpose" is lit up... then you play the transposition amount -- above or below middle c.

Same with Select Range... except here it will ask you for a Low note thena a Hi note then the transpose button will come on and you play the transpose amount on the keyboard. I hope this makes sence... it should be very intuitive.

You'll notice there are 2 tables... they are both 88 segment tables representing the 88 keys and the top Table represents the tuning (up or down) and the bottom Table shows you the keys as you are playing them... so you can see if you're hitting a "tuned" note or not.







Once you have set up a tuning for a patch, you can save it in 1 of 5 presets to be recalled any time... it saves *all* the keys' tunings and the presets are persistent.

You can clear all the notes on the screen by choosing Clear_Screen. A new button will pop up asking you if you're sure.

The Bypass button is hard-wired to CC 90... because that's what I use :smile: 


Here's the script's text...

http://www.andrewkmusic.com/filearea/K2%20Scripts/Perc%20Tuner%20v1.1.html (http://www.andrewkmusic.com/filearea/K2 ... 0v1.1.html)

Here is a zip of the script that you can put in the script folder and open in K2:
http://www.andrewkmusic.com/filearea/K2%20Scripts/AK%20Perc%20Tuner%20V2.zip (http://www.andrewkmusic.com/filearea/K2 ... r%20V2.zip)

It's a fun script.... enjoy.



Cheers,

T


----------



## José Herring (Jun 3, 2006)

*Re: New Percussion Tuner Script with user Presets*

Looks nice. I have a piece that I can try it on. I'll let you know how it goes.

thanks!

Jose


----------



## kotori (Jun 3, 2006)

*Re: New Percussion Tuner Script with user Presets*



Thonex @ Sat Jun 03 said:


> Everything works great... except I get this annoying "Script Warning" at the lower left. It says "Array index out of bounds Line 121"
> and "Play_note: 'note' parameter out of range"
> 
> But this seems to have no effect whatsoever on the script's performance.... but it's annoying... anyone know how I could get rid of it... I've tried but it alludes me.



First of all thanks for posting this.
Regarding the play_note error message you probably try to play a note that's outside the 0-127 range. I wish there was a builtin limit function in KSP but I guess you could use something like this:
``_(* constrain the value to lie between min and max *)_
``*function* limit(value, min, max, result)
````*if* value < min
``````result = min
````*else* *if* value > max
``````result = max
````*else*
``````result = value
````*end if*
``*end function*
``
``_{ before running play_note }_
``$note := $EVENT_NOTE + transpose
``_{ limit note to lie between 0 and 127 }_
``limit($note, 0, 127, $note) 
``play_note(...)

Cheers,
Nils


----------



## TheoKrueger (Jun 3, 2006)

*Re: New Percussion Tuner Script with user Presets*

Thanks T!  Very cool idea, can't wait to try it out.


----------



## Ned Bouhalassa (Jun 3, 2006)

*Re: New Percussion Tuner Script with user Presets*

Great idea! Thanks Mr. T!

Oh, and if you come up with a K2 script that will transpose any series of notes played into a memorable, original melody, please upload it! :lol:


----------



## Thonex (Jun 3, 2006)

*Re: New Percussion Tuner Script with user Presets*

Thanks guys.

Nils... I was hoping you'd chime in .... I'll try your suggestion when I get a minute later today. Also, this morning I realized I could have had the bottom table display the note & *velocity* instead of just the note with just 1 more line of code [EDIT -- I addad that funtion with no added lines of code] .... and I think I'll prgram it to cycle through the presets based on CC command... that way the presets are automatable and recallable via the sequencer (not just manually like it is now).

The problem with K2 scripting is that it's so addictive :neutral: ... I have police myself when I'm on tough deadlines :lol: 

Cheers,

T


----------



## Elfen (Jun 3, 2006)

Thank you very much for this script, I simplify the work a bunch. I can see plenty of uses.


----------



## Thonex (Jun 3, 2006)

Elfen @ Sat Jun 03 said:


> I can see plenty of uses.



Thanks Elfen. Yes... it's not just for percussion... but that was my original intention. It's cool to have the option of pitching down (say) Guitar harmonics or piccolo a few octaves without having to mess with the patch.

Cheers,

T


----------



## Rich Pell (Jun 5, 2006)

This ones really fun Andrew.. u canuse it for all kinds of stuff...thanks alot, Best ,Rich


----------



## synergy543 (Jun 5, 2006)

I want to play too but it doesn't work when I paste it into K2.02 Mac script editor. :cry: 

Does this require the Kontakt V2.1 update?

I remember I had problem pasting scripts into Kontakt 2.0 Mac before and I needed the .nkp file or it didn't work. Puzzled...


----------



## Thonex (Jun 5, 2006)

synergy543 @ Mon Jun 05 said:


> I want to play too but it doesn't work when I paste it into K2.02 Mac script editor. :cry:
> 
> Does this require the Kontakt V2.1 update?
> 
> I remember I had problem pasting scripts into Kontakt 2.0 Mac before and I needed the .nkp file or it didn't work. Puzzled...



You know what... I think you're right... there is some issue with the way Mac copy/pastes text from the browser to it's clipboard... or something. I think ComposerDude knows more about it.

I'll post a zip file of the program shortly... sorry of the confusion.

Cheers,

T


----------



## synergy543 (Jun 5, 2006)

Thanks. I thought I was late to the party but I guess I'm the only one on a Mac ? :???:


----------



## Thonex (Jun 5, 2006)

synergy543 @ Mon Jun 05 said:


> Thanks. I thought I was late to the party but I guess I'm the only one on a Mac ? :???:



Here ya go:
http://www.andrewkmusic.com/filearea/K2%20Scripts/AK%20Perc%20Tuner%20V2.zip (http://www.andrewkmusic.com/filearea/K2 ... r%20V2.zip)

Cheers,

T


----------



## ComposerDude (Jun 5, 2006)

There was some weirdness involving extra characters being consistently added to the clipboard buffer when copying/pasting scripts from VI into Kontakt. We never completely resolved why it occurred, but the semi-tedious workaround involved deleting the extra characters within the Kontakt editor. IIRC this was only an issue on the Mac.

Handing off the script files in binary format worked fine - and you've already done that, so this post is a mere footnote...


----------



## synergy543 (Jun 5, 2006)

ComposerDude @ Mon Jun 05 said:


> Handing off the script files in binary format worked fine - and you've already done that, so this post is a mere footnote...


Yeah, but not everyone does that. So does the same problem exist in K2.1 Mac? Is a Kontact issue or a Mac issue?


----------



## Thonex (Jun 5, 2006)

synergy543 @ Mon Jun 05 said:


> ComposerDude @ Mon Jun 05 said:
> 
> 
> > Handing off the script files in binary format worked fine - and you've already done that, so this post is a mere footnote...
> ...


Were you able to oprn the zip file I posted?


----------



## synergy543 (Jun 5, 2006)

Thonex @ Mon Jun 05 said:


> Were you able to oprn the zip file I posted?


Oprn? GARP! :smile: 

Well, yes.....and no. It opens, but it doesn't really look right...:cry: 






Is that because I'm still using V2.0? I want to upgrade but I still need 2.0 compatibilty.


----------



## Dynamitec (Jun 5, 2006)

Hi! It shouldn't work in 2.0. Sorry, they change a lot concerning the ui! So you have to use at least 2.1...imo.


----------



## synergy543 (Jun 5, 2006)

Dynamitec @ Mon Jun 05 said:


> Hi! It shouldn't work in 2.0. Sorry, they change a lot concerning the ui! So you have to use at least 2.1...


Well, it didn't say that anywhere in the instructions! :twisted: 
How do I get my money back? :roll:


----------



## Thonex (Jun 5, 2006)

synergy543 @ Mon Jun 05 said:


> Thonex @ Mon Jun 05 said:
> 
> 
> > Were you able to oprn the zip file I posted?
> ...



That's the wrong script... somehow you have an old script of a Legato script I was working on many moons ago :shock: 

I just DLed the link above and it seems fine. Have you been snooping around my site? :wink: 

This is the link to the zip file:

http://www.andrewkmusic.com/filearea/K2%20Scripts/AK%20Perc%20Tuner%20V2.zip (http://www.andrewkmusic.com/filearea/K2 ... r%20V2.zip)

am I going mad here... is anyone else getting what synergy is getting?? I think you loaded the wrong script in your instrument... you must have a legato script in there from vi-pro and clicked on the wrong one because they bother start with "AK"... only guessing.

CHeers,

T


----------



## synergy543 (Jun 5, 2006)

Thonex @ Mon Jun 05 said:


> That's the wrong script... somehow you have an old script of a Legato script I was working on many moons ago :shock:
> 
> I just DLed the link above and it seems fine. Have you been snooping around my site? :wink:
> 
> ...


Well 'ol chap, (your voice over left an indelible impression pal  ) 
Your partly right and partly wrong. :wink: I did have an old script in there but the new one still doesn't load and the most likely reason is because I'm still using K2.02 and not K 2.1 yet. 

So maybe another Mac user on the "bleedin edge" could check this out? (but I'm sure it works).


----------



## ComposerDude (Jun 5, 2006)

synergy543 @ Mon Jun 05 said:


> ComposerDude @ Mon Jun 05 said:
> 
> 
> > Handing off the script files in binary format worked fine - and you've already done that, so this post is a mere footnote...
> ...



Just wanted to acknowledge this question...but I don't know the answer at this time. Perhaps someone else with direct knowledge of this one can chime in...


----------

