Forums > MaxMSP

table into multislider

February 2, 2007 | 8:35 pm

Hi

I’m new to Max but not programming.

I’m trying to get the contents of a 64 item table to be represented in
a 64 item multislider.

Very difficult. I tried for 3 hours!

Also: how do you generate an array of 64 items out of a table? It
seems to me I has to use uzi to read the table and put into a pack
with 64 items !!! [pack 0 0 0 0 0 0 etc].
What if I have 400 items in a list? How is this possible?

I also try to draw the MIDI notes I play into a multislider with only
64 items, but this does not seem to be possible.

Can anyone help?

Thank you all very much.

M


February 2, 2007 | 9:06 pm


February 2, 2007 | 9:47 pm

Thank you Jean-Michel

This was a clever trick. I didn’t know about the zl.
Is that how you store arrays in Max?

Now I’ve got the opposite problem: I want to read values of the Y in
the multislider with a counter (the X index) and send to a midinote
player. But that doesn’t seem to be possible.

I then thought I’d dump the multislider into another table (which can
read by index). But even though the table should take a list, it
doesn’t accept the list coming out of the multislider. (it prints the
list but doesn’t fill the table).

Does anyone know the trick here?

M


February 2, 2007 | 10:15 pm


February 2, 2007 | 10:22 pm

Look in the "fetch" command for multislider in the max reference, it will allow you to query data from the multislider much like a table (though the index starts with 1 instead of 0).

There are a few ways to turn a list into a table format, but the easiest way is to use the LtoTab object found in Pete Elsea’s LObjects collection-

http://arts.ucsc.edu/ems/music/research/lobjects.readme.html


February 3, 2007 | 12:51 am

Thanks to all who answered.

I’ve got it all working now. In a magic trick software like Max, it’s
good to be able to ask the magicians how to do the tricks : )

M


February 3, 2007 | 7:11 pm

At 8:35 PM +0000 2/2/07, mhd ali wrote:
>I’m trying to get the contents of a 64 item table to be represented in
>a 64 item multislider.

Max does take a little adjustment of world view when initially coming to grips with it. You’ve already gotten some good examples, but here’s one that is vaguely like procedural programming. It takes an original table, gets its length, sets the length of the target multislider and copies the table to the multislider. There is also a section that copies the multislider back into another table.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 43 104 91 196617 t i i;
#P newex 43 83 27 196617 int;
#P newex 124 309 66 196617 prepend size;
#P comment 343 139 64 196617 Table length;
#P newex 420 203 66 196617 prepend size;
#P newex 279 76 38 196617 t b b;
#P number 307 138 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 307 114 30 196617 grab;
#P message 307 96 37 196617 length;
#P comment 58 45 122 196617 Copy multislider -> table;
#P newex 90 206 71 196617 prepend fetch;
#N vtable 64 749 514 1284 859 980000 128 copied;
#P newobj 73 381 63 196617 table copied;
#P newex 73 272 27 196617 – 1;
#P newex 73 184 27 196617 t i i;
#P button 43 45 15 0;
#P newex 43 161 40 196617 uzi;
#P newex 324 206 27 196617 – 1;
#P newex 307 185 27 196617 t i i;
#P button 279 47 15 0;
#P newex 324 226 30 196617 grab;
#P newex 246 248 88 196617 sprintf set %i %i;
#P newex 279 164 38 196617 uzi;
#P user multiSlider 246 290 182 85 0. 127. 64 2665 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#N vtable 64 48 261 856 707 989916 128 original;
#T set 0 32 125 123 121 119 117 115 113 111 109 107 105 103 101 99 97 95 93 91 89 87 85 83 81 79 77 75 73 71 69 67 65 62 60 58 56 54 52 50 48 46 44 42 40 38 36 34 32 30 28 26 24 22 20 18 16 14 12 10 8 6 4 2 95;
#P newobj 580 50 69 196617 table original;
#B color 5;
#P comment 297 47 122 196617 Copy table -> multislider;
#P comment 589 36 72 196617 Original Table;
#B frgb 99 83 0;
#P window linecount 5;
#P comment 438 296 227 196617 One drawback to multislider is that there doesn’t seem to be a way to query the length , so we have to know how big it is when doing the copy. Here , the length of the original table is used for all subsequent copying.;
#P connect 12 0 25 0;
#P connect 25 0 26 0;
#P connect 26 0 11 0;
#P connect 20 0 25 1;
#P connect 11 2 13 0;
#P connect 13 0 14 0;
#P connect 24 0 15 0;
#P connect 14 0 15 0;
#P connect 13 1 16 0;
#P connect 26 1 24 0;
#P connect 4 1 15 1;
#P connect 9 0 6 0;
#P fasten 22 0 4 0 425 271 251 271;
#P connect 16 0 4 0;
#P connect 6 0 4 0;
#P connect 8 0 21 0;
#P connect 21 0 5 0;
#P connect 21 1 18 0;
#P connect 18 0 19 0;
#P connect 19 0 20 0;
#P connect 20 0 5 1;
#P connect 5 2 9 0;
#P connect 9 1 10 0;
#P connect 10 0 7 0;
#P connect 7 0 6 1;
#P fasten 20 0 22 0 312 160 425 160;
#P fasten 7 1 3 0 349 248 569 248 569 45 585 45;
#P lcolor 6;
#P fasten 19 1 3 0 332 135 569 135 569 45 585 45;
#P lcolor 6;
#P window clipboard copycount 27;


Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." – Brian Eno


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