Forums > MaxMSP

Jit.cellblock bug

January 20, 2007 | 12:53 pm

I hate to keep complaining about text handling in max but I have encountered
another block in my quest for a way to edit, store and sequence text
messages. The contents of cells in a jit.cellblock are not being retrieved
correctly from a saved patcher or saved cellblock data file.

Note the #P user textedit line where commas are backslashed apparently
automatically by textedit. In the #P user jit.cellblock line, the setting is
likewise correct as a result of save with patcher. However, the backslashes
are not included. Likewise, the #X set lines in the saved dara file hold
all of the data. However, upon reloading the patch or reading the data file
only the first part of the data returns – the part before the first comma.

Here is the data file…

#X set 0 0 target jabber, index 1, seed 44074, passpct 100, tempo 60, subdiv
3, pitchwindow 12, pitchfloor 0, grainwindow 0, grainfloor 500, startwindow
0, startfloor 0, locwindow 0, locfloor 4000 ? 2 0 1, diswindow 0, disfloor
4000 0.8 1 0.4 3 0.8, move 100, gain 4000 0.3, roomsize 100, revtime 15,
metro 1111;

And here is patch to illustrate the problem…

#P window setfont "Sans Serif" 14.;
#P window linecount 3;
#P comment 152 706 423 196622 When a cell is selected , its contents are
displayed in the window to the left and parses out individual messages using
the comma as separator.;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 202 411 48 196617 loadbang;
#P newex 85 706 56 196617 route text;
#P button 45 434 15 0;
#P newex 86 733 32 196617 print;
#P message 203 434 67 196617 separator \,;
#P newex 154 434 31 196617 t set;
#P window setfont "Sans Serif" 18.;
#P user textedit 84 471 603 697 32896 3 18;
#P window setfont "Sans Serif" 9.;
#P message 369 77 30 196617 read;
#P message 312 77 35 196617 write;
#P message 190 77 106 196617 rowhead 0 , colhead 0;
#P message 130 77 47 196617 clear all;
#P newex 86 434 62 196617 prepend set;
#P newex 45 396 51 196617 zl slice 2;
#P number 88 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 43 52 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 44 77 43 196617 pak 0 0;
#P window setfont "Sans Serif" 18.;
#P user textedit 584 102 968 377 32900 3 18 target jabber , index 1 , seed
44074 , passpct 100 , tempo 60 , subdiv 3 , pitchwindow 12 , pitchfloor
0 , grainwindow 0 , grainfloor 500 , startwindow 0 , startfloor 0 ,
locwindow 0 , locfloor 4000 ? 2 0 1 , diswindow 0 , disfloor 4000 0.8 1
0.4 3 0.8 , move 100 , gain 4000 0.3 , roomsize 100 , revtime 15 ,
metro 1111;
#P user jit.cellblock 45 105 575 377 3 9 8 8 64 32 0 1 1 1 0 0 1 1 1 0 0 0
255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4 0 0 0;
#X set 0 0 target jabber, index 1, seed 44074, passpct 100, tempo 60, subdiv
3, pitchwindow 12, pitchfloor 0, grainwindow 0, grainfloor 500, startwindow
0, startfloor 0, locwindow 0, locfloor 4000 ? 2 0 1, diswindow 0, disfloor
4000 0.8 1 0.4 3 0.8, move 100, gain 4000 0.3, roomsize 100, revtime 15,
metro 1111;
#P window setfont "Sans Serif" 14.;
#P window linecount 3;
#P comment 643 387 257 196622 Select a cell in jit.cellblock. Modify the
textedit above and press return to store it in the cellblock.;
#P window setfont "Sans Serif" 18.;
#P window linecount 12;
#P comment 621 470 287 196626 Save with patcher is enabled. When this patch
is saved and reloaded only the part of the text before the first comma is
placed in the cell. This also happens with a write/read sequence. Examining
the text of the saved patch and the saved cellblock file shows that the
entire message was stored correctly so something is going wrong during the
reload.;
#P connect 5 0 4 0;
#P hidden connect 3 0 2 0;
#P connect 12 0 2 0;
#P connect 11 0 2 0;
#P connect 4 0 2 0;
#P connect 9 0 2 0;
#P connect 10 0 2 0;
#P connect 2 0 7 0;
#P connect 7 0 17 0;
#P connect 6 0 4 1;
#P connect 17 0 13 0;
#P connect 15 0 13 0;
#P connect 8 0 13 0;
#P connect 14 0 13 0;
#P connect 13 0 18 0;
#P connect 7 1 8 0;
#P connect 18 0 16 0;
#P connect 2 0 14 0;
#P connect 19 0 15 0;
#P window clipboard copycount 21;

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


January 20, 2007 | 2:05 pm

On Jan 20, 2007, at 7:53 AM, Gary Lee Nelson wrote:
> The contents of cells in a jit.cellblock are not being retrieved
> correctly from a saved patcher or saved cellblock data file.

Gary:
Not a direct answer to your bug inquiry, but I have another suggested
strategy for interfacing the pattr system with [jit.cellbock] which
may help you or others out. It uses [poly~] for non-MSP work,
something Peter Elsea’s tutorials turned me onto.

It’s currently 1-dimensional because that’s all I needed, but maybe
could be adapted? [jit.cellblock] has to be at the top of my
wishlist for objects that should interface with pattr system. I
traded emails with Jeremy about this a while back, but I’ll repeat my
request for this feature.

Let me know what you think. Save both files, then open the
"nw.polypattr.mxb".
–Nathan

Save following as "nw.transitlabels.mxb"

max v2;
#N vpatcher 237 167 540 454;
#P window setfont "Sans Serif" 9.;
#P newex 148 70 27 196617 t i i;
#P newex 165 94 113 196617 sprintf name label_%ld;
#P button 27 165 15 0;
#P newex 50 219 35 196617 zl join;
#P newex 27 186 27 196617 int;
#P newex 148 27 45 196617 loadbang;
#P newex 148 148 27 196617 – 1;
#P newex 148 49 51 196617 thispoly~;
#N out 1;
#X comment value output;
#P newobj 50 245 32 196617 out 1;
#N in 1;
#X comment value input;
#P newobj 36 71 25 196617 in 1;
#P newex 36 120 105 196617 pattr @autorestore 0;
#X prestore 1 0 0;
#P objectname u174000230;
#P connect 0 0 8 0;
#P connect 8 0 6 0;
#P connect 9 0 0 0;
#P connect 1 0 0 0;
#P connect 4 0 6 1;
#P connect 6 0 7 0;
#P connect 7 0 2 0;
#P connect 0 0 7 1;
#P connect 5 0 3 0;
#P connect 3 0 10 0;
#P connect 10 0 4 0;
#P connect 10 1 9 0;
#P pop;

Save following as "nw.polypattr.mxb"

max v2;
#N vpatcher 745 170 1018 503;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 75 277 118 196617 pattrstorage @greedy 1;
#X client_rect 10 59 650 299;
#X storage_rect 0 0 640 240;
#P objectname u782000064;
#P user ubumenu 141 241 100 196617 0 1 1 0;
#X prefix_set 0 0 0;
#N vpatcher 10 59 274 312;
#N comlet clear;
#P inlet 56 49 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 56 83 48 196617 sel clear;
#P newex 56 110 40 196617 uzi 10;
#N comlet inlet 1 of cellblock;
#P outlet 56 197 15 0;
#P message 56 159 172 196617 select 0 $1 , clear current , append -;
#N counter 0 0 9;
#X flags 0 0;
#P newobj 56 134 70 196617 counter 0 0 9;
#P connect 5 0 4 0;
#P connect 4 1 3 0;
#P connect 4 0 3 0;
#P connect 3 0 0 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P pop;
#P hidden newobj 165 30 79 196617 p clearcellblock;
#N vpatcher 295 199 503 456;
#N comlet inlet 1 of ubumenu;
#P outlet 82 183 15 0;
#N comlet inlet 1 of cellblock;
#P outlet 42 183 15 0;
#N comlet from polypattr;
#P inlet 55 62 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 82 136 81 196617 prepend setitem;
#P newex 42 112 70 196617 prepend set 0;
#P connect 2 0 0 0;
#P connect 0 0 3 0;
#P connect 2 0 1 0;
#P connect 1 0 4 0;
#P pop;
#P newobj 10 169 81 196617 p polypattr2cell;
#N vpatcher 236 165 452 475;
#P window setfont "Sans Serif" 9.;
#P newex 128 220 27 196617 + 1;
#P message 128 240 52 196617 target $1;
#P newex 69 192 27 196617 t b i;
#P newex 84 240 35 196617 zl reg;
#P newex 69 169 50 196617 zl slice 1;
#N comlet to polypattr;
#P outlet 113 280 15 0;
#N comlet outlet 1 from jit.cellblock;
#P inlet 46 28 15 0;
#P newex 29 145 50 196617 zl slice 1;
#P newex 29 123 27 196617 gate;
#P newex 63 98 27 196617 > 2;
#P newex 63 76 33 196617 zl len;
#P newex 46 54 27 196617 t l l;
#P fasten 2 0 3 0 68 118 34 118;
#P connect 3 0 4 0;
#P connect 5 0 0 0;
#P connect 0 0 3 1;
#P connect 0 1 1 0;
#P connect 1 0 2 0;
#P connect 4 1 7 0;
#P connect 7 0 9 0;
#P connect 9 0 8 0;
#P connect 7 1 8 1;
#P connect 10 0 6 0;
#P connect 8 0 6 0;
#P connect 9 1 11 0;
#P connect 11 0 10 0;
#P pop;
#P newobj 10 124 81 196617 p cell2polypattr;
#P newex 10 147 148 196617 poly~ nw.transitlabels.mxb 10;
#P objectname transitlabels;
#P message 175 63 32 196617 clear;
#P user jit.cellblock 165 80 216 231 3 9 1 10 50 15 0 1 1 0 1 1 0 0 5
0 0 0 255 255 255 0 0 0 0 0 0 191 191 191 0 0 0 215 215 240 1 1 1 0 4
0 0 2;
#P hidden connect 0 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P hidden connect 4 1 6 0;
#P hidden connect 1 0 5 0;
#P hidden connect 5 0 0 0;
#P hidden connect 4 0 0 0;
#P pop;


January 20, 2007 | 3:50 pm

I’ll have a look at this after I finish my commission. In the meantime, I
have found a simple work around. Use a / as a message delimiter instead of
a comma.

On 1/20/07 9:05 AM, "Nathan Wolek"

wrote:

> On Jan 20, 2007, at 7:53 AM, Gary Lee Nelson wrote:
>> The contents of cells in a jit.cellblock are not being retrieved
>> correctly from a saved patcher or saved cellblock data file.
>
> Gary:
> Not a direct answer to your bug inquiry, but I have another suggested
> strategy for interfacing the pattr system with [jit.cellbock] which
> may help you or others out. It uses [poly~] for non-MSP work,
> something Peter Elsea’s tutorials turned me onto.
>
> It’s currently 1-dimensional because that’s all I needed, but maybe
> could be adapted? [jit.cellblock] has to be at the top of my
> wishlist for objects that should interface with pattr system. I
> traded emails with Jeremy about this a while back, but I’ll repeat my
> request for this feature.
>
> Let me know what you think. Save both files, then open the
> "nw.polypattr.mxb".
> –Nathan

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


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