Embedding a large MatrixCtrl into a GUI screen to scroll about

May 8, 2013 at 5:23pm

Embedding a large MatrixCtrl into a GUI screen to scroll about

Hello dear people,

I’m currently working with very large columns of MatrixCtrl objects with different sizes. I’m using these to control events, but since they have grown so large I’m trying to find a way to reduce the scope of what I’m actually seeing, and to control details with more accuracy. I did some tweaking to store the overall content of these into a Coll object, and then scroll through these lists by a common index and re-feeding this into the Matrixctrl. Now the problem is that since they have unequal sizes (33, 17, 18 for instance) they appear misaligned.

I think that a JS GUI object might do the trick, kind of embedding large Matrixctrl into a window and only showing parts of it depending on a scrollbar. It would be something like this:

oooooooo [ OOO ] oooooooo (Where o = individual matrix cell, and the middle figure is what is actually shown by the GUI window.)

Does anyone here have any pointers or ideas? Perhaps this is already too complicated, but perhaps not. If I could just find a similar object and tweak it that would be the best, since my JS skillz are beyond rusty.

Thank you very much!

#67770
May 8, 2013 at 7:36pm

I did something like this a couple years a go, sadly I don’t have the code anymore.

I think the best approach is to use a bpatcher and script the position using the offset message.

#243697
May 8, 2013 at 8:34pm

Thanks for your answer Nat. By scripting the position you mean plain old messages to the bpatcher or something more complex using JS?

BTW, does anyone else have an example code of a similar application? At least now I know my inquiry isn’t that peculiar, so hopefully I don’t have to re-invent the wheel, especially since I don’t know JS.

#243698
May 8, 2013 at 8:41pm

You could probably do it just within Max with some sliders and the offset message…

#243699
May 8, 2013 at 9:51pm

OK, been experimenting with this and it works fine, except that being large UI objects, these matrices take some processing power. I discovered the “hscroll” parameter, which does all the offsetting work for me. Now I would like to know how in the hell do I retrieve these values that the scroll sends back to [bpatcher] (or is it that it sends it to the embedded patch?). While I’m at it, I also can’t figure out how to send messages to [bpatcher] without using the inlet, which is actually the inlet of the embedded patch.

Here I copy both files, first the patch, then bpatcher:

– Pasted Max Patch, click to expand. –
– Pasted Max Patch, click to expand. –
#243700
May 9, 2013 at 3:43am

I think you pretty much need an inlet to communicate to the bpatcher, but it can be any inlet as long as it goes to a thispatcher object inside the bpatcher…

#243701
May 9, 2013 at 3:59am

Thank you! Since there’s no apparent way to control the output of “hscroll” then I will just make a custom scrollbar.

#243702

You must be logged in to reply to this topic.