Forums > MaxMSP

Duration of notes using the mouse

December 13, 2006 | 9:54 am

hi, is there a way to keep track of how long the mouse is held down to change the duration in the third inlet of make note.
Thanks in advance


December 13, 2006 | 10:20 am

Like this?

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 158 191 44 196617 sel 1 0;
#P toggle 158 99 15 0;
#P newex 158 131 52 196617 metro 20;
#P flonum 158 238 54 9 0 0 0 3 0 0 0 221 221 221 222
222 222 0 0 0;
#P newex 158 214 35 196617 timer;
#P newex 158 161 66 196617 mousestate;
#P connect 0 0 5 0;
#P connect 3 0 0 0;
#P connect 4 0 3 0;
#P connect 5 1 1 1;
#P connect 5 0 1 0;
#P connect 1 0 2 0;
#P window clipboard copycount 6;

cheers
Roger

— Freddy wrote:

>
> hi, is there a way to keep track of how long the
> mouse is held down to change the duration in the
> third inlet of make note.
> Thanks in advance
>


December 13, 2006 | 10:35 am

Thanks Roger, i seem to be having problems opening this in Max (Sorry im new)
im using an older version so cannot use the new from clipboard, im trying to save it in a text file and open it but no joy.
any help?
Thanks,


December 13, 2006 | 10:48 am


December 13, 2006 | 12:31 pm

likes this, but obviously working and in real time…

max v2;
#N vpatcher 10 59 610 459;
#P window setfont "Sans Serif" 9.;
#P number 605 346 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N counter;
#X flags 0 0;
#P newobj 605 320 66 196617 counter;
#P button 631 282 15 0;
#P button 583 268 15 0;
#P toggle 572 215 15 0;
#P number 627 180 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 627 109 15 0;
#P newex 583 242 51 196617 metro 20;
#P newex 627 141 66 196617 mousestate;
#P newex 15 65 30 196617 mtof;
#P user kslider 84 77 54 0 36 48 31 12 1 255 230 25 255 230 25 255 255 255 0 0 0 0 0 0;
#P window setfont "Sans Serif" 14.;
#P newex 325 405 64 196622 noteout;
#P window setfont "Sans Serif" 10.;
#P number 38 151 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 325 340 51 196617 makenote;
#P user gain~ 464 141 24 100 128 0 1.071519 7.94321 43.;
#P number 478 297 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P fasten 5 0 6 0 63 131 63 63 20 63;
#P fasten 6 0 3 0 20 146 43 146;
#P fasten 5 0 2 0 89 138 330 138;
#P connect 2 0 4 0;
#P fasten 5 1 2 1 416 234 350 234;
#P fasten 0 0 4 1 483 378 357 378;
#P connect 15 0 2 2;
#P fasten 2 1 1 0 433 357 433 113 469 113;
#P connect 1 1 0 0;
#P connect 10 0 11 0;
#P connect 11 0 8 0;
#P connect 8 0 12 0;
#P fasten 12 0 14 0 588 301 610 301;
#P connect 14 0 15 0;
#P connect 9 0 7 0;
#P connect 7 0 10 0;
#P fasten 11 0 14 2 577 241 638 241;
#P pop;


December 15, 2006 | 12:50 am

The answer is simple and given above..

example:

max v2;
#N vpatcher 10 59 401 288;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 174 145 100 196617 elapsed time (ms);
#P window linecount 2;
#P comment 164 95 100 196617 bang when button released;
#P button 146 94 15 0;
#P button 98 94 15 0;
#P number 98 143 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 146 71 46 196617 select 0;
#P newex 98 71 46 196617 select 1;
#P newex 98 119 35 196617 timer;
#P newex 98 38 66 196617 mousestate;
#P window linecount 2;
#P comment 10 94 87 196617 bang when button pressed;
#P connect 1 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 2 0;
#P connect 2 0 5 0;
#P connect 7 0 2 1;
#P connect 1 0 4 0;
#P connect 4 0 7 0;
#P pop;

you’ll need to do some alterations and first create a working patch before adding effects such as this, (The example you posted is not a very nice way of treating the [metro] !) best advised is to stick with tutorials and the tutarial patches untill you understand them and got a little bit of routine in creating and looking at patches.
It saves you a lot of time and your work will be more efficient.


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