TOWARDS THE DIGITAL ENCODING OF HISPANIC WHITE MENSURAL NOTATION HACIA LA CODIFICACIÓN DIGITAL DE LA NOTACIÓN MENSURAL

In this work, the elements necessary for digitally encoding music contained in manuscripts from the centuries 16th to 17th are introduced. The solutions proposed to overcome the diffi culties that generate some of the aspects that make this notation different from the modern Western notation are presented. Problems faced are, for example, the absence of bar lines or the duration of notes that are based on the context. The new typographic font “Capitán”, created specifi cally to represent this type of early notation, is also presented.


INTRODUCTION
Three ways of generating new content for the global musical corpus can be distinguished: a) the creation of original music by composers; b) the review by musicologists of previous musical editions or known manuscripts; and fi nally, c) the result of the study by musical paleographers of unpublished manuscript or printed material that, after transcribing it to modern musical notations, make that content accessible to any interested musician.According to Strayer1 , "New things are often viewed as being better and more advanced than older counterparts; however, new does not denote superior."In this work we are going to focus on this last type of musical production: that obtained from the analysis by musical paleographers of unpublished works.
Musical notation has evolved over the centuries to become one of the various musical writing systems commonly used today, such as modern Western notation or poly phonic instrument tablatures2 .In general, most of the original material of each period is written according to the rules considered valid at that time.Thus, omitting aspects such as harmony and taking into account only the notation, it could be said that almost any occidental musical work would be written in pneumatic notation, in mensural writing, or in modern notation.However, the evolution inherent in any language, and in particular music, entails changes in its notation, which is progressively assimilated.For that reason, it is possible to fi nd scores that do not fully comply with the norms dictated by the treatises which in each period have guided composers and musicians.This is what happens in the white mensural notation of the Hispanic territories between the 16th and 18th centuries.Being a notation that shares many elements with the "international" white mensural notation used in previous centuries in the rest of Europe, it has many details that make it very different 3 .
Currently there is no software system or computational proposal capable of encoding and representing this type of particular notation.This is due mainly to the fact that there are not too many specialists capable of correctly interpreting this type of source and because most of the available content is handwritten, leading to a great variability in the symbols and styles used.A misinterpretation of a symbol can lead to a major change in the musical content.It is necessary, therefore, the use of an interactive editing system capable of assisting the musicologist in the transcription of this type of music when dealing with a large volume of manuscripts.
In this paper, we introduce the necessary elements to build a computerized notation system to digitally transcribe digitally written musical manuscripts in Hispanic white mensural notation from the 16th to the 18th centuries, and we present the proposed solution to address some of the aspects that make this notation different to Common Western Music Notation (CWMN)4 , such as the absence of dividing lines.Our proposed system architecture is depicted and early prototypes of each module are described.Namely, a software score editor able to deal with the specifi cs of this notation, a digital typographic font developed on purpose for being included in the score editor software, created from original manuscripts to visually communicate the rhythmic dimension of music in the same way as original manuscripts, and a mensural to modern notation transducer.
This article is organized as follows: in the next section we briefl y introduce the basic and most common elements of the notation that will be found in the target manuscripts.Next, we present the architecture of the system and detail each of its parts.Finally, we will show a small example of transcription and conclude by indicating some future lines of work.

Basic elements of Hispanic white mensural notation
This section is not intended to be an introduction to white mensural notation because it is too complex to be summarized in a few short lines.The reader is referred to the books by Rubio5 and Ezquerro6 .We will only present here the basic elements to understand the operation of the transcription system.Notation cannot be isolated from the context in which it served7 .It is necessary to know the context in which the specifi c musical notation is used to be able to understand the reason of some practices that we are going to review.

Context
It is necessary to defi ne the context from several points of view: political/religious, geographical, and historical.Regarding the fi rst one, we are dealing with written music between the 16th and 18th centuries.At that time, although tending to decay, Spain is the center of the greatest empire of the time comprising, in addition, part of the Iberian peninsula, the overseas territories in America, the Philippines and several European countries (Flanders, Naples...).Religion, in particular the Catholic one, is part 295 In Spain and its territories, most of the music is created to be used in the various daily religious services.The chapel master must create a composition, which may be original, for each of those services.Since paper is expensive at the time, a wooden board is frequently used where the composer registers the fi rst stage of his musical composition: tabula compositoria (see Figure 1).From it, the parts are copied in papers, that are then distributed to the different voices and instruments of the musical chapel (Figure 2).It is important to note that in many cases this task is carried out by boys whose voice is changing and not being useful to sing, they work during that period as copyists until they qualify for a position as a professional musician by opposition.Thus, with a large number of manuscripts to copy, and even though they usually are suffi ciently trained for the musical reading, they introduce errors in the copy that is the one that survives in our days.of the politics at that moment.Thus, the Catholic Church is an essential pillar in the sociopolitical organization of the time, which is the one that demands the service of musicians and, therefore, sponsors most of the musical creation.In the rest of Europe it is the civil aristocracy (the nobility courts) that overwhelmingly sponsors composers and musicians for their social, commercial, and political purposes.
Conversely, in the rest of Europe, written music was mainly distributed through printed copies (see Figure 3).
There are, therefore, two basic differences between the content of the Spanish manuscripts and the printed ones of the rest of Europe: the frequency in the appearance of errata in notation and the diversity of stylistic elements.Carrying on with the problem contextualization, the second aspect to take into ac-count is the historical one.We can establish some fundamental milestones in the evolution of written music.Without going back to early notations such as Greek alphabetic one, we establish as a starting point the pneumatic notation, which emerged at the end of the fi rst millennium as a mnemonic technique to remind the singers of the melodic outline and heights of a musical piece, mainly monodic and with a rhythm determined by the prosody of Latin language.Since rhythm is given by the underlying text, it is not necessary to explicitly represent it in the notation.
With the birth of vernacular languages and their use as text in sung works replacing the Latin text, which had a known fi xed rhythmic structure, the need of representing explicitly the rhythm in musical notation with text in romance arises.Polyphony (which does not always run homophonic) appears, that requires some way of voice alignment.As a means of accommodating these requirements, mensural notation is developed, where the different fi gures already have a rhythmic duration meaning.At that time it was not usual to use bar lines.Finally, according to the specifi c needs of the music language evolution, the modern Western notation nowadays used, emerged.
The notation we deal with in this work is situated in the last times of the mensural notation.Being a handwriting made in the religious context, it is usual to fi nd in the manuscripts elements of pneumatic notation widely extended as religious notation, and in the later manuscripts, elements of modern notation.

Rhythmic notation
Next we will briefl y introduce some basic concepts of the metric used in Hispanic mensural notation.As we have already pointed out, we will only present those concepts necessary for the comprehension of the transcription system8 .
In this type of notation, there is no visual horizontal subdivision in bars, so no bar lines are found.However, we do have a mensuration sign (currently known as meter signature) that initially determines the duration relationships that the fi gures represented in the score will have (see Figure 4).and imperfect.Perfect when they are equal to thirds of those immediately superior in length and imperfect when they are equal to halves.The perfection can be determined by the mensural sign, by the onset time (if it is a syncopation or not) and, above all, by the context in which we fi nd the note (by its positioning with respect to other surrounding fi gures).Perfection or imperfection determines the actual duration of the current note.As guidance to the player, and following very specifi c rules that are not always (although almost systematically) fulfi lled, the heads of the notes are colored in a practice called blackening (see Figure 5).In short, it can be said that every blackened or colored fi gure has become imperfect, that is, they are equivalent to two of the fi gures immediately inferior in value, and void fi gures, those not colored, remain perfect lasting three fi gures immediately inferior in value.
As an example, in the case of a minor proportion mensural sign, a semibrevis fi gure that onsets on time (see Table 1), if followed by another semibrevis, it will be perfect (that is, it will equal three minims) and therefore, it will not be colored.The fact that this semibrevis is perfect implies T OWARDS THE DIGITAL ENCODING OF HISPANIC WHITE MENSURAL NOTATION 297 that it should last the equivalent of three minims.If, on the other hand, it appears after a minim, both the minima and the semibrevis will be blackened, both imperfected, so that the semibrevis will have the duration equivalent to two minims (Figure 5).

Objective
The aim of this work is to defi ne some of the necessary tools to, eventually, develop a full-fl edged score editor that will assist the transcription of Hispanic music from the 16 th to the 18 th centuries in mensural notation, and create some proof-of-concept prototypes that demonstrate the suitability of the proposal.Specifi cally, these tools must be able to faithfully capture the musical content, respecting the different stylistic variants and helping to annotate and correct errors of the manuscripts themselves.Finally they should be able to assist in the transcription of the mensural notation to a modern notation.
To achieve this goal there are several obstacles to be overcome, such as the fact that there are so many calligraphic styles as scribes, that we will fi nd elements of ancient and modern notation embedded in the mensural manuscripts.Other problems such as the physical defects of the source, in which we will sometimes fi nd holes, ink spots or, on the contrary, absence of pigment that make diffi cult the identifi cation of the written elements, will not be approached in this work.

Background
Currently the transcription of handwritten fonts in Hispanic mensural notation is being performed by editing commercially available publishers such as Sibelius9 and Finale10 , to later edit the image that is generated after the score is printed11 .
Regarding the transcription of early printed sources to digital formats in which the musical information is codifi ed, as far as we know, only three works can be found in the scientifi c literature.The fi rst, and oldest, is the one done since 1984 at the University of Melbourne and the University of La Trobe in Australia with the Scribe system12 .Being the initial aim of this project the encoding of medieval music in pneumatic notation, it evolved to allow the edition of French and Italian mensural notation from the beginning of 15 th century.
The Computerized Mensural Music Editing (CMME) project, currently housed at Utrecht University13 , aimed at digitally editing printed works of Dufay, Josquin, Machaut, Palestrina and Tallis.Finally, focusing on the same type of repertoire printed, the most recent contribution we can fi nd is the project Aruspix14 , which aims to have a means to obtain the musical content from images of the scores in what is called OMR (optical music recognition).None of the above systems focuses their attention on the period or the specifi c notation we deal with in our work.

PROPOSED SYSTEM
The representation and edition of scores by computer has been taking place for decades 15 .In general, a score editor requires algorithms to properly distribute elements in space 16 , a musical typography (except in the case of an old score editor named SCORE that draws geometric objects), and computational musical models that guide the action of the user when introducing or editing musical contents (Figure 6).
Besides the universally extended applications such as Finale and Sibelius, there are non-commercial initiatives that allow high-quality music engraving (Lilypond)17 , Verovio) 18 or the interactive edition of modern Western notation (Musescore) 19 .However, none of the available options is ready to work with the type of notation that concerns us in this work.For this reason, we have opted to develop a prototype of score editor on purpose that allows us to digitize the contents in Hispanic manuscript mensural notation.
The prototype has been developed using the JavaFX 8 language20 .For the graphical representation of the scores, the algorithms described by Bellini have been used21 .The specifi c components not available in any other score editor are the contribution of this article.
Above we mentioned that, in general, the perfection of the notes and their coloring are guided by rules of common use established in theoretical treatises of the time, but nevertheless, we found many inconsistencies in the manuscripts with those norms that could be errata or, on the other hand, could be given by a misunderstanding by the com-poser or the copyist, or perhaps by the simple evolution of the written musical language.In order to allow the score editor to support this type of abnormality, the computational musical model, initially constructed from the theoretical norms of musical mensural writing, is also capable of learning from the user's action.

Typographic font: Capitán
The typographic font initially named Solera22 and renamed as Capitán in honor of master Romero or Maestro Capitán, chapel master of the court of Felipe III and Felipe IV, intends to recall the essence of the original manuscripts, while being readable and elegant.For this, an analytical study of the elements that compose the Hispanic mensural notation on original manuscripts is made by extracting the different glyphs to be designed (see Figure 7).

299
The computer design of these symbols can be done in two different ways.The fi rst one is using a raster design program, in which the color information of every pixel is stored 23 .In this case, a possibility to recreate the symbols of musical notation is to photograph or digitize using a scanner a representative sample of each one and, after retouching the image to remove elements such as the lines of the staff, leave that symbol isolated.The problem with this option is the low versatility of the fonts thus created to be resized resulting in glyphs with little sharpness and quality.
The second option is to use a vectorial design application, in which what is represented is the geometry and constituent elements of each symbol, that is, its shape represented by points that delimit lines, the curvature of the arcs, the thickness of the lines along the path, and the color of each part of the shape.Fonts created in this way do not deform or reduce their quality after being resized.This is the preferred way to create typographic fonts and the one we use to create Capitán.
To be able to draw each of the glyphs that make up the font, a process of measurement and analysis of the behavior of the symbols is done (Figure 8).After selecting the best combination of quill, line, ink and color, as shown in the fi gures, all the symbols that will make up the font are drawn in sheets of paper with multiple variations of each one (see an excerpt in Figure 12) to later choose a representative of each symbol to be vectorized 24 (Figure 13).Once all symbols in vector format are available, the base elements of the font are defi ned (Figure 14) and the digital typography is created with a specifi c application (see Figure 15).Most computer score editors use computer typographic fonts to represent music symbols.Each symbol must be assigned a code.In regular text fonts such Arial, the code 'a' is assigned to the glyph that represents that letter, etc.In the case of non-Western fonts, such as Chinese, or in music fonts Unicode25 is used to index glyphs.Nowadays, de facto standard in the industry and scientifi c community of Musical notation is the Standard Music Font Layout (SMuFL) 26 .For the kind of symbols present in that catalogue, such as semibrevis, clefs, dots, we have used the Unicode in SMuFL.For glyphs not available in SMuFL, an ad-hoc code has been given.

Computational musical model
There are two elements that make the correct interpretation of his handwritten Hispanic notation particularly diffi cult.The fi rst is what is named semitonia subintelecta, whereby the pitch of the notes in the score may require an interpretation of the musician so that, according to the context, some unwritten alteration is added.This work does not include yet the treatment of this problem.The second element to take into account is the correct interpretation of the durations of the written elements, which also depend on the context.In order to be able to model it computationally, a weighted fi nite state transducer (WFST) has been used27 .
Formally, a weighted fi nite-state transducer is an 8-tuple T = (Σ, ∆, Q, I, F, E, F, λ, ρ) where Σ is the input alphabet to the transducer; ∆ is the output alphabet; Q is the fi nite state set; I ⊆ Q is the initial state set; F ⊆ Q is the fi nal state set; E ⊆ Q × {Σ ∪ ε} × {∆ ∪ ε} × Q a fi nite transition set; λ : I → N the initial weight function; and ρ : F → N the fi nal weight function.For the translation of the metric dimension of the mensural notation to a modern notation, the following transducer was constructed: Σ = {maxima, longa, brevis, semibrevis, minima, seminima, fusa} x {void, colored} Δ = {whole, half, quarter, 8 th } x {tied, ε} x {dot, ε} Q = {1; 2; 3} x {half, colored} x {1; 2; 3; 4} ∪ {SBVP} I = {half : 1 : 0} F = {Q} K = N, is the number of times each edge is visited The initialization of the WFST has been done through an algorithm that generates all the possibilities of transition in function of the valid sequences of void and coloured fi gures based on the rules given by the writers of the time and the criteria for their transcription as Detailed in Ezquerro's book 28 , setting all initial weights λ and ρ to 1.
Figure 16 shows an extract of the transducer.For each time and subdivision of the meter (not represented graphically by bar lines but will be used for translation to modern notation) we have two nodes, one for the void fi gures (or white represented by W in the graph) and another for the colored (or black represented by a B).An additional node has been added for the perfect semibrevis (SBVP).The 28 EZQUERRO ESTEBAN (2009).
edges represent the possible fi gures that we can be found, given a coloring and a subdivision of a given meter.The following format is shown in the graph: <input> / <output> #n @ <instances>, where <input> is one of the possible mensural fi gures, colored or void, <output> is a fi gure in modern notation (possible dotted or tied), #n is the number of times this edge has been visited, which gives the idea of the importance of that sequence, and <instances> is a list of indices that indicates, for a given work, the positions in the input musical sequence where the edge has been visited (the latter element is not defi ned in the WFST but it is a useful information for its practical application).The transcription process is done by visiting the successive edges, guided using the nodes representing times and colorings.Thus, with a note in a given time, we know whether its fi gure and coloring are correct or not, if there is an edge that starts from the node in which we are that is labelled with that fi gure and coloring.If the input is correct, the translation to modern notation is accomplished just by copying to the output the fi gure in modern notation the edge 303 is labelled with.If no edge for that fi gure and coloring is found, the system should ask the user if it has to be corrected, and a descending frequency order list with mensural fi gures that start from the current node is shown (see Figure 17).If instead, the user prefers to accept the input, the graph will be added a new edge, allowing this way the model to learn from the user action (the user may want to correct the previous note, what represents exactly the same situation we are describing).

TRANSCRIPTION EXAMPLE
Using this system, the transcript of the manuscript shown in Figure 18 29 is shown in Figure 19.29 EZQUERRO ESTEBAN (2000).

CONCLUSIONS AND FUTURE WORKS
In this paper we have introduced the fi rst results of an ongoing project for the transcription of manuscripts whose notation is different from the modern one.The translation is solved by using a simple computational learning model and a typographic font designed on purpose to represent the essence of the calligraphy of the Hispanic mensural notation of the centuries 16 th to 18 th .
Being a work still active, there is still much work to be done, such as the treatment of semitonia subintellecta, the completion of all possible symbols, even infrequent ones such as ligature, and exporting to music exchange fi le formats.

ACKNOWLEDGEMENTS
This project has been fi nanced by the Ministry of Economy and Competitiveness project with the name TIMuL (TIN2013-48152-C2-1-R).

Figure 4 .
Figure 4. Common mensuration signs Figures are divided intoperfect and imperfect.Perfect when they are equal to thirds of those immediately superior in length and imperfect when they are equal to halves.The perfection can be determined by the mensural sign, by the onset time (if it is a syncopation or not) and, above all, by the context in which we fi nd the note (by its positioning with respect to other surrounding fi gures).Perfection or imperfection determines the actual duration of the current note.As guidance to the player, and following very specifi c rules that are not always (although almost systematically) fulfi lled, the heads of the notes are colored in a practice called blackening (see Figure5).In short, it can be said that every blackened or colored fi gure has become imperfect, that is, they are equivalent to two of the fi gures immediately inferior in value, and void fi gures, those not colored, remain perfect lasting three fi gures immediately inferior in value.As an example, in the case of a minor proportion mensural sign, a semibrevis fi gure that onsets on time (see Table1), if followed by another semibrevis, it will be perfect (that is, it will equal three minims) and therefore, it will not be colored.The fact that this semibrevis is perfect implies Figures are divided into perfect and imperfect.Perfect when they are equal to thirds of those immediately superior in length and imperfect when they are equal to halves.The perfection can be determined by the mensural sign, by the onset time (if it is a syncopation or not) and, above all, by the context in which we fi nd the note (by its positioning with respect to other surrounding fi gures).Perfection or imperfection determines the actual duration of the current note.As guidance to the player, and following very specifi c rules that are not always (although almost systematically) fulfi lled, the heads of the notes are colored in a practice called blackening (see Figure5).In short, it can be said that every blackened or colored fi gure has become imperfect, that is, they are equivalent to two of the fi gures immediately inferior in value, and void fi gures, those not colored, remain perfect lasting three fi gures immediately inferior in value.As an example, in the case of a minor proportion mensural sign, a semibrevis fi gure that onsets on time (see Table1), if followed by another semibrevis, it will be perfect (that is, it will equal three minims) and therefore, it will not be colored.The fact that this semibrevis is perfect implies

Figure 7 .
Figure 7. First classifi cation of symbols to be designed

Figure 16 .
Figure 16.Part of the fi nite state weighted transducer.

Figure 17 .
Figure 17.The system prompts the user for a possible correction.