matrixctrl: swapping values
I'm trying my hand at max8 right now - trying to make a patch that will allow me to control the Akai APC mini mk2...
would like to have a 4x4 matrix or 4 individual columns with 4 rows each, so that I can assign different colors...
I would like each column to have only 1 value (I managed to do that) - but now I also want no column to have the same value.
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
Is the starting point. For example, if I now set the 1 to 3 in column two, the 1 in column 3 should jump to 2:
1 0 0 0
0 0 1 0
0 1 0 0
0 0 0 1
If I then put about 1 from column 1 on row 4, the 1 in column 4 should jump to 1:
0 0 0 1
0 1 0 0
0 0 1 0
1 0 0 0
the patch is attached that you can idea…
what I did doesn't work at all
... I think to myself that there is certainly a simple / logical solution that I don't check.... also because I many, don't know the commands and am now frustrated... Maybe someone can help me?!
problem is not clear. explain it to me on the dark side (in german), then i will post solution here. :)
Please provide at least 10 characters
thanks, I will take a look in your patch later... sorry, but I don't understand what you mean with providing at least 10 characters ... 🙄
If you load the patch you have the 4 matrix objects. So after loading everything is initialized and if I now click on the 2nd field in the first (white) column, the second field in the second jumps to 1 ... If I then click on the third in the first column, the orange jumps to the 2 and close, if you go to the 4 with the white one, the red jumps to the three - so far so good, but then nothing works anymore...
all the objects on the left are there to save the state of Matrix 1 before I click, so the next column knows where to go. In the patch, this should be the comparison of column 1 with 2, 1 with 3, 1 with 4 - if that works then it would have to be done for all other columns as well. What I unfortunately don't check is why the list value in the corresponding message boxes (yellow, orange, red) fits at the beginning, but is then no longer updated when I trigger the matrixctrl object with a new list?!
It's all very strange - I'm not getting smart...
with your help I found a first solution:
thanks a lot!
your patch does not work...

as first, try to use objects like radiogroup,
or tab etc which solves first problem -
only 1 active row and 1 row must be active.
then after init any field that changes
should look which column had that value
and then swap the 2 values.
here example using radiogroup,
if you need bigger UI , replace them with tab
hi source audio! thanks for your patches. they work perfektly and are also well structured. as an (advanced?!) beginner, i unfortunately don't quite see through the list logic. there is still a lot to learn for me. Anyway, it's nice to see that there is a "simple" and efficient solution. one problem is certainly also that i have no programming experience in other languages and "this" logic is often still foreign to me. Anyway thanks for the help!
trust me, max was documented much better in the days I started with it.
well, there were less objects to learn compared to what is
available now, but - it makes sense to visit max docs page and read
documentation from max 5, 6 , or 7.
There are infos there that you will not find in new docs.