displaying a range of values with matrixctrl

Feb 17, 2008 at 11:59pm

displaying a range of values with matrixctrl

Hi!
By default, the matrixctrl object outputs a list of three numbers: row, column, and the value for that location (i.e. 1 or 0). I am interested in the ability of the matrixctrl object to put out more values than just 1 or 0 — say, a range of 5 values.

When I set the object to do this, however, the visual display of the matrixctrl object gets very messy.

I gather the solution is to somehow supply my own cell images to the matrixctrl object. I’m guessing one could have a number of images corresponding to the range of value-states.

Has anyone done this? Do I need to go into photoshop and create 5 identically-sized different images, and point the matrixctrl object toward those images in the Inspector window? (there does not seem to be an obvious way to specify multiple matrix cell pictures).

Your advice would be deeply appreciated.

#35864
Feb 18, 2008 at 12:57am

update: I’ve been trying things out by trial and error, substituting various little images into the matrixctrl object via the “cell picture file” option in the inspector. Matrixctrl seems to divide whatever pict file you feed it into a number of chunks (depending on how many output values you specified), and displays only one of those chunks at a time. I’m still not clear on how it works though — parts of my image are still being chopped off.

#122790
Feb 18, 2008 at 5:37am

Try the simplest version: no inactive images, no image mask. Make a single horizontal image that has (however many) states in it, as rectangles. Simplest would be to start with black and go thru grayscale for higher values. Make sure all the rectangles are EXACTLY the same dimensions and are lined up (don’t have to be square, they just have to match).

The example below is a 20X20 pixel 4-state matrix image, for a total size of 80 X 20. Just set no image mask or inactive, set to 4 value range, and see if that works for you.

I agree the formatting is not totally clear, especially as the additional options seem to make things even more screwy. It *does* eventually work though ;)

One note: matrixctrl is pretty special in that if you script the size with thispatcher (see help file), the actual dimensions (number of cells) increases, therefore changing the functionality. This is not the case for most objects. So, your user could have multiple arrangements of matrices for different purposes if they want… like something with 4 tracks and 16 beats, or 8 tracks with 8 beats, etc. The tradeoff is that you can’t scale the actual cells :)

Pattr and preset also work with matrixctrl and add a *ton* of functionality right away. Absolutely worth looking into and they only take minutes. So you can have multiple, complex settings of large matrices, with a range of values, and interpolate between them… very useful!

–CJ

#122791
Feb 18, 2008 at 6:43am

CJ — thanks for your input! that was helpful. I think the geometry of the pict files I was making in photoshop was being thrown out of whack because inactive images were turned on. This is great — it makes matrixctrl so much more than a patch bay.

#122792
Feb 18, 2008 at 10:02am

this is so cool !!!!
i was not aware matrixctrl could do that !!!!!
i guess i never even tried or thought about it
amzing how i learn something new every day on this forum

thanks CJ :)

Quote: seejayjames wrote on Mon, 18 February 2008 06:37
—————————————————-
> Try the simplest version: no inactive images, no image mask. Make a single horizontal image that has (however many) states in it, as rectangles. Simplest would be to start with black and go thru grayscale for higher values. Make sure all the rectangles are EXACTLY the same dimensions and are lined up (don’t have to be square, they just have to match).
>
> The example below is a 20X20 pixel 4-state matrix image, for a total size of 80 X 20. Just set no image mask or inactive, set to 4 value range, and see if that works for you.
>
> I agree the formatting is not totally clear, especially as the additional options seem to make things even more screwy. It *does* eventually work though ;)
>
> One note: matrixctrl is pretty special in that if you script the size with thispatcher (see help file), the actual dimensions (number of cells) increases, therefore changing the functionality. This is not the case for most objects. So, your user could have multiple arrangements of matrices for different purposes if they want… like something with 4 tracks and 16 beats, or 8 tracks with 8 beats, etc. The tradeoff is that you can’t scale the actual cells :)
>
> Pattr and preset also work with matrixctrl and add a *ton* of functionality right away. Absolutely worth looking into and they only take minutes. So you can have multiple, complex settings of large matrices, with a range of values, and interpolate between them… very useful!
>
> –CJ
>
>
—————————————————-

#122793
Feb 18, 2008 at 12:42pm

yeah, i love matrixctrl. i’ve been using it to create step sequencers, and since i figured out the multiple possible states i got easy velocity control as well. making the picts isn’t that hard, really. it’s a matter of copy/paste in photoshop, with minor modifications to each state. same goes for inactive images and image masks. all in the same file.
i’ve made real good use of that! it’s awesome, innit?
take this one i attached for instance. i modified some pict i found of a 4 step matrix into a 6 step matrix (best way to learn how to do it). make a matrix, load this picture in it, put the cell value range up to 6, tick “has clicked images”, tick “has inactive images”, and tick “invisible background”, both spacings 0, both margins 1. then resize it to your preferences.
and of course, use the pict, or hunt down other picts, and play with them. as with everything in max/msp, that’s the best way to learn.

#122794
Feb 18, 2008 at 2:06pm

Another nifty thing to know if you’re using
multi-state matrixctrls, is that you can, if you
prefer, set your matrixctrl to respond to
click-dragging, instead of having to make multiples
clicks, by sending it a ‘dialmode 1′ message. I find
it much easier to make quick adjustments on the fly,
this way.
To set the sensitivity use the ‘dialtracking (int)’
message – I find a value of around 3 works well,
cheers
Roger

#122795
Feb 18, 2008 at 3:03pm

that’s an excellent tip! i hadn’t thought of that! that’s awesome!

#122796
Feb 22, 2008 at 9:00am

Hey CJ,
I’m really interested in your patch but I get the error “can’t find file matrix_8_40_40_grayscale.png” and the matrixctrl is black. Is that a custom matrix image? Care to share?

#122797
Feb 22, 2008 at 9:16am

And in case you didn’t see this last week, Roger shared a patch that shows an awesome use of matrixctrl. It’s what he was describing earlier in this thread:

http://www.cycling74.com/forums/index.php?t=msg&goto=129174#msg_129174
(Don’t forget to download the image file too)

I had no idea this was even possible. I don’t think it’s documented…

#122798
Feb 22, 2008 at 10:35pm

I’m such an eeeee-diot! It’s those little details that can make a whole project unusable…

Here it is….

#122799

You must be logged in to reply to this topic.