There is software for that. But it is not always very accurate. Especially with multiple voices (or instruments) starting at the same time.
Research on this started over 40 years ago:
Rabiner, Lawrence, et al. "A comparative performance study of several pitch detection algorithms." Acoustics, Speech and Signal Processing, IEEE Transactions on 24.5 (1976): 399-418.
And has improved a lot during the last few years:
De La Cuadra, Patricio, Aaron Master, and Craig Sapp. "Efficient pitch detection techniques for interactive music." Proceedings of the 2001 International Computer Music Conference. 2001.
I suggest you take a look at the pitch detection plugin of the (free software) Audacity here.