Forums > MaxMSP

Computer keyboard as MIDI keyboard


tlb
November 25, 2007 | 4:30 am

I’m trying to use my computer keyboard as a MIDI keyboard so that pressing "a" key triggers a C note.
I made the following patch, but notes are generated after releasing the key.
I know that it is because duration cannot be determined until releasing the key.
How can I make it sound during pressing the key?
I would not like to use custom externals.
I would like to make it only by standard Max/MSP objects.

max v2;
#N vpatcher 43 113 344 509;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 47 319 52 196617 noteout 1;
#P flonum 47 156 92 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 47 128 35 196617 timer;
#P newex 130 87 52 196617 select 97;
#P newex 130 36 40 196617 keyup;
#P message 47 198 43 196617 60 127;
#P newex 47 247 52 196617 makenote;
#P newex 47 87 52 196617 select 97;
#P newex 47 36 40 196617 key;
#P window linecount 4;
#P comment 158 126 100 196617 Press and hold "a" key on your computer keyboard for a second.;
#P window linecount 3;
#P comment 158 250 100 196617 Notes are generated after releasing the key. I know that.;
#P comment 158 314 100 196617 How can I make it sound "during" pressing the key?;
#P connect 3 0 4 0;
#P connect 4 0 9 0;
#P connect 9 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 11 0;
#P connect 5 1 11 1;
#P connect 8 0 9 1;
#P fasten 10 0 5 2 52 184 94 184;
#P connect 7 0 8 0;
#P pop;


November 25, 2007 | 4:47 am

On Nov 24, 2007, at 9:30 PM, tlb wrote:

>
> I’m trying to use my computer keyboard as a MIDI keyboard so that
> pressing "a" key triggers a C note.
> I made the following patch, but notes are generated after releasing
> the key.
> I know that it is because duration cannot be determined until
> releasing the key.
> How can I make it sound during pressing the key?
> I would not like to use custom externals.
> I would like to make it only by standard Max/MSP objects.
>
>

Try this.

max v2;
#N vpatcher 253 234 554 630;
#P window setfont "Sans Serif" 9.;
#P window linecount 4;
#P user com 173 173 100 196617 34;
#K set 0 18790 8299 25977 8297 29472 28786 25971 29541 25644 8307
25966 25632 28271 29797 8303 28192 26990 26223 11296 28532 26725
29303 26995 25888 29541 28260 8302 28532 25888 28518 26144 26990
26223 11776;
#K end;
#P window linecount 1;
#P newex 47 141 155 196617 if $i1 > 0 then 60 127 else 60 0;
#P message 130 111 14 196617 0;
#P message 47 111 14 196617 1;
#P newex 47 319 52 196617 noteout 1;
#P newex 130 87 52 196617 select 97;
#P newex 130 36 40 196617 keyup;
#P newex 47 87 52 196617 select 97;
#P newex 47 36 40 196617 key;
#P window linecount 4;
#P user com 183 36 100 196617 31;
#K set 0 20594 25971 29472 24942 25632 26735 27748 8226 24866 8299
25977 8303 28192 31087 30066 8291 28525 28789 29797 29216 27493 31074
28513 29284 8294 28530 8289 8307 25955 28526 25646;
#K end;
#P connect 1 0 2 0;
#P connect 2 0 6 0;
#P fasten 7 0 8 0 135 133 52 133;
#P connect 6 0 8 0;
#P connect 8 0 5 0;
#P connect 3 0 4 0;
#P connect 4 0 7 0;
#P pop;

—-
Steven M. Miller
Professor, Contemporary Music Program
College of Santa Fe

Home < http://pubweb.csf.edu/~smill>
SFIFEM <
http://sfifem.csf.edu>
Atrium Sound Space <
http://atrium.csf.edu>
OVOS <
http://pubweb.csf.edu/~smill/ovos.html>
CMP <
http://www.csf.edu/csf/academics/cmp/index.html>


November 25, 2007 | 4:57 am

Hi,
Here’s another option. Enjoy.
_b

#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 27 609 126 9109513 a handy tool to send midi notes with your computer kybd -BTW this starts on G#;
#P window linecount 2;
#P comment 29 582 126 9109513 by Bradford Reed pencilina.com;
#P number 200 576 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 656 633 27 9109513 b;
#P window setfont "Sans Serif" 12.;
#P comment 262 325 100 9109516 set velocity out;
#P window setfont "Sans Serif" 9.;
#P newex 289 537 50 9109513 flush;
#P newex 289 508 50 9109513 unpack i i;
#P message 568 647 19 9109513 0;
#P newex 567 618 60 9109513 prepend set;
#P window setfont "Sans Serif" 12.;
#P comment 405 4 100 9109516 note off;
#P window setfont "Sans Serif" 9.;
#P message 515 590 19 9109513 -2;
#P message 543 590 19 9109513 -1;
#P message 573 590 14 9109513 0;
#P message 622 590 20 9109513 +2;
#P message 593 590 20 9109513 +1;
#P newex 165 347 27 9109513 +;
#P newex 500 343 27 9109513 +;
#P number 654 607 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 648 516 25 9109513 -24;
#P message 676 516 25 9109513 -12;
#P message 706 516 14 9109513 0;
#P message 755 516 20 9109513 24;
#P message 726 516 20 9109513 12;
#P newex 665 470 79 9109513 route 0 1 2 3 4;
#P newex 704 274 155 9109513 if $i2 >= 0 && $i2 < 4 then bang;
#P newex 663 298 155 9109513 if $i2 < = 4 && $i2 > 0 then bang;
#P message 779 353 14 9109513 3;
#P message 680 354 14 9109513 1;
#P button 664 327 15 0;
#P message 720 355 14 9109513 0;
#P button 704 328 14 0;
#N counter 5;
#X flags 0 0;
#P newobj 665 425 66 9109513 counter 5;
#P newex 661 239 35 9109513 sel 43;
#P newex 702 241 35 9109513 sel 47;
#P message 424 493 14 9109513 1;
#P user umenu 426 537 100 9109543 1 64 553 1;
#X add "Microsoft Synthesizer";
#X add "Microsoft GS Wavetable SW Synth";
#P newex 424 513 43 9109513 omsinfo;
#P newex 411 375 43 9109513 pack i 0;
#P newex 422 463 45 9109513 loadbang;
#P number 291 342 35 9 0 127 3 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 179 369 40 9109513 pack i i;
#P newex 289 584 90 9109513 noteout;
#P number 503 313 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 665 132 35 9109513 sel 39;
#P newex 581 181 35 9109513 sel 41;
#P newex 560 160 35 9109513 sel 37;
#P newex 532 182 35 9109513 sel 40;
#P newex 514 158 35 9109513 sel 38;
#P newex 485 181 30 9109513 sel 4;
#P newex 464 160 30 9109513 sel 5;
#P newex 438 184 30 9109513 sel 3;
#P newex 420 160 30 9109513 sel 2;
#P newex 391 183 30 9109513 sel 1;
#P newex 370 162 30 9109513 sel 0;
#P newex 640 68 35 9109513 sel 30;
#P newex 611 91 35 9109513 sel 33;
#P newex 564 69 35 9109513 sel 31;
#P newex 535 92 35 9109513 sel 34;
#P newex 491 48 35 9109513 sel 16;
#P newex 464 69 35 9109513 sel 17;
#P newex 437 90 35 9109513 sel 15;
#P newex 382 75 35 9109513 sel 13;
#P newex 353 98 39 9109513 sel 12;
#P message 637 132 20 9109513 68;
#P message 614 132 20 9109513 66;
#P message 624 225 20 9109513 67;
#P message 600 225 20 9109513 65;
#P message 577 225 20 9109513 64;
#P message 555 225 20 9109513 62;
#P message 532 225 20 9109513 60;
#P message 507 225 20 9109513 59;
#P message 484 225 20 9109513 57;
#P message 568 133 20 9109513 63;
#P message 545 133 20 9109513 61;
#P message 495 133 20 9109513 58;
#P message 472 133 20 9109513 56;
#P message 463 225 20 9109513 55;
#P message 438 225 20 9109513 53;
#P message 416 225 20 9109513 52;
#P message 450 133 20 9109513 54;
#P message 405 133 20 9109513 51;
#P message 391 225 20 9109513 50;
#P message 381 133 20 9109513 49;
#P comment 620 210 14 9109513 ‘;
#P window linecount 2;
#P comment 598 210 14 9109513 ;;
#P window linecount 1;
#P comment 575 210 14 9109513 l;
#P comment 554 210 14 9109513 k;
#P comment 533 210 14 9109513 j;
#P comment 509 210 14 9109513 h;
#P comment 488 210 14 9109513 g;
#P comment 461 210 14 9109513 f;
#P comment 440 210 14 9109513 d;
#P comment 418 210 14 9109513 s;
#P comment 397 210 14 9109513 a;
#P comment 407 118 14 9109513 w;
#P comment 635 118 14 9109513 ];
#P comment 615 118 14 9109513 [;
#P comment 594 118 14 9109513 p;
#P comment 572 118 14 9109513 o;
#P comment 545 118 14 9109513 i;
#P comment 523 118 14 9109513 u;
#P comment 496 118 14 9109513 y;
#P comment 475 118 14 9109513 t;
#P comment 454 118 14 9109513 r;
#P comment 431 118 14 9109513 e;
#P comment 407 118 14 9109513 w;
#P newex 520 -6 40 9109513 keyup;
#P comment 387 118 14 9109513 q;
#P number 162 325 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 273 176 35 9109513 sel 39;
#P newex 240 193 35 9109513 sel 41;
#P newex 219 172 35 9109513 sel 37;
#P newex 191 194 35 9109513 sel 40;
#P newex 173 170 35 9109513 sel 38;
#P newex 144 193 30 9109513 sel 4;
#P newex 123 172 30 9109513 sel 5;
#P newex 97 196 30 9109513 sel 3;
#P newex 79 172 30 9109513 sel 2;
#P newex 50 195 30 9109513 sel 1;
#P newex 29 174 30 9109513 sel 0;
#P newex 299 80 35 9109513 sel 30;
#P newex 270 103 35 9109513 sel 33;
#P newex 223 81 35 9109513 sel 31;
#P newex 194 104 35 9109513 sel 34;
#P newex 150 60 35 9109513 sel 16;
#P newex 123 81 35 9109513 sel 17;
#P newex 96 102 35 9109513 sel 15;
#P newex 41 87 35 9109513 sel 13;
#P newex 12 110 39 9109513 sel 12;
#P message 296 144 20 9109513 68;
#P message 273 144 20 9109513 66;
#P message 283 237 20 9109513 67;
#P message 259 237 20 9109513 65;
#P message 236 237 20 9109513 64;
#P message 214 237 20 9109513 62;
#P message 191 237 20 9109513 60;
#P message 166 237 20 9109513 59;
#P message 143 237 20 9109513 57;
#P message 227 145 20 9109513 63;
#P message 204 145 20 9109513 61;
#P message 154 145 20 9109513 58;
#P message 131 145 20 9109513 56;
#P message 122 237 20 9109513 55;
#P message 97 237 20 9109513 53;
#P message 75 237 20 9109513 52;
#P message 109 145 20 9109513 54;
#P message 64 145 20 9109513 51;
#P message 50 237 20 9109513 50;
#P message 40 145 20 9109513 49;
#P newex 677 213 40 9109513 key;
#P comment 279 222 14 9109513 ';
#P window linecount 2;
#P comment 257 222 14 9109513 ;;
#P window linecount 1;
#P comment 234 222 14 9109513 l;
#P comment 213 222 14 9109513 k;
#P comment 192 222 14 9109513 j;
#P comment 168 222 14 9109513 h;
#P comment 147 222 14 9109513 g;
#P comment 120 222 14 9109513 f;
#P comment 99 222 14 9109513 d;
#P comment 77 222 14 9109513 s;
#P comment 56 222 14 9109513 a;
#P comment 66 130 14 9109513 w;
#P comment 294 130 14 9109513 ];
#P comment 274 130 14 9109513 [;
#P comment 253 130 14 9109513 p;
#P comment 231 130 14 9109513 o;
#P comment 204 130 14 9109513 i;
#P comment 182 130 14 9109513 u;
#P comment 155 130 14 9109513 y;
#P comment 134 130 14 9109513 t;
#P comment 113 130 14 9109513 r;
#P comment 90 130 14 9109513 e;
#P comment 66 130 14 9109513 w;
#P newex 179 6 40 9109513 key;
#P comment 46 130 14 9109513 q;
#P window setfont "Sans Serif" 12.;
#P comment 75 10 100 9109516 note on;
#P window linecount 2;
#P comment 731 208 100 9109516 "<>" keys to shift octave;
#P connect 145 0 153 0;
#P connect 145 0 151 1;
#P connect 145 0 152 1;
#P connect 153 4 163 0;
#P connect 153 4 155 0;
#P connect 153 3 162 0;
#P connect 153 3 154 0;
#P connect 152 0 146 0;
#P connect 152 0 147 0;
#P connect 146 0 145 0;
#P connect 146 0 147 0;
#P connect 150 0 145 3;
#P connect 153 2 164 0;
#P connect 153 2 156 0;
#P connect 143 0 152 0;
#P connect 27 1 144 0;
#P connect 27 1 143 0;
#P connect 148 0 145 0;
#P connect 148 0 149 0;
#P connect 147 0 145 1;
#P connect 149 0 145 1;
#P connect 153 1 165 0;
#P connect 153 1 157 0;
#P connect 70 1 114 0;
#P connect 70 1 123 0;
#P connect 70 1 115 0;
#P connect 70 1 124 0;
#P connect 70 1 125 0;
#P connect 70 1 116 0;
#P connect 70 1 126 0;
#P connect 70 1 117 0;
#P connect 70 1 127 0;
#P connect 70 1 128 0;
#P connect 70 1 118 0;
#P connect 70 1 129 0;
#P connect 70 1 130 0;
#P connect 70 1 119 0;
#P connect 70 1 131 0;
#P connect 70 1 120 0;
#P connect 70 1 132 0;
#P connect 70 1 121 0;
#P connect 70 1 122 0;
#P connect 70 1 133 0;
#P connect 151 0 148 0;
#P connect 144 0 151 0;
#P connect 159 0 161 1;
#P connect 159 0 160 1;
#P connect 159 0 173 0;
#P connect 155 0 159 0;
#P connect 154 0 159 0;
#P connect 156 0 159 0;
#P connect 157 0 159 0;
#P connect 158 0 159 0;
#P connect 153 0 166 0;
#P connect 153 0 158 0;
#P connect 122 0 113 0;
#P connect 133 0 111 0;
#P connect 121 0 112 0;
#P connect 132 0 110 0;
#P connect 131 0 109 0;
#P connect 168 0 169 0;
#P connect 120 0 104 0;
#P connect 166 0 168 0;
#P connect 165 0 168 0;
#P connect 164 0 168 0;
#P connect 162 0 168 0;
#P connect 163 0 168 0;
#P connect 130 0 108 0;
#P fasten 119 0 103 0 559 153;
#P connect 129 0 107 0;
#P connect 128 0 106 0;
#P connect 111 0 134 0;
#P connect 110 0 134 0;
#P connect 109 0 134 0;
#P fasten 108 0 134 0 561 240;
#P connect 107 0 134 0;
#P connect 106 0 134 0;
#P connect 105 0 134 0;
#P connect 100 0 134 0;
#P connect 99 0 134 0;
#P connect 98 0 134 0;
#P connect 95 0 134 0;
#P connect 113 0 134 0;
#P connect 112 0 134 0;
#P connect 104 0 134 0;
#P connect 103 0 134 0;
#P connect 102 0 134 0;
#P connect 101 0 134 0;
#P connect 97 0 134 0;
#P connect 96 0 134 0;
#P connect 94 0 134 0;
#P connect 134 0 160 0;
#P connect 118 0 102 0;
#P connect 127 0 105 0;
#P connect 117 0 101 0;
#P connect 126 0 100 0;
#P connect 116 0 97 0;
#P connect 125 0 99 0;
#P connect 140 0 141 0;
#P connect 142 0 140 0;
#P connect 138 0 142 0;
#P connect 124 0 98 0;
#P connect 160 0 139 0;
#P connect 115 0 96 0;
#P connect 123 0 95 0;
#P connect 114 0 94 0;
#P connect 171 1 135 1;
#P connect 170 1 171 1;
#P connect 3 1 48 0;
#P connect 3 1 57 0;
#P connect 3 1 49 0;
#P connect 3 1 58 0;
#P connect 3 1 59 0;
#P connect 3 1 50 0;
#P connect 3 1 60 0;
#P connect 3 1 51 0;
#P connect 3 1 61 0;
#P connect 3 1 62 0;
#P connect 3 1 52 0;
#P connect 3 1 63 0;
#P connect 3 1 64 0;
#P connect 3 1 53 0;
#P connect 3 1 65 0;
#P connect 3 1 54 0;
#P connect 3 1 66 0;
#P connect 3 1 55 0;
#P connect 3 1 67 0;
#P connect 3 1 56 0;
#P connect 56 0 47 0;
#P connect 141 1 135 0;
#P connect 171 0 135 0;
#P connect 170 0 174 0;
#P connect 170 0 171 0;
#P connect 173 0 171 0;
#P connect 139 0 170 0;
#P connect 136 0 170 0;
#P connect 67 0 45 0;
#P connect 55 0 46 0;
#P connect 66 0 44 0;
#P connect 65 0 43 0;
#P connect 54 0 38 0;
#P connect 64 0 42 0;
#P connect 137 0 136 1;
#P fasten 53 0 37 0 218 165;
#P connect 63 0 41 0;
#P connect 161 0 136 0;
#P connect 62 0 40 0;
#P connect 68 0 161 0;
#P connect 28 0 68 0;
#P connect 30 0 68 0;
#P connect 31 0 68 0;
#P connect 35 0 68 0;
#P connect 36 0 68 0;
#P connect 37 0 68 0;
#P connect 38 0 68 0;
#P connect 46 0 68 0;
#P connect 47 0 68 0;
#P connect 29 0 68 0;
#P connect 32 0 68 0;
#P connect 33 0 68 0;
#P connect 34 0 68 0;
#P connect 39 0 68 0;
#P connect 40 0 68 0;
#P connect 41 0 68 0;
#P fasten 42 0 68 0 220 252;
#P connect 43 0 68 0;
#P connect 44 0 68 0;
#P connect 45 0 68 0;
#P connect 52 0 36 0;
#P connect 61 0 39 0;
#P connect 51 0 35 0;
#P connect 60 0 34 0;
#P connect 50 0 31 0;
#P connect 59 0 33 0;
#P connect 58 0 32 0;
#P connect 49 0 30 0;
#P connect 57 0 29 0;
#P connect 48 0 28 0;
#P window clipboard copycount 177;



tlb
November 25, 2007 | 6:05 am

Thank you, smill and Bradford.
I tried both of the two patches and they work as I want.


November 26, 2007 | 9:30 am

tlb schrieb:
> I’m trying to use my computer keyboard as a MIDI keyboard so that pressing "a" key triggers a C note.
> I made the following patch, but notes are generated after releasing the key.
> I know that it is because duration cannot be determined until releasing the key.
> How can I make it sound during pressing the key?
> I would not like to use custom externals.
> I would like to make it only by standard Max/MSP objects.

its thought too complicated (see patch below):

I have a fully blown Comidkey on the C74/share site. But beware, its not
updated correctly since Max 4.1. But you can have a look at how I did it
back then…

Unfortunately the keycodes on Mac OS X are not related to the hardware
anymore. They change if you change the keymap of your country. I haven’t
found a satisfying solution to make make it crossplatform/crosskeymap…
Maybe I’ll give it a shot next year… ;-)

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 104 198 43 196617 60 0;
#P newex 47 319 52 196617 noteout 1;
#P newex 130 87 52 196617 select 97;
#P newex 130 36 40 196617 keyup;
#P newex 47 87 52 196617 select 97;
#P newex 47 36 40 196617 key;
#P window linecount 4;
#P comment 158 126 100 196617 Press and hold "a" key on your computer
keyboard for a second.;
#P window linecount 3;
#P comment 158 250 100 196617 Notes are generated after releasing the
key. I know that.;
#P comment 158 314 100 196617 How can I make it sound "during" pressing
the key?;
#P window linecount 1;
#P message 47 198 43 196617 60 127;
#P connect 0 0 8 0;
#P connect 9 0 8 0;
#P connect 7 0 9 0;
#P connect 5 0 0 0;
#P connect 6 0 7 0;
#P connect 4 0 5 0;
#P window clipboard copycount 10;


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



tlb
November 26, 2007 | 10:12 am

Thank you for another solution, Stefan.


November 26, 2007 | 11:24 am

this is how i do it:

#P window setfont "Fixedwidth Serif" 12.;
#P number 207 245 35 12 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 1;
#P message 496 149 20 1441802 12;
#P message 264 147 20 1441802 12;
#P newex 379 270 58 1441802 pack 0 0;
#P number 379 236 35 10 0 0 256 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 377 212 34 1441802 + 60;
#P number 379 190 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 475 149 20 1441802 11;
#P message 454 149 20 1441802 10;
#P message 439 149 14 1441802 9;
#P message 424 149 14 1441802 8;
#P message 409 149 14 1441802 7;
#P message 394 149 14 1441802 6;
#P message 379 149 14 1441802 5;
#P message 364 149 14 1441802 4;
#P message 349 149 14 1441802 3;
#P message 334 149 14 1441802 2;
#P message 319 149 14 1441802 1;
#P message 304 149 14 1441802 0;
#P newex 304 110 207 1441802 sel a w s e d f t g y h u j k;
#P newex 304 82 40 1441802 itoa;
#P newex 304 52 40 1441802 keyup;
#P newex 147 268 70 1441802 pack 0 100;
#P number 147 234 35 10 0 0 256 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 147 212 34 1441802 + 60;
#P number 147 188 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 243 147 20 1441802 11;
#P message 222 147 20 1441802 10;
#P message 207 147 14 1441802 9;
#P message 192 147 14 1441802 8;
#P message 177 147 14 1441802 7;
#P message 162 147 14 1441802 6;
#P message 147 147 14 1441802 5;
#P message 132 147 14 1441802 4;
#P message 117 147 14 1441802 3;
#P message 102 147 14 1441802 2;
#P message 87 147 14 1441802 1;
#P message 72 147 14 1441802 0;
#P newex 72 108 207 1441802 sel a w s e d f t g y h u j k;
#P newex 72 80 40 1441802 itoa;
#P newex 72 50 40 1441802 key;
#N comlet note num and velocity list;
#P outlet 242 338 15 0;
#P comment 259 338 166 1441802 note num and velocity list;
#P window setfont "Fixedwidth Serif" 12.;
#P comment 244 246 100 1441804 set vel;
#P connect 43 0 21 1;
#P connect 24 12 42 0;
#P connect 24 11 36 0;
#P connect 24 10 35 0;
#P connect 24 9 34 0;
#P connect 24 8 33 0;
#P connect 24 7 32 0;
#P connect 24 6 31 0;
#P connect 39 0 40 0;
#P connect 38 0 39 0;
#P connect 42 0 37 0;
#P connect 25 0 37 0;
#P connect 26 0 37 0;
#P connect 27 0 37 0;
#P connect 28 0 37 0;
#P connect 29 0 37 0;
#P connect 30 0 37 0;
#P connect 31 0 37 0;
#P connect 32 0 37 0;
#P connect 33 0 37 0;
#P connect 34 0 37 0;
#P connect 35 0 37 0;
#P connect 36 0 37 0;
#P connect 24 5 30 0;
#P connect 37 0 38 0;
#P connect 24 4 29 0;
#P connect 24 3 28 0;
#P connect 24 2 27 0;
#P connect 24 1 26 0;
#P connect 24 0 25 0;
#P connect 23 0 24 0;
#P connect 22 0 23 0;
#P connect 5 12 41 0;
#P connect 5 11 17 0;
#P connect 21 0 2 0;
#P connect 40 0 2 0;
#P connect 5 10 16 0;
#P connect 5 9 15 0;
#P connect 5 8 14 0;
#P connect 5 7 13 0;
#P connect 5 6 12 0;
#P connect 20 0 21 0;
#P connect 19 0 20 0;
#P connect 18 0 19 0;
#P connect 41 0 18 0;
#P connect 17 0 18 0;
#P connect 16 0 18 0;
#P connect 15 0 18 0;
#P connect 14 0 18 0;
#P connect 13 0 18 0;
#P connect 12 0 18 0;
#P connect 11 0 18 0;
#P connect 10 0 18 0;
#P connect 9 0 18 0;
#P connect 8 0 18 0;
#P connect 7 0 18 0;
#P connect 6 0 18 0;
#P connect 5 5 11 0;
#P connect 5 4 10 0;
#P connect 5 3 9 0;
#P connect 5 2 8 0;
#P connect 5 1 7 0;
#P connect 5 0 6 0;
#P connect 4 0 5 0;
#P connect 3 0 4 0;
#P window clipboard copycount 44;

On 26/11/2007, tlb wrote:
>
> Thank you for another solution, Stefan.
>
>



tlb
November 26, 2007 | 11:52 am

Thank you for an elegant patch, samuel.

I think it would be a bit handier if you add an inlet to velocity number box like the following:

max v2;
#N vpatcher 23 148 623 548;
#P inlet 207 217 15 0;
#P window setfont "Fixedwidth Serif" 12.;
#P number 207 245 35 12 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Fixedwidth Serif" 10.;
#P window linecount 1;
#P message 496 149 20 1441802 12;
#P message 264 147 20 1441802 12;
#P newex 379 270 58 1441802 pack 0 0;
#P number 379 236 35 10 0 0 256 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 377 212 34 1441802 + 60;
#P number 379 190 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 475 149 20 1441802 11;
#P message 454 149 20 1441802 10;
#P message 439 149 14 1441802 9;
#P message 424 149 14 1441802 8;
#P message 409 149 14 1441802 7;
#P message 394 149 14 1441802 6;
#P message 379 149 14 1441802 5;
#P message 364 149 14 1441802 4;
#P message 349 149 14 1441802 3;
#P message 334 149 14 1441802 2;
#P message 319 149 14 1441802 1;
#P message 304 149 14 1441802 0;
#P newex 304 110 207 1441802 sel a w s e d f t g y h u j k;
#P newex 304 82 40 1441802 itoa;
#P newex 304 52 40 1441802 keyup;
#P newex 147 268 70 1441802 pack 0 100;
#P number 147 234 35 10 0 0 256 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 147 212 34 1441802 + 60;
#P number 147 188 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 243 147 20 1441802 11;
#P message 222 147 20 1441802 10;
#P message 207 147 14 1441802 9;
#P message 192 147 14 1441802 8;
#P message 177 147 14 1441802 7;
#P message 162 147 14 1441802 6;
#P message 147 147 14 1441802 5;
#P message 132 147 14 1441802 4;
#P message 117 147 14 1441802 3;
#P message 102 147 14 1441802 2;
#P message 87 147 14 1441802 1;
#P message 72 147 14 1441802 0;
#P newex 72 108 207 1441802 sel a w s e d f t g y h u j k;
#P newex 72 80 40 1441802 itoa;
#P newex 72 50 40 1441802 key;
#N comlet note num and velocity list;
#P outlet 242 338 15 0;
#P comment 259 338 166 1441802 note num and velocity list;
#P window setfont "Fixedwidth Serif" 12.;
#P comment 244 246 100 1441804 set vel;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 6 0;
#P connect 5 1 7 0;
#P connect 5 2 8 0;
#P connect 5 3 9 0;
#P connect 5 4 10 0;
#P connect 5 5 11 0;
#P connect 6 0 18 0;
#P connect 7 0 18 0;
#P connect 8 0 18 0;
#P connect 9 0 18 0;
#P connect 10 0 18 0;
#P connect 11 0 18 0;
#P connect 12 0 18 0;
#P connect 13 0 18 0;
#P connect 14 0 18 0;
#P connect 15 0 18 0;
#P connect 16 0 18 0;
#P connect 17 0 18 0;
#P connect 41 0 18 0;
#P connect 18 0 19 0;
#P connect 19 0 20 0;
#P connect 20 0 21 0;
#P connect 5 6 12 0;
#P connect 5 7 13 0;
#P connect 5 8 14 0;
#P connect 5 9 15 0;
#P connect 44 0 43 0;
#P connect 43 0 21 1;
#P connect 5 10 16 0;
#P connect 40 0 2 0;
#P connect 21 0 2 0;
#P connect 5 11 17 0;
#P connect 5 12 41 0;
#P connect 22 0 23 0;
#P connect 23 0 24 0;
#P connect 24 0 25 0;
#P connect 24 1 26 0;
#P connect 24 2 27 0;
#P connect 24 3 28 0;
#P connect 24 4 29 0;
#P connect 37 0 38 0;
#P connect 24 5 30 0;
#P connect 36 0 37 0;
#P connect 35 0 37 0;
#P connect 34 0 37 0;
#P connect 33 0 37 0;
#P connect 32 0 37 0;
#P connect 31 0 37 0;
#P connect 30 0 37 0;
#P connect 29 0 37 0;
#P connect 28 0 37 0;
#P connect 27 0 37 0;
#P connect 26 0 37 0;
#P connect 25 0 37 0;
#P connect 42 0 37 0;
#P connect 38 0 39 0;
#P connect 39 0 40 0;
#P connect 24 6 31 0;
#P connect 24 7 32 0;
#P connect 24 8 33 0;
#P connect 24 9 34 0;
#P connect 24 10 35 0;
#P connect 24 11 36 0;
#P connect 24 12 42 0;
#P pop;


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