Forums > MaxMSP

How to make a countdown.

February 22, 2007 | 3:19 am

Hey Everyone, Im rather new to max msp so please forgive the newbie question.

I am trying to make something similar to a stopwatch, but something that will count down from 10 seconds, and when it finishes counting down, will play a short video clip.

Ive searched for quite a while and couldnt find anything on how to make a count down.

I know how to make a simple stopwatch, but i need something that will count down from 10.

Any help / info is much appreciated.

Thanks!

Dan


February 22, 2007 | 3:30 am

look at counter

On 2/21/07, spectre333 wrote:
>
> Hey Everyone, Im rather new to max msp so please forgive the newbie question.
>
> I am trying to make something similar to a stopwatch, but something that will count down from 10 seconds, and when it finishes counting down, will play a short video clip.
>
> Ive searched for quite a while and couldnt find anything on how to make a count down.
>
> I know how to make a simple stopwatch, but i need something that will count down from 10.
>
> Any help / info is much appreciated.
>
> Thanks!
>
> Dan
>
>


February 22, 2007 | 3:43 am

or a simple line might do the trick.

bests,
-ben

keith manlove wrote:
> look at counter
>
> On 2/21/07, spectre333 wrote:
>>
>> Hey Everyone, Im rather new to max msp so please forgive the newbie
>> question.
>>
>> I am trying to make something similar to a stopwatch, but something
>> that will count down from 10 seconds, and when it finishes counting
>> down, will play a short video clip.
>>
>> Ive searched for quite a while and couldnt find anything on how to
>> make a count down.
>>
>> I know how to make a simple stopwatch, but i need something that will
>> count down from 10.
>>
>> Any help / info is much appreciated.
>>
>> Thanks!
>>
>> Dan
>>
>>


Cycling ’74

http://www.cycling74.com

Main Office:
379A Clementina Street
San Francisco, CA 94103 USA
p: 415-974-1818
f: 415-974-1812

Authorization Support:
p: 415-974-1818 ext. 2#
e: challenge@cycling74.com

Technical Support:
p: 415-974-1818 ext. 5#
e: support@cycling74.com


February 22, 2007 | 3:44 am

hi, ive played around with counter object and tried searching but havnt found anything for counting down, only counting up.


February 22, 2007 | 3:46 am

hmmm im not quite sure i follow.

im now familiar with terminology and such, could you clarify what you meant by "simple line"?

thanks


February 22, 2007 | 3:54 am

scale should do the trick, on the other end of the counter – just use a 0 to -10 range to do the reversal of values


February 22, 2007 | 3:55 am

thanks! I’ll give that a shot :)


February 22, 2007 | 4:18 am

Check the tutorials out. They cover a lot of this kind of stuff. Take
your time and go slow. Max is an odd beast and can be a bit odd to
get used to.

On Feb 21, 2007, at 10:19 PM, spectre333 wrote:

>
> Hey Everyone, Im rather new to max msp so please forgive the newbie
> question.
>
> I am trying to make something similar to a stopwatch, but something
> that will count down from 10 seconds, and when it finishes counting
> down, will play a short video clip.
>
> Ive searched for quite a while and couldnt find anything on how to
> make a count down.
>
> I know how to make a simple stopwatch, but i need something that
> will count down from 10.
>
> Any help / info is much appreciated.
>
> Thanks!
>
> Dan
>

v a d e //

http://www.vade.info
abstrakt.vade.info


February 22, 2007 | 4:19 am

read all the counter documentation… look for "dec."

Eliot Palmer wrote:
> scale should do the trick, on the other end of the counter – just use a 0 to -10 range to do the reversal of values
>
>
>


February 22, 2007 | 6:43 am

This can be done with just the counter object. You will have a much better time with Max/MSP if you go through the tutorials! Also, simply reading the help files for an object that looks like it might do the trick will lead you in the right direction. If the object doesn’t do what you want, the help file might point you to one that does.
Anyways, here is a solution:

Copy the following text (with the "#P"s) and then go to

Max File–> New From Clipboard

#P window setfont "Sans Serif" 9.;
#P number 20 101 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#N counter 1 0 10;
#X flags 0 0;
#P newobj 20 77 77 196617 counter 1 0 10;
#P toggle 20 29 15 0;
#P newex 20 53 58 196617 metro 500;
#P comment 105 77 307 196617 three arguments: direction (1 for down) min count and max count;
#P comment 41 29 87 196617 < -- click to start;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 5 0;
#P window clipboard copycount 6;


February 22, 2007 | 6:48 am

thanks a million guys that really helped. i feel silly finding out it was so simple.

aaah i just found the tutorials. they are great!

all this time i was trying to find info off the net when all the while it was right here in the install.

thanks for all the help guys!

Dan


February 22, 2007 | 9:02 am

Hi all,

This is interesting. How about populating the Help menu in Max?

- Reference
- Tutorials
- Object help files
- Forum

.. just a thought.

Mattijs


February 22, 2007 | 5:52 pm

Agreed! I got tired of navigating to the tutorials, so I made a little patch with "links" to the reference manuals and added it to my Extras. The path names would need to be modified for it to work on windows, but the idea is pretty simple. It would make sense for something like this to be included with Max already.

#P button 8 90 15 0;
#P button 8 70 15 0;
#P button 8 50 15 0;
#P button 8 30 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 26 92 111 196617 Pluggo Dev Guide;
#P comment 26 52 118 196617 MSP Tutorials and Topic;
#P comment 26 72 111 196617 MSP Reference Manual;
#P comment 26 32 111 196617 Max Reference Manual;
#P button 8 10 15 0;
#P window linecount 3;
#P hidden message 8 510 239 196617 ; max launchbrowser "file:///Applications/Pluggo/Development Materials/PluggoDevGuide.pdf";
#P hidden message 8 441 243 196617 ; max launchbrowser "file:///Applications/MaxMSP 4.6/Documentation/MSP46TutorialsAndTopics.pdf";
#P hidden message 8 374 243 196617 ; max launchbrowser "file:///Applications/MaxMSP 4.6/Documentation/MSP46ReferenceManual.pdf";
#P hidden message 8 297 243 196617 ; max launchbrowser "file:///Applications/MaxMSP 4.6/Documentation/Max46TutorialsAndTopics.pdf";
#P window linecount 5;
#P hidden message 8 215 156 196617 ; max launchbrowser "file:///
Applications/MaxMSP 4.6/Documentation/Max46ReferenceManual.pdf";
#P window linecount 1;
#P comment 26 12 118 196617 Max Tutorials and Topic;
#P user panel 7 7 17 103;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 89 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 48 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 7 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 18 0 9 0;
#P hidden connect 16 0 8 0;
#P hidden connect 17 0 7 0;
#P hidden connect 10 0 6 0;
#P hidden connect 15 0 5 0;
#P window clipboard copycount 19;


February 22, 2007 | 5:59 pm

Great idea but you didn’t send the complete patch

On 2/22/07 12:52 PM, "Nick Inhofe" wrote:

>
> Agreed! I got tired of navigating to the tutorials, so I made a little patch
> with "links" to the reference manuals and added it to my Extras. The path
> names would need to be modified for it to work on windows, but the idea is
> pretty simple. It would make sense for something like this to be included with
> Max already.
>
> #P button 8 90 15 0;
> #P button 8 70 15 0;
> #P button 8 50 15 0;
> #P button 8 30 15 0;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 26 92 111 196617 Pluggo Dev Guide;
> #P comment 26 52 118 196617 MSP Tutorials and Topic;
> #P comment 26 72 111 196617 MSP Reference Manual;
> #P comment 26 32 111 196617 Max Reference Manual;
> #P button 8 10 15 0;
> #P window linecount 3;
> #P hidden message 8 510 239 196617 ; max launchbrowser
> "file:///Applications/Pluggo/Development Materials/PluggoDevGuide.pdf";
> #P hidden message 8 441 243 196617 ; max launchbrowser
> "file:///Applications/MaxMSP 4.6/Documentation/MSP46TutorialsAndTopics.pdf";
> #P hidden message 8 374 243 196617 ; max launchbrowser
> "file:///Applications/MaxMSP 4.6/Documentation/MSP46ReferenceManual.pdf";
> #P hidden message 8 297 243 196617 ; max launchbrowser
> "file:///Applications/MaxMSP 4.6/Documentation/Max46TutorialsAndTopics.pdf";
> #P window linecount 5;
> #P hidden message 8 215 156 196617 ; max launchbrowser "file:///
> Applications/MaxMSP 4.6/Documentation/Max46ReferenceManual.pdf";
> #P window linecount 1;
> #P comment 26 12 118 196617 Max Tutorials and Topic;
> #P user panel 7 7 17 103;
> #X brgb 205 215 224;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P user panel 23 89 130 21;
> #X brgb 205 215 224;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P user panel 23 48 130 21;
> #X brgb 205 215 224;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P user panel 23 7 130 21;
> #X brgb 205 215 224;
> #X frgb 0 0 0;
> #X border 0;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P hidden connect 18 0 9 0;
> #P hidden connect 16 0 8 0;
> #P hidden connect 17 0 7 0;
> #P hidden connect 10 0 6 0;
> #P hidden connect 15 0 5 0;
> #P window clipboard copycount 19;
>

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


February 22, 2007 | 6:56 pm

Works OK here.
David

On Feb 22, 2007, at 9:59 AM, Gary Lee Nelson wrote:

> Great idea but you didn’t send the complete patch
>


February 22, 2007 | 7:59 pm

Still doesn’t work here. Shouldn’t there be something more at the
beginning. Note the first three lines and the very last.

max v2;
#N vpatcher 10 59 610 459;
#P button 149 97 15 0;
#P button 8 90 15 0;
#P button 8 70 15 0;
#P button 8 50 15 0;
#P button 8 30 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 26 92 111 196617 Pluggo Dev Guide;
#P comment 26 52 118 196617 MSP Tutorials and Topic;
#P comment 26 72 111 196617 MSP Reference Manual;
#P comment 26 32 111 196617 Max Reference Manual;
#P button 8 10 15 0;
#P window linecount 3;
#P hidden message 8 510 239 196617 ; max launchbrowser
"file:///Applications/Pluggo/Development Materials/PluggoDevGuide.pdf";
#P hidden message 8 441 243 196617 ; max launchbrowser
"file:///Applications/MaxMSP 4.6/Documentation/MSP46TutorialsAndTopics.pdf";
#P hidden message 8 374 243 196617 ; max launchbrowser
"file:///Applications/MaxMSP 4.6/Documentation/MSP46ReferenceManual.pdf";
#P hidden message 8 297 243 196617 ; max launchbrowser
"file:///Applications/MaxMSP 4.6/Documentation/Max46TutorialsAndTopics.pdf";
#P window linecount 5;
#P hidden message 8 215 156 196617 ; max launchbrowser "file:///
Applications/MaxMSP 4.6/Documentation/Max46ReferenceManual.pdf";
#P window linecount 1;
#P comment 26 12 118 196617 Max Tutorials and Topic;
#P user panel 7 7 17 103;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 89 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 48 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 7 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 18 0 9 0;
#P hidden connect 16 0 8 0;
#P hidden connect 17 0 7 0;
#P hidden connect 10 0 6 0;
#P hidden connect 15 0 5 0;
#P window clipboard copycount 19;
#P pop;

On 2/22/07 1:56 PM, "David Beaudry" wrote:

> Works OK here.
> David
>
> On Feb 22, 2007, at 9:59 AM, Gary Lee Nelson wrote:
>
>> Great idea but you didn’t send the complete patch
>>
>

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


February 22, 2007 | 8:33 pm

Quote: Gary Lee Nelson wrote on Thu, 22 February 2007 11:59
—————————————————-
> Still doesn’t work here. Shouldn’t there be something more at the
> beginning. Note the first three lines and the very last.
>
> max v2;
> #N vpatcher 10 59 610 459;
>…
> #P pop;
>
>

As far as I know, the version without these lines works when selecting "New from clipboard" from the file menu. These lines are needed, though, when making a patch in text format.

mz


February 22, 2007 | 8:45 pm

Adding these lines makes it open with open from clipboard. Without them it
doesn’t. Max 4.6 on Intel.

On 2/22/07 3:34 PM, "mzed" wrote:

>
> Quote: Gary Lee Nelson wrote on Thu, 22 February 2007 11:59
> —————————————————-
>> Still doesn’t work here. Shouldn’t there be something more at the
>> beginning. Note the first three lines and the very last.
>>
>> max v2;
>> #N vpatcher 10 59 610 459;
>> …
>> #P pop;
>>
>>
>
> As far as I know, the version without these lines works when selecting "New
> from clipboard" from the file menu. These lines are needed, though, when
> making a patch in text format.
>
> mz
>
>
> –
> || michael f. zbyszynski — molecular gastronimist
> || http://www.cnmat.berkeley.edu/
> || http://www.mikezed.com/
>
>
>

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


February 22, 2007 | 10:31 pm

but again…it worked as originally posted for me doing open from
clipboard. 4.6.2 on intel as well. most interesting ;)

On Feb 22, 2007, at 12:45 PM, Gary Lee Nelson wrote:

> Adding these lines makes it open with open from clipboard. Without
> them it
> doesn’t. Max 4.6 on Intel.
>
>
> On 2/22/07 3:34 PM, "mzed" wrote:
>
>>
>> Quote: Gary Lee Nelson wrote on Thu, 22 February 2007 11:59
>> —————————————————-
>>> Still doesn’t work here. Shouldn’t there be something more at the
>>> beginning. Note the first three lines and the very last.
>>>
>>> max v2;
>>> #N vpatcher 10 59 610 459;
>>> …
>>> #P pop;
>>>
>>>
>>
>> As far as I know, the version without these lines works when
>> selecting "New
>> from clipboard" from the file menu. These lines are needed,
>> though, when
>> making a patch in text format.
>>
>> mz
>>
>>
>> –
>> || michael f. zbyszynski — molecular gastronimist
>> || http://www.cnmat.berkeley.edu/
>> || http://www.mikezed.com/
>>
>>
>>
>
>
> Cheers
> Gary Lee Nelson
> Oberlin College
> http://www.timara.oberlin.edu/GaryLeeNelson
>
>


February 23, 2007 | 7:28 am

Nick Inhofe wrote:
> Agreed! I got tired of navigating to the tutorials, so I made a
> little patch with "links" to the reference manuals and added it to my
> Extras. The path names would need to be modified for it to work on
> windows, but the idea is pretty simple. It would make sense for
> something like this to be included with Max already.

I made a complete overview system including pointing to manuals, you can
directly call helpfiles and manuals at your will, worth to try out. Its
sitting always on the right of my screen and is indispensible for me…

(If someone knows how to jump directly to a corresponding page of an
external in the pdf manual I am all ears…)

You’ll find it at

http://www.cycling74.com/twiki/bin/view/Share/StefanTiedje

I’d love to hear some comments. You have to set it up correctly though,
and I don’t know if my manual/description does give enough information
to do so…

I included a lot of 3rd party collections, which might be not up to date
now, if anybody has some enhancements in form of additional or corrected
overview files, you can send them to the list or to me privately, I’ll
include them in future releases…

Stefan


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


February 24, 2007 | 1:03 am

Hey Guys, I just had one more question which has kinda been bugging me.

How do I get the countdown to STOP when it reaches 0?

Im trying to make something that will countdown to 0, then play a movie file.

Thanks!

Dan


February 24, 2007 | 1:05 am

actually never mind guys,

I just added Select 0 below counter and reconnected it to my toggle.

silly.

Thanks!


February 24, 2007 | 4:55 am

I tried to copy/paste the patch again… the text is the same… However if I open the patch as text, the header shows up. Weird!
Here is the full patch (which I called Reference.pat) -

max v2;
#N vpatcher 11 58 202 196;
#P button 8 90 15 0;
#P button 8 70 15 0;
#P button 8 50 15 0;
#P button 8 30 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 26 92 111 196617 Pluggo Dev Guide;
#P comment 26 52 118 196617 MSP Tutorials and Topic;
#P comment 26 72 111 196617 MSP Reference Manual;
#P comment 26 32 111 196617 Max Reference Manual;
#P button 8 10 15 0;
#P window linecount 3;
#P hidden message 8 510 239 196617 ; max launchbrowser "file:///Applications/Pluggo/Development Materials/PluggoDevGuide.pdf";
#P hidden message 8 441 243 196617 ; max launchbrowser "file:///Applications/MaxMSP 4.6/Documentation/MSP46TutorialsAndTopics.pdf";
#P hidden message 8 374 243 196617 ; max launchbrowser "file:///Applications/MaxMSP 4.6/Documentation/MSP46ReferenceManual.pdf";
#P hidden message 8 297 243 196617 ; max launchbrowser "file:///Applications/MaxMSP 4.6/Documentation/Max46TutorialsAndTopics.pdf";
#P window linecount 5;
#P hidden message 8 215 156 196617 ; max launchbrowser "file:///
Applications/MaxMSP 4.6/Documentation/Max46ReferenceManual.pdf";
#P window linecount 1;
#P comment 26 12 118 196617 Max Tutorials and Topic;
#P user panel 7 7 17 103;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 89 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 48 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 23 7 130 21;
#X brgb 205 215 224;
#X frgb 0 0 0;
#X border 0;
#X rounded 0;
#X shadow 0;
#X done;
#P hidden connect 15 0 5 0;
#P hidden connect 10 0 6 0;
#P hidden connect 17 0 7 0;
#P hidden connect 16 0 8 0;
#P hidden connect 18 0 9 0;
#P pop;


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