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

Version 3.7 beta/preview

3 posters

Go down

Version 3.7 beta/preview Empty Version 3.7 beta/preview

Post by Admin Tue Dec 05, 2023 10:35 pm

This is a little something for the script nerds. I leave it with that to see what questions pop up. Very Happy

Version 3.6.1.69 Use download in later post


Last edited by Admin on Wed Dec 06, 2023 3:48 pm; edited 1 time in total
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by thx538 Wed Dec 06, 2023 11:04 am

That's interesting !

I have a background script with the following :
Code:
[(cc:16,1,0-127){@g_n1:#@e_ccvalue#}]
[(cc:16,2,0-127){@g_n2:#@e_ccvalue#}]
[(cc:16,3,0-127){@g_n3:#@e_ccvalue#}]
[(cc:16,4,0-127){@g_n4:#@e_ccvalue#}]
[(cc:16,5,0-127){@g_n5:#@e_ccvalue#}]
[(cc:16,6,0-127){@g_n6:#@e_ccvalue#}]
[(cc:16,7,0-127){@g_n7:#@e_ccvalue#}]
[(cc:16,8,0-127){@g_n8:#@e_ccvalue#}{@g_nupd:1}]


And a buttton with the following code :
Code:
[(init){image:%trevligaspel%/Icons/Blank.png}]
[(press){cc:1,1,127}]
[(release){cc:1,1,0}]
[(@g_nupd:1){text:#CONCAT(CHAR(10),CHAR(10),CHAR(@g_n1 ),CHAR(@g_n2 ),CHAR(@g_n3 ),CHAR(@g_n4 ),CHAR(@g_n5 ),CHAR(@g_n6 ),CHAR(@g_n7 ),CHAR(@g_n8 ))#}{@g_nupd:0}]
[(init)(@g_nupd:1){text:#CONCAT(CHAR(10),CHAR(10),CHAR(@g_n1 ),CHAR(@g_n2 ),CHAR(@g_n3 ),CHAR(@g_n4 ),CHAR(@g_n5 ),CHAR(@g_n6 ),CHAR(@g_n7 ),CHAR(@g_n8 ))#}{@g_nupd:0}]
[(cc:3,0,1){image:%trevligaspel%/Icons/TrackMuteSolo-1.png}]
[(cc:3,0,2){image:%trevligaspel%/Icons/TrackMuteSolo-2.png}]
[(cc:3,0,3){image:%trevligaspel%/Icons/TrackMuteSolo-3.png}]
[(cc:3,0,4){image:%trevligaspel%/Icons/TrackMuteSolo-4.png}]
[(cc:3,0,5){image:%trevligaspel%/Icons/TrackMuteSolo-5.png}]
[(init)(cc:3,0,1){image:%trevligaspel%/Icons/TrackMuteSolo-1.png}]
[(init)(cc:3,0,2){image:%trevligaspel%/Icons/TrackMuteSolo-2.png}]
[(init)(cc:3,0,3){image:%trevligaspel%/Icons/TrackMuteSolo-3.png}]
[(init)(cc:3,0,4){image:%trevligaspel%/Icons/TrackMuteSolo-4.png}]
[(init)(cc:3,0,5){image:%trevligaspel%/Icons/TrackMuteSolo-5.png}]


but surprisingly the button image and text are not updated when I load the page that contains it.
Attached is a log file.
Any idea ?
Attachments
Version 3.7 beta/preview Attachment
pluginlog.txt You don't have permission to download attachments.(135 Kb) Downloaded 0 times

thx538

Posts : 130
Join date : 2023-10-23

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Wed Dec 06, 2023 3:47 pm

That was interesting. I had to detach the script engine from the script button to have it available for background usage. When doing so, I verified that scripts still ran as expected in the script button, but I failed to verify the (init) commands.

The code is there to handle the (init) commands, but due to an unexpected and interesting chicken-and-egg situation, it didn't work. Fixed in this version; thanks for the report.

Version 3.6.1.74 Use download in later post.


Last edited by Admin on Sat Dec 09, 2023 10:16 am; edited 1 time in total
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by thx538 Wed Dec 06, 2023 6:39 pm

Thanks ...
It works as expected now.
Background script provides an elegant way to mutualize common midi handling, especially with buttons duplicated on several pages.

thx538

Posts : 130
Join date : 2023-10-23

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by thx538 Fri Dec 08, 2023 7:17 pm

But now it raises the question of parallelism in managing global variables.
Suppose I have {@g_nupd:1} set in a background script, and the following in several buttons : [(@g_nupd:1){... do something here ... }{@g_nupd:0}].

What will happen ? Will the "do something" be executed for all buttons or only once ?

Thanks for your support.

thx538

Posts : 130
Join date : 2023-10-23

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Fri Dec 08, 2023 8:30 pm

There is no difference between script buttons and background scripts regarding how variables are handled.

When a script sets a variable, it will immediately trigger commands in all other scripts where this variable is referenced. Each script will be triggered with the triggering value (=1) even though other scripts reset it to 0 during the execution.

So, all scripts will "do something". Smile
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by thx538 Sat Dec 09, 2023 8:29 am

Thank you for this explanation and sorry to bother you again, but there is something I don't understand.

I have a background script as follows (extract) :
Code:
[(cc:14,0,0-127){@g_p:#@e_ccvalue#}{@g_dupd:1}] Parameters : Global switch Half Bank

and then a button script with :
Code:
[(config){TriggerOnLocalMidiEvents:Yes}{TriggerOnUnchangedVariables:Yes}]
[(@g_p:0-127)(@g_dupd:1){cc:14,1,#@g_p#}{@g_dupd:0}] Global half bank switch : Trigger local
[(init)(@g_dupd:1)(@g_p:0-127){cc:14,1,#@g_p#}{@g_dupd:0}]
[(cc:14,1,0-127){@l_bp:#@e_ccvalue#}] 1 Local = Parameter only
[(init)(cc:14,1,0-127){@l_bp:#@e_ccvalue#}]
[(press){cc:14,1,#127 - @l_bp#}]
[(@l_bp:0){image:%trevligaspel%/Icons/ParamB1.png}]
[(@l_bp:127){image:%trevligaspel%/Icons/ParamB2.png}]

Looking at the second line I would have expected this button to send a CC message on channel 14 (13), but is sends a message on channel 13 (12) instead, as confirmed by the attached log file.

Thanks again for your support.

Edit:

Surprisingly, If I change the button script (2nd and 3rd line) to :
Code:
[(@g_dupd:1){cc:14,1,#@g_p#}{@g_dupd:0}] Global half bank switch : Trigger local
[(init)(@g_dupd:1){cc:14,1,#@g_p#}{@g_dupd:0}]

it works as expected.
Attachments
Version 3.7 beta/preview Attachment
pluginlog.txt You don't have permission to download attachments.(4 Kb) Downloaded 1 times

thx538

Posts : 130
Join date : 2023-10-23

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Sat Dec 09, 2023 10:16 am

That was an interesting bug; it's fantastic that you found it. It must have been present for a long time...

It should be fixed in this version.

Version 3.6.1.76 Use downoad in later post.


Last edited by Admin on Sun Dec 10, 2023 3:54 pm; edited 1 time in total
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Sun Dec 10, 2023 3:54 pm

OK, final(?) version. If no more problems are found, I will start to prepare for the publishing.

Unfortunately, there is a breaking change if you have used plugin-internal ports.

I decided to add an input field where you can define the number of available plugin-internal ports, and with that, I changed the internal representation of the ports. If you have used internal ports, you need to re-select the same ports since it will not find the ports with the previous internal names. Sorry.  Rolling Eyes

Version 3.6.1.84
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Joerg Sat Dec 16, 2023 3:24 pm

I am not able to get 3.6.1.84 up and running 

2023-12-16 14:56:13.0115|INFO|TrevligaSpel|Plugin version: 3.6.1.84
2023-12-16 14:56:13.0115|INFO|TrevligaSpel|Connecting to Stream Deck...
2023-12-16 14:56:13.0115|INFO|TrevligaSpel|RunAsync WebSocketState.Open
2023-12-16 14:56:13.0351|INFO|TrevligaSpel|RunAsync registerEvent
2023-12-16 14:56:13.0351|INFO|TrevligaSpel|RunAsync OnConnected.Invoke
2023-12-16 14:56:13.0351|INFO|TrevligaSpel|Connected to Stream Deck
2023-12-16 14:56:13.0351|INFO|TrevligaSpel|GlobalSettingsManager initialized
2023-12-16 14:56:13.0742      0,00ms  INFO    11  Midi             plugin version 3.6.1.84, StreamDeck version 6.4.1.19697
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at StreamDeck_Midi.BackgroundScriptController.AreGlobalSettingsChanged() in E:\Projects\StreamDeck-Midi - Net 7 3.7\StreamDeck-Midi\Script\BackgroundScriptController.cs:line 49
   at StreamDeck_Midi.GlobalSettings.ReceivedGlobalSettings(ReceivedGlobalSettingsPayload payload) in E:\Projects\StreamDeck-Midi - Net 7 3.7\StreamDeck-Midi\Actions\GlobalSettings.cs:line 799
   at StreamDeck_Midi.PluginActionNoteOn.ReceivedGlobalSettings(ReceivedGlobalSettingsPayload payload) in E:\Projects\StreamDeck-Midi - Net 7 3.7\StreamDeck-Midi\Actions\PluginActionNoteOn.cs:line 1791
   at BarRaider.SdTools.PluginContainer.Connection_OnDidReceiveGlobalSettings(Object sender, SDEventReceivedEventArgs`1 e) in E:\Projects\barraider-sdtools 6.1.1\Backend\PluginContainer.cs:line 254
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

Joerg

Posts : 142
Join date : 2021-09-03

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Sat Dec 16, 2023 3:59 pm

That's a very odd error.

The only way I can imagine this may possibly happen is if you had the published 3.6 version installed and uninstalled that before installing the beta. Is that the case?

Anyhow, try this version:

Version 3.7.0.1
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Joerg Sat Dec 16, 2023 4:56 pm

Admin wrote:That's a very odd error.

The only way I can imagine this may possibly happen is if you had the published 3.6 version installed and uninstalled that before installing the beta. Is that the case?

Anyhow, try this version:

Version 3.7.0.1
That is exactly what happend. I always deinstall the official published version before installing the test version because of problems I had in the past.

Joerg

Posts : 142
Join date : 2021-09-03

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Joerg Sat Dec 16, 2023 5:06 pm

I was able to install 3.7.0.1 and everything looks like working as usual.

Then I tried to create an instance of "Backgound Scripts", which isn't working.

2023-12-16 16:57:22.0523|DEBUG|TrevligaSpel|Logger Initialized
2023-12-16 16:57:22.0649|INFO|TrevligaSpel|Plugin [se.trevligaspel.midi] Loading - 12 Actions Found
2023-12-16 16:57:22.2091|INFO|TrevligaSpel|RunAsync Start
2023-12-16 16:57:22.2435|DEBUG|TrevligaSpel|Plugin Loaded: UUID: 2508B48221C21D147A440B826582B330 Device Info: Devices:
[Id: F7FB5408A117D1FD12966C0099CFFE0A Type: StreamDeckMobile Size: Rows: 8 Columns: 8]
[Id: 8C8F4250384A04C2D0BCEB0478841950 Type: StreamDeckPlus Size: Rows: 2 Columns: 4]
[Id: D71A3FD4D97D37F5BBFC61C6F13BCD43 Type: StreamDeckMobile Size: Rows: 8 Columns: 8]
[Id: 40F22F6F89AB0EAAD15FF3FDB40CAC4D Type: StreamDeckMobile Size: Rows: 8 Columns: 8]
[Id: E77015FA9AF980029CA2CA0372321E93 Type: StreamDeckXL Size: Rows: 4 Columns: 8]
[Id: E4081A4570A71A869536C2D711A5D6B4 Type: CorsairGKeys Size: Rows: 1 Columns: 4]
ApplicationInfo: Language: de Platform: windows Version: 6.4.1.19697
PluginInfo: Version: 3.7.0.1

2023-12-16 16:57:22.2435|INFO|TrevligaSpel|Plugin version: 3.7.0.1
2023-12-16 16:57:22.2435|INFO|TrevligaSpel|Connecting to Stream Deck...
2023-12-16 16:57:22.4127|INFO|TrevligaSpel|RunAsync WebSocketState.Open
2023-12-16 16:57:22.4361|INFO|TrevligaSpel|RunAsync registerEvent
2023-12-16 16:57:22.4361|INFO|TrevligaSpel|RunAsync OnConnected.Invoke
2023-12-16 16:57:22.4361|INFO|TrevligaSpel|Connected to Stream Deck
2023-12-16 16:57:22.4361|INFO|TrevligaSpel|GlobalSettingsManager initialized
2023-12-16 16:57:22.4752      0,00ms  INFO    11  Midi             plugin version 3.7.0.1, StreamDeck version 6.4.1.19697
2023-12-16 17:02:36.1080 313632,78ms ERROR    84  BackgroundScript Constructor                   [d925ddac46587986affd6d6756d8fdac:Exception:System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at StreamDeck_Midi.PluginActionBackgroundScript.GlobalHasDefaultValues(Int32 idx) in E:\Projects\StreamDeck-Midi - Net 7 3.7\StreamDeck-Midi\Actions\PluginActionBackgroundScript.cs:line 464
   at StreamDeck_Midi.PluginActionBackgroundScript.GlobalSettingsChanged(Boolean constructorcall) in E:\Projects\StreamDeck-Midi - Net 7 3.7\StreamDeck-Midi\Actions\PluginActionBackgroundScript.cs:line 391
   at StreamDeck_Midi.PluginActionBackgroundScript..ctor(SDConnection connection, InitialPayload payload) in E:\Projects\StreamDeck-Midi - Net 7 3.7\StreamDeck-Midi\Actions\PluginActionBackgroundScript.cs:line 328]

Joerg

Posts : 142
Join date : 2021-09-03

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Sat Dec 16, 2023 5:45 pm

Please tell me how you installed the updates.

I still claim that the only way I can imagine this may possibly happen is if you had the published 3.6 version installed and uninstalled that before installing the beta. Is that the case?
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Sat Dec 16, 2023 6:00 pm

It's important to me to understand how you got to this point. Version 3.7 is already published on MarketPlace, so I need to understand why you get this problem.
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Joerg Sat Dec 16, 2023 6:38 pm

Admin wrote:It's important to me to understand how you got to this point. Version 3.7 is already published on MarketPlace, so I need to understand why you get this problem.

As mentioned above this is exactly what happend. 

I uninstalled the official Midi version from the shop and after that I installed your 3.6.xx test version by simply unpacking and clicking on the data file to be installed by StreamDeck. As this Version didn't work out, I uninstalled everything again, closed StreamDeck, restarted StreamDeck and went for another install which didn't work either.

After that I uninstalled everything and installed Version 3.7.xx which is up and running now. The only thing that isn't working is the new "Background scripts" function.

Version 3.7 beta/preview Unbena13

Joerg

Posts : 142
Join date : 2021-09-03

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Sat Dec 16, 2023 6:43 pm

I can't imagine what the problem is, I can't reproduce it, no matter how brutal I am.

Could you please enable extended logging, restart the Stream Deck software and send me the (whole) log file?
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Joerg Sat Dec 16, 2023 7:10 pm

So, after enabling the logging I closed and restartet StreamDeck and suddenly the "Background scripts" action shows up. Looks like the whole StreamDeck needed this restart to complete the plugin update.

Version 3.7 beta/preview Unbena14

Joerg

Posts : 142
Join date : 2021-09-03

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Sat Dec 16, 2023 7:45 pm

Yes, that's why I was so eager to learn exactly how you performed the update. These settings are stored in the global settings (not in the profile), And the state of the global settings and from where it is read depends very much on the sequence of actions.
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Sun Dec 17, 2023 12:27 pm

Version 3.7 is now released; thanks for the help with testing it.

Regarding the update/installation procedure, I recommend always doing an update (not a reinstall) if possible. The only situations where an update isn't possible is if you want to reinstall the same version or downgrade to an earlier version.

When I release new versions (beta or release), the version number is always increased, so an update is possible.

The only difference between an update and a reinstall is, as far as I know, that the global settings are deleted if you perform a reinstall. Global settings keep many settings for the plugin, such as Mackie midi ports, default settings for dials and buttons and the background script configuration.

The plugin tries in various ways to recreate the deleted global settings if you do a reinstall, but depending on the situation, this may be more or less successful. So, if possible, do an update, not a reinstall. Smile
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by thx538 Tue Dec 19, 2023 12:46 pm

Hello,
Just out of curiosity, what is "New key images" ?

thx538

Posts : 130
Join date : 2023-10-23

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

Post by Admin Tue Dec 19, 2023 2:09 pm

.The images on the keys. Very Happy

Version 3.7 beta/preview 2023-12-19_14-19-16
Admin
Admin
Admin

Posts : 1251
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

Version 3.7 beta/preview Empty Re: Version 3.7 beta/preview

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