Hello! On my BU16 I want to have a “global” Button across all 4 pages. (It has to be on each page, cause I need very quick access) I can apply the same CC# for the Button on each page and map it on, let’s say, a Track Mute switch in Ableton.
Now here is the problem:
Page 1 → I press Button → Track is unmuted → Button LED turns on
loading Page 2 → Button LED is off by initial load, hence doesn’t show the correct Track Mute state
Page 2 → I press Button twice → Button LED on and then off again → Track is muted
re-loading Page 1 → Button LED is remembered as on from before, hence doesn’t show the correct Track Mute state
I need to receive the DAW state each time I change pages, I suppose. How do I do that? Or is there another easier way to solve this?
AI can help by explaining and writing code in these cases so that’s a good start!
For solution 1:
This might be the simpler solution. In Editor there’s an option in the sidebar called the File Manager. This allows you to create files that exist outside of Pages. For example creating the file globals.lua and then making that file a library like this:
local globals = {
MY_GLOBAL = 0
}
return globals
After this, you will be able to require this library on any Page (any you will have to do that on all Pages, best practice would be to do it on System/Setup) like this:
G = require("globals")
And after this you can write to or read from this library like so:
For solution 2:
Check out the Profile called 64CTRL (Workflow folder)/256CTRL (Community folder) in the Profile Cloud, as both of these use 4/16 “faux” Pages you can switch between. This is a more complex solution, but AI could figure it out from the json files I think.
But in any case, if you run into any trouble, let me know and I’ll try to help.
Trying to get to work solution 1. But failing. I create globals.lua which contains:
local globals = {
SWITCH1 = 64,
SWITCH2 = 64,
SWITCH3 = 64
}
return globals
In the System/Setup of page 1 and 2 I type:
G = require(“globals”)
On Switch 1 I add a Code-Action:
print(“Switch 1”)
print(G.SWITCH1)
G.SWITCH1 = G.SWITCH1 + 1
print(G.SWITCH1)
And this happens:
I press Switch 1 on Page 1:
[-2,0] Switch 1
[-2,0] 65.000000
[-2,0] 66.000000
I change to page 2 by pressing a completely different button which runs a page_load(1). I didn’t press Switch 1 yet, but already receive another: