Performance drops when using MIDI device

Hi! I still have mostly the same problem, searching for a solution, and it seems that for Version 2.1.46 of widgets (or some other specifics) it doesn’t work.

I made an interface for a midi controller using 56 widgets (knobs, vertical and momentary) by replicating them several times.

Problems:

  1. Using direct midi binding inside the .toe I get significant fps drop (60->15) when interacting with physical elements.
  2. Using touchOut-touchIn TCP (2 .toe instances) with binding I get a constant drop (60->22).

Probe shows that the most consuming elements are:
launch_control_xl/ui/column1/

In all replicated Knobs:

  1. block1/knob1/overlay COMP
  2. block1/knob1/knob0/knobWidgetShader GLSL TOP
  3. block1/knob1/knob0/knobRotateScale DAT

In all replicated Vertical sliders:
4. block2/sliderVert/overlay COMP
5. block2/sliderVert/numericValue0/text (when Field Display turned off - doesn’t give a load)
6. block2/sliderVert/slider0/slider GLSL Multi TOP (+ flip TOP and over TOP nearby)

In all replicated Buttons:
7. block3/button1/overlay COMP
8. block3/button1/button0/text COMP

Testing the sketch with lfo channels results in the same frame drop as the TouchIn. Do you know what may be the reason for such slowdown?

LaunchControlXL_new.toe (3.0 MB)

1 Like

Hey @davinel000

It is likely that your whole UI is cooking, and this is triggered by one channel change.

The massive cooking in your example is not realistic right ? or you’d need many fingers to trigger all those Midi controls to change values at the same time ? :sweat_smile:

What you could try is add a Null CHOP with Selective cooking, after your Midi In CHOPs. See if that helps at all.

You could also try to use select CHOPs individually to break the CHOP into multiple “flows” and avoid having everything to cook.

For what I see after briefly looking at your sample file, the most effective, I think, would be to push the values that changed to the specific widgets using the python callback of the Bind CHOP. This would ensure that only the dedicated UI element is cooking, rather thant the whole UI.

Best,
Michel

2 Likes

Thank you very much for the suggestion!

A solution for not losing frames turned to be very short in callbacks:

ctrl = op(‘launch_control_xl’)

def onValueChange(bindOp, chan, val, prev, source):
ctrl.par[chan.name]=chan
return