Hi everyone !
I'm trying to find a way to change the script of MENU B
(containing three values X, Y, Z) based on the selected value of the MENU A
(containing three values A, B, C. Each of them sending messages) then once the script of MENU B
is changed, it will also change the values and the messages of the three switch.
To find a solution I was thinking of applying the following script only on the MENU A
.
It's totally wrong but it's just an attempt for now:
if (value === "A") return
{
send ('midi:my_device', '/control', 1, 1, 1)
//First value of MENU B
if (get('MENU_B') === "X") {
set("switch_1", 1)
set("switch_2", 1)
set("switch_3", 1)
}
//script for switch_1
if (value == "1")
{
send("midi:my_device","/control", 3, 3, 80)
}
//Second value of MENU B
if (get('MENU_B') === "Y") {
set("switch_1", 2)
set("switch_2", 2)
set("switch_3", 2)
}
//script for switch_2
if (value == "2")
{
send("midi:my_device","/control", 3, 4, 80)
}
//Third value of MENU B
if (get('MENU_B') === "Z") {
set("switch_1", 3)
set("switch_2", 3)
set("switch_3", 3)
}
//script for switch_3
if (value == "3")
{
send("midi:my_device","/control", 3, 5, 80)
}
}
//Second value of MENU A
if (value === "B") return
{
send ('midi:my_device', '/control', 1, 1, 1)
//First value of MENU B
if (get('MENU_B') === "X") {
set("switch_1", 2)
set("switch_2", 2)
set("switch_3", 2)
}
//script for switch_1
//changed to channel 4
if (value == "1")
{
send("midi:my_device","/control", 4, 3, 80)
}
//Second value of MENU B
if (get('MENU_B') === "Y") {
set("switch_1", 3)
set("switch_2", 3)
set("switch_3", 3)
}
//script for switch_2
//changed to channel 4
if (value == "2")
{
send("midi:my_device","/control", 4, 4, 80)
}
//Third value of MENU B
if (get('MENU_B') === "Z") {
set("switch_1", 1)
set("switch_2", 1)
set("switch_3", 1)
}
//script for switch_3
//changed to channel 4
if (value == "3")
{
send("midi:my_device","/control", 4, 5, 80)
}
}
//Third value of MENU A
if (value === "C") return
{
send ('midi:my_device', '/control', 1, 1, 1)
//First value of MENU B
if (get('MENU_B') === "X") {
set("switch_1", 3)
set("switch_2", 3)
set("switch_3", 3)
}
//script for switch_1
//changed to channel 5
if (value == "1")
{
send("midi:my_device","/control", 5, 3, 80)
}
//Second value of MENU B
if (get('MENU_B') === "Y") {
set("switch_1", 1)
set("switch_2", 1)
set("switch_3", 1)
}
//script for switch_2
//changed to channel 5
if (value == "2")
{
send("midi:my_device","/control", 5, 4, 80)
}
//Third value of MENU B
if (get('MENU_B') === "Z") {
set("switch_1", 2)
set("switch_2", 2)
set("switch_3", 2)
}
//script for switch_3
//changed to channel 5
if (value == "3")
{
send("midi:my_device","/control", 5, 5, 80)
}
}
In the end, if let's say you select the value B
from MENU A
, and the value X
from MENU B
it would not put all the three switch to their first value but to their second value and the three switch will also have different messages since the MENU B
would have a different script thanks to the MENU A.
Probably quite complex to understand but i feel like the solution is not that far.
I attached the session below for you to have a better look at it:
Change menu and switch script.json (11.1 KB)
Looking forward to hearing from you,
Swayrian