16×16 grid that can be filled with different colors when mouse click on cells

Dec 17, 2012 at 11:53am

16×16 grid that can be filled with different colors when mouse click on cells

Hello.
I want to create a painter that will actually send midi notes to a midi controller using a midiout object.
what can be used as 16×16 grid object in order to be able to draw with a mouse a 16×16 shape with different colors and to be able to parse
it and send it to a java extern ?

any information regarding the issue would be greatly appreciated

thank you!

kfir

#65716
Dec 17, 2012 at 6:07pm

You can use [matrixctrl] in dial mode as a big grid with lots of states/colours for your interface. Parsing the state of each cell and turning it to MIDI is definitely possible but will depend exactly on what sort of mapping you want. Have a look through the basic Max and MIDI tutorials to help get yourself started and if you have any more specific questions when you get started then feel free to ask away!

#236748
Dec 17, 2012 at 7:01pm

i thought about using the matrixctrl, what i could find is how to change color to each item in the matrix. any ideas ?

#236749
Dec 17, 2012 at 7:14pm

it seems that with dial mode disabled is the desired behaviour from the matrixctrl but i’m having problem understanding how to use custom colors. do i must use custom images for that? and if so how ?! thanks!

#236750
Dec 17, 2012 at 11:47pm

Here (hopefully) is an example of something I've used before. It's a simple 8 state PNG which you would need to set as the cell image. You'd also need to set [matrixctrl]'s cell range to 8 and check the inactiveimage box (leave the imagemask and clickedimage settings unchecked in the inspector). Hopefully these settings match the image file (they seem to work for me but if not then you might need to tinker a little). I hope it gives you an idea of how to create these images. You can have dial mode on or off depending on how you want the user to interact with the cells. I personally prefer leaving dial mode off and using the “clickvalue” message to choose which state to use globally.

[attachment=210741,4776]

Attachments:
  1. 8matrix.png
#236751
Dec 18, 2012 at 5:02am

Here’s a 16×16 matrix of toggles (click to see), with each cell having a different color for its “on” state. (The colors are assigned at random, just to demonstrate, but you could fill the coll in the subpatch with whatever RGB color values you want, and remove the random color assignments.) Is that anything like what you intend?

– Pasted Max Patch, click to expand. –
#236752
Dec 18, 2012 at 5:45am

Christopher Dobrian: you example looks really cool. i’m a real beginner, never worked with jitter if you could explain more on how to work with your example that would be great. thank you!

Luke: using your image and testing your example! thank you!

#236753
Dec 18, 2012 at 5:56am

Luke! it works amazing! it has a small glitch that i see half of the first box that i pressed on while i have the mouse pressed and i see it totally when i release the mouse click. it doesn’t happen on Christopher solution. but then again i have no idea what jitter is! so first of all thanks so much for everything!
that’s an awesome solution!!!

#236754

You must be logged in to reply to this topic.