Issues with Ableton Track Activator and State Example
2 posters
Page 1 of 1
Issues with Ableton Track Activator and State Example
Hello,
I'm having some trouble with the following example:
I'm mapping the "Script" button to the "Track Activator" in Ableton 11. It works for a short period of time (between two and five presses of the button). Then, it pops up a yellow warning symbol on the button. The rest of Stream Deck starts not working well at that point.
Here is my log file.
Any thoughts on what could be going wrong?
I'm having some trouble with the following example:
- Code:
[(press){cc:1,4,127}]
[(release){state:1}]
[(press){cc:1,4,0}]
[(release){state:0}]
[(cc:1,4,0){state:0}{nextpress:1}]
[(cc:1,4,127){state:1}{nextpress:2}]
I'm mapping the "Script" button to the "Track Activator" in Ableton 11. It works for a short period of time (between two and five presses of the button). Then, it pops up a yellow warning symbol on the button. The rest of Stream Deck starts not working well at that point.
Here is my log file.
- Code:
2022-12-31 13:30:24.170 Debug 2.95ms 4 Script KeyPressed [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4]
2022-12-31 13:30:24.170 Debug 0.07ms 4 Script RunActionList [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4 Press]
2022-12-31 13:30:24.170 Debug 0.45ms 4 DawController Send [00ef43cfc9f187cdbbe4f6483ac32696 OutPort(StreamDeck2Daw) Channel(0) Control(4) ControlFunction(4) Value(127) ControlChange]
2022-12-31 13:30:24.170 Debug 0.70ms 4 Script RunActionList [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4 CC:0,4,127]
2022-12-31 13:30:24.170 Debug 3.75ms 4 Script KeyReleased [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4]
2022-12-31 13:30:24.170 Debug 0.02ms 4 Script RunActionList [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4 Release]
2022-12-31 13:30:24.170 Debug 0.23ms 4 Script KeyPressed [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4]
2022-12-31 13:30:24.170 Debug 0.01ms 4 Script RunActionList [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4 Press]
2022-12-31 13:30:24.170 Debug 0.04ms 4 DawController Send [00ef43cfc9f187cdbbe4f6483ac32696 OutPort(StreamDeck2Daw) Channel(0) Control(4) ControlFunction(4) Value(0) ControlChange]
2022-12-31 13:30:24.170 Debug 0.34ms 4 Script RunActionList [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4 CC:0,4,0]
2022-12-31 13:30:24.170 Debug 0.56ms 4 Script KeyPressed [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4]
2022-12-31 13:30:24.170 Debug 0.01ms 4 Script RunActionList [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4 Press]
2022-12-31 13:30:24.170 Debug 0.01ms 4 DawController Send [00ef43cfc9f187cdbbe4f6483ac32696 OutPort(StreamDeck2Daw) Channel(0) Control(4) ControlFunction(4) Value(127) ControlChange]
2022-12-31 13:30:24.170 Debug 0.15ms 4 Script RunActionList [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4 CC:0,4,127]
2022-12-31 13:30:24.185 Fatal 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.KeyReleased(KeyPayload payload) in D:\Projects\StreamDeck-Midi - Core\StreamDeck-Midi\Actions\PluginActionScript.cs:line 1329
at BarRaider.SdTools.PluginContainer.Connection_OnKeyUp(Object sender, SDEventReceivedEventArgs`1 e) in D:\Projects\StreamDeck-Midi - Core\barraider-sdtools-sdplus\Backend\PluginContainer.cs:line 127
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
2022-12-31 13:30:24.202 Debug 29.61ms 9 Script KeyReleased [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4]
2022-12-31 13:30:24.202 Debug 0.06ms 9 Script RunActionList [00ef43cfc9f187cdbbe4f6483ac32696 Row:2, Column:4 Release]
2022-12-31 13:31:25.0845|DEBUG|TrevligaSpel|Logger Initialized
2022-12-31 13:31:25.0845|INFO|TrevligaSpel|Plugin [se.trevligaspel.midi] Loading - 9 Actions Found
2022-12-31 13:31:25.2132|DEBUG|TrevligaSpel|Plugin Loaded: UUID: CD43519A6691746D1FA39E5982E8EDD9 Device Info: Devices:
[Id: B3806B96A784EA6D4864CAB263A92FDA Type: StreamDeckXL Size: Rows: 4 Columns: 8]
[Id: 2056B7E85D34017A27CF2DC47A25154B Type: StreamDeckPedal Size: Rows: 1 Columns: 3]
ApplicationInfo: Language: en Platform: windows Version: 6.0.2.17735
PluginInfo: Version: 3.0.0
Any thoughts on what could be going wrong?
mboldisc- Posts : 5
Join date : 2022-12-31
Re: Issues with Ableton Track Activator and State Example
That's a nasty bug you've found.
It is triggered by the fact that the cc commands are run when you set the cc value in the press commands.
You can bypass the problem by adding the following command anywhere in the script:
[(config){TriggerOnLocalMidiEvents:No}]
It is triggered by the fact that the cc commands are run when you set the cc value in the press commands.
You can bypass the problem by adding the following command anywhere in the script:
[(config){TriggerOnLocalMidiEvents:No}]
Worked!
Wow! Thanks for the quick reply. It worked with that extra command you provided. I'm on to trying some more advanced state configurations. Much appreciated!
mboldisc- Posts : 5
Join date : 2022-12-31
Re: Issues with Ableton Track Activator and State Example
I tried a more advanced example using variables.
Here's the log file:
Here's what I tried:
I noticed that "state" and "cc:channel" do not work well with variables. Even with constants inserted, I couldn't get the variables to work well.
Here's the log file:
- Code:
2022-12-31 16:53:51.531 Warn 0.00ms 44 ScriptParser GetActions [Invalid parameter in action {state:@StandardDrumsState}]
2022-12-31 16:53:51.531 Warn 0.02ms 44 ScriptParser GetMidiEvent [In the event (cc:@channel,@note,@off), the channel must be within 1-16]
2022-12-31 16:53:51.531 Warn 0.01ms 44 ScriptParser GetMidiEvent [In the event (cc:@channel,@note,@on), the channel must be within 1-16]
2022-12-31 16:53:51.531 Debug 0.83ms 44 TSFile Watcher_Stable [File 'C:/Users/mike/workspace/ableton-control/streamdeck/standard_drums.txt' thread end]
2022-12-31 16:54:10.061 Debug 18525.08ms 38 Script OnSendToPlugin [00ef43cfc9f187cdbbe4f6483ac32696
Here's what I tried:
- Code:
[(config){TriggerOnLocalMidiEvents:No}]
{@Channel:1}
{@Note:1}
{@On:127}
{@Off:0}
{@StandardDrumsState:0}
{@ElectricDrumsState:1}
[(press){cc:@Channel,@Note,@On}]
[(release){state:@ElectricDrumsState}]
[(press){cc:@Channel,@Note,@Off}]
[(release){state:@StandardDrumsState}]
[(cc:@Channel,@Note,@Off){state:@StandardDrumsState}{nextpress:1}{text:Electric}]
[(cc:@Channel,@Note,@On){state:@ElectricDrumsState}{nextpress:2}{text:Standard}]
I noticed that "state" and "cc:channel" do not work well with variables. Even with constants inserted, I couldn't get the variables to work well.
mboldisc- Posts : 5
Join date : 2022-12-31
Re: Issues with Ableton Track Activator and State Example
I did get the example I wanted working without variables:
This allows me to control two track activate toggles such that they behave as mutually exclusive buttons.
Nice work on this plugin!
- Code:
[(config){TriggerOnLocalMidiEvents:No}]
[(press){cc:1,2,127}{cc:1,1,0}]
[(release){state:1}]
[(press){cc:1,2,0}{cc:1,1,127}]
[(release){state:0}]
[(cc:1,2,0){state:0}{nextpress:1}{text:"Standard"}]
[(cc:1,2,127){state:1}{nextpress:2}{text:"Electronic"}]
This allows me to control two track activate toggles such that they behave as mutually exclusive buttons.
Nice work on this plugin!
mboldisc- Posts : 5
Join date : 2022-12-31
Re: Issues with Ableton Track Activator and State Example
mboldisc wrote:
- Code:
[(config){TriggerOnLocalMidiEvents:No}]
{@Channel:1}
{@Note:1}
{@On:127}
{@Off:0}
{@StandardDrumsState:0}
{@ElectricDrumsState:1}
[(press){cc:@Channel,@Note,@On}]
[(release){state:@ElectricDrumsState}]
[(press){cc:@Channel,@Note,@Off}]
[(release){state:@StandardDrumsState}]
[(cc:@Channel,@Note,@Off){state:@StandardDrumsState}{nextpress:1}{text:Electric}]
[(cc:@Channel,@Note,@On){state:@ElectricDrumsState}{nextpress:2}{text:Standard}]
I noticed that "state" and "cc:channel" do not work well with variables. Even with constants inserted, I couldn't get the variables to work well.
I don't know the purpose of the "{@Channel:1}" rows; since they are not in commands, they are ignored by the script engine. If you need default values for variables, you can set them in an Init command:
- Code:
[(Init){@Channel:1}{@Note:1}{@On:127}{@Off:0}{@StandardDrumsState:0}{@ElectricDrumsState:1}]
The "{state:@ElectricDrumsState}" action did not work since I didn't expect anyone to use variables to set the state. I have added this to the next release.
The "(cc:@Channel,@Note,@Off)" events did not work since variables can only be set in events, not referenced, and this will not change. Variable references in events would introduce immense complexity that, besides me getting it all right, requires that you get it all right. Instead, you need to add multiple commands if you have multiple situations to react to.
Re: Issues with Ableton Track Activator and State Example
I'm starting to understand. Thanks for all the help.
From an example:
Is the "event" portion of that statement considered "(press)"?
Or is the event portion also including the expected event state, i.e., "(press){cc:1,2,127}"?
I'm trying to understand if variables can be used in the expected event state. It didn't seem to work with variables in the expected event state portion.
Example:
From an example:
- Code:
[(press){cc:1,2,127}{cc:1,1,0}]
Is the "event" portion of that statement considered "(press)"?
Or is the event portion also including the expected event state, i.e., "(press){cc:1,2,127}"?
I'm trying to understand if variables can be used in the expected event state. It didn't seem to work with variables in the expected event state portion.
Example:
- Code:
[(config){TriggerOnLocalMidiEvents:No}]
[(Init){@Channel:1}{@StandardNote:1}{@ElectricNote:2}{@On:127}{@Off:0}{@StandardDrumsState:0}{@ElectricDrumsState:1}]
[(press){cc:@Channel,@ElectricNote,@On}{cc:@Channel,@StandardNote,@Off}{image:"C:\Users\mike\workspace\ableton-control\streamdeck\freebie-musical-instruments\Green style\png\icons\64\snare-drum.png"}]
[(release){state:1}]
[(press){cc:@Channel,@ElectricNote,@Off}{cc:@Channel,@StandardNote,@On}{image:"C:\Users\mike\workspace\ableton-control\streamdeck\freebie-musical-instruments\Plain style\png\icons\64\snare-drum.png"}]
[(release){state:0}]
[(cc:1,2,0){state:0}{nextpress:1}{text:"Standard"}]
[(cc:1,2,127){state:1}{nextpress:2}{text:"Electronic"}]
mboldisc- Posts : 5
Join date : 2022-12-31
Re: Issues with Ableton Track Activator and State Example
When everything else fails, read the manual.
From the manual:
Please remember the following syntax rules:
From the manual:
Please remember the following syntax rules:
- Commands are enclosed in square brackets. [ ]
- Events are enclosed in parentheses. ( )
- Actions are enclosed in curly brackets. { }
Similar topics
» Ableton selected track vu not working.
» Known issues with release 2.0.1
» Key Command issues
» Transport Buttons Ableton
» Ableton Session View
» Known issues with release 2.0.1
» Key Command issues
» Transport Buttons Ableton
» Ableton Session View
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum