# Mute　button



## kontakt one (Sep 25, 2021)

I would like everyone to tell me.

The group is divided into three.
1. Piano
2.E.piano
3. Strings

Waveforms are mapped to each to make three sounds.

Install "MUTE button" on each of these three

I want to switch between 1 and 2, 2 and 3, 1, 3.

The script for the MUTE button is

declare ui_switch $ mix_mute1
make_persistent ($ mix_mute1)
read_persistent_var ($ mix_mute1)
set_control_par_str (get_ui_id ($ mix_mute1), $ CONTROL_PAR_PICTURE, "switch")
move_control_px ($ mix_mute1,457,218)
set_text ($ mix_mute1, "")
set_control_par_str (get_ui_id ($ mix_mute1), $ CONTROL_PAR_PICTURE, "switch")
set_control_par (get_ui_id ($ mix_mute1), $ CONTROL_PAR_WIDTH, 48)
set_control_par (get_ui_id ($ mix_mute1), $ CONTROL_PAR_HEIGHT, 48)

declare ui_switch $ mix_mute2
make_persistent ($ mix_mute2)
read_persistent_var ($ mix_mute2)
set_control_par_str (get_ui_id ($ mix_mute2), $ CONTROL_PAR_PICTURE, "switch")
move_control_px ($ mix_mute2,512,218)
set_text ($ mix_mute2, "")
set_control_par_str (get_ui_id ($ mix_mute2), $ CONTROL_PAR_PICTURE, "switch")
set_control_par (get_ui_id ($ mix_mute2), $ CONTROL_PAR_WIDTH, 48)
set_control_par (get_ui_id ($ mix_mute2), $ CONTROL_PAR_HEIGHT, 48)

declare ui_switch $ mix_mute3
make_persistent ($ mix_mute3)
read_persistent_var ($ mix_mute3)
set_control_par_str (get_ui_id ($ mix_mute3), $ CONTROL_PAR_PICTURE, "switch")
move_control_px ($ mix_mute3,567,218)
set_text ($ mix_mute3, "")
set_control_par_str (get_ui_id ($ mix_mute3), $ CONTROL_PAR_PICTURE, "switch")
set_control_par (get_ui_id ($ mix_mute3), $ CONTROL_PAR_WIDTH, 48)
set_control_par (get_ui_id ($ mix_mute3), $ CONTROL_PAR_HEIGHT, 48)

I created it like this.

The controlling script just doesn't work.

What kind of description do you need?


----------



## geronimo (Sep 26, 2021)

Hi _

It's just the Init Callback part for each of the controls; the following part is missing which is the individual Callback part.
on ui_control ($ mix_mute1)
on ui_control ($ mix_mute2)
on ui_control ($ mix_mute2)

Otherwise, in your existing script, you mention the $CONTROL_PAR_PICTURE twice!


----------



## kontakt one (Sep 26, 2021)

geronimo said:


> Hi _
> 
> It's just the Init Callback part for each of the controls; the following part is missing which is the individual Callback part.
> on ui_control ($ mix_mute1)
> ...


I want to know how to describe that part.


----------



## geronimo (Sep 26, 2021)

OK, but there you ask for information on the basics of writing in the KSP (Kontakt Script Processor). You should start with more simple and basic things to do, it seems to me. 
Because giving you the solution directly, will absolutely not represent an entry, say educational. In your example, it is the on ui_control () callback part that you have to work on and fill in.

And looking at page 16 of the KSP_Reference_Manual, it might help _


----------



## kontakt one (Sep 26, 2021)

geronimo said:


> OK, but there you ask for information on the basics of writing in the KSP (Kontakt Script Processor). You should start with more simple and basic things to do, it seems to me.
> Because giving you the solution directly, will absolutely not represent an entry, say educational. In your example, it is the on ui_control () callback part that you have to work on and fill in.
> 
> And looking at page 16 of the KSP_Reference_Manual, it might help _


You can't answer yourself, right?
In that case, you don't have to respond.
Those who understand will surely tell you.


----------



## Mike Greene (Sep 26, 2021)

kontakt one said:


> You can't answer yourself, right?
> In that case, you don't have to respond.
> Those who understand will surely tell you.


@kontakt one I suspect there's a language issue here, but just so you know, in English, that's interpreted as a very rude reply. My guess is that no one will reply to you after that.

I understand that you wanted geronimo to help more than he did (it seems you wanted him to actually write the ui_control callbacks for you?), but it was nice of him to respond at all. (Especially in a post where you didn't use CODE tags. It took me a while just to realize this was only an init callback.) Plus, his advice was good.

No one is being paid to respond to posts here. We do it because we like to help. That's a 2-way street, though. You need to do your part as well.

For instance, not only did you not use CODE tags, but the code you gave us has a LOT of unnecessary information it in. If you want anyone here to read your script, then you want your code to be as clean as possible, so that we can read it quickly. Otherwise it takes a too much of our time to read it.

In this case, no one wants to read 27 lines of code that do nothing more than create three buttons. So don't include the parts about button width, height, picture, position, etc. I would even leave out the make/read persistent parts. They don't effect the code, so it's much simpler for us to analyze your logic if you leave out the unnecessary parts. Obviously you can customize your buttons later, but for this forum, don't make _us_ read all that.


----------

