Custom Tab Button
Hello,
I am currently working on a custom tab button.
--------------------------------------
Requirements:
I am working on multiple Max For Live devices, but this is not necessarily related to M4L.
I need a custom tab button where I can freely arrange the tab buttons.
I send the tab selection through send/receive from my MasterDevice to a SubDevice_n – back and forth in both directions.
Both devices need to be able to change the value.
Of course there is no loop allowed, but SubDevice_n can not make use of "set" value.
I switch between SubDevice_1, SubDevice_2, SubDevice_3, ... Everytime I switch the device, all my tab objects need to be set to the last values of the current device.
In the end I will have about 20 tab objects with 25 tab buttons each in my MasterDevice and equivalent 20 dials in my sub devices.
--------------------------------------
Current Patch:
I came up with this, which works perfectly. It is important to use the INITIALIZE button.
Just the tab object:
Tab Object within an example of what I need:
--------------------------------------
Problem: Performance
Sadly when implemented within my greater patch with 20 tab objects and 25 tabs, it absolutely kills my performance when switching between devices and triggering all 500 buttons at the same time.
--------------------------------------
Question:
Does anyone come up with an easier and better performing solution?
--------------------------------------
Apple M1 Max
maxOS Monterey 12.6.5
Ableton Live 11.3.4
Max 8.5.4 (Full Version)
could you explain the logic in somewhat simpler relations ?
maybe I had more wine then allowed for this task, but I can't
see through the depenencies between tabs, devices , set or updated values, who controls what ?
"master" seems to have stubborn 4 fields which are either all on or off ?
at the end - 500 GUI elements is not what you want.
Can you organise that 500 values to be controlled and updated
hidden, without any automation and other slowups from live system,
and bring only stuff needed to be visible to front ?
if I see it right you need 20 tabs, each having 25 buttons.
Maybe they controll something internally, separated, irrelevant,
but as you say :
every tab that is currenty visible, sets values for all other tabs ????
That would mean all 20 tabs share same button selection, no matter which of 20 tabs is in control.
To make the patch work you need to use the initialize button first!
I have just updated the patch with some additions to make everything more clear.
Also you can use presentation view to better understand how it is supposed to work.
In the end I will have indeed 20 different tab objects with 25 buttons each and 500 UI elements with at least 264 visible at the same time. There can be the possibility to change that part of my project idea, but right now I am trying to find a fix.
I will think about your other questions and hopyfully come back with more feedback, but for right now I want to give your the opportunity to understand the problem. ;)
Also here is a patch with just the tab object. Because I think this is the part that needs improvement:
So to be clear, when you mean "tab" buttons you mean a set of buttons of which only one can be non-zero at a time (and also one MUST be non-zero at a time)? And your desire is for them be arranged in positions on the screen other than what [live.tab] or [tab] object allow?
This seems like a case where, if at all possible, you want to code this in a typed language like JS rather than Max (especially for the number of objects you're talking about... loading lots of M4L devices that have tons of Max objects in them will always be much slower than equivalent code in JS).
But in Max you could save yourself some complexity and objects with a few tricks. This would be easier to implement and scale better to the quantity of buttons you're looking at.
Hey Tyler,
thanks a lot for this lesson. Your tab object is so much cleaner and better than mine. I will implement it and see how much my performance goes up.
In general I think I should start my project over in JS, but I have no coding experience so far. My project got pretty huge by now an I fear of letting down several month of work. :(
Ok, I implemented your solution and the performance got way worse. :D I will try something else tomorrow.
I think non working tabs in your first patches confused me.
once removed and ignored, one could see relation between 4 selected devices and master - sub dials.
here is a bit simplified link between master and 4 sub dial groups.
now just 6 of them as example, you can add as many as you wish.
and also add tabs to it in whatever configuration you want.
what matters is current selected number 0 - 24.
I would use number objects instead of live dials,
don't like the look of them, and they take too much space
on the screen.
this is only personal preference.

25 individual buttons per "tab" will be more difficult to implement in an efficient way.
would need a lot of patch cords or a bunch of send-receive or forward
objects, or scripting, but it is up to you to test that.
Thanks @SOURCE AUDIO. The gate switch combo is awesome! I implemented this in some form at various places in my project now and it makes things easier!
By the way, I was able to reduce the performance load by combining my data with pak, pack, unpack, zl.change and not updating all the buttons at the same time.
With this I was also able to implement the way straight forward tab buttons from @TYLER MAZAIKA. ;)