# Kontakt-Tune Knob



## EVRE15 (May 26, 2014)

Hello 

Is it possible to create a button (instead of a knob) for the Tune knob of the instrument?

I would like to implement a button (instead of a knob) so that when the button is pressed it will detune the whole instrument by +.20 and when not pressed it will not apply any change and rather leave it at the default 0.00.


I am basically trying to apply the script below to a button instead of a knob so that I may apply either one of two changes on the Tune knob of the instrument, +.20 or 0.00.

_on init
declare ui_knob $Tune (0,1000000,1)
set_knob_label($Tune,get_engine_par_disp($ENGINE_PAR_TUNE,-1,-1,-1))
end on 

on ui_control ($Tune)
set_engine_par ($ENGINE_PAR_TUNE, $Tune,-1,-1,-1)
set_knob_label($Tune,get_engine_par_disp($ENGINE_PAR_TUNE,-1,-1,-1))
end on _


Thank you in advance to all of you for your help. 


With Great Gratitude,

Eva


----------



## d.healey (May 27, 2014)

Yes this is quite simple 



```
on init

    declare $tuning := 2000 {Change this to whatever the correct value is for .20}
    declare button $btn_tune

end on

on ui_control($btn_tune)
    set_engine_par($ENGINE_PAR_TUNE, $tuning*$btn_tune, -1, -1, -1)
end on
```


----------



## EVRE15 (May 27, 2014)

Hello X,


Thank you tons! You are La Bomba. 

The script you sent me has two Tune settings. I was able to change it to +.20 so that when I push the button the Tune knob changes to +.20. However, when the button is deselected, I get a Tune setting of -36.00. How do I change this value to 0.00, what should by default be the value of the Tune knob anyways. I tried various scripting methods but I'm not having any luck. I really appreciate all your help. :D 


Thank You,

Eva


----------



## mk282 (May 28, 2014)

Gotta subtract from 500000 (which is the midpoint of the knob, i.e. 0.0 tuning).


----------



## Lindon (May 28, 2014)

so what Mario said..... so it looks like this:


```
on ui_control($btn_tune) 
    set_engine_par($ENGINE_PAR_TUNE, 500000 - ($tuning*$btn_tune), -1, -1, -1) 
end on
```


----------



## EVRE15 (May 28, 2014)

You folks are freakin' awesome! Thank you so much! =o _-)


----------

