## Is This Possible For Beginner?

Mar 28, 2008 at 1:57am

# Is This Possible For Beginner?

I’m a user of MAXMSP and want to do a simple (for you guys) Jitter application. Have a matrix/window and draw a line forward if a certain midi note is received, turn left if another, turn right if another, etc etc…almost like a lindenmeyer system, but with musical notes….

Would this be possible by looking at the tutorials? It took me a long time to process everything in the MAX/MSP tutorials and manual. I don’t plan on committing to Jitter until MAX5, so I wanted to know if this is a fairly simple endeavor that won’t require months.

I already have the algorithm of the notes all coded out in MAXMSP, I just need some Jitter app to parse and draw. Thanks!

#36567
Mar 28, 2008 at 2:20am

I would say so. Look at the help file for jit.lcd to see how to specify co-ordinates for a line in a window/pwindow.

An idea how you may do it…..

All you would need then is something like a coll object to store a list of values to add to your current position. For example if a ‘C’ is a right movement, the new position could be:

(X(old) + Increment, Y(old) + 0)

If you number each midi note accordingly e.g A = 1, A* = 2, B = 3 etc etc the list could be used for every octave (may also need to look at the modulus (%) function).

So for the ‘C’ note example the line in the coll may say:

4, 10, 0;

where 4 = note number
10 = x change
0 = y change.

to increment the 4th note of the chromatic scale (C) by 10 in the X direction and 0 in the Y direction (unpack the values and use accordingly).

Not saying its the only/best solution but hope that gives you an idea.

Andy

#125598
Mar 28, 2008 at 2:29am

Yeah I think Coll is a good choice as well, I make extensive use of that in my MAX patch. Im just not sure how hard it is to draw lines in a jitter matrix, bcs I haven’t even looked at the tutorials.

I would def start at the bottom left, use % 12 to analyze what the note is, and then access the col to see if I increment the X or Y position….I guess what im asking is…once I decide the note is a D (for example) and I want to increment the X position by Z pixels, how hard is it to make jitter SLOWLY draw a line from current position, up Z pixels? If it’s not toooo hard I will dive into the tutorials right away.

#125599
Mar 28, 2008 at 2:54am

Right I see.

I suppose it depends upon how you want it to be controlled. The jitter part of all this is easy as it is really just a matter of updating and drawing a line – which is a simple command. The logic part is the tricky bit.

If you want it to move in set increments you will need to consider that a note could be pressed at any time (I’m assuming that you want this to be part of a performance tool?). If this is the case do you want to:

a) have the line constantly moving – if so the chosen note just changes the direction of movement.

In this scenario the movement will need to be calculated continuously at regular intervals – e.g use a metro to add/subtract appropriate values to/from the position indefinitely (every 20ms for example) and just alter the polarity of the added/subtracted value for x and y to specify direction.

or

b) have the line move the a set amount per note played in a direction specified by the note – in which case does the note interrupt the current movement or does it wait until the movement from the previous note before it takes effect?

In this scenario the same metro setup will be needed to bang through the calculation but you will need to set it to move ‘x’ amount of times until the desired distance has been achieved. So moving 100 pixels over 100 ms will require a metro at 10ms to add 10 to the current position each time – test it to see if 100 has been added and then turn off the metro. (maybe use in conjunction with a counter – which can be rest to zero if a new note is played if thats the way you want to work it)

Any good?

Andy

#125600
Mar 28, 2008 at 3:11am

I got it working at least. Just storing move up down left or right positions in a coll and calling them into an accum.

Its nothing fancy and the output isnt too interesting yet, but oh well.

Right now I am sending a setcell x y val \$1 command to jit.matrix 1 char 1 120 120

the val \$1 is controlling the “whiteness” of the fill…is there anyway to make it a color? I cant get that to work, its only a grayscale.

#125601
Mar 28, 2008 at 3:23am

Here is the patch:

max v2;
#N vpatcher 106 116 1024 748;
#P origin 43 18;
#P button 42 34 15 0;
#P window setfont “Sans Serif” 9.;
#P number 62 49 35 9 60 60 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 62 18 48 196617 loadbang;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 317 217 58 1441802 accum 60;
#P window setfont “Sans Serif” 9.;
#P newex 281 82 27 196617 + 1;
#P newex 281 60 58 196617 random 11;
#P toggle 281 1 15 0;
#P newex 281 31 58 196617 metro 200;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 251 217 58 1441802 accum 60;
#P window setfont “Sans Serif” 9.;
#P number 319 186 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 275 186 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 280 153 40 196617 unpack;
#P message 349 109 30 196617 read;
#N coll ;
#T flags 1 0;
#T 1 1 0;
#T 2 1 0;
#T 3 1 0;
#T 4 -1 0;
#T 5 -1 0;
#T 6 0 1;
#T 7 0 1;
#T 8 0 -1;
#T 9 0 1;
#T 10 0 -1;
#T 11 -1 0;
#P newobj 281 127 53 196617 coll;
#P number 281 103 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont Times 10.;
#P comment 135 270 34 1310730 output;
#P user jit.pwindow 311 422 252 252 0 1 0 0 1 0;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 144 415 62 1441802 jit.print;
#B color 5;
#P window setfont Times 10.;
#P comment 196 270 29 1310730 value;
#P comment 306 270 49 1310730 y position;
#P window setfont “Fixedwidth Serif” 10.;
#P number 192 284 49 10 200 200 67 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 310 284 35 10 0 120 67 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 251 284 35 10 0 120 67 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 192 302 128 1441802 pack 0 0 0;
#P message 192 323 128 1441802 setcell \$2 \$3 val \$1;
#P button 144 284 15 0;
#P message 402 302 38 1441802 clear;
#P newex 144 372 160 1441802 jit.matrix 1 char 120 120;
#B color 5;
#P window setfont Times 10.;
#P comment 247 270 49 1310730 x position;
#P connect 26 0 27 0;
#P connect 28 0 27 0;
#P fasten 21 0 3 0 286 53 149 53;
#P fasten 4 0 1 0 197 368 149 368;
#P connect 3 0 1 0;
#P connect 2 0 1 0;
#P connect 1 0 11 0;
#P fasten 21 0 8 0 286 53 197 53;
#P connect 8 0 5 0;
#P connect 5 0 4 0;
#P connect 27 0 20 0;
#P fasten 21 0 20 0 286 53 256 53;
#P connect 20 0 6 0;
#P connect 6 0 5 1;
#P connect 17 0 18 0;
#P connect 18 0 20 1;
#P connect 15 0 17 0;
#P connect 22 0 21 0;
#P connect 21 0 23 0;
#P connect 23 0 24 0;
#P connect 24 0 14 0;
#P connect 14 0 15 0;
#P connect 16 0 15 0;
#P connect 25 0 7 0;
#P connect 7 0 5 2;
#P fasten 1 0 12 0 149 398 317 398;
#P connect 27 0 25 0;
#P fasten 21 0 25 0 286 53 394 53 394 210 322 210;
#P connect 17 1 19 0;
#P connect 19 0 25 1;
#P pop;

#125602
Mar 28, 2008 at 1:41pm

#125603

You must be logged in to reply to this topic.