max v2; #N vpatcher 78 48 976 705; #P window setfont Times 12.; #P window linecount 4; #P comment 2 435 349 1310732 Note the importance of the right-to-left ordering of Max messages here. The velocity values are produced FIRST \, so that they will have already been received by makenote when the pitch values arrive. Also \, the select object turns off the metro AFTER the last note is played.; #P window setfont Times 18.; #P window linecount 3; #P comment 405 317 216 1310738 scale and offset the numbers 0-35 to produce velocity values 20-125; #P window setfont "Fixedwidth Serif" 18.; #P number 472 444 48 18 0 127 3 22 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 397 403 54 1441810 + 20; #P newex 397 375 43 1441810 * 3; #P window setfont Times 18.; #P comment 26 387 114 1310738 stop the metro; #P window setfont "Fixedwidth Serif" 18.; #P message 7 386 19 1441810 0; #P newex 7 357 109 1441810 select 35; #N vtable 36 30 89 413 296 970020 128; #T set 0 36 38 40 41 43 45 47 48 50 52 53 55 57 59 60 62 64 65 67 69 71 72 74 76 77 79 81 83 84 86 88 89 91 93 95 96; #P newobj 168 337 65 1441810 table; #P window setfont Times 18.; #P window linecount 2; #P comment 11 30 472 1310738 Use counter to play a 7-note ("diatonic") scale over five octaves \, and also to increase the velocity from soft to loud (20 to 125); #P comment 466 510 369 1310738 set port a in the MIDI Setup... dialog \, or you can double-click to select the port from a popup menu; #P window setfont "Fixedwidth Serif" 18.; #P window linecount 1; #P newex 357 515 109 1441810 noteout a; #P window setfont Times 18.; #P window linecount 3; #P comment 175 362 146 1310738 use the numbers to look up the notes of a C-major scale; #P window setfont "Fixedwidth Serif" 18.; #P number 357 443 44 18 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P window setfont Times 18.; #P window linecount 2; #P comment 598 458 191 1310738 inter-onset interval is also used as the note duration; #P window setfont "Fixedwidth Serif" 18.; #P window linecount 1; #P newex 357 469 241 1441810 makenote 100; #P window setfont Times 18.; #P comment 752 56 100 1310738 initialize rate; #P window setfont "Fixedwidth Serif" 18.; #P flonum 351 184 71 18 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P message 733 54 19 1441810 8; #P newex 733 26 98 1441810 loadbang; #P window setfont Times 18.; #P comment 423 132 37 1310738 rate; #P comment 422 185 31 1310738 ms; #P comment 41 272 101 1310738 count events; #P comment 284 274 227 1310738 count 36 bangs (from 0 to 35); #P toggle 142 223 15 0; #P window setfont "Fixedwidth Serif" 18.; #P number 142 300 35 18 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P flonum 351 131 71 18 0 0 0 22 0 0 0 252 255 141 222 222 222 0 0 0; #P newex 351 156 98 1441810 !/ 1000.; #P newex 142 241 219 1441810 metro; #N counter 0 35; #X flags 0 0; #P newobj 142 271 142 1441810 counter 0 35; #P window setfont Times 18.; #P comment 86 200 141 1310738 toggle on/off (1/0); #P user panel 375 310 251 128; #X brgb 179 217 213; #X frgb 0 0 0; #X border 0; #X rounded 16; #X shadow 0; #X done; #P fasten 6 0 24 0 147 327 12 327; #P connect 24 0 25 0; #P fasten 25 0 7 0 12 412 3 412 3 219 147 219; #P connect 7 0 3 0; #P connect 3 0 2 0; #P connect 2 0 6 0; #P fasten 6 0 23 0 147 327 173 327; #P fasten 13 0 5 0 738 85 356 85; #P connect 5 0 4 0; #P connect 4 0 14 0; #P connect 14 0 3 1; #P fasten 23 0 18 0 173 421 362 421; #P connect 18 0 16 0; #P connect 16 0 20 0; #P fasten 6 0 27 0 147 327 402 327; #P connect 27 0 28 0; #P fasten 16 1 20 1 593 498 411 498; #P fasten 28 0 29 0 402 433 477 433; #P connect 29 0 16 1; #P fasten 14 0 16 2 356 232 632 232 632 449 592 449; #P connect 12 0 13 0; #P pop;