Dynamic graphic user interfaces
Apr 22, 2011 at 12:38am
Dynamic graphic user interfaces
What is the best solution for getting a tab graphic control in Max? I mean, something like the tabs in Google Chrome.
For example, take a patch that can be divided in 3 parts: “sequencer”, “instrument”, “effects”. Each has a dedicated graphic user interface, and only one is displayed at a given time. For displaying the “sequencer” interface, you click on a tab or a button labelled “show sequencer” (same for “instrument” and “effects”).
What is the clean way for doing this in Max?
Apr 22, 2011 at 12:51am
– Pasted Max Patch, click to expand. –
Copy all of the following text.Then, in Max, select New From Clipboard.
Apr 22, 2011 at 3:56am
Or just look in the “more” subpatch of the [bpatcher] help file.
Apr 22, 2011 at 12:23pm
Thanks for your suggestions.
They work correctly, but I was talking about big interface panels (say 1024×768), and I can have many of them (up to about 10 maybe) so the bpatcher-based solutions are quite difficult to use in this case. Moreover some of my interfaces already contain a bpatcher and I have not tested bpatcher nesting in Max.
Alternatively, the bpatcher could embed different patches dynamically, but it would be problematic for implementing the patch-level preset system (classic pattrstorage + autopattr stuff), and I prefer to have all the patch in a single file so that everything is loaded when the patch is opened.
Currently I am using the following workaround:
1. The main patch is a horizontal narrow window, situated at the top of the screen.
2 Each interface is a big window that is displayed below the main patch window.
3. The main patch window contains buttons for loading the interface windows (loading one of them also closes the others).
4. All window open in presentation mode with “Fixed Initial Window Location” set to the proper value. The OS window decorations (bar, close button, menu, etc) are disabled (message “window notitle” to [thispatcher], and I use the patch with Max Runtime so that the Max low toolbar is not displayed either.
Apr 22, 2011 at 5:10pm
You can nest bpatchers. In my Gyre program, I have a bunch of note twisters at the top of the window that get swapped around by using a custom tab control. Basically, each twister is its own bpatcher. All the twisters then get included into a scroller bpatcher. The scroller bpatcher gets inserted at the top level. The scroller bpatcher takes messages from the top level about which pane should be shown, and scrolls to that position. Each of the twister bpatchers knows when it is selected, and enables output.
Apr 23, 2011 at 5:13am
There are some examples in the collection of devices which come in MaxForLive.
Apr 25, 2011 at 12:02am
Thanks for your answers.
In my current patch template, any control (of any subpatch/window) can either be saved:
* directly in the master preset
I would like to keep this functionality but cannot find a solution when using bpatchers (either tiled or nested, it’s not the problem in this case).
I do use bpatchers for loading abstractions that have a GUI, but in this case they always have a “local” preset system.
Apr 25, 2011 at 2:29am
If the bpatcher has a scripting name, and has pattr or autopattr stuff in it, it will be visible to the pattr system at the upper level.
I have a mix of local and global preset saving. In reality, things get saved at the top level no matter what, even if there’s local storage, too. The local level has a library of local presets, but the current local state also gets stored at the top level when a preset is stored there. This does mean that the local storage always changes when the top level preset changes, but that’s more or less what I want. In my ideal world, just the address of the local storage would be stashed at the top level, but this is really only a storage efficiency concern.
May 1, 2011 at 5:00pm
Thanks everybody, I have finally found a solution using bpatchers and full screen mode.
The only problem I have is that I cannot show or hide a bpatcher.
Officially, sending “presentation 1″ or “presentation 0″ to the bpatcher’s leftmost inlet should work, but in practice this does not work, or I missed something. Same for the “hidden” message.
Both messages work correctly with other objects though.
I was working on OSX, will try it on Windows just now, maybe it works better.
So, how do you show or hide a bpatcher?
May 1, 2011 at 5:36pm
I just wonder why you can still send “presentation $1″ to a bpatcher
May 1, 2011 at 5:51pm
Attached is an example of how I’m doing it with nested bpatchers.
May 1, 2011 at 10:11pm
Thanks for your example Chris. It is similar to the one shown in the bpatcher help patch, though yours is much cleaner.
Actually, the patches I am programming use large bpatchers (1070 x 780 in presentation). A single screen is too small for displaying many things, moreover I don’t like tiny graphic controls, especially on my 13′ laptop. This is why I use several views in parallel, that I launch with tab buttons. Most patches will have 5 to 10 views, perhaps more in some cases. You can really think of it as Google Chrome or Firefox, albeit with a static tab count for each patch. Also, I chose to stack the tabs vertically, at the left border of the window.
This is why the bpatcher offset technique is difficult to use for me (a 10700 pixel wide patcher would be quite impractical to edit). So finally I made a “main” patch that contains as many bpatchers as there are views. Each bpatcher loads a specific “view” patch. In presentation mode, the bpatchers are tiled but only one is shown at a time, using “script hide X” or “script show X” messages.
Of course the views can contain other bpatchers as nesting works indeed.
Thanks to your explanations I could finally make a preset system with:
This is not a Max-based audio software, but a template for making a specific patch for each song.
It displays identically on Windows and OSX. When I have a new desktop, the screen resolution will be different but I guess I can stretch the Max widgets automatically, using the built-in zoom.
There is only one problem I could not resolve:
You must be logged in to reply to this topic.