Trevliga Spel forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

multi event script bug ?

2 posters

Go down

multi event script bug ? Empty multi event script bug ?

Post by lionoil Wed Nov 23, 2022 7:17 pm

Hello !
I try to make a bank of PC to work this way
 
One buton to send PC 0,7 alternatively regarding a second , a third buton that wil store the bank state.

I created a 2 buttons that will give the value a of a variable named @OberBank

first buton give the value of 0
[(press){@OberBank:0}]
second button give the value of 1
[(press){@OberBank:1}]

then the last button will send a pc regarding the state of the Overbank variable
[(@OberBank:0)(press){pc:6,0}]
[(@OberBank:1)(press){pc:6,7}]

but it does not work and i don't understand why .
I read that in a multievent the (press) must NOT be first event ... still it does not work.
why ?
Thanks !


Last edited by lionoil on Wed Nov 23, 2022 9:17 pm; edited 1 time in total

lionoil

Posts : 53
Join date : 2022-03-03

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by lionoil Wed Nov 23, 2022 7:25 pm

Ok ,i found the problem . it works now . Still there is a bug : i have to set [(@OberBank:0)(press){pc:7,0}] to send on channel 6....don't know why , i supose it's a little bug ?


.... BUT IT WORKS !!!! soo happy !!! this multievent scripts are goood ! Smile Thank you !!!!

lionoil

Posts : 53
Join date : 2022-03-03

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by lionoil Wed Nov 23, 2022 7:59 pm

Ohhh ! that's so beautifull !!!


[(@OberBank:0-127){@l_OberBank:#@OberBank * 8#}{text:#@l_OberBank#}]
[(@OberBank:0)(press){pc:7,0}]
[(@OberBank:1)(press){pc:7,8}]
[(@OberBank:2)(press){pc:7,16}]
[(@OberBank:3)(press){pc:7,24}]

This on a button make refresh the state of the PC regarding the state of the bank .
Then with one button and 4 banks i have on the same button PC 0,8,16,24 !!!

 multi event script bug ? 1f60d 

And it refresh immediatly the state of the PC without pushing the PC button itself !!!
Soooo mutch thanks !!! Smile

lionoil

Posts : 53
Join date : 2022-03-03

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by Admin Wed Nov 23, 2022 11:17 pm

Hi,

I'm glad you found a solution. Very Happy

By default, the script button uses channels 1-16 in the scripts. Technically, the channels are numbered 0-15 in the Midi protocol, but most software uses the more human-friendly 1-16 range. I guess that you are connected to something that uses the 0-15 range, in which case it is a bit confusing to use 1-16 in the script since you must set "channel 7" for what in your other software is "channel 6".

If you add the following command anywhere in the script, you can use the range 0-15 for the channel numbers if that makes more sense in your configuration:

[(config){firstmidichannel:0}]
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by lionoil Fri Nov 25, 2022 12:10 pm

Thanks ! Still there is a weird thing .
If i send a [(press){pc:6,10}]
It will send on channel 6. That's the good one
but if i send it like this
[(@OberBank:0)(press){pc:6,#@l_n - 1 #}]
Then it should also be on channel 6 .
It is not it's on channel 5 .
That's why  i said there is a bug .
Because depending if it's in multieven script or not it does not send on the same channel .

lionoil

Posts : 53
Join date : 2022-03-03

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by lionoil Fri Nov 25, 2022 12:22 pm

Also i have another difficulty .
In my script my 1st bank is one button with this script :

[(Init){@OberBank:0}]
[(press){@OberBank:0}]

It is meant to initialise the bank variable with value 0 when the screen is displayed.
It's an event then it should trigger other global variable (here the {@OberBank:0})? no ?

then on my PC button i have this script

[(@OberBank:0-127){@l_n:1}{@l_OberBank:#@OberBank * 8 + @l_n#}{text:Pc #@l_OberBank# \n\n}]
[(@OberBank:0)(press){pc:7,#@l_n - 1 #}]
[(@OberBank:1)(press){pc:7,#@l_n+7#}]
[(@OberBank:2)(press){pc:7,#@l_n+15#}]
[(@OberBank:3)(press){pc:7,#@l_n+23#}]

Regarding this line :
[(@OberBank:0-127){@l_n:1}{@l_OberBank:#@OberBank * 8 + @l_n#}{text:Pc #@l_OberBank# \n\n}]
I expected it would trigger the text on the first PC button then . But it does nothing .

I would like to initialise my @OberBank when the streamdeck app is started and write on the PC icon the value of the initialized value .

then at the begining my @OberBank is "0" and the PC should show "PC0" 
But i have to push my Bank button to show values.

I certainly made a mistake in my logic but i do not know what.

Also i wanted to initialize it once the stream deck app is started , not each time the screen display the button .
But (init) , regarding the documentation, initialize in page switch to. Is there a way to do it only when the streamdeck app start and the button is shown once ?

Thanks !

lionoil

Posts : 53
Join date : 2022-03-03

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by Admin Fri Nov 25, 2022 1:22 pm

Found the channel problem.  cheers

The second problem is a bit tricky, it's all about timing and button order. The (init) command is executed when that button is loaded, at which time the other button is not yet initialized.

Since the second button is not yet initialized, the (init) command is unaware of the fact that it will reference the @OberBank variable.

If you switch the order of the buttons, it will work as you expect.

I have logic in place to delay the execution of the (init) command if the Midi ports are not yet opened; I'll see if I can introduce a delay until the full page is loaded (even though there is no clear indication on when this happens).

Thanks for reporting the issues. Smile
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by lionoil Fri Nov 25, 2022 1:49 pm

Thanks for your tip ! Wink
Still no luck . 

I put the bank button (the button with a red circle) that has to be initialized first in the first place on the screen .
multi event script bug ? Variab10

But nothing happen .
Here is the state of PC buttons (red floppy) when i push the first bank button .
multi event script bug ? Bank_110
each floppy have their PC number regarding the bank state

Also it's not a big deal ! i just have to push the bank once the stream deck app start Wink
Thanks so mutch to make this fabulous multievent scripting possible ! Wink

lionoil

Posts : 53
Join date : 2022-03-03

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by lionoil Fri Nov 25, 2022 1:52 pm

I can send you the profile if you want to test it ? It could also be shared if you think that this little script worth it ?

lionoil

Posts : 53
Join date : 2022-03-03

Back to top Go down

multi event script bug ? Empty Re: multi event script bug ?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum