Forums > MaxMSP

the last Noob question… Any help would be great..

August 17, 2007 | 3:58 pm

hi

I want to have a list of numbers (that will become pitch values) – in a message box. I want to squirt them out to become nice midi notes, but i want them to come out one at a time, ie every time i bang the message box, the next number comes out, to form the note part of a midi note.. Im sure this is easy, but im stuck. iter seems to send them all out at once.. Any ideas?

best wishes

Andrew


August 17, 2007 | 4:35 pm

there’s a number of ways to do this, but its difficult to suggest which would be best as it depends on what you are trying to achieve.

anyway, here’s one way to do it:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 103 97 64 196617 metro 1000;
#P newex 50 54 48 196617 loadbang;
#P toggle 50 457 15 0;
#P newex 160 479 31 196617 dac~;
#P newex 91 415 44 196617 line~ 0.;
#P user function 61 351 161 409 1 1 0 0;
#X frgb 82 82 82;
#X brgb 204 204 204;
#X rgb2 85 85 85;
#X rgb3 255 255 255;
#X rgb4 0 0 0;
#X rgb5 0 0 0;
#X add 0. 0. 0;
#X add 68.181824 1. 0;
#X add 1000. 0. 0;
#X domain 1000.;
#X range 0. 1.;
#X done;
#P newex 160 438 27 196617 *~;
#P newex 160 303 27 196617 t b i;
#P message 177 352 37 196617 $1 80;
#P newex 177 369 44 196617 line~ 0.;
#P newex 177 332 31 196617 mtof;
#P newex 177 389 40 196617 cycle~;
#N counter 0 1 4;
#X flags 0 0;
#P newobj 203 209 71 196617 counter 0 1 4;
#P newex 103 154 40 196617 t b l l;
#P newex 259 177 34 196617 zl len;
#P newex 203 248 27 196617 t b i;
#P number 83 325 35 9 0 0 256 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 83 303 62 196617 prepend set;
#P newex 160 277 70 196617 zl nth;
#P button 103 117 15 0;
#P message 103 134 67 196617 60 62 64 65;
#P connect 19 0 18 0;
#P connect 19 0 20 0;
#P connect 20 0 1 0;
#P fasten 18 0 17 0 55 475 165 475;
#P connect 14 0 17 0;
#P connect 14 0 17 1;
#P fasten 16 0 14 0 96 435 165 435;
#P connect 15 1 16 0;
#P fasten 13 0 15 0 165 345 66 345;
#P connect 9 0 14 1;
#P connect 13 1 10 0;
#P fasten 2 0 3 0 165 298 88 298;
#P connect 2 0 13 0;
#P connect 11 0 9 0;
#P connect 10 0 12 0;
#P connect 12 0 11 0;
#P fasten 6 0 8 4 264 201 268 201;
#P connect 8 0 5 0;
#P fasten 7 0 8 0 108 190 208 190;
#P connect 1 0 0 0;
#P connect 3 0 4 0;
#P connect 5 1 2 1;
#P connect 5 0 2 0;
#P connect 0 0 7 0;
#P fasten 7 2 6 0 138 174 264 174;
#P connect 7 1 2 0;
#P window clipboard copycount 21;


August 17, 2007 | 4:50 pm

hi there…

thanks a lot for that – im basically wanting an incoming midi trigger to cyle through a list of predetermined midi notes.. so every tap on the sensor (for example) moves us on down the list of notes.. Better still would be to randomly choose a midinote number from a list of possibles, but id be happy with the sequential list thing..

That list of text you pasted in the last email – i tried saving it as a patch with no success.. Any ideas? Thanks again for the post..

Andrew


August 17, 2007 | 5:35 pm

At 5:50 PM +0100 8/17/07, Andrew wrote:
>im basically wanting an incoming midi trigger to cyle through a list of predetermined midi notes.. so every tap on the sensor (for example) moves us on down the list of notes.. Better still would be to randomly choose a midinote number from a list of possibles, but id be happy with the sequential list thing..

Once you get a little more max under your belt, this sort of thing gets easy, honest.

>That list of text you pasted in the last email – i tried saving it as a patch with no success.. Any ideas?

Copy it from the email, then go to Max and select "New from Clipboard" (from the FIle menu).

-C


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


August 17, 2007 | 6:02 pm

Quote: greyworld wrote on Fri, 17 August 2007 17:50
—————————————————-
> hi there…
>
>
> thanks a lot for that – im basically wanting an incoming midi trigger to cyle through a list of predetermined midi notes.. so every tap on the sensor (for example) moves us on down the list of notes.. Better still would be to randomly choose a midinote number from a list of possibles, but id be happy with the sequential list thing..
>
> That list of text you pasted in the last email – i tried saving it as a patch with no success.. Any ideas? Thanks again for the post..
>
> Andrew
—————————————————-

if you want random then change the [counter] object to [random], but remember to add +1 on the output cos [zl] starts its index at 1 , not 0.

it should be fairly self explanatory once you get over the copy/paste thing!

j


August 17, 2007 | 7:36 pm

hi,
you should also take a look at the RTC-lib by Karlheinz Essl :

http://www.essl.at/works/rtc.html

There is a lot of things about random and list.

peace

a


August 17, 2007 | 9:10 pm

one to do both.

#P window setfont "Sans Serif" 9.;
#P user umenu 157 234 68 196645 1 64 250 0;
#X add Up;
#X add Down;
#X add Up & Down;
#P window linecount 1;
#P comment 76 148 59 196617 2 = cycle;
#P newex 237 240 27 196617 – 1;
#P message 113 162 14 196617 2;
#P message 98 162 14 196617 1;
#P newex 98 193 55 196617 gate 2 2;
#N counter 0 3;
#X flags 0 0;
#P newobj 143 258 66 196617 counter 0 3;
#P newex 70 344 32 196617 print;
#P newex 143 163 74 196617 t b i;
#P newex 98 258 42 196617 random;
#P newex 70 321 38 196617 zl mth;
#P message 70 75 103 196617 1 2 3 4 5 6 7 8 9 10;
#P newex 143 137 34 196617 zl len;
#P comment 76 136 59 196617 1 = random;
#P connect 5 1 4 1;
#P connect 5 1 11 0;
#P connect 13 0 7 1;
#P connect 8 1 7 0;
#P connect 7 0 3 1;
#P connect 11 0 7 4;
#P connect 2 0 3 0;
#P connect 2 0 1 0;
#P connect 8 0 4 0;
#P connect 5 0 8 1;
#P connect 9 0 8 0;
#P connect 10 0 8 0;
#P connect 1 0 5 0;
#P connect 3 0 6 0;
#P connect 4 0 3 1;
#P window clipboard copycount 14;


August 19, 2007 | 11:50 am

Andrew schrieb:
> Im sure this is easy, but im stuck. iter seems to send
> them all out at once.. Any ideas?

You can’t get it simpler than below I guess…

Stefan

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 220 159 67 196617 60 62 64 65;
#P number 220 205 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 220 181 114 196617 mxj list.RandomSample;
#P number 110 210 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 80 140 15 0;
#P newex 110 180 50 196617 zl queue;
#P message 110 141 67 196617 60 62 64 65;
#P connect 6 0 4 0;
#P connect 4 0 5 0;
#P connect 1 0 3 0;
#P connect 2 0 1 0;
#P connect 0 0 1 0;
#P window clipboard copycount 7;


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


August 20, 2007 | 2:05 pm

Hi Spleef

Thanks so much for the patch, its helped me enormously. One question tho.. When I use it, ranadomly, it works great. But i when i use it to make the sequential numbers, it only plays the first four notes in the list.. Any ideas?

Thanks again, help really appreciated!

Andrew


August 20, 2007 | 3:28 pm

works fine here ?


August 20, 2007 | 4:22 pm

hello..

It must be something ive done – all i did was add a metronome to bang out the numbers.. the random works great, the sequential one just goes 60,61,62,63… It must me me!

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 548 551 26 9109513 print;
#P user umenu 546 408 68 9109541 1 64 424 0;
#X add Up;
#X add Down;
#X add Up & Down;
#P comment 465 356 59 9109513 2 = cycle;
#P message 502 370 14 9109513 2;
#P message 487 370 14 9109513 1;
#P newex 487 401 55 9109513 gate 2 2;
#N counter 0 3;
#X flags 0 0;
#P newobj 532 466 66 9109513 counter 0 3;
#P newex 532 371 74 9109513 t b i;
#P newex 487 466 42 9109513 random;
#P newex 459 502 38 9109513 zl mth;
#P message 456 304 148 9109513 60 61 62 63 64 65 66 67 68 69 70;
#P newex 532 345 34 9109513 zl len;
#P comment 465 344 59 9109513 1 = random;
#P message 515 156 18 9109513 47;
#P number 515 197 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P slider 536 55 15 128 0 1;
#P toggle 457 120 15 0;
#P newex 515 235 47 9109513 pgmout 1;
#P button 457 92 15 0;
#P newex 456 149 55 9109513 metro 2000;
#P newex 459 551 80 9109513 makenote 60 100;
#P newex 460 582 47 9109513 noteout 1;
#P window linecount 2;
#P comment 569 230 100 9109513 Sets the Midi sound to Pizzicato at Start;
#P connect 6 0 3 0;
#P connect 3 0 12 0;
#P connect 4 0 6 0;
#P connect 12 0 13 0;
#P connect 13 0 2 0;
#P connect 2 0 1 0;
#P connect 2 1 1 1;
#P connect 19 0 17 0;
#P connect 18 0 17 0;
#P connect 17 0 14 0;
#P connect 14 0 13 1;
#P connect 16 0 13 1;
#P connect 6 0 9 0;
#P connect 7 0 8 0;
#P connect 9 0 8 0;
#P connect 8 0 5 0;
#P connect 15 1 14 1;
#P connect 12 0 11 0;
#P connect 11 0 15 0;
#P connect 15 0 17 1;
#P connect 17 1 16 0;
#P connect 21 0 16 1;
#P connect 13 0 22 0;
#P window clipboard copycount 23;

Best wishes

Andrew


August 20, 2007 | 5:12 pm

look now

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 233 360 27 196617 – 1;
#P newex 126 497 40 196617 print;
#P user umenu 124 354 68 196645 1 64 370 0;
#X add Up;
#X add Down;
#X add Up & Down;
#P comment 43 302 59 196617 2 = cycle;
#P message 80 316 14 196617 2;
#P message 65 316 14 196617 1;
#P newex 65 347 55 196617 gate 2 2;
#N counter 0 3;
#X flags 0 0;
#P newobj 110 412 66 196617 counter 0 3;
#P newex 110 317 74 196617 t b i;
#P newex 65 412 42 196617 random;
#P newex 37 448 38 196617 zl mth;
#P message 34 250 177 196617 60 61 62 63 64 65 66 67 68 69 70;
#P newex 110 291 34 196617 zl len;
#P comment 43 290 59 196617 1 = random;
#P message 93 102 18 196617 47;
#P number 93 143 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P slider 114 1 15 128 0 1;
#P toggle 35 66 15 0;
#P newex 93 181 47 196617 pgmout 1;
#P button 35 38 15 0;
#P newex 34 95 69 196617 metro 2000;
#P newex 37 497 94 196617 makenote 60 100;
#P newex 38 528 47 196617 noteout 1;
#P window linecount 2;
#P comment 147 176 100 196617 Sets the Midi sound to Pizzicato at Start;
#P comment 266 362 100 196617 < - you deleted this part;
#P connect 16 1 15 1;
#P connect 16 1 24 0;
#P connect 14 0 3 0;
#P connect 14 0 23 0;
#P connect 13 0 14 0;
#P connect 13 0 12 0;
#P connect 7 0 4 0;
#P connect 7 0 10 0;
#P connect 24 0 17 4;
#P connect 22 0 17 1;
#P connect 18 1 17 0;
#P connect 16 0 18 1;
#P connect 12 0 16 0;
#P connect 9 0 6 0;
#P connect 10 0 9 0;
#P connect 8 0 9 0;
#P connect 17 0 14 1;
#P connect 15 0 14 1;
#P connect 18 0 15 0;
#P connect 19 0 18 0;
#P connect 20 0 18 0;
#P connect 3 1 2 1;
#P connect 3 0 2 0;
#P connect 5 0 7 0;
#P connect 4 0 13 0;
#P window clipboard copycount 25;


August 20, 2007 | 5:13 pm

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 233 360 27 196617 – 1;
#P newex 126 497 40 196617 print;
#P user umenu 124 354 68 196645 1 64 370 0;
#X add Up;
#X add Down;
#X add Up & Down;
#P comment 43 302 59 196617 2 = cycle;
#P message 80 316 14 196617 2;
#P message 65 316 14 196617 1;
#P newex 65 347 55 196617 gate 2 2;
#N counter 0 3;
#X flags 0 0;
#P newobj 110 412 66 196617 counter 0 3;
#P newex 110 317 74 196617 t b i;
#P newex 65 412 42 196617 random;
#P newex 37 448 38 196617 zl mth;
#P message 34 250 177 196617 60 61 62 63 64 65 66 67 68 69 70;
#P newex 110 291 34 196617 zl len;
#P comment 43 290 59 196617 1 = random;
#P message 93 102 18 196617 47;
#P number 93 143 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P slider 114 1 15 128 0 1;
#P toggle 35 66 15 0;
#P newex 93 181 47 196617 pgmout 1;
#P button 35 38 15 0;
#P newex 34 95 69 196617 metro 2000;
#P newex 37 497 94 196617 makenote 60 100;
#P newex 38 528 47 196617 noteout 1;
#P window linecount 2;
#P comment 147 176 100 196617 Sets the Midi sound to Pizzicato at Start;
#P comment 266 362 100 196617 < - you deleted this part;
#P connect 16 1 15 1;
#P connect 16 1 24 0;
#P connect 14 0 3 0;
#P connect 14 0 23 0;
#P connect 13 0 14 0;
#P connect 13 0 12 0;
#P connect 7 0 4 0;
#P connect 7 0 10 0;
#P connect 24 0 17 4;
#P connect 22 0 17 1;
#P connect 18 1 17 0;
#P connect 16 0 18 1;
#P connect 12 0 16 0;
#P connect 9 0 6 0;
#P connect 10 0 9 0;
#P connect 8 0 9 0;
#P connect 17 0 14 1;
#P connect 15 0 14 1;
#P connect 18 0 15 0;
#P connect 19 0 18 0;
#P connect 20 0 18 0;
#P connect 3 1 2 1;
#P connect 3 0 2 0;
#P connect 5 0 7 0;
#P connect 4 0 13 0;
#P window clipboard copycount 25;


August 20, 2007 | 5:15 pm

hi Andrew,
you have to set up counter with the "max $1" message according to the list lenght :
max v2;
#N vpatcher 171 86 441 685;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 128 376 42 9109513 max $1;
#P newex 114 527 26 9109513 print;
#P user umenu 112 418 68 9109541 1 64 434 0;
#X add Up;
#X add Down;
#X add Up & Down;
#P comment 31 332 59 9109513 2 = cycle;
#P message 68 346 14 9109513 2;
#P message 53 346 14 9109513 1;
#P newex 53 377 55 9109513 gate 2 2;
#N counter 0 3;
#X flags 0 0;
#P newobj 98 442 66 9109513 counter 0 3;
#P newex 98 347 40 9109513 t b i i;
#P newex 53 442 42 9109513 random;
#P newex 25 478 38 9109513 zl mth;
#P message 22 280 148 9109513 60 61 62 63 64 65 66 67 68 69 70;
#P newex 98 321 34 9109513 zl len;
#P comment 31 320 59 9109513 1 = random;
#P message 81 132 18 9109513 47;
#P number 81 173 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P slider 102 31 15 128 0 1;
#P toggle 23 96 15 0;
#P newex 81 211 47 9109513 pgmout 1;
#P button 23 68 15 0;
#P newex 22 125 55 9109513 metro 2000;
#P newex 25 527 80 9109513 makenote 60 100;
#P newex 26 558 47 9109513 noteout 1;
#P window linecount 2;
#P comment 135 206 100 9109513 Sets the Midi sound to Pizzicato at Start;
#P user panel 124 368 71 37;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 7 0 4 0;
#P connect 4 0 13 0;
#P connect 5 0 7 0;
#P connect 13 0 14 0;
#P connect 14 0 3 0;
#P connect 3 0 2 0;
#P connect 3 1 2 1;
#P connect 19 0 18 0;
#P connect 20 0 18 0;
#P connect 18 0 15 0;
#P connect 17 0 14 1;
#P connect 15 0 14 1;
#P connect 7 0 10 0;
#P connect 10 0 9 0;
#P connect 8 0 9 0;
#P connect 9 0 6 0;
#P connect 16 1 15 1;
#P connect 13 0 12 0;
#P connect 12 0 16 0;
#P connect 16 0 18 1;
#P fasten 24 0 17 0 133 408 103 408;
#P connect 18 1 17 0;
#P connect 22 0 17 1;
#P connect 14 0 23 0;
#P connect 16 2 24 0;
#P pop;


August 20, 2007 | 5:19 pm

… or with the [counter] right inlet.
Sorry Spleef, I didn’t see your last post


August 20, 2007 | 5:26 pm

At 5:22 PM +0100 8/20/07, Andrew wrote:
>It must be something ive done – all i did was add a metronome to bang out the numbers.. the random works great, the sequential one just goes 60,61,62,63… It must me me!

You need to tell counter what the maximum count is:
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 272 421 27 196617 – 1;
#P number 216 473 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 157 503 40 196617 print;
#P user umenu 230 384 68 196645 1 64 400 0;
#X add Up;
#X add Down;
#X add Up & Down;
#P comment 150 332 59 196617 2 = cycle;
#P message 186 346 14 196617 2;
#P message 171 346 14 196617 1;
#P newex 171 377 55 196617 gate 2 2;
#N counter 0 3;
#X flags 0 0;
#P newobj 216 442 66 196617 counter 0 3;
#P newex 216 347 74 196617 t b i;
#P newex 171 442 42 196617 random;
#P newex 141 478 38 196617 zl mth;
#P message 141 280 177 196617 60 61 62 63 64 65 66 67 68 69 70;
#P newex 216 321 34 196617 zl len;
#P comment 150 320 59 196617 1 = random;
#P message 248 122 18 196617 47;
#P number 248 163 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P slider 294 21 15 128 0 1;
#P toggle 141 96 15 0;
#P newex 248 201 47 196617 pgmout 1;
#P button 141 68 15 0;
#P newex 141 125 69 196617 metro 2000;
#P newex 141 563 94 196617 makenote 60 100;
#P newex 141 599 47 196617 noteout 1;
#P window linecount 2;
#P comment 302 196 100 196617 Sets the Midi sound to Pizzicato at Start;
#P connect 6 0 3 0;
#P connect 6 0 9 0;
#P connect 16 0 13 1;
#P connect 16 0 23 0;
#P connect 15 1 14 1;
#P connect 15 1 24 0;
#P connect 13 0 2 0;
#P connect 13 0 22 0;
#P connect 12 0 13 0;
#P connect 12 0 11 0;
#P connect 24 0 16 4;
#P connect 21 0 16 1;
#P connect 17 1 16 0;
#P connect 15 0 17 1;
#P connect 11 0 15 0;
#P connect 8 0 5 0;
#P connect 9 0 8 0;
#P connect 7 0 8 0;
#P connect 14 0 13 1;
#P connect 17 0 14 0;
#P connect 18 0 17 0;
#P connect 19 0 17 0;
#P connect 2 1 1 1;
#P connect 2 0 1 0;
#P connect 4 0 6 0;
#P connect 3 0 12 0;
#P window clipboard copycount 25;


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


August 20, 2007 | 5:42 pm

hi, just to say thanks for your comments, they really helped me!

Best wishes

Andrew


August 20, 2007 | 5:44 pm

Hey Spleef

Thats perfect, I knew Id done something daft.. Now to find some nice scales and stick them in there..

Best wishes from grey London, and greyworld

Andrew


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