max v2; #N vpatcher 10 59 1128 704; #P window setfont Times 12.; #P window linecount 3; #P comment 499 466 162 1310732 noteout uses the first three items as pitch \, velocity \, and channel (and it ignores the fourth item); #P comment 488 400 162 1310732 noteout uses the first three items as pitch \, velocity \, and channel (and it ignores the fourth item); #P window linecount 10; #P comment 312 257 173 1310732 Since makenote doesn't store channel information \, here is a way to do the same thing with multiple MIDI channels. Pipe stores the first three numbers and uses the last (fourth( argument as a delay time after which it sends the numbers out. But we convert the velocity value to 0 to turn it into a note-off message.; #P window linecount 2; #P comment 490 200 249 1310732 send the first four items of the list out the left outlet \, and the remaining item(s) out the right outlet; #P window linecount 1; #P comment 791 65 234 1310732 set the sounds you want on each MIDI channel; #P window setfont Times 18.; #P comment 38 30 383 1310738 Using coll to store a sequence of complex messages; #P window setfont Times 12.; #P window linecount 7; #P comment 55 375 203 1310732 Note that when you create a coll object you must "Get Info..." on the coll object and specify that its contents be saved as part of the patch! If you don't do this -- or save the coll's contents in a separate text file -- its contents will be lost when you close the patch!; #P window linecount 2; #P comment 20 314 247 1310732 The coll contains a sequence of lists: pitch \, velocity \, duration \, and time to wait till the next event.; #P window setfont Times 18.; #P window linecount 1; #P comment 119 168 249 1310738 a sequence of time-tagged events; #P window linecount 2; #P comment 72 525 203 1310738 option-click (or Alt-click) to get help on these objects; #P window setfont "Fixedwidth Serif" 18.; #P window linecount 1; #N coll ; #T flags 1 0; #T 0 65 100 1 1500 0; #T 1 46 100 2 2750 500; #T 2 57 80 3 1000 500; #T 3 62 85 3 500 500; #T 4 66 95 1 1250 0; #T 5 58 90 3 1500 0; #T 6 63 90 3 1500 500; #T 7 60 75 3 1000 833; #T 8 53 85 2 167 0; #T 9 61 75 1 167 167; #P newobj 82 499 91 1441810 coll; #P newex 27 283 109 1441810 noteout a; #P newex 27 249 130 1441810 makenote; #P message 222 252 54 1441810 stop; #P newex 207 279 65 1441810 delay; #P number 207 222 58 18 0 0 1 22 0 0 0 221 221 221 222 222 222 0 0 0; #P number 147 222 58 18 0 0 1 22 0 0 0 221 221 221 222 222 222 0 0 0; #P number 87 222 48 18 0 127 3 22 0 0 0 221 221 221 222 222 222 0 0 0; #P number 27 222 48 18 0 127 3 22 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 27 193 190 1441810 unpack 0 0 0 0; #P message 27 132 54 1441810 next; #P message 112 132 76 1441810 goto 0; #P button 27 99 15 0; #P window setfont Times 18.; #P comment 42 97 41 1310738 start; #P window setfont "Fixedwidth Serif" 18.; #N coll ; #T flags 1 0; #T 0 65 100 1500 0; #T 1 46 100 2000 500; #T 2 57 80 1000 500; #T 3 62 85 500 500; #T 4 66 95 1250 0; #T 5 58 90 1500 333; #T 7 46 90 1000 167; #T 6 63 90 1000 500; #T 8 60 75 500 333; #T 9 53 85 167 167; #P newobj 27 165 91 1441810 coll; #P window setfont Times 12.; #P window linecount 3; #P comment 717 438 306 1310732 For unknown (historical) reasons \, pgmout expects program numbers 1-128 instead of the more correct 0-127. (It subtracts 1 from whatever number it receives! Don't ask why.); #P window setfont Times 18.; #P window linecount 2; #P comment 850 317 250 1310738 open the gate to change the sound on every note of channel 1; #P toggle 795 307 15 0; #P window setfont "Fixedwidth Serif" 18.; #P window linecount 1; #P newex 795 327 54 1441810 gate; #P message 784 81 120 1441810 13 1 \, 35 2; #P newex 784 108 98 1441810 pgmout a; #N counter 1 128; #X flags 0 0; #P newobj 795 356 155 1441810 counter 1 128; #P number 795 386 62 18 1 128 3 22 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 795 414 98 1441810 pgmout a; #P message 565 329 19 1441810 0; #P message 605 228 54 1441810 stop; #P newex 480 375 181 1441810 noteout a; #P newex 499 299 142 1441810 pipe 0 0 0 0; #P newex 590 255 65 1441810 delay; #P newex 480 227 120 1441810 zl slice 4; #P message 480 78 54 1441810 next; #P message 676 78 76 1441810 goto 0; #P button 480 25 15 0; #N qlist; #P newobj 188 499 65 1441810 qlist; #N coll ; #T flags 1 0; #T 0 62 108 1 166.667007 166.667007; #T 1 64 76 1 166.667007 166.667007; #T 2 65 84 1 166.666 166.666; #T 3 67 80 1 166.667007 166.667007; #T 4 69 92 1 166.667007 166.667007; #T 5 70 88 1 166.666 166.666; #T 6 61 108 1 166.667007 166.667007; #T 7 70 88 1 166.667007 166.667007; #T 8 69 92 1 166.666 166.666; #T 9 67 84 1 166.667007 166.667007; #T 10 65 88 1 166.667007 166.667007; #T 11 64 80 1 166.666 166.666; #T 12 50 108 1 166.667007 0; #T 13 65 108 1 250. 166.667007; #T 14 52 76 2 166.667007 166.667007; #T 15 53 84 2 166.666 0; #T 16 69 84 1 250 166.666; #T 17 55 80 2 166.667007 166.667007; #T 18 57 92 2 166.667007 0; #T 19 74 92 1 250 166.667007; #T 20 58 88 2 166.666 166.666; #T 21 49 108 2 166.667007 0; #T 22 67 108 1 250 166.667007; #T 23 58 88 2 166.667007 166.667007; #T 24 57 92 2 166.666 0; #T 25 73 92 1 250 166.666; #T 26 55 84 2 166.667007 166.667007; #T 27 53 88 2 166.667007 0; #T 28 76 88 1 250 166.667007; #T 29 52 80 2 166.666 166.666; #P newobj 480 114 145 1441810 coll; #P window setfont Times 18.; #P comment 495 23 41 1310738 start; #P connect 23 0 25 0; #P fasten 31 0 25 0 212 311 20 311 20 126 32 126; #P fasten 24 0 21 0 117 159 32 159; #P connect 25 0 21 0; #P connect 21 0 26 0; #P connect 26 0 27 0; #P connect 27 0 33 0; #P connect 33 0 34 0; #P fasten 33 1 34 1 152 277 81 277; #P connect 26 1 28 0; #P connect 28 0 33 1; #P fasten 23 0 24 0 32 122 117 122; #P connect 26 2 29 0; #P connect 29 0 33 2; #P connect 26 3 30 0; #P connect 30 0 31 0; #P connect 32 0 31 0; #P fasten 7 0 5 0 595 283 663 283 663 72 485 72; #P connect 3 0 5 0; #P connect 5 0 1 0; #P fasten 4 0 1 0 681 107 485 107; #P connect 1 0 6 0; #P connect 6 0 9 0; #P connect 8 0 9 0; #P connect 6 0 8 0; #P connect 8 1 11 0; #P connect 11 0 9 1; #P connect 10 0 7 0; #P connect 6 1 7 0; #P connect 8 2 9 2; #P fasten 3 0 4 0 485 48 681 48; #P fasten 3 0 16 0 485 48 789 48; #P connect 16 0 15 0; #P connect 18 0 17 0; #P connect 17 0 14 0; #P connect 14 0 13 0; #P connect 13 0 12 0; #P fasten 7 0 17 1 595 289 844 289; #P pop;