Is the pitch (frequency) of a G# different from that of an Ab? The answer to this question depends on which type of tuning we assume. A piano is generally tuned equal tempered, which means that the octave has been divided into twelve equal steps. As a consequence, most intervals are not pure and thus generate audible beats, which can be perceived as a kind of vibrato. Equal tempered tuning could be thought of as a reference. It is a very practical tuning since we can modulate between different keys while using a set of only twelve notes per octave; each note having a fixed pitch. In equal tempered tuning, G# and Ab are both tuned to the same frequency.
If we would like to have pure fifths and pure octaves, then we can use Pythagorean tuning. But since we now require both fifths and octaves to be pure, we will need more than twelve notes per octave. This means that C, D, E, F, G, A and B will have fixed pitches, while sharp notes become slightly higher in pitch compared to flat notes. So, in the Pythagorean approach, a G# is slightly higher in pitch compared to Ab.
There are some misconceptions with regard to Pythagorean tuning because it is sometimes implemented as a temperament on a piano (the piano only has twelve keys per octave). So, for example, contrary to what is often believed, the so-called wolf fifth can actually always be avoided, provided that we are not limited to twelve notes per octave. Another misconception is that Pythagorean tuning is only used in medieval music - this isn't so, it's still very much in use today! The third misconception is that thirds should ideally always be pure. But try using pure thirds in melodies - not a very pleasant experience for most of us!
We can imitate Pythagorean tuning on a piano by playing sharp notes slightly harder, and flat notes slightly softer (a note can be perceived as being higher in pitch if you strike the key harder). This could be due to psycho-acoustical phenomena; and/or simply the fact that a slightly higher pitch, or a louder voice, both will make you sound more assertive. These effects could also explain why music with flat key signatures may have a more mellow sound than music with sharp key signatures. Relative loudness isn't, however, the only parameter we can use to our advantage; timing and note durations can also be employed when mimicking Pythagorean tuning.
If we would like to have not only fifths and octaves justly tuned, but also thirds, then we end up with a great number of different pitches within the octave if we are to be able to modulate between keys. In fact, it is a mathematical consequence that for each additional interval we demand to be justly tuned, the number of needed pitches increases dramatically. By doing so we lose the feeling of, for example, what the note C stands for, since its pitch may change according to the musical context.
Is then justly tuned intervals what we should strive for? It has been shown that musicians who are playing instruments that allow free intonation, or singers, do not necessarily prefer "just intonation", but might sometimes play or sing equal tempered, and sometimes with features lent from Pythagorean tuning. Using only justly tuned intervals could potentially make the music sound dull or lifeless. Choirs often choose to justly intonate the third in the final chord, but otherwise not! Pipe organs with complex registrations could perhaps benefit from a more pure tuning in order to avoid excessive beating between partials coming from a multitude of sound producing sources.
The introduction of audible beats does otherwise actually enhance the sound by adding what might resemble the vibrato of a singer. This implicates that equal tempered tuning is, contrary to what is sometimes claimed, not necessarily an inferior tuning. It is simply a question of personal taste if you prefer other tunings. Most people are so used to equal tempered tuning that they find other tunings less satisfying. Pianists today can play digital pianos where you can tune the piano in many ways. If you have access to one of these pianos, try out different tunings and see what your personal preferences are.
Equal tempered tuning doesn't imply that we cannot deviate from it, provided, of course, that the instrument allows it. The musician is then free to make deliberate artistic deviations from the actual pitch. It is also a known fact that even very professional musicians make random errors occasionally, something which doesn't seem to bother us that much.
Another tuning that should be mentioned here is the stretched equal tempered tuning with justly tuned fifths and slightly wider octaves. This tuning has been explored by Serge Cordier, who has written an excellent book (in French) on how to tune a piano to pure fifths (Piano bien tempéré et justesse orchestrale). A piano tuned this way will sound better together with violins, for example, which are generally tuned using beatless fifths. Violinists, among others, also have a tendency to play stretched.
The wider octaves in the stretched tuning do not constitute any problem since people generally prefer these. In fact, all intervals seem to be closer to those preferred by most people. Also, if you play an arpeggio on an instrument with stretched tuning, the final note will sound just right, whereas in an ordinary strict equal tempered tuning you may get the impression of not reaching all the way. The stretched tuning with justly tuned fifths really ought to be the new reference in Western music, and not just for piano. A stretch of 0.3 cents per semitone (3.6 cents per octave) will make the fifths pure.
Should a musical notation be able to make the distinction between, for example, G# and Ab? It's not absolutely necessary, but on the other hand, it certainly cannot be regarded as a disadvantage if made possible. However, it's not only a question about pitch. Making the distinction between flat and sharp notes can also, to some degree, help clarify the musical structure. For instance, a G# followed by an A could signal that we're in the key of A major, or perhaps E major, while Ab followed by A may indicate a modulation from one key to another. It may also be helpful, especially if you're improvising, to know that, for instance, F# is derived from the note F, which means that F will generally be replaced by F#. In case you give F#/Gb a new name, let's say "Q", then it isn't as easy to know that this Q is meant to replace F in a certain situation, because it could also be replacing G if we're dealing with another key.
One useful thing about the traditional note naming system is that it allow us to identify leading-tones. For example: C -> C# -> D lets us know that there is a bigger step (in Pythagorean tuning) from C to C# than it is from C# to D (cf. augmented prime vs. minor second). Consequently, C# is a leading-tone to D (minor second). D -> Db -> C signals that Db is a leading-tone down to C; that is, Db is closer to C than it is to D - "Db is being repelled from D and leans towards C". Differentiations such as these may allow us to make better musical interpretations, closer to what the composer may originally have had in mind.