that is a fantastic and very funny response from 'galaxiesmerge'.
whilst it is mainly true, i suspect there is a wry grin there somewhere behind his/her post, as the OP's question is so so common, they should really have searched the ableton and cycling 74 forums first to get a more pragmatic answer.
i must be in a weird mood today, here goes:
1. there are 'third party externals' for Max, and thus many many many patches, knocking around, which do all this for you. or at least 'help you along the way'. as with any hugely general question like the op's, it usually demonstrates that the asker has very little clue of the intricacies which go into achieving such a goal. i.e., "it is not as simple as that".
2. in case you do not realise, 'third party externals' are a bit like 'plugins' for max that 'other people' make (as opposed to coming with the standard distro). the ones you need are:
pitch~ for windows and osx
analyzer~ osx only
sigmund~ osx only (there is a windows port, but not by the author, so do not trust it)
if you search
www.maxobjects.com or google, you will find them.
many many people will tell you to use the third party "fiddle~" external - do not. ignore them. it is rubbish and old now and does not really work properly. the author of it wrote 'sigmund~' instead, and 'pitch~' is almost identical to 'fiddle~' but slightly better.
3. study these objects, try using them, work out what you need to do, listen to the advice of galaxiesmerge above?
4. you will find that there is a hell of a lot of 'tweaking' and 'customisation' involved depending on your need.
also, do not forget the avg~, average~, peakamp~, etc objects that come with the standard Max distribution - they can be very helpful in these matters.
while galaxiesmerge was mainly correct, there are other ways to do all this. for example the 'wavelet transform'.
in max6 (so soon M4L too we hope) there is a new standard object in the distro which does pitch tracking etc using 'wavelet transform' method called "fzero~". it works very well monophonic, although not so well on piano / some types of bass. the handy thing about wavelet method is that it has less latency (usually) than the fft method.
this issue comes up on the forums all the time. please send people here for a verbose and likely inaccurate answer in the future.