Western music is built on twelve notes, each a semitone apart: C, C \#, D, D \#, E, F, F \#, G, G \#, A, A \# and B. We can continue with another C, an octave above the first, but as Jean-Philippe Rameau noted in his 1750 treatise, the convention is to treat them as the same note. This identification provides a link with the language of congruences: two notes are considered identical if their positions are congruent modulo 12.
Thus, the twelve notes can be replaced by the twelve integers from 0 to 11.
Many compositions are based on the idea of a "mode." But what exactly is a musical mode? Without delving into the theory, we can think of it as a collection of essential notes that provide the framework for a composer's musical ideas.
The mode gives a work its atmosphere. Two modes, for example, are familiar to us: the major and minor modes. To draw a parallel with mathematics, we can view the mode as a first, slightly rough approximation of a musical work, or of a passage within one. After all, nothing prevents a composer from changing mode along the way. Composers such as Gabriel Fauré did so freely. Several musicians naturally associate colors with notes or, more broadly, with modes. Olivier Messiaen was one of them, as he explains in his Traité de rythme, de couleur et d’ornithologie.
Operations on notes --------------------------------