max v2; #N vpatcher 160 44 1062 797; #P origin 0 996; #P window setfont "Sans Serif" 9.; #P window linecount 1; #N vpatcher 10 59 610 459; #P outlet 225 244 15 0; #P window setfont "Sans Serif" 9.; #P number 129 82 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P inlet 103 35 15 0; #P newex 198 157 93 196617 expr ($i1 * 3) + 1; #P number 225 210 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 102 157 65 196617 expr $i1 / 2; #P newex 102 122 192 196617 if ($i1 % 2) == 0 then $i1 else out2 $i1; #P fasten 5 0 0 0 134 111 107 111; #P connect 0 0 1 0; #P fasten 4 0 5 0 108 75 134 75; #P fasten 0 1 3 0 289 148 203 148; #P fasten 1 0 2 0 107 195 230 195; #P fasten 3 0 2 0 203 196 230 196; #P connect 2 0 6 0; #P pop; #P newobj 199 96 61 196617 p wondrous; #N vpatcher 10 59 610 459; #P outlet 369 278 15 0; #P button 369 241 15 0; #P window setfont "Sans Serif" 9.; #P newex 223 207 156 196617 if $i1 > 1 then \$1 else out2 bang; #P outlet 223 278 15 0; #P number 129 82 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P inlet 103 35 15 0; #P newex 198 157 93 196617 expr ($i1 * 3) + 1; #P number 223 243 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 102 157 65 196617 expr $i1 / 2; #P newex 102 122 192 196617 if ($i1 % 2) == 0 then $i1 else out2 $i1; #P fasten 5 0 0 0 134 111 107 111; #P connect 0 0 1 0; #P fasten 4 0 5 0 108 75 134 75; #P fasten 0 1 3 0 289 148 203 148; #P fasten 1 0 7 0 107 191 228 191; #P fasten 3 0 7 0 203 185 228 185; #P connect 7 0 2 0; #P connect 2 0 6 0; #P connect 7 1 8 0; #P connect 8 0 9 0; #P pop; #P newobj 463 504 67 196617 p wondrous2; #P number 489 612 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 472 630 27 196617 + 0; #P number 577 483 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 463 478 40 196617 % 128; #P number 536 536 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 579 613 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 538 643 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P button 597 642 18 0; #P newex 597 664 36 196617 flush; #B color 5; #P newex 497 667 92 196617 makenote 80 1000; #P newex 497 710 46 196617 noteout; #P user gswitch 415 662 41 32 1 0; #P newex 463 536 58 196617 pipe 0 100; #P button 520 560 15 0; #P button 338 300 15 0; #P button 431 382 15 0; #P newex 463 414 70 196617 random 1000; #P number 463 559 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 463 454 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window setfont "American Typewriter" 14.; #P window linecount 2; #P comment 263 177 91 199491598 Being wondrous...; #P outlet 209 382 15 0; #P window setfont "Sans Serif" 9.; #P number 113 220 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P inlet 87 173 15 0; #P window linecount 1; #P newex 182 295 93 196617 expr ($i1 * 3) + 1; #P number 209 348 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 86 295 65 196617 expr $i1 / 2; #P newex 86 260 192 196617 if ($i1 % 2) == 0 then $i1 else out2 $i1; #P number 199 127 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P number 199 63 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window setfont "Fixedwidth Serif" 10.; #P number 375 -136 32 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 375 -159 32 1441802 key; #B color 5; #P button 555 -110 18 0; #P window setfont "Sans Serif" 9.; #P newex 555 -88 36 196617 flush; #B color 5; #P window setfont "Fixedwidth Serif" 10.; #P number 274 -127 32 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 274 -150 32 1441802 key; #B color 5; #P window setfont "Sans Serif" 9.; #P newex 320 -79 92 196617 makenote 80 1000; #P newex 320 -34 46 196617 noteout; #P message 320 -99 26 196617 60; #P window setfont "American Typewriter" 14.; #P comment 628 -814 53 199491598 Flush; #P button 497 -833 29 0; #P window setfont "Sans Serif" 9.; #P window linecount 5; #P comment 497 -901 45 196617 bang tells flush to turn the notes off; #P window linecount 1; #P newex 554 -740 63 196617 noteout; #P newex 554 -778 36 196617 flush; #B color 5; #P message 554 -813 41 196617 \$1 64; #P window linecount 3; #P comment 576 -919 100 196617 Move the slider up and down to play a few hanging notes; #P window linecount 1; #P newex 554 -839 35 196617 + 36; #P slider 554 -920 15 64 0 1; #P newex 648 -561 31 196617 flush; #P window setfont "American Typewriter" 14.; #P comment 55 -596 80 199491598 MakeNote; #P window linecount 2; #P comment 564 -336 107 199491598 Using the Mac Keyboard; #P window setfont "American Typewriter" 18.; #P window linecount 1; #P comment 366 -949 70 199491602 MIDI; #P window setfont "Fixedwidth Serif" 10.; #P message 307 -263 15 1441802 0; #P newex 399 -420 47 1441802 numkey; #B color 5; #P number 436 -397 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P number 399 -397 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 399 -378 68 1441802 pgmout a 1; #P window setfont Times 10.; #P window linecount 3; #P comment 474 -406 71 1310730 number is shown here as it is being typed; #P window setfont Times 12.; #P window linecount 1; #P comment 454 -429 37 1310732 Part B; #P comment 182 -429 37 1310732 Part A; #P window setfont Times 10.; #P comment 79 -324 56 1310730 gate number; #P window linecount 3; #P comment 228 -392 62 1310730 all other keys are sent out here; #P window setfont "Fixedwidth Serif" 10.; #P number 215 -352 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P window setfont Times 10.; #P comment 67 -387 68 1310730 keys 120 to 122 (x to z) are sent out here; #P window setfont "Fixedwidth Serif" 10.; #P number 140 -325 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 140 -347 44 1441802 - 120; #P number 140 -366 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 140 -387 85 1441802 split 120 122; #P number 140 -406 32 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 140 -429 32 1441802 key; #B color 5; #P newex 180 -325 68 1441802 notein a 1; #P newex 140 -303 50 1441802 gate 2; #P newex 140 -281 31 1441802 - 12; #P newex 180 -281 31 1441802 + 12; #P button 119 -280 15 0; #P newex 389 -203 78 1441802 noteout a 1; #P message 307 -211 18 1441802 96; #P newex 389 -228 78 1441802 makenote 64; #P newex 457 -253 28 1441802 / 2; #P newex 307 -232 38 1441802 metro; #P newex 376 -325 36 1441802 keyup; #B color 5; #P newex 376 -302 48 1441802 sel 116; #P newex 307 -302 66 1441802 sel 46 116; #P window setfont Times 12.; #P comment 328 -325 37 1310732 Part C; #P window setfont "Fixedwidth Serif" 10.; #P newex 180 -217 74 1441802 noteout a 1; #P newex 180 -244 68 1441802 flush; #P window setfont Times 10.; #P window linecount 3; #P comment 316 -406 80 1310730 number is sent out here when Return or Enter is typed; #P window linecount 4; #P comment 425 -328 98 1310730 letter "t" sets tempo (by how long it is held down) and starts metro \; period (.) stops metro; #P window setfont "Fixedwidth Serif" 10.; #P window linecount 1; #P newex 335 -279 51 1441802 timer; #P number 335 -257 51 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; #P window setfont "Sans Serif" 9.; #P window linecount 3; #P comment 480 -671 90 196617 arguments: 2 ints \; inlets: int \; outlets: int; #P number 262 -548 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P button 262 -529 15 0; #P window linecount 1; #P newex 262 -574 116 196617 makenote 60 1000; #B color 5; #P button 368 -529 15 0; #P number 368 -548 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P comment 324 -546 42 196617 Velocity; #P newex 368 -614 28 196617 * 40; #P number 368 -594 33 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P slider 368 -676 16 51 0 1; #P window linecount 3; #P comment 387 -683 77 196617 int in right sets duration in miliseconds.; #P number 315 -594 23 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P slider 315 -655 16 51 0 1; #P window linecount 2; #P comment 283 -683 78 196617 int in middle sets velocity; #P slider 262 -655 16 51 0 1; #P number 262 -594 23 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P comment 200 -511 275 196617 Typically \, you connect the output of makenote to noteout; #P comment 232 -547 28 196617 Pitch; #P message 413 -622 32 196617 clear; #P comment 445 -621 114 196617 Cancel future note-offs; #P comment 445 -597 125 196617 Send all note-offs out now; #P window linecount 2; #P comment 381 -573 145 196617 optional arguments to initialize velocity and duration; #P window linecount 1; #P message 413 -598 30 196617 stop; #P window linecount 9; #P comment 190 -683 70 196617 int in left sets pitch and starts a note. The note-on comes out immediately \, followed by a delayed note-off; #P window linecount 1; #P newex 58 -750 66 196617 outport.help; #P window linecount 2; #P comment 255 -797 143 196617 optional argument to initialize channel number; #P window linecount 4; #P comment 214 -951 85 196617 int in left inlet sends a program change message to a MIDI device; #P window linecount 2; #P comment 263 -852 136 196617 int in right inlet sets MIDI channel; #P slider 241 -865 17 33 0 1; #P number 241 -818 30 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P window linecount 1; #P newex 194 -794 57 196617 pgmout 1; #B color 5; #P number 194 -818 28 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P slider 194 -958 15 128 0 1; #P newex 41 -878 92 196617 makenote 80 1000; #P newex 41 -833 46 196617 noteout; #P message 41 -898 26 196617 60; #P comment 485 596 41 196617 offset; #P comment 577 537 100 196617 delay the process; #P comment 451 382 100 196617 start the process; #P window linecount 2; #P comment 560 561 122 196617 <<< this will bang when the process is finished; #P comment 308 664 100 196617 turn the process on and off; #P connect 5 0 7 0; #P connect 7 0 6 0; #P connect 7 1 6 1; #P fasten 108 0 103 0 118 249 91 249; #P connect 103 0 104 0; #P fasten 107 0 108 0 92 213 118 213; #P fasten 66 0 56 0 145 -306 124 -306; #P connect 61 0 62 0; #P connect 62 0 63 0; #P connect 63 0 64 0; #P connect 64 0 65 0; #P connect 65 0 66 0; #P connect 66 0 59 0; #P connect 59 0 58 0; #P connect 60 0 59 1; #P connect 59 1 57 0; #P fasten 58 0 45 0 145 -258 185 -258; #P connect 57 0 45 0; #P fasten 56 0 45 0 124 -251 185 -251; #P connect 45 0 46 0; #P fasten 103 1 106 0 273 286 187 286; #P connect 8 0 9 0; #P connect 9 0 10 0; #P connect 101 0 131 0; #P connect 131 0 102 0; #P fasten 106 0 105 0 187 334 214 334; #P fasten 104 0 105 0 91 333 214 333; #P connect 105 0 109 0; #P fasten 45 1 46 1 243 -221 217 -221; #P connect 63 1 68 0; #P connect 60 1 45 1; #P connect 12 0 11 0; #P connect 11 0 10 1; #P connect 26 0 25 0; #P fasten 18 0 37 0 418 -576 267 -576; #P fasten 22 0 37 0 418 -602 408 -602 408 -576 267 -576; #P connect 25 0 37 0; #P connect 37 0 39 0; #P connect 39 0 38 0; #P connect 95 0 96 0; #P fasten 68 0 48 0 220 -329 312 -329; #P connect 48 0 78 0; #P connect 49 0 51 0; #P connect 78 0 51 0; #P connect 51 0 54 0; #P connect 28 0 29 0; #P connect 29 0 37 1; #P connect 92 0 94 0; #P connect 96 0 94 0; #P hidden connect 39 0 94 0; #P connect 94 0 93 0; #P fasten 97 0 93 0 560 -50 325 -50; #P connect 48 1 42 0; #P connect 42 0 41 0; #P connect 41 0 51 1; #P connect 94 1 93 1; #P fasten 97 1 93 1 586 -46 343 -46; #P connect 103 1 115 0; #P hidden connect 35 0 94 1; #P fasten 100 0 94 1 395 -97; #P connect 31 0 33 0; #P connect 33 0 32 0; #P connect 32 0 37 2; #P connect 37 1 35 0; #P connect 35 0 36 0; #P connect 99 0 100 0; #P connect 50 0 49 0; #P connect 49 0 42 1; #P fasten 54 0 53 0 312 -192 384 -192 384 -231 394 -231; #P connect 53 0 55 0; #P fasten 68 0 77 0 220 -334 312 -334 312 -425 404 -425; #P connect 77 0 75 0; #P connect 75 0 74 0; #P fasten 53 1 55 1 462 -207 428 -207; #P fasten 112 0 118 1 468 621 435 621; #P connect 77 1 76 0; #P fasten 41 0 52 0 340 -239 450 -239 450 -257 462 -257; #P connect 52 0 53 2; #P fasten 114 0 113 0 436 406 468 406; #P fasten 116 0 113 0 525 585 555 585 555 406 468 406; #P connect 113 0 111 0; #P fasten 118 0 111 0 420 648 401 648 401 452 468 452; #P fasten 111 0 126 0 468 472 468 472; #P connect 126 0 130 0; #P connect 130 0 117 0; #P connect 117 0 112 0; #P fasten 112 0 128 0 468 581 477 581; #P connect 129 0 128 1; #P fasten 128 0 120 0 477 651 502 651; #P fasten 121 0 119 0 602 694 502 694; #P connect 120 0 119 0; #P fasten 125 0 117 1 541 555 530 555 530 528 516 528; #P fasten 121 1 119 1 628 698 520 698; #P connect 120 1 119 1; #P connect 130 1 116 0; #P connect 123 0 120 1; #P connect 83 0 84 0; #P connect 84 0 86 0; #P connect 90 0 87 0; #P connect 86 0 87 0; #P connect 87 0 88 0; #P connect 98 0 97 0; #P connect 126 0 127 0; #P connect 124 0 120 2; #P connect 87 1 88 1; #P connect 122 0 121 0; #P pop;