If MIDI sound sounds not realistic enough to you (which I understand; it means you have some musical hearing — my congratulations :-)) you can only generate more realistic sound from scratch. It has nothing to do with MIDI: it can carry only as much information as it does, no more.
You can analyze the sound from the microphone, but this problem is quite difficult. You need to break the sound into some time intervals and try to perform
spectral analysis of the sound. The problem is that not always it's possible to extract some "dominating" frequency from the spectrum and also the spectral image is constantly changed with time; so you need to try recognize the pure tones out of all this mess. This is really difficult and requires a combination of
Fourier analysis with
image recognition. To get a general idea, please see:
http://en.wikipedia.org/wiki/Spectrum_analyzer[
^],
http://en.wikipedia.org/wiki/Fourier_transform[
^],
http://en.wikipedia.org/wiki/Fast_Fourier_transform[
^].
[EDIT]
Basically, MIDI itself (a MIDI event) simply gives you the note number in the scale using the
equal temperament tuning system. Please see:
http://en.wikipedia.org/wiki/MIDI[
^],
http://en.wikipedia.org/wiki/Equal_temperament[
^].
In other words, MIDI is just a form of traditional musical notation. Bu the note value, you should calculate the main frequency of the note. I also gives you the instrument, by number. Knowing this two pieces of information, you can create your own waveform. Enrich the main frequency with many over-tones, form the attack, damping and other effects characteristic to a given instrument. By the way, some effects involve resonances between, say, strings, bodies and active parts of other instruments in orchestra. The simplest such effect is the
acoustic beat (
http://en.wikipedia.org/wiki/Beat_%28acoustics%29[
^]). These effects a non-local, volatile, so you won't be able to simulate them based on one instrument.
Potentially, you can create realistic sound (albeit not involving the collective effects like those I mentioned above) by obtaining records of sound of real instruments and studying them. Did you think you could just magically get it somewhere? Well, one such source is MIDI, but it's not realistic enough for you. I agree.
—SA