Hi,
From the first time I came into contact of Open Stage Control I have been thoroughly enjoyed it.
I'm still very grateful to Jean-Emmanuel.
However I started to notice slower response times (lag) when the template grew (to many hundreds of widgets). Lately I came to realize the template as I had imagined will become too slow to be comfortably usable on most devices. The large number of widgets seems to be the main culprit, something other users (and Jean-Emmanuel) also were aware of.
That made me start a quest for more cpu efficiency and quick response times.
So I'm in the process of reducing the number of widgets by making them dynamic. Instead of a dozen of panels with 32 buttons each (only one at a time is visible) I will use a single panel with dynamic properties. These include color, label, messages to be sent, etc. which are set with a script in other button widgets.
All properties are considered performance safe according to the manual.
Details
"Some properties have much cheaper update routines and can be considered as dynamic, as in performance safe. These properties are marked in the documentation with a ." ( Advanced syntaxes - Open Stage Control )
Unfortunately updating the 32 buttons is very slow ! About ten times slower than switching between 'pre-made' panels. Is there a far more efficient way to make the buttons dynamic?
In my template I use a 2-dimensional array (by creating a variable widget called 'buttonArray' and assigning it an array of properties):
Code
// variables: number, visible, color, saturation, luminance, textColor, textSize, left, top, width, height, MSB, LSB, label
if (value > 0) {
set('buttonArray',[
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
// no. vis. clr sat. lum. textC textS left top width height type MSB LSB label
[ 0, 1, 55, 40, 50, 220, 0.7, 0, 0, 6.25, 50, 3 6, 54, "AUDIO EDITOR"],
[ 1, 1, 55, 40, 50, 220, 0.7, 6.25, 0, 6.25, 50, 3 6, 54, "MIDI EDITOR"],
[ 2, 1, 55, 40, 50, 220, 0.7, 12.5, 0, 6.25, 50, 3 6, 54, "DRUM EDITOR"],
// 32 buttons in total .................................................................
[31, 1, 160, 40, 50, 220, 0.7, 6.25, 0, 6.25, 50, 3 6, 54, "STEP BACK BAR"]
])}
These properties are called upon by the button widgets with #{@{buttonArray}[0][x]}%
.
For the first button (nr. 0) it shows like this:
Here's an idea what the button panel looks like:
How can I seriously improve the efficiency and responsiveness, if possible at all? Any help is appreciated.