Music viewed by its entropy content: A novel window for comparative analysis

Polyphonic music files were analyzed using the set of symbols that produced the Minimal Entropy Description, which we call the Fundamental Scale. This allowed us to create a novel space to represent music pieces by developing: (a) a method to adjust a textual description from its original scale of observation to an arbitrarily selected scale, (b) a method to model the structure of any textual description based on the shape of the symbol frequency profiles, and (c) the concept of higher order entropy as the entropy associated with the deviations of a frequency-ranked symbol profile from a perfect Zipfian profile. We call this diversity index the ‘2nd Order Entropy’. Applying these methods to a variety of musical pieces showed how the space of ‘symbolic specific diversity-entropy’ and that of ‘2nd order entropy’ captures characteristics that are unique to each music type, style, composer and genre. Some clustering of these properties around each musical category is shown. These methods allow us to visualize a historic trajectory of academic music across this space, from medieval to contemporary academic music. We show that the description of musical structures using entropy, symbol frequency profiles and specific symbolic diversity allows us to characterize traditional and popular expressions of music. These classification techniques promise to be useful in other disciplines for pattern recognition and machine learning.


Introduction
We all share the intuitive idea of music as a flow of ordered sound waves.Formally the presence of order in music was studied by Leonard Meyer [1], who pioneered the analysis of music as a phenomenon capable of creating emotions.Meyer analyzed in depth the expectancy experienced by the listener.In his explanations, Meyer used musical concepts and technical notations which are difficult to represent in quantitative mathematical terms.But the idea of music as a means to create specific sensations such as tension, sadness, euphoria, happiness, rest and completeness, is always present along his study.Meyer described the emotions caused by music as the result of the interaction between the sound patterns perceived and the brain.In his words [1]: "The mind, for example, expects structural gaps to be filled; but what constitutes such a gap depends upon what constitutes completeness within a particular musical style system.Musical language, like verbal language, is heuristic in the sense "that its forms predetermine for us certain modes of observation and interpretation."† Thus the expectations which result from the nature of human mental processes are always conditioned by the possibilities and probabilities inherent in the materials and their organization as presented in a particular musical style."( † Edward Sapir, "Language," Encyclopedia of the Social Sciences, IX (New York: Macmillan Co., 1934), 157.) Meyer's referral to conditional probabilities implies the possibility of capturing some of the essence of musical style by observing the values of entropy associated with each music style.But the style of music has proved to be a difficult concept to handle.Similarly as occurs with other types of languages, the style is a way of classifying specific musical pieces.The determination of the style is based on characteristics describing the music, the time when it was composed, and the geographical context.Some researchers have set a style framework for music by quantifying those characteristics.In 1997 R. Dannenberg, B. Thom and D. Watson [2] produced readable Musical Instrument Digital Interface (MIDI) files by recording trumpet 10-second-long performances.Dannenberg et al used neural networks to classify the style of each recorded performance according to several features of music.In 2004 P. J. Ponce de León and J. M. Iñesta [3], measured the pitch, note duration, silence duration, pitch interval, non-diatonic notes, syncopation, and other music components, to build statistical characterizations of jazz and classical melody pieces.Perez-Sancho, J. M. Inesta and J. Calera-Ruiz [4] approached the same problem by categorizing the texts of music MIDI files.They extracted the melodies from the MIDI files and segmented the resulting texts into sequences of characters representing different lengths of music beats.In 2004, P. van Kranenburg and E. Backer [5] studied music styles starting from some music properties.They included the entropy of some parameters as properties.These studies indicate that it is possible to recognize properties related to the musical style in an automated fashion, but none fulfills the required generality as to be considered a true style recognizer.Music style is just a concept too fuzzy to serve as a quantitative reference framework useful to classify, with a single value, something as complex as music.
From a more theoretical perspective some researchers have provided useful schemas about the structures underlying music.In 2006 Mavromatis [6] presented models of Greek Chants depicting the melodic component of music as a process dominated by Markov chains.Later, in 2011 Rohrmeier [7] argues that that Markovian processes are too limited to properly model the complexity that arises when harmonies are added to melody.Rohrmeier proposes a Generative Theory of Tonal Harmony (GTTH) [7] as a set of recursive rules based on the Chomskian grammar and on the Generative Theory of Tonal Music (GTTM) by Lerdahl and Jackendorf [8].Both branches of study, music as a phenomenon governed by Markovian processes, and the recursive context-free rules to model harmonies, are developed for music as it is written on the music-sheet.
That is, music as an abstract entity represented by a set of meaningful symbols written on the music-sheet, which are supposed to represent the sonic effects pretended by the composer.
Even for this conception of music -its description on the music-sheet, which is simpler than recorded actual sounds-Rohrmeier points out in one of his notes in 2012 [9], that GTTH does not suffice to properly model the polyphonic music.On the other hand, in 2009 Mavromatis [10] suggested the application of the Minimal Description Length Principle (MDL) as an alternative to the Markovian models of melodies, and explained why MDL should be a powerful tool to describe music.Yet he announces these advantages are subject to the huge computational complexity foreseen of the algorithms associated to this type of analysis.
Even for the most intricate pieces of music, the music-sheet is rather simple when compared with the actual music and with the recorded file that can be reproduced -the sounds we hear.The quantitative analysis of music is even more demanding if polyphonic music is the subject of study.
Polyphony adds more dimensions to an already almost unmanageable problem.To deal with polyphonic music Cox [11] measured the entropy of the sound for each time beat.Cox represents his results in two time-dependent entropy profiles: one for pitch and another for rhythm.The polyphonic music can be described as the superposition of many monophonic sound streams.The result is an overwhelmingly large number of combinations of sound frequencies.Luckily, all these sound streams are synchronized in time and therefore its record in a file leads to a one-dimensional text, where some character sequences may form patterns that represent the musical elements contained in the text-file.
A method based on the MDL Principle applicable not only to music, but to most problems in which the recognition of patterns in a large string of written symbols, is an issue.The FSA is capable of unveiling the 'dominant' symbols of a description.In the present work we apply the FSA to 453 MIDI files containing academic, traditional, and popular music.For each piece, the Fundamental Symbols -the set of symbols leading to the description minimal symbolic entropy-was determined, and the symbol frequency profiles built.In order to compare the shape of profiles based on different number of symbols, a method is devised and presented.Additionally, a measure of Higher Order Entropy and a method for its calculation, is proposed.We used these methods to represent different types of MIDI-music in an entropy-diversity space.The dependence between the type of music and the selected representation-space is analyzed.

Methods
Understanding the structures underlying music is an old restlessness, always present among researchers During the 50's, Meyer [1] and, more recently, Huron [13] have linked the music structure to our emotions and expectations.Their description of musical structure and its influence in our emotions is based on considerations of explicit musical language, as written on the music sheet.By using other analytical resources, a group of researchers, Mavromatis [13] among them, offer models for the construction of melodies that assume that a Markovian process is behind each specific style of melody.These models, based on Finite State Machines (FSM) generalized in stochastic terms by a Hidden Markov Model (HMM) [14], are able to produce melodies that fit into a certain music style, after being properly trained.Extending the HMM to include harmonies, requires the identification of an inconveniently large number of states.As an alternative method Rohrmeier [7] proposes a system of grammar rules to model harmonic progressions, an important extension of Lerdahl and Jackendorf [8] previous work and their Generative Theory of Tonal Music (GTTM).
Music can be seen as a recursively nested group of structures (Rohrmeier [15]).Even considering just melody, music consists of kinds of fractal structures leading any attempt for its analysis, to a very complex task.Attempting to model polyphonic music 'amplifies' these difficulties so much, that Rohrmeier [15] considers the analysis of the structures of polyphonic music, a practically impossible task.
In those studies where the focus is on the music sheet, the analysis is limited to the music as the composer intended it to sound -instruments, rhythms and tempo, scales, note pitches, keys, chords, temperament, volume, etc.-, but leaving out of the assessment of many other effects of real music which are present when it is performed with musical instruments.This study, on the contrary, is done with the recording of sounds as expressed in computerized music files.Subtleties as the effects of relative position of the instruments, their timber, syncopation, mistuning, the performer's style and even errors, are represented in these files, up to some degree depending on the recording quality and resolution.

Language Recognition, Diversity and Entropy
In this study we propose a radically different method to study the structure of music.Instead of analyzing the symbols written on the music sheet, we look at the sound recorded from an actual performance, by reading the text associated to the computerized file which contains the recording.To do this, we inspect the sequence of characters of the computerized files viewed as texts.
Even for short files, this is not a simple task.A music file read as a text, is a long sequence of characters which does not exhibit recognizable patterns, resulting in a code extremely difficult to interpret.Not knowing the rules of a grammar system it is not possible to decide a priori how to recognize the symbols needed to interpret the description.There are no words in the sense we are used to, and the characters we see do not indicate any meaning for us.We cannot even be sure about the meaning of the space character " ".Thus music files contain character strings to represent sounds according to the coding system used and the selected discretization level.But, as opposed to natural language text files, the music files do not show words or symbols that we humans can recognize without the help of some decoding device.Therefore, to find some order within these symbols -sequences of characters-that are camouflaged with the surrounding text, we consider the entropy of each possible set of symbols, that is, each possible way of reading the same written message.
We claim that the set of symbols whose frequency distribution corresponds to the lowest (or is near to), possible symbolic entropy value, is a good representation of the structure of the language used for the description.We call this set the Fundamental Symbols, and the method used to its determination is the Fundamental Scale Algorithm [12].The result is the set of symbols Yi which can reproduce the description with such a frequency distribution P(Yi), that the entropy associated with, is minimal.The set grouping the Fundamental Symbols is regarded as the Fundamental Language B*.The asterisk as sub-index is used to recall that B is the result of an entropy minimization process.Thus we can write * = { , … , , … , , ( )} . ( In Expression (1) the diversity -the number of different symbols-is represented as D. Once we know the set of Fundamental Symbols along with the frequency of each fundamental symbol -equivalent to their probability distribution-, we can compute its symbolic specific diversity and the entropy of each piece of music, applying Expressions (2) and (3).The specific diversity d is calculated as Where D is the diversity of language B -the number of different symbols in the description-and N is the total number of symbols, repeated or not.A version of Shannon's entropy h [16], generalized for languages comprised of D symbols, is used to compute quantity of information describing each music piece.The probabilities of occurrence of symbols Yi are the components of the one-dimensional array P: ℎ = − . (3)

Frequency Profiles
The value of entropy h is a good base for the comparison of descriptions.But it may be not be enough to properly represent the many dimensional differences of entities as those we are dealing with.For that reason, we complement our treatment of each music piece with the shape associated to the values of array P. To obtain the shape, we ranked the symbols according to their appearance frequency P(Yi) and plotted P(Yi) vs Rank(Yi), both in logarithmic scales; pretty much as the method to build a Zipf's profile.

Higher Order Entropy
The use the symbolic diversity and the symbolic entropy h to characterize music pieces, allowed for differentiating among genres of music.However, two pieces of music, even though having different ranked frequency profiles, may share similar values of entropy.When this is the case, the difference between two profiles can be descripted as the way they 'oscillate' around their respective middle line.Thus, we looked at the patterns of these oscillations, and quantified them by computing the value of the entropy associated with these oscillations.Therefore, elevating the comparison of descriptions to a finer level of detail.Details of the mathematical formulation to compute the Higher Order Entropy are shown in Appendix B. In this work we use the 2 nd order entropy, and we refer to it with the symbol h and adding a superscript between brackets (h [2] ).

Scale Downgrading
As mentioned, we used the shapes of frequency profiles as characteristic of a music piece.When comparing the shape of several frequency profiles, the different number of symbols for which each profile was created, is a problem.To solve this we present a method we called Scale Downgrading, useful to represent a symbol frequency profile with a smaller number of symbols while keeping it general shape.Details of the mathematical formulation to compute the Scale Downgrading are shown in Appendix C.

Music Selection
Music is the result of the superposition of a vast variety of sounds.But music sounds respond not only to the information written on the music sheet, but also the addition of small differences introduced by the interpreter.Music is then the result of a large number of different symbols to form sounds sequences.These sound sequences are included in the file produced by the recording of a musical piece.In spite of the unreadable condition of any of these files for us humans, the files contain all the information regarding the music, and thus we can appreciate this information as music when we reproduce the file and hear it.Due to limitations of the Fundamental Scale [12] Algorithm and the enormous complexity of most conventional music recording formats, we had to rely on file MIDI coding to discretize the symbols forming these pieces of music while keeping the computations within a feasible condition for our algorithm in its current condition.Using formal music recording formats as .MP3, .MP4 or .WAV, is still desirable and a matter of further improvement of technical aspects of the Fundamental Scale Algorithm [12].Yet, MIDI-music provides the conditions for us to advance with this study.
Most MIDI files include metadata at their beginnings and their ends, usually written in English or Spanish.The length of these headers and footers can be considered small compared to the total symbolic description length; since cleaning all files would represent a non-automated task, we decided not to prune this small amount of noise and leave the files as they show when opened with a .txtextension.
Table 1 shows a synthesis of the music selection we used as subject to apply the entropy measurement method.The selection includes pieces from classical and popular music of different genres.Our music library is organized in a tree.To have some reference of the place where a music piece, or group of pieces, is located within the tree, we assigned a name to each tree level.Table 1 shows this classification structure fed with more than 450 pieces from 71 composers and 15 different periods or types of music.

Results
All pieces of music were organized in a classification tree to which we refer to as MusicNet.By computing the Fundamental Scale to all leaves of MusicNet, we were able to obtain the fundamental symbols of each music piece included in our dataset, as well as for each music subset defined by composer, type, genre, period, or any other characteristic property of the included music.MusicNet is too lush to be extensively presented here.But we include the upper levels of the tree in Table 1 and a link that allows access to the whole tree in Appendix A. Table 1 displays the datasets of MIDI music used for our tests and values of specific diversity, entropy and 2 nd order entropy accompanied with their respective standard deviations.MusicNet.

Diversity and Entropy
Diversity and entropy are quantitative characterizations of communication systems.Within the scope of a communication system, the diversity and the entropy may reveal differences regarding style or even period of its evolution.All pieces of our music library are organized in three groups: occidental academic, traditional and Rock/Movie Themes.Diversity vs. length and entropy vs. length graphs are shown in Figures 1 and 2.

Information Profiles
We are interested to know the effect of degrading the scale of observation of musical descriptions.Prior to this computation, we know that degrading the scale -equivalent to viewing the system from a remoter perspective-, means observing less details, therefore, as the number of symbols used in the description decreases, we expect to get less information.Thus, there are at least two reasons to inspect these information profiles: (a) to evaluate if they capture information about the music's type or class.(b) To obtain a sense of the minimal degraded diversity that maintains the essence of the system, by showing a shape that resembles the description at its original symbol diversity.Using this minimal degraded diversity allowed us to compare the shapes of many music frequency profiles at the same diversity; a condition needed for a fair comparison.
We built the information profiles for several pieces of music.To obtain them we started from the description at their original symbol diversity D, and degraded the observation scale S by applying Equations (C3), (C4a), (C4b) and (C4c).An example of information profile is presented in the bottom of Figure 4.This information profile was built with the amount of information (the entropy) corresponding to the symbol probability profiles observed at different downgraded scales (shown in the upper section of Figure 4).The downgraded values of the diversity were selected, so that at any scale, the number of degrees of freedom of the symbol frequency profile (symbolic probability profile) is a power of 2. The number of degrees of freedom of any probability distribution is k-1, being k the number of different categories in the distribution.Thus, the number of different symbols considered for each degraded symbol diversity is S = 2 i + 1, where i is a positive integer.we had to inspect the profiles with a diversity S=129.With that level of refinement in the profile drawing, we were able to distinguish each music pieces' profile from another; we thus selected this diversity value (S=129) as the diversity we should downgrade all pieces in order to obtain characteristic property values for each piece.

Symbol Frequency Profiles
A way to visualize the differences between two classes of music is to draw the ranked symbol frequency profile.Each profile has D-1 degrees of freedom.That means the profile's shape can be altered in D-1 different ways by modifying the frequency of the D different symbols which make the musical piece description.When looking at traditional and popular music, we observe a shorter vertical range of values if compared against the academic music profiles.From all non-academic music considered, Hindu-Raga music exhibits the flattest profile while Chinese music has the steepest one.
The comparison of these profiles suggests that it is possible to capture structural music differences by observing these shapes.On the other hand, there are profile similitudes between some pairs of classes of music.Baroque music and Rock music, for example, have similar shaped profiles.
Also, music from Impressionistic and Chinese periods, exhibit similar overall profiles.However, reducing the profile shapes down to a quantifiable index proves to be difficult and perhaps over simplistic.In this sense, the inclusion of an additional characteristic, as is our recently defined 2 nd Order Entropy, seems to be justified.

Clusters and Tendencies
The frequency profiles built lead us to obtain values of symbolic diversity, entropy and 2nd order entropy for our selected set of MIDI-musical pieces.These values are shown in Appendix E. To extend the observation space up to a three-dimensional space, we present 3D graphs representing the values of Appendix E. Figure 5 presents 3D graphs for the diversity d, entropy h [1]   and 2 nd order entropy h [2] of our music data sample.
In the graphs of Figure 5 each bubble corresponds to a single music piece.When a musical work is complex and can be divided by parts -for example: suites, concerts and symphonies-, each part is considered a single piece and is represented by a bubble.Figures 6 and Appendixes  Figure 6 reveals how all periods of academic music locate in different sectors of the 3D space formed by diversity d, entropy h and 2 nd order entropy h [2] .It is worthwhile to mention that in Figure 6 the size of the bubbles do not represent the dispersion of the music pieces grouped under a music style or period, thus there is more overlapping among types of music than that suggested by the representation of the bubbles in the graph.
Returning to Figure 5, the Graphs shown may appear, at first glance, as a disorganized mix of bubbles representing music styles in our 3D space.Certainly, there are clusters of types of music sharing the local space.Therefore it would be difficult to split some clusters according to their location.However, in spite of the difficulty to see through this dense cloud of bubbles, for some specific types of music, the separation of their cluster's locations seems a feasible task.Medieval music (old-rose bubbles), for example, occupies a subspace of relatively high entropy and high diversity if compared to the location of Renaissance music (light green bubbles).Following the chronological time direction, Baroque music (dark green bubbles) maintains the general tendency towards a reduction of its symbolic diversity and its entropy ℎ (represented as h1 in the 3D graphs).Comparing Classical music (light blue) with Baroque, its predecessor in time, we observe a stabilization of diversity and entropy h values, however, there appears a noticeable reduction in the values of the second order entropy h [2] (represented as h2 in the 3D graphs).On the other hand, if we consider 'distant' types of music as Hindu-Raga (yellow bubbles), and Venezuelan music (orange bubbles), there is very little, or none overlapping between the spaces where the bubbles are; these clusters occupy different spaces and our representation allows separate them.
Figure 5: Three views of the representation of MIDI-music selected pieces in the space specific diversity, entropy, 2 nd order entropy (d, h [1] , h [2] ).Each bubble represents a MIDI-music piece.
To have a quantitative sense of the overlapping occurring for these clusters, we present the averages and standard deviations of the properties that characterize each type of music in our sample.Tables 2 and 3 show the results.We address some aspects of this discussion in Section 4.
To appreciate any tendency of specific diversity d and entropies h and h [2] over time, we plotted these variables as functions of time.The resulting graphs are included in Figure 7 and Appendix I.For Chinese and Hindu-Raga music pieces we do not have information about the time when they were composed.We, therefore, did not include those types of music in these graphs.
Figure 6: Three views of the representation of music period/style groups in the space specific diversity, entropy, 2 nd order entropy (d, h [1] , h [2] ).Each bubble represents a group of music pieces sharing the same style/period.
Table 2: Properties of western academic music.
Table 3: Properties of some traditional and popular music.

Discussion
Music can be transmitted by sounds and by writing.But, the communication of music by writing lacks of its essence and does not produce, at least not for most people, the emotions and sensations associated to a pattern of sounds.Music writing shall be considered as a useful tool for composing, making arrangements, recording, and teaching music.Thus, transferring musical information is possible by means of music sheets or other kinds of music written representation.
But, we think that rigorously speaking, written forms of music convey information, instead of conveying real music.Thus we devote our discussion to some of the properties of the information associated to a set of MIDI-music files.Our purpose is to demonstrate that the properties of these texts, even though in an indirect manner, can be used to characterize, and up to some degree to depict, the actual pattern of sounds that we call music.

Diversity and Entropy
The dependence of Diversity D vs Length N is nearly linear.Only for short music pieces, the Diversity-Length curve shows slight concavity.For all other ranges, the Diversity D of music can be modelled as linear relationship with the length N of the music description.The slope change observed near the origin, may be due to the English and Spanish overhead texts, which are generally included to start and to end the MIDI files.These natural language segments are considered as noise and its presence should not have an important affect over the overall music description when the music piece is reasonably large in terms of symbols.Nevertheless, the specific diversity , represented by slope D/N, keeps close to a constant value for every type of music, becoming a characteristic value that may distinguish one type or style of music from another. Figure 1  As can be seen in Figure 3, the graphs show that entropy is aligned to a very stiff slope in the space entropy h vs specific diversity d, and even though the entropy values represented, fill a wide range of values (from 0.45 to 0.8), they seem to closely follow an average curve of the form h = d  , similar to those found for human natural languages in a previous work [17].The large dispersion of entropy is then a consequence of the small range of specific diversities where music establishes.Nevertheless, the values of the entropy standard deviation observed in Tables 2 and 3 are, in general, small compared to the range of entropy averages, suggesting that entropy values capture some of the essence of the type or period of music and therefore justify its inclusion in a music entropy model.Values of the 2 nd order entropy average go from 0.89 (Academic: 20 th century) to 0.97 (Asian: Traditional: Indian Raga).The standard deviation is about 0.05 and in general smaller than the range of variation of the average 2 nd order entropy from one group to another.

Frequency Profiles
Figure 4 include graphs with the information needed for a system description, in its vertical axis, and the scale of observation -the diversity D of symbols used in the description-in its horizontal axis.These graphs have been called with two different names; researchers who consider Shannon's information [16] as a direct measure of complexity [18,19] call it Complexity Profile.
Those who consider complexity as the pseudo-equilibrium [20][21][22][23] that the system reaches when it bounds its disorder by self-organizing its symbols, prefer to call these graphs Information Profiles.
These names, which refer to the same type of graph, arise from the different interpretation of complexity.The first group of researchers see complexity as proportional to the length of the symbolic description, while the latter group pays more attention to the system's activity to keep itself organized.Despite the fact these names refer to different concepts, both seem to be valid, Any case, these information profiles show how sensitive are the description lengths of a MIDImusic piece to the change in the observation scale, represented here by the downgraded diversity.
We traversed two paths for our procedure.In a path we inspected the shapes of the ordered frequency profiles for all types of music included in this study.By visually comparing them, we found similarities between the profiles of different types of music; Baroque and Rock showed very similar shaped profiles, as well as the chronologically successive periods, Romantic and impressionistic, also did.We also found that Hindu-Raga and Venezuelan music have the flattest and the steepest profile shapes respectively, locating their shapes at opposite extremes of a scale somehow built to evaluate these shapes.

About the Evolution of Music
Indeed, in Figure 5 it turns out difficult to distinguish the dominant locations for all types of music.
The locations of individual pieces of some types of music are dispersed and their central location is not easily recognized.But this does not mean that a piece, properly classified as a specific type of music, does not lie relatively near a certain location which corresponds to the type of music in the space considered.Take for example Romantic music (darker blue bubbles) and Baroque music (darker green bubbles).Despite the noticeable dispersion of the bubbles, each group occupies a different volumes within the space represented in Figure 5.Both music-type clusters are shaped as bows.The one representing Romantic music, is located toward the center of the cube, while the Baroque music-type cluster is located near the high second-order entropy corner.This aspect of the discussion is important because the standard deviations of the three properties evaluated, presented in Tables 2 and 3, are of the same order as the variation of the averages of the same properties, thus giving the false idea that these clusters are indistinctly dispersed all over the same space and are, therefore, not separable by the properties suggested here.The reason why our clusters may be separable while exhibiting high standard deviations, with an apparent full overlapping, resides on the shape on the clusters; they are not spherical, instead they are shaped as thick arched sheets.
Figure 6 shows how each type of music tend to occupy different sector of the space diversityentropy.Focusing in the academic music, it can be seen a progressive move from the location of Medieval music, located in the sector of high diversity and entropy, to the location of more recent music as the Classical and Impressionistic, located at relatively lower specific diversity and entropy.The ordered locations of each type of academic music upon the time parameter, suggests that some types of music evolve in a way that can be detected in the mentioned space; d, h [1] , h [2] ).
Hindu traditional raga and Venezuelan traditional music are easily recognizable.There must be some properties that make them well defined and different from each other.The fact Hindu-Raga and Venezuelan music appear far from any other style of music in Figure 6, does not surprise.On the contrary, it should be taken as sign of goodness of the space d, h [1] , h [2] to represent music differences, and confirming the prominent distinctions between the profile shapes seen for these types of music in the profiles shown in Appendixes F and G. Appendix G, we see that academic music has evolved to produce profiles associated with a lower value of the 2 nd order entropy; for academic music this tendency seems sustained from the medieval music to the impressionistic period.Traditional and Popular music exhibit a 2 nd order entropy comparable to the academic 20 th Century's music.

Considering Graphs in Figures in
The specific diversity d, on the other hand, reveals a slight reduction with time but an increase of dispersion of this variable, shown starting from the classical music and the romantic period, does not allow us to make a clear statement about the sustained tendency of a reduction of the specific diversity over time.On the side of traditional and popular music, specific diversity and entropy show less dispersion than their counterpart from academic music at comparable times.
Figure 7 and Appendix I show the behavior of variables d, h [1] , and h [2] each one plotted vs time for academic music.There seems to be a tendency to lower the value of those variables with time.But the evident increase of the dispersion of these indexes, hides the overall change over time of academic music's entropy.Yet, when the three properties d, h [1] , and h [2] form a joint view and time is a parameter, a clustering migrates from an extreme position to another emerges from the graphs (Figure 5 and 6).Suggesting that the combination of the properties d, h [1] , and h [2]   offer a good basis to build a space where the music style can be recognized.

Conclusions
The texts produced with music coded by the MIDI synthesizer, are susceptible to be analyzed using symbolic diversity and entropy as variables which can be used to characterize music type, and even more subtle properties, as style.The inclusion of higher order entropies accentuates the detectable differences between music styles.
We did not use any knowledge of the mechanisms of the MIDI coding process.We started looking at file texts that seemed to be totally meaningless and not decipherable.Discovering the set of fundamental symbols for each music text description we found several important facts: 1: There is a fundamental symbol set that describes each piece of music.2: The Fundamental Scale concept, presented in former works, is useful for determining the set of fundamental symbols of machine-coded texts, as MIDI-music text descriptions.3: The scale downgrading method proposed allows for comparison of properties of systems of different nature and at different scale.
By applying the Fundamental Scale Algorithm, we have gone beyond the theoretical considerations about the Minimal Description Length Principle.We built frequency symbol profiles which work as quantitative descriptions for several hundreds of MIDI-music pieces.Due to the shapes of these profiles, which are practically unique, these profiles represent a sort of 'signature' of the complete polyphonic sound of each musical piece, with all its subtleties and complexity.
After comparing our results for musical pieces according to their music style and period of time, we can affirm that the method works as a consistent procedure to visualize and to classify music styles and to quantify differences among them.Due to the shapes of the clusters representing each type of music, which are far from-spherical, we did not attempt to create probability fields for each type of music in the space diversity-entropy.However, we foresee the possibility for handling transformations to the shape of the space d, h [1] and h [2] , to achieve the conditions required for a reasonable separation of these clusters, or alternatively, to estimate the probability associating each location in that space with each type of music.But that would lie within the scope of a future work.For the time being, locating text descriptions in the space specific diversity, entropy and 2nd order entropy, presents as a promising tool for classifying MIDI-music descriptions, with applications in many research fields as quantitative linguistics, pattern recognition, and machine learning.
Music is a reflex of social and cultural likes.We have strived to compare music styles over a quantitative basis.Our results reveal that for all the indexes used to characterize musical genres and styles, there is an increasing dispersion over time; perhaps the image of a society constantly committed to overcome any cultural barrier, thus making music an expanding phenomenon which grows in any direction of the space we use to observe it.This novel quantitative way of analyzing music might eventually allow us to gain a deeper insight into the musical structures that elicit emotions, illuminating the working of our brains and getting a better handle on music.

Acknowledgments
We  To differentiate these two entropy calculations, we will call this first order entropy, or simply, entropy.We refer to the newly created concept as the second order entropy.For an ordered probability distribution profile, its first order entropy of is sensitive to its overall shape.Since any change of the profile slope needs to run along a wide range of the horizontal axis in order to impact the weighted area calculation, local changes in the profile slope are not effectively captured with the entropy.Second order entropy, on the contrary, is an index that focuses in the gap between the ordered symbol frequency distribution and the reference Zipf's distribution, it senses therefore the shape of the oscillations of the symbol probability profile.
To obtain a measure sensitive to small oscillations -or slope changes-we focus the distance E between the symbols probability and the imaginary perfect Zipf's distribution zi that best fits the profile subject to study.The distribution zi is calculated as follows: Where g is the Zipf's distribution slope and k is a real number to stablish the starting point on the Zipf line for the first ranked symbol.Notice that k is not necessarily equal to p1, as is usually presented.Here the value of k have to be adjusted to lead to a unitary area under the Zipf's distribution.The distance Ei between a symbol probability pi and the imaginary Zipf's distribution zi is presented as a one-dimensional array.
As depicted in Figure 1, the size of these deviations around the Zipf's profile can define a new language: the second order language.To obtain the 2 nd order language we need to define the smallest Emin and the largest Emax and a resolution q to establish the size of the bands to classify the symbols between the values of Emin and Emax.After some arithmetic, these band boundaries can synthetized as the one-dimensional array B as: Vectors and distributions associated to an order u are represented using a supra-index enclosed by squared brackets.The transition matrix U to relate the distribution at order u with the distribution at order u-1, is represented using the supra-index formed by the supra-index [u, u-1].The symbol probability distribution associated to the 2 nd order language is represented by array P [2] and obtained as indicated by Expression (12).
In general, specifying the desired resolution at some distribution order qu the distribution of any order u can be obtained starting from the preceding order u-1 as:

Appendix C. Math formulation for Scale Downgrading
The frequency profile associated to a complex language is a representation of the language.In a language made of D different symbols, this representation uses D values to describe the language.The graphical representation of these values is useful because it permits to observe an abstract depiction.Depending on the level of detail the observer intends to appreciate, the D values may or may not be needed.If for some purpose a rough idea of the profile's shape is sufficient, a smaller number of values can be used.If on the contrary, the observer needs to detail tiny changes in the profile, a higher density of dots will be required to draw these changes of direction.Changing the number of symbols used to describe a system constitutes a change of the scale of observation of the system; thus we refer to the process of reducing the number of values used to draw the frequency profile as downgrading the language scale.
Consider de language B as a set of D different symbols.If language B is employed to build a N (C3)

Figure 1 .
Figure 1.Diversity as a function of piece length measured in symbols for different classes of music.

Figure 2 .
Figure 2. Entropy as a function of specific diversity for different classes of music.

Figure 3 .
Figure 3. Variation of frequency profiles for several degraded scales and Information profiles calculated for Hindu-Raga.Miyan ki Malhar.

Figure 4
Figure 4 shows the symbol frequency profiles computed for our sample of impressionistic music; Graphs (a) and (b) show first and second order symbol profiles correspondingly.Frequency profiles computed for all the groups of music contained in our data set are included in Appendixes F and G.All frequency profiles in Appendix F were computed at a scale or downgraded diversity D=129, using the numeric values of the probability of each symbol and each style of music, which are included in Appendix F. The 2 nd order frequency profiles shown in Appendix H were all computed at a downgraded diversity D=33.

Figure 4 .
Figure 4. Symbol ranked frequency profiles for registered impressionistic music.Graph (a.Left) shows the traditional symbol profile.Graph (b.Right) shows the profile for the 2 nd order symbols.
J and K show the average values of the same properties, but this time, computed for sets of musical pieces grouped according to Music type and composer, thus, in these Figures each bubble corresponds to a different music period/styles or a composer.Three views of the same 3D plot are presented.

Figure 7 :
Figure 7: Variation of 2 nd order entropy over time for several types of music.
illustrates how the point clusters for different types of music, tend to group around different lines, leading to different averages of specific diversity d as shown in Tables 2 and 3.The value specific diversity measured for individual pieces ranges from 0.0183 (Academic: Impressionistic: RAVEL.Maurice, Bolero2) to 0.1341 (Academic: Romantic: SAINTSAENS.Camille: CarnavalDesAnimaux: 08.PersonnagesLonguesOreilles).Complete set of values can be found in the link signaled in Appendix A.

Figure B1 .
Figure B1.Typical symbol ranked probability profile with examples of 2 nd order symbol bands.Each dot represent the probability of finding a symbol within all the symbols forming a system description.1 st order symbols are ranked according to their probability of appearance.The most common symbol appears in first place (r = 1) the least frequent symbols appear at the end or tail of the ordered probability distribution representation (r = D).
symbol long system description, then language B can be specified as the set of D symbols Yi and the probability density function P(Yi) which establishes the relative frequencies of appearance of the symbols fi.Thus = { , … , , … , , ( )} , this point language B is presented at scale D. To include the observation scale of a language as part of the nomenclature, we propose adding a sub-index to the letter representing the language.Then, language B at some scale S, where 1≤ S ≤ D, would be denoted as B[S].When the index does not appear, it can be assumed the language is expressed at its original and maximum scale.That is B = B[D].Downgrading a language from scale D to scale S can be performed by pre multiplying vector P with transformation matrix G, as indicated below:[ ] = [ , ] • [ ] .

Table 1 .
Music classification tree MusicNet, and the data associated to top levels of the tree.
Type Period/Style Region Genre Com posers Pieces Ave.Std.Dev.Ave.Std.Dev.Ave.Std Dev want to thank those musicians and enthusiasts who produce several web sites where MIDI sequences of several kinds of music are available, accompanied with additional information presented in well-organized sites.Here we explicitly acknowledge them: midiworld.com,gregorypino74.jimdo.com/partituras-instrumentales.classicalarchives.com/midi.html,cse.iitk.ac.in/users/tvp/music/, faculty.pittstate.edu/~ilia/music/Mchinese.html, venezuela.ch .