The formal language of music is the language of the pitch value alphabet A = 0, 1, 2,...N. The language is the set of all horizontal and vertical strings of pitch value letters (integers).
Formal language does not include any secondary elements in music like performance, volume, color, duration, rhythm, etc.
Since the alphabet is finite, the language is regular. It is that simple! (The free language is infinite but the number of states on musical instruments is finite.)
Regular languages are the simplest formal language in Chomsky's hierarchy.
The definition of a regular language clarifies the sense in which music is a formal language. Regular means the language has the property of recognizability You can recognize when music belongs to a key or tuning.
A regular language is the output of an automaton that reads music as input and writes music as output: a musical instrument is a finite state machine.
Music is a discrete-time finite-alphabet language. This defines the set of stochastic languages and regular languages are a subset of stochastic languages.
The automaton has a terminal state called the acceptor state which recognizes when music belongs to the musical key.
You can recognize when music is true to the theory of the key by ear and by analysis.
Then music that belongs to the musical key is true and music that does not belong to the musical key is false.
This true-false analysis is everywhere in music if you look.
If a guitar string is in tune, it is true; otherwise false.
A guitar can recognize when tablature is true to the tuning.
Consider a melody and suppose you change a note at random. Will you recognize the note is false? Almost always.
Everyone thinks music is mathematical but no one thinks music is formally mathematics. That is because ordinary mathematics does not have a musical key, so it seems that mathematic is not an adequate foundation for music.
Think of the set of all 6-line tablature written in fret numbers. Don't you think that is a formal language?
I think that mathematicians, linguists, and physicists do not understand music properly because they think it is a Chomsky natural language like English, that evolved by human use without a plan. Nothing to see here.
But if that is true, why did music converge on the common tonal practice which is the terminal state on musical instruments. The musical key has been conserved for hundreds of years, while English continues to evolve.