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

Maintaining state of cycle buttons over multiple pages

2 posters

Go down

Maintaining state of cycle buttons over multiple pages Empty Maintaining state of cycle buttons over multiple pages

Post by jtints Tue Feb 20, 2024 12:45 am

I am wondering if there is a way of maintaining the state of "cycle" buttons over multiple pages. I have a number of cycle buttons that are present on several pages. I am using the xml method. For example:

<?xml version="1.0" encoding="utf-8" ?>
<MidiSteps version="1.1">
  <Default send="yes" receive="yes" display="" image="" displayonsend="yes" useclosestvalueonreceive="yes"/>
  <StepValues>
    <Step value="0" display="--P1-- PULSE"/>
    <Step value="1" display="--P2-- PULSE"/>
    <Step value="2" display="--P3-- PULSE"/>
    <Step value="3" display="--P4-- PULSE"/>
  </StepValues>
</MidiSteps>

A given cycle button will maintain the same channel and controller number over all the pages. Is there a way of using a global variable or other technique to accomplish this? Alternatively is there a way of scripting a cycle without using "states" given that there are only state 1 and state 2? In the scripting direction, I could use a global variable to maintain a state across all the pages.

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Maintaining state of cycle buttons over multiple pages Empty Re: Maintaining state of cycle buttons over multiple pages

Post by jtints Tue Feb 20, 2024 2:34 am

I tried a simple brute-force script, but it is not setting the button on other pages.


Code:
[ (config) {TriggerOnUnchangedVariables:No} ]
[(init){image:%thumbs%\fcnTN\aubergineBG.png}]

[(@g_activeGROUP:0){nextpress:2}{text:SINGLE\nCLIP\nGROUP}]
[(@g_activeGROUP:1){nextpress:3}{text:BANK\n1\nGROUP}]
[(@g_activeGROUP:2){nextpress:4}{text:BANK\n2\nGROUP}]
[(@g_activeGROUP:2){nextpress:1}{text:PAGE\n\nGROUP}]

[ (press) {@g_activeGROUP:#0#}{cc:1,2,0}{nextpress:2}{text:SINGLE\nCLIP\nGROUP}]
[ (press) {@g_activeGROUP:#1#}{cc:1,2,1}{nextpress:3}{text:BANK\n1\nGROUP}]
[ (press) {@g_activeGROUP:#2#}{cc:1,2,2}{nextpress:4}{text:BANK\n2\nGROUP}]
[ (press) {@g_activeGROUP:#3#}{cc:1,2,3}{nextpress:1}{text:PAGE\n\nGROUP}]

[(cc:1,2,0) {@g_activeGROUP:#0#}{nextpress:2}{text:SINGLE\nCLIP\nGROUP}]
[(cc:1,2,1) {@g_activeGROUP:#1#}{nextpress:3}{text:BANK\n1\nGROUP}]
[(cc:1,2,2) {@g_activeGROUP:#2#}{nextpress:4}{text:BANK\n2\nGROUP}]
[(cc:1,2,3) {@g_activeGROUP:#3#}{nextpress:1}{text:PAGE\n\nGROUP}]

Is there anyone that might be able to point me in the right direction? Do I need to declare the global variable somewhere?


Last edited by jtints on Tue Feb 20, 2024 6:34 pm; edited 1 time in total

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Maintaining state of cycle buttons over multiple pages Empty Re: Maintaining state of cycle buttons over multiple pages

Post by Admin Tue Feb 20, 2024 9:34 am

The cycle button should maintain state over multiple pages; if it doesn't, I would say it's a bug.

In the script, you need more (init) commands for the various values in the global variable; that will set the correct value for a button when the page is activated.

I'm busy with other things at the moment but I will look more into these things later today.
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

jtints likes this post

Back to top Go down

Maintaining state of cycle buttons over multiple pages Empty Re: Maintaining state of cycle buttons over multiple pages

Post by Admin Tue Feb 20, 2024 11:57 am

Yes, it was a bug in the CC action. Embarassed
Admin
Admin
Admin

Posts : 1235
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

jtints likes this post

Back to top Go down

Maintaining state of cycle buttons over multiple pages Empty Re: Maintaining state of cycle buttons over multiple pages

Post by jtints Tue Feb 20, 2024 6:50 pm

I have this working for now. Thanks for the information about using INIT to create a multi-event to test the global active state of this button.

Code:
[ (config) {TriggerOnUnchangedVariables:No} ]
[(init){image:%thumbs%\fcnTN\aubergineBG.png}]

[(init)(@g_activeGROUP:0){nextpress:2}{text:SINGLE\nCLIP\nGROUP}]
[(init)(@g_activeGROUP:1){nextpress:3}{text:BANK\n1\nGROUP}]
[(init)(@g_activeGROUP:2){nextpress:4}{text:BANK\n2\nGROUP}]
[(init)(@g_activeGROUP:3){nextpress:1}{text:PAGE\n\nGROUP}]

[ (press) {@g_activeGROUP:0}{cc:1,2,0}{nextpress:2}{text:SINGLE\nCLIP\nGROUP}]
[ (press) {@g_activeGROUP:1}{cc:1,2,1}{nextpress:3}{text:BANK\n1\nGROUP}]
[ (press) {@g_activeGROUP:2}{cc:1,2,2}{nextpress:4}{text:BANK\n2\nGROUP}]
[ (press) {@g_activeGROUP:3}{cc:1,2,3}{nextpress:1}{text:PAGE\n\nGROUP}]

[(cc:1,2,0) {@g_activeGROUP:0}{nextpress:2}{text:SINGLE\nCLIP\nGROUP}]
[(cc:1,2,1) {@g_activeGROUP:1}{nextpress:3}{text:BANK\n1\nGROUP}]
[(cc:1,2,2) {@g_activeGROUP:2}{nextpress:4}{text:BANK\n2\nGROUP}]
[(cc:1,2,3) {@g_activeGROUP:3}{nextpress:1}{text:PAGE\n\nGROUP}]

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Maintaining state of cycle buttons over multiple pages Empty Re: Maintaining state of cycle buttons over multiple pages

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