# Knob working in Kontakt 5 but not in Kontakt 6



## danilocff (Dec 3, 2018)

Hello, 

I just released my first instrument and one of the customers reported the reverb knob not working on Kontakt 6, despite functioning perfectly fine on Kontakt 5. I tried it on the Player and confirmed this issue.

Any idea of what's going on?


----------



## P.N. (Dec 3, 2018)

Hi, danilocff.

According to this thread, the hierarchy of controls has changed in Kontakt 6.

https://vi-control.net/community/threads/layering-ui-controls.71700/

Check your control's declaration order, sizes and positions. 
It could just be a case of something being blocked.

Paulo


----------



## danilocff (Dec 9, 2018)

Unfortunately this thread did not help (although very useful for the future) :(


----------



## P.N. (Dec 9, 2018)

Hi, again, Danilocff.

The issue is ocurring with Dr.Ums?

Please try to offset your control positions to see if it helps.
If using grid instead of pixels, try using pixels.

Check if controls are overlapping and their order of declarations.

One of these is probably causing the issue.

Best regards,

Paulo.


----------



## Mike Greene (Dec 9, 2018)

If it's a reverb knob, maybe the effects slot order or parameter names changed in the 6 update?


----------



## P.N. (Dec 9, 2018)

Mike Greene said:


> If it's a reverb knob, maybe the effects slot order or parameter names changed in the 6 update?


I'm pretty sure that's not the case, otherwise Kontakt 5 instruments would not be compatible with Kontakt 6.

I downloaded the free version of the problematic instrument so i have a good guess of what may be the isse, since i've seen this before in instruments i worked on.

The instrument in question has a knob, and an image displaying the values right next to it.
The image that shows the values is non-clickable, so that probably means it's a different ui element.

Ideally, this image should be a label, but 've seen other developers using a slider, then covering it up with another transparent slider, or transparent button.

If the control hierarchy changed in Kontakt 6, that's probably the issue, depending on the declaration order and the transparent elements sizes (if it's a button).

Maybe even the resizable properties of the transparent image are interfering with something.

If the instrument is correctly using labels and not sliders for displaying the values, well...

In that case, i have no idea.

Please note that i don't own Kontakt 6, so this is all theory.


----------



## Desire Inspires (Dec 9, 2018)

I own Kontakt 6.
Send me a free copy of the sample library so I can troubleshoot.


----------



## danilocff (Dec 11, 2018)

P.N. said:


> Ideally, this image should be a label, but 've seen other developers using a slider, then covering it up with another transparent slider, or transparent button.


Yes, I used a second slider covered by a transparent layer. I'm going to noodle and see if I can make it a label, as well as moving things using pixels instead of grid (I have been away from home and couldn't put my hands on it yet). Thank you!



Desire Inspires said:


> I own Kontakt 6.
> Send me a free copy of the sample library so I can troubleshoot.


You can find it here: https://prismasounds.github.io/dr_ums_lite.html


----------



## P.N. (Dec 11, 2018)

danilocff said:


> Yes, I used a second slider covered by a transparent layer.



Alright. Now that you confirmed this, this solution has got to work in Kontakt 6.
Replace your second slider with a laber and remove the transparent controls.

Your slider controls will now need a small update as well.
Before, with the second slider, you had something like "label slider" = "main slider" or, control_par_value.

Now you use'd use $CONTROL_PAR_PICTURE_STATE. 

Your case instrument has 0-127 images for the values, so you are looking at a situation where they probably won't match, so your $CONTROL_PAR_PICTURE may be (max_slider/127) * current slider value.

For example, if your slider has a 0-1000000 range and you have 127 image states (we'll ignore image state 0, as it corresponds to 0) , your control par picture value will be $slider/7874.

There are situations were you can get rounding errors, so... if the values don't quite correspond your labels, you may need to re-think your image states.


Still, while this will work in Kontakt 6 (almost 100% sure), it still doesn't explain why your previous code would work in Kontakt 5 but not in 6.

After thinking a little more about this, there may be some issue with the transparent images themselves. Without seeing them, and the accompanying txt, it's just a theory though...
Maybe something in the "horizontal Resizable", etc, settings...

May i see your transparent images? (See what i did there?) 

Paulo


----------



## EvilDragon (Dec 11, 2018)

Resize settings in the .txt file have no bearing with ui_slider at all. Sliders are not resizeable.


----------



## P.N. (Dec 11, 2018)

EvilDragon said:


> Resize settings in the .txt file have no bearing with ui_slider at all. Sliders are not resizeable.



The question is not the slider, but the transparent element (which may be a button) that's covering the slider.


----------



## EvilDragon (Dec 11, 2018)

Ahhhh. Missed that somehow. Then yeah, it might be worth a check.


----------



## P.N. (Dec 11, 2018)

EvilDragon said:


> Ahhhh. Missed that somehow. Then yeah, it might be worth a check.



Yes, this is something intriguing. If Kontakt 6 is somehow behaving differently in regards to the txt, that could cause issues for a lot of instruments out there...
But who knows? It could just be a bad txt that works properly with Kontakt 5, but not Kontakt 6.
That's why i'd like to take a look at the transparent image and txt.


----------



## danilocff (Dec 12, 2018)

P.N. said:


> Now you use'd use $CONTROL_PAR_PICTURE_STATE.


AH! That's how you do custom labels! Thank you

I replaced the sliders (and removed transparences) with actual labels one at a time and found out the problem was not the transparence on Rev Wet, but the one on Rev Size. Tested it and all works fine now.



P.N. said:


> May i see your transparent images? (See what i did there?)


lol. For science, I'm also curious to see what could be wrong with transparences, so I'll post here the old ksp toghether with the image and txt:


```
on init
...
declare ui_slider $Size (0,1000000)
    move_control ($Size,3,5)
    set_control_par_str(get_ui_id($Size),  $CONTROL_PAR_PICTURE, "knob")  
    set_control_par(get_ui_id($Size),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    make_persistent($Size)
    $Size := get_engine_par($ENGINE_PAR_RV_SIZE, -1, 1, 1)
    read_persistent_var($Size)

declare ui_button $trasparenza_size
    set_text($trasparenza_size,"")
    set_control_par_str(get_ui_id($trasparenza_size),$CONTROL_PAR_PICTURE, "Trasparenza")
    set_control_par(get_ui_id($trasparenza_size),$CONTROL_PAR_HEIGHT, 40)
    set_control_par(get_ui_id($trasparenza_size),$CONTROL_PAR_WIDTH, 58)
    move_control_px($trasparenza_size,286,86)

declare ui_slider $Size_label (0,1000000)
    $Size_label := $Size
    set_control_par_str(get_ui_id($Size_label),$CONTROL_PAR_PICTURE, "Size_label")
    move_control_px($Size_label,288,88)

declare ui_slider $ReverbReturn (0,1000000)
    $Reverbreturn := get_engine_par($ENGINE_PAR_SEND_EFFECT_OUTPUT_GAIN, -1,1,1)
    set_control_par_str(get_ui_id($ReverbReturn), $CONTROL_PAR_PICTURE, "knob") 
    set_control_par(get_ui_id($ReverbReturn),$CONTROL_PAR_MOUSE_BEHAVIOUR,-750)
    move_control ($ReverbReturn,4,5)
    make_persistent($ReverbReturn)

declare ui_button $trasparenza_wet
    set_text($trasparenza_wet,"")
    set_control_par_str(get_ui_id($trasparenza_wet),$CONTROL_PAR_PICTURE, "Trasparenza")
    set_control_par(get_ui_id($trasparenza_wet),$CONTROL_PAR_HEIGHT, 40)
    set_control_par(get_ui_id($trasparenza_wet),$CONTROL_PAR_WIDTH, 65)
    move_control_px($trasparenza_wet,379,86)

declare ui_slider $Wet_label (0,1000000)
    $Wet_label := $ReverbReturn
    set_control_par_str(get_ui_id($Wet_label),$CONTROL_PAR_PICTURE, "Wet_label")
    move_control_px($Wet_label,380,88)

...
end on

on ui_control ($ReverbReturn)
    set_engine_par ($ENGINE_PAR_SEND_EFFECT_OUTPUT_GAIN,$ReverbReturn, -1,1,1)
    $Wet_label := $ReverbReturn
end on
```

Thank you very much for the help!


----------



## P.N. (Dec 12, 2018)

Here's the issue.


```
Has Alpha Channel: yes
Number of Animations: 0
Horizontal Animation:  no
Vertical Resizable: no
Horizontal Resizable: no
Fixed Top: 0
Fixed Bottom: 0
Fixed Left: 0
Fixed Right:  0
```

Vertical Resizable and Horizontable Resizable should be set to "yes" (although in this case you'd probably only need to set Horizontal Resizable, for transparent images you may as well set both, just in case).

This would most likely fix the Kontakt 6 issue too if you were to continue working with the transparent stacked ui elements.

The mistery that still remains is... why was it working in Kontakt 5? Maybe Kontakt 6 deals with this differently, and that wouldn't surprise me as everyday we're seeing small changes here and there in the way that Kontakt 6 behaves.

I understand this issue is now solved, though. 

Best regards,
Paulo


----------



## EvilDragon (Dec 12, 2018)

K6 is reading out the txt file exactly the same as K5, there were no changes there.


----------

