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

nextpress causes crash

2 posters

Go down

nextpress causes crash Empty nextpress causes crash

Post by rodd Fri Sep 01, 2023 2:12 pm

I have a very basic script for a button press:

[(press){cc:1,24,0}]
[(press){cc:1,24,32}]
[(press){cc:1,24,64}]
[(press){cc:1,24,95}]
[(press){cc:1,24,127}]
[(cc:1,24,127){text:Comp2\nAll}{nextpress:1}]
[(cc:1,24,0){text:Comp2\n4:1}{nextpress:2}]
[(cc:1,24,32){text:Comp2\n8:1}{nextpress:3}]
[(cc:1,24,64){text:Comp2\n12:1}{nextpress:4}]
[(cc:1,24,95){text:Comp2\n20:1}{nextpress:5}]

whenever I include the "nextpress:1" action it causes the plugin to crash:

2023-09-01 08:01:08.6943      0.01ms DEBUG    34  MCUConnction     ReceiveControlChange          [acb4d72ef5ffcb3c4d298e3f0cca98c7 control=24, value=127]
Unhandled 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.PluginActionScript.KeyPressed(KeyPayload payload) in P:\Projects\StreamDeck-Midi - Net 7\StreamDeck-Midi\Actions\PluginActionScript.cs:line 1467
   at BarRaider.SdTools.PluginContainer.Connection_OnKeyDown(Object sender, SDEventReceivedEventArgs`1 e) in P:\Projects\StreamDeck-Midi - Net 7\barraider-sdtools 6.1.1\Backend\PluginContainer.cs:line 97
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()


2023-09-01 08:02:08.7373|DEBUG|TrevligaSpel|Logger Initialized
2023-09-01 08:02:08.7731|INFO|TrevligaSpel|Plugin [se.trevligaspel] Loading - 11 Actions Found
2023-09-01 08:02:09.0882|DEBUG|TrevligaSpel|Plugin Loaded: UUID: 6F0001BF6C151263600DE5B15427269E Device Info: Devices:
[Id: 036562AB735FE015C5784A794990044A Type: StreamDeckPlus Size: Rows: 2 Columns: 4]
[Id: 627DAE0BF1C1BCCBAF77CCDCA9911853 Type: StreamDeckClassic Size: Rows: 8 Columns: 8]
ApplicationInfo: Language: en Platform: mac Version: 6.3.0.18948
PluginInfo: Version: 3.5.2

2023-09-01 08:02:09.0882|INFO|TrevligaSpel|Plugin version: 3.5.2
2023-09-01 08:02:09.0882|INFO|TrevligaSpel|Connecting to Stream Deck...
2023-09-01 08:02:09.1400|INFO|TrevligaSpel|Connected to Stream Deck
2023-09-01 08:02:09.1413|INFO|TrevligaSpel|GlobalSettingsManager initialized

I have attached the script file if that helps. I originally had nextpress 1 at the end of the script because that is the max value, so I moved it to the top, but that has the same results. For some reason it doesn't like looping around back to 1.

rodd

Posts : 37
Join date : 2023-09-01

Back to top Go down

nextpress causes crash Empty Re: nextpress causes crash

Post by Admin Fri Sep 01, 2023 3:19 pm

Thanks for the bug report.

I will fix that for the next release. (I sent an update to Elgato yesterday, which will be published today or early next week; this fix is not included in that release).

Meanwhile, you can avoid the bug by changing the script like this:

[(press){cc:1,24,0}{text:Comp2\n4:1}]
[(press){cc:1,24,32}{text:Comp2\n8:1}]
[(press){cc:1,24,64}{text:Comp2\n12:1}]
[(press){cc:1,24,95}{text:Comp2\n20:1}]
[(press){cc:1,24,127}{text:Comp2\nAll}]
[(cc:1,24,127){text:Comp2\nAll}{nextpress:1}]
[(cc:1,24,0){text:Comp2\n4:1}{nextpress:2}]
[(cc:1,24,32){text:Comp2\n8:1}{nextpress:3}]
[(cc:1,24,64){text:Comp2\n12:1}{nextpress:4}]
[(cc:1,24,95){text:Comp2\n20:1}{nextpress:5}]
[(config){TriggerOnLocalMidiEvents:No}]

The bug was triggered when the nextpress action was executed while processing a press command, and by stopping the script from triggering on local events, the nextpress actions are only run when the cc commands are received from the host. The "downside" is that the text actions must be duplicated to the press commands.
Admin
Admin
Admin

Posts : 962
Join date : 2020-03-26

https://trevligaspel.forumotion.eu

Back to top Go down

nextpress causes crash Empty Re: nextpress causes crash

Post by rodd Fri Sep 01, 2023 3:26 pm

Thanks, I originally had the text action in the press commands but I forgot to mention that I removed them thinking that might be causing it. Seems like the "triggeronlocalmidievents" was the key to making it stop. Great, thanks!

rodd

Posts : 37
Join date : 2023-09-01

Back to top Go down

nextpress causes crash Empty Re: nextpress causes crash

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


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