Forums > MaxMSP

line object help

December 1, 2007 | 5:59 pm

Hello! I’m having some trouble getting the line object to work. What am I doing wrong here? Why am I getting the same readout from the counter and after the line object?

Thanks!

John

max v2;
#N vpatcher 634 67 1310 566;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 386 256 31 196617 0.01;
#P flonum 248 353 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 257 280 30 196617 pack;
#P message 414 199 26 196617 500;
#P flonum 268 77 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 262 304 40 196617 line;
#P newex 287 257 39 196617 bucket;
#P toggle 182 75 15 0;
#P flonum 265 220 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 278 146 41 196617 min $1;
#P message 296 123 14 196617 1;
#P message 322 149 44 196617 max $1;
#P message 320 128 20 196617 16;
#P button 317 61 15 0;
#P newex 322 98 51 196617 loadmess;
#N counter;
#X flags 0 0;
#P newobj 218 170 66 196617 counter;
#P newex 218 128 58 196617 metro 500;
#P window linecount 4;
#P comment 150 318 100 196617 why doesn’t this work? I want this bit to rise smoothly in value. ———>;
#P connect 10 0 1 0;
#P connect 8 0 2 0;
#P connect 6 0 2 0;
#P connect 1 0 2 0;
#P connect 12 0 16 0;
#P connect 9 0 15 0;
#P connect 15 0 12 0;
#P connect 2 0 9 0;
#P connect 13 0 1 1;
#P connect 11 0 15 1;
#P connect 13 0 12 1;
#P connect 14 0 12 1;
#P connect 7 0 8 0;
#P connect 9 0 11 0;
#P connect 17 0 12 2;
#P connect 3 0 7 0;
#P connect 3 0 5 0;
#P connect 4 0 3 0;
#P connect 5 0 6 0;
#P connect 3 0 17 0;
#P connect 3 0 14 0;
#P pop;


December 1, 2007 | 6:15 pm

like this?

#P window setfont "Sans Serif" 9.;
#P flonum 169 325 45 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 169 302 40 196617 / 100.;
#P flonum 220 158 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 170 159 15 0;
#P flonum 170 272 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter 1 1600;
#X flags 0 0;
#P newobj 170 247 80 196617 counter 1 1600;
#P newex 170 209 58 196617 metro 100;
#P connect 5 0 6 0;
#P connect 2 0 5 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 3 0 0 0;
#P connect 4 0 0 1;
#P window clipboard copycount 7;


December 1, 2007 | 6:24 pm

Hi.
First of all, as you are counting from 1 to 16, I guess you are using line to have a ramp between those numbers so you should use [line 0.] to deal with floats (notice the argument).
Also, if you look at the number box which sets the metro speed, you connected it to the ramp inlet of [line] but your [bucket] object (which outputs your counter values in pack) updates the line ramp with values between 1 and 16 ms…
Here is a modified version of your patch.
Best.

#P window setfont "Sans Serif" 9.;
#P flonum 320 406 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 320 325 51 9109513 pack i 500;
#P flonum 366 138 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 320 377 40 9109513 line 0.;
#P toggle 278 138 15 0;
#P flonum 244 269 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 158 296 15 0;
#P newex 158 321 69 9109513 loadmess 0.01;
#N counter 1 16;
#X flags 0 0;
#P newobj 278 239 66 9109513 counter 1 16;
#P newex 278 188 58 9109513 metro 500;
#P connect 2 0 6 2;
#P connect 3 0 2 0;
#P connect 7 0 0 1;
#P connect 7 0 8 1;
#P connect 1 0 4 0;
#P connect 1 0 8 0;
#P connect 8 0 6 0;
#P connect 0 0 1 0;
#P connect 6 0 9 0;
#P connect 5 0 0 0;
#P window clipboard copycount 10;


December 1, 2007 | 6:26 pm

Why yes, that’s a much better way of doing it :)

Still, why didn’t the line work? I’ve been able to use it when doing glissandos on cycle~ with no problems. What did I miss here?


December 1, 2007 | 6:26 pm

Never mind, my questions have been answered! Thanks!


December 1, 2007 | 6:41 pm

At 10:59 AM -0700 12/1/07, John Tamm-Buckle wrote:
>Hello! I’m having some trouble getting the line object to work. What am I doing wrong here? Why am I getting the same readout from the counter and after the line object?

There were a couple of reasons. One was that line wasn’t set up to do floating point output, the other was you weren’t packing quite the right things to line. Try this:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 109 284 105 196617 floating point args ->;
#P message 291 82 26 196617 500;
#P newex 218 220 30 196617 t f b;
#P newex 238 240 63 196617 f;
#P flonum 218 328 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 218 260 30 196617 pack;
#P flonum 291 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 218 282 56 196617 line 1. 0.01;
#P toggle 218 83 15 0;
#P flonum 218 196 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 291 39 15 0;
#P newex 291 62 48 196617 loadbang;
#N counter 1 16;
#X flags 0 0;
#P newobj 218 170 68 196617 counter 1 16;
#P newex 218 128 58 196617 metro 500;
#P comment 78 263 136 196617 pack destination and time ->;
#P connect 8 0 1 1;
#P connect 8 0 11 1;
#P connect 1 0 2 0;
#P connect 2 0 5 0;
#P connect 3 0 13 0;
#P connect 7 0 10 0;
#P connect 9 0 7 0;
#P connect 4 0 3 0;
#P connect 13 0 8 0;
#P connect 5 0 12 0;
#P connect 12 0 9 0;
#P connect 12 1 11 0;
#P connect 11 0 9 1;
#P connect 6 0 1 0;
#P window clipboard copycount 15;


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 6 posts - 1 through 6 (of 6 total)