# Controlling Zone Tuning



## raidmarji (Apr 27, 2019)

Hi All
Just wondering if i can control the tune of a zone from a script.
I have a group with 60 zones, sampled in chromatic way. Each note have a single sample.
Is it possible to make tuning of specific zones through a script to play some japanese scales?


----------



## Lindon (Apr 27, 2019)

why not just retune the note you are playing?


----------



## raidmarji (Apr 27, 2019)

Lindon said:


> why not just retune the note you are playing?


Because they are 25 instruments, all sampled the same way in chromatic order & sometimes within the same Instrument, I want to tune F4 for example, and sometimes the E3


----------



## INCIRIOS (Apr 27, 2019)

Bunch of ways to do this, KSP reference manual has plenty of examples with change_tune. If you're looking to set up tunings for different scales I recommend setting up an array and add change_tune to your on note section. Then you can just nil out the array for the samples as is, and have them set to whatever you need for the other scales, or just add an if statement to ignore should you want to do it that way.


----------



## Lindon (Apr 27, 2019)

raidmarji said:


> Because they are 25 instruments, all sampled the same way in chromatic order & sometimes within the same Instrument, I want to tune F4 for example, and sometimes the E3


read the post from L & S - then read the KSP manual


----------



## raidmarji (Apr 27, 2019)

Light and Sound said:


> Bunch of ways to do this, KSP reference manual has plenty of examples with change_tune. If you're looking to set up tunings for different scales I recommend setting up an array and add change_tune to your on note section. Then you can just nil out the array for the samples as is, and have them set to whatever you need for the other scales, or just add an if statement to ignore should you want to do it that way.



change_tune() does not change any tune settings in the instrument. I want to change the tune in the instrument


----------



## INCIRIOS (Apr 27, 2019)

Change tune will change the tuning of a given note when played. You'd have within a script that the given notes (for example E3) would be tuned upon being played. This will happen for all note IDs played during that event, so for multimic for example it will affect all of them.

This prevents the need to manually change anything in the instrument itself, so the as the notes themselves are in tune originally, you can "correct" the tune within the script based on what you need at any point.

Unless I'm completely misunderstanding what you need to do (which I believe is to have your standard chromaticly tuned samples to play sounding as other tuned scales, and also keep them natural sometimes)?


----------



## olmerk (Feb 20, 2021)

Can it be done now with $ZONE_PAR_TUNE?


----------



## EvilDragon (Feb 21, 2021)

Only with user zones. But it's not realtime so not exactly useful for the scenario outlined above. It's still better to use change_tune().


----------



## soundtrax (Feb 21, 2021)

EvilDragon said:


> But it's not realtime


It actually works in realtime (at least here). But yeah, I agree, it wouldn't be my first choice too to apply different tunings.


----------



## EvilDragon (Feb 21, 2021)

Changing any user zone parameters is an asynchronous operation (you're supposed to use the async_complete callback or wait_async() with them), and they're definitely not responsive enough for i.e. realtime slider adjustments while voices are playing etc.


----------



## soundtrax (Feb 21, 2021)

Hm, maybe it wasn't intended by the devs, but actually $ZONE_PAR_TUNE for user zones works quite perfectly (and in realtime) without the 'wait async' before "set_zone_par". I've tested this extensively and never had a problem with it.


----------



## EvilDragon (Feb 22, 2021)

Ha, ok I guess. I'd still use change_tune() tho


----------

