#N canvas 2 43 662 489 10; #X floatatom 71 -133 5 0 0 0 - - -; #X obj 160 -195 keyup; #N canvas 0 22 450 300 (subpatch) 0; #X array kbdmap 255 float 3; #A 0 0 63 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 93 0 0 0 0 0 0 0 0 0 0 0 72 0 74 76 63 0 49 51 0 54 56 58 0 61 0 75 123 66 120 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 65 0 67 0 0 0 0 67 64 63 52 0 66 68 60 70 0 73 71 69 62 64 48 53 61 55 59 65 50 62 57 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; #X coords 0 0 255 255 200 50 1; #X restore 330 -144 graph; #X obj 62 -194 key; #X floatatom 71 -173 5 0 0 0 - - -; #X obj 62 -154 tabread kbdmap; #X obj 160 -154 tabread kbdmap; #X text 4 -194 Key down; #X text -32 -154 Convert to MIDI; #X text 205 -197 Key released; #X text 232 -78 Note off event; #X text 326 -197 Hand-build mapping from keycodes; #X text 324 -183 to midi note numbers; #X text -58 -252 Generate MIDI-like note events from the computer keyboard ; #X obj 342 55 key; #X obj 323 124 f; #X obj 352 124 + 1; #X floatatom 275 153 5 0 0 0 - - -; #X obj 323 204 tabwrite kbdmap; #X obj 323 179 pack 48 122; #X obj 342 98 t b b f; #X obj 323 155 f; #X floatatom 403 180 5 0 0 0 - - -; #X msg 304 -6 48; #X msg 304 19 60; #X obj 380 55 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 999; #X obj 342 78 moses; #X msg 380 35 999; #X obj 349 16 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 -1; #X text 0 40 LEARN KEYBOARD MAPPING; #X text 398 55 Learning Active; #X text 178 153 Next MIDI note; #X text 440 179 Last key code; #X msg 304 45 0; #X text 151 44 Click to stop learning-->; #X text 151 18 Click to start from C4-->; #X text 151 -8 Click to start from C3-->; #X text 0 63 Click a start note \,; #X text 0 78 then press keys in; #X text -1 130 Click stop when done.; #X text 0 92 a chromatic scale; #X text 0 107 to rewrite map table.; #X text -38 -218 ** REMEMBER TO TURN OFF KEYBOARD AUTO REPEAT **; #X obj 62 -6 outlet; #X obj 160 -77 pack 60 0; #X text -40 -237 Generates a single output as note/velocity pairs; #X text -80 -77 Construct note on event; #X obj 3 -53 notein; #X obj 3 -28 pack f f; #X text -65 -53 MIDI input; #X text -67 -36 also works; #X obj 62 -77 pack 60 80; #X obj 434 141 tabwrite kbdmap; #X msg 434 110 0; #X floatatom 521 111 5 0 0 0 - - -; #X obj 62 -111 split 1 127; #X obj 160 -111 split 1 127; #X text -57 -116 Keep only valid; #X text -59 -104 note values (1-127); #X text -67 207 2010-02-08 \, 2013-01-30 Dan Ellis dpwe@ee.columbia.edu ; #X text 503 93 Table index; #X text 404 93 Click to clear; #X connect 1 0 6 0; #X connect 3 0 4 0; #X connect 3 0 5 0; #X connect 5 0 0 0; #X connect 5 0 55 0; #X connect 6 0 56 0; #X connect 14 0 26 0; #X connect 15 0 16 0; #X connect 15 0 21 1; #X connect 15 0 17 0; #X connect 16 0 15 1; #X connect 19 0 18 0; #X connect 20 0 15 0; #X connect 20 1 21 0; #X connect 20 2 19 1; #X connect 20 2 22 0; #X connect 21 0 19 0; #X connect 23 0 15 0; #X connect 23 0 28 0; #X connect 24 0 15 0; #X connect 24 0 28 0; #X connect 25 0 26 1; #X connect 26 0 20 0; #X connect 27 0 25 0; #X connect 28 0 27 0; #X connect 33 0 25 0; #X connect 44 0 43 0; #X connect 47 0 48 0; #X connect 47 1 48 1; #X connect 48 0 43 0; #X connect 51 0 43 0; #X connect 53 0 52 0; #X connect 54 0 52 1; #X connect 55 0 51 0; #X connect 56 0 44 0; #X coords 0 489 1 488 0 0 0;