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

Batch Programming Buttons

3 posters

Go down

Batch Programming Buttons Empty Batch Programming Buttons

Post by jtints Wed Jan 31, 2024 3:36 am

Is there any way of batch programming buttons? I am building a large, flexible video player for Isadora with 4 possible tracks each on their own profile. Each track has a possible 9 pages of 32 buttons. I have used the following scheme for programming midi in my host application:

Track 1/CH1/Page 2, CC#1-32; Page 3, CC#33-64; Page 4 CC#65-96; CH2/Page 5, CC#1-32 [...]
Track 2/CH4 etc.

It's a lot of buttons (576) to program by hand. I am considering scripting the buttons and iterating the scripts in an excel spreadsheet so it will fill in the Channel and CC#s for me. I will then either copy/paste the script into each button, or save them out as individual files and populate the pulldown with the scripts one page at a time and use the pulldown. 

They're all toggles that will need to respond to incoming midi, too. In addition, each button will hopefull init to a unique custom icon (a thumbnail from the video with a set naming scheme).

If there was a way of programming buttons with a batch script or programmatically it would save me grinding this out.

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Batch Programming Buttons Empty Re: Batch Programming Buttons

Post by arbibarbarona Wed Jan 31, 2024 7:35 am

You can Create an XML  file and save it under PredefinedScripts folder and save it in the Trevliga Spel folder in your documents.

Sample script would be like this
Code:
<?xml version="1.0" encoding="utf-8" ?>
<Scripts>
<Category name="CC Assignments">

<Script name="CC5,_1">[(press){cc:5,1,127}]</Script>
<Script name="CC5,_2">[(press){cc:5,2,127}]</Script>
<Script name="CC5,_3">[(press){cc:5,3,127}]</Script>
<Script name="CC5,_4">[(press){cc:5,4,127}]</Script>
<Script name="CC5,_5">[(press){cc:5,5,127}]</Script>
<Script name="CC5,_6">[(press){cc:5,6,127}]</Script>
<Script name="CC5,_7">[(press){cc:5,7,127}]</Script>
<Script name="CC5,_8">[(press){cc:5,8,127}]</Script>
<Script name="CC5,_9">[(press){cc:5,9,127}]</Script>




</Category>
</Scripts>



Then you can pull it for each Script buttons out in the Pre defined scripts in the button editor.

Batch Programming Buttons Screen93

arbibarbarona

Posts : 99
Join date : 2021-05-16

jtints likes this post

Back to top Go down

Batch Programming Buttons Empty Re: Batch Programming Buttons

Post by Admin Wed Jan 31, 2024 9:02 am

I know of no tools that enable batch creation of Stream Deck buttons. It is, in theory, possible to duplicate an existing page folder and use a text editor to change all involved json files. I'm pretty familiar with the structure of the json files for profiles, but I would hesitate to do such a thing; there are too many things that can go wrong, and there’s an obvious risk you spend more time troubleshooting than it would have taken creating the pages the official way.

BarRaider has created a tool with which you can copy columns from one profile to another, but I don’t know if that helps.
Admin
Admin
Admin

Posts : 1250
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

jtints likes this post

Back to top Go down

Batch Programming Buttons Empty Re: Batch Programming Buttons

Post by jtints Wed Jan 31, 2024 1:34 pm

Both of these tips will cut down on the work. Thank-you..

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Batch Programming Buttons Empty Re: Batch Programming Buttons

Post by jtints Wed Feb 07, 2024 2:36 am

Amazing. With the help of ChatCGT, I will be able to create the buttons in 32 button groups having the Chat do the work of acending numbers with the patterns required for each page. I just did a small test and it worked perfectly. Thanks for your help. 

This is the sctipt I am using for the video player toggles. They call an image for the thumbnail, and display "ON" when toggled on. The filenames, midi channel, and CC# are a patterns than can be calculated from the profile (which I am using for 4 different video tracks), page and button#.


Code:
[(init){image:%thumbs%\tn\T01_P02_B01_C01.jpg}] 
[ (press) {cc:1,3,127} ] 
[ (release) {text:ON} ] 
[ (press) {cc:1,3,0} ] 
[ (release) {text:#none#} ] 
[ (cc:1,3,0) {text:#none#} {nextpress:1}] 
[ (cc:1,3,127) {text:ON} {nextpress:2}]


Is there any way to adjust the text size or colour?

jtints

Posts : 37
Join date : 2024-01-22

Back to top Go down

Batch Programming Buttons Empty Re: Batch Programming Buttons

Post by Admin Wed Feb 07, 2024 8:54 am

jtints wrote:Is there any way to adjust the text size or colour?

You can't control size or color from the script, but you can use the font controls in the editor.
Admin
Admin
Admin

Posts : 1250
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

jtints likes this post

Back to top Go down

Batch Programming Buttons Empty Re: Batch Programming Buttons

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