Forums > MaxMSP

matrixctrl bang weirdness

September 4, 2006 | 1:09 am

I’m experiencing strange things when sending the bang message to
matrixctrl. I want to write x/y-values into 2 buffers via peek~ with
matrixctrl as interface. This works as expected.
However, when i send the bang to matrixctrl it sends out its contents
out the left outlet (as it should), and i thought that this would not
change anything in the buffers, just re-write the same data that’s
already stored in it.. Instead it seems to erase the contents. And i
really don’t understand why. Then if i send the clear message to
matrixctrl something happens with one of the buffers..
Maybe i did something wrong or it is a bug.
Any help would be great! Example patch below with steps to reproduce my
problem.
/m
———
max v2;
#N vpatcher 10 59 588 516;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 247 219 109 196617 7. check the buffer b..;
#P comment 247 198 216 196617 6. press the clear-box connected to
matrixctl;
#P comment 247 177 285 196617 5. please explain why the content is not
the same as before…;
#P comment 246 156 129 196617 4. check the buffers again.;
#P comment 246 135 70 196617 3. press bang;
#P comment 246 114 232 196617 2. note that something was written in the
buffers;
#P message 9 69 33 196617 clear;
#P newex 86 164 32 196617 print;
#P message 9 324 33 196617 clear;
#P user matrixctrl 60 85 130 66 MatrixDefaultCell.pct
MatrixDefaultBkgnd.pct 130 66 16 16 8 4 16 16 1 1 48 2 5120 0;
#P newex 188 264 41 196617 * 0.25;
#P newex 155 288 43 196617 pack i f;
#P newex 155 309 44 196617 peek~ b;
#P newex 155 340 73 196617 buffer~ b 100;
#P message 60 49 30 196617 bang;
#P newex 84 227 23 196617 abs;
#P newex 84 206 27 196617 – 3;
#P newex 60 185 58 196617 unpack i i i;
#P newex 60 288 43 196617 pack i f;
#P newex 60 340 73 196617 buffer~ a 100;
#P newex 60 309 44 196617 peek~ a;
#P comment 246 93 170 196617 1. click some dots in the matrixctrl;
#P connect 7 0 12 0;
#P connect 15 0 12 0;
#P connect 12 0 4 0;
#P connect 4 0 3 0;
#P connect 3 0 1 0;
#P connect 13 0 2 0;
#P connect 4 1 5 0;
#P connect 5 0 6 0;
#P connect 12 0 14 0;
#P connect 4 2 3 1;
#P fasten 4 0 10 0 65 269 160 269;
#P connect 10 0 9 0;
#P connect 13 0 8 0;
#P connect 6 0 11 0;
#P connect 11 0 10 1;
#P pop;



f
September 5, 2006 | 9:29 am

hi mattias,
i’m afraid your patch is wrong. try with a smaller matrixctrl. then
it might be easier to read the printout after a bang. matrixctrl spits
out all xy-pairs and as your patch is filtering one of the dimensions,
values will be overwritten. you’ll see this if you have an empty cell
below an active one in the same column (eg col 4 row 2 is active but
col 4 row 3 is not: [4, 2, 1] and [4, 3, 0]). if you ignore the row
the first value will be overwritten.
how to solve this depends on how you want to store the data. in your
example you’d actually need 4 (or 8) buffers to save all data without
some kind of mixdown/merge. perhaps using one 4-channel buffer?
/f0

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 9 69 33 196617 clear;
#P newex 86 164 32 196617 print;
#P message 10 344 33 196617 clear;
#P user matrixctrl 60 85 50 66 MatrixDefaultCell.pct
MatrixDefaultBkgnd.pct 50 66 16 16 3 4 16 16 1 1 48 2 5120 0;
#P newex 115 229 41 196617 * 0.25;
#P message 60 49 30 196617 bang;
#P newex 60 185 58 196617 unpack i i i;
#P newex 60 288 49 196617 pack i f i;
#P newex 61 360 94 196617 buffer~ testa 10 4;
#P newex 60 309 62 196617 peek~ testa;
#P newex 84 229 27 196617 + 1;
#P connect 8 0 2 0;
#P connect 7 0 4 0;
#P connect 7 0 9 0;
#P connect 3 0 1 0;
#P connect 6 0 3 1;
#P connect 4 2 6 0;
#P connect 4 0 3 0;
#P connect 0 0 3 2;
#P connect 4 1 0 0;
#P connect 5 0 7 0;
#P connect 10 0 7 0;
#P window clipboard copycount 11;

On 04.09.2006, at 03:09, Mattias Petersson wrote:

> I’m experiencing strange things when sending the bang message to
> matrixctrl. I want to write x/y-values into 2 buffers via peek~ with
> matrixctrl as interface. This works as expected.
> However, when i send the bang to matrixctrl it sends out its contents
> out the left outlet (as it should), and i thought that this would not
> change anything in the buffers, just re-write the same data that’s
> already stored in it.. Instead it seems to erase the contents. And i
> really don’t understand why. Then if i send the clear message to
> matrixctrl something happens with one of the buffers..
> Maybe i did something wrong or it is a bug.
> Any help would be great! Example patch below with steps to reproduce
> my problem.
> /m
> ———
> max v2;
> #N vpatcher 10 59 588 516;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 247 219 109 196617 7. check the buffer b..;
> #P comment 247 198 216 196617 6. press the clear-box connected to
> matrixctl;
> #P comment 247 177 285 196617 5. please explain why the content is not
> the same as before…;
> #P comment 246 156 129 196617 4. check the buffers again.;
> #P comment 246 135 70 196617 3. press bang;
> #P comment 246 114 232 196617 2. note that something was written in
> the buffers;
> #P message 9 69 33 196617 clear;
> #P newex 86 164 32 196617 print;
> #P message 9 324 33 196617 clear;
> #P user matrixctrl 60 85 130 66 MatrixDefaultCell.pct
> MatrixDefaultBkgnd.pct 130 66 16 16 8 4 16 16 1 1 48 2 5120 0;
> #P newex 188 264 41 196617 * 0.25;
> #P newex 155 288 43 196617 pack i f;
> #P newex 155 309 44 196617 peek~ b;
> #P newex 155 340 73 196617 buffer~ b 100;
> #P message 60 49 30 196617 bang;
> #P newex 84 227 23 196617 abs;
> #P newex 84 206 27 196617 – 3;
> #P newex 60 185 58 196617 unpack i i i;
> #P newex 60 288 43 196617 pack i f;
> #P newex 60 340 73 196617 buffer~ a 100;
> #P newex 60 309 44 196617 peek~ a;
> #P comment 246 93 170 196617 1. click some dots in the matrixctrl;
> #P connect 7 0 12 0;
> #P connect 15 0 12 0;
> #P connect 12 0 4 0;
> #P connect 4 0 3 0;
> #P connect 3 0 1 0;
> #P connect 13 0 2 0;
> #P connect 4 1 5 0;
> #P connect 5 0 6 0;
> #P connect 12 0 14 0;
> #P connect 4 2 3 1;
> #P fasten 4 0 10 0 65 269 160 269;
> #P connect 10 0 9 0;
> #P connect 13 0 8 0;
> #P connect 6 0 11 0;
> #P connect 11 0 10 1;
> #P pop;

#|
fredrikolofsson.com klippav.org musicalfieldsforever.com
|#


September 5, 2006 | 2:41 pm


Viewing 3 posts - 1 through 3 (of 3 total)