Musicology

Musicology with LaTeX

Musi­col­o­gists have a hard time — name­ly if they want to enrich their LaTeX texts by score exam­ples and har­mo­ny analy­ses. Up to now, there did not exist any study of whether and how that could be real­ized with free soft­ware. This arti­cle sum­ma­rizes a Ger­man-writ­ten self-ref­er­en­tial tuto­r­i­al teach­ing what’s pos­si­ble and what is not with respect to LaTeX and Musi­col­o­gy:

Repos­i­to­ry Musi­col­o­gy with LaTeX

[ en | de ]

How it started

In the begin­ning, there was my task to write a musi­co­log­i­cal work. I had already explored and doc­u­ment­ed how one can write human­is­tic texts with LaTeX. proScienta.ltx — a project ‘host­ed on GitHub‘ — cov­ered the results, a for­mer ver­sion was labeled ‘myC­srf’. Their spe­cif­ic inten­tions have been described in a sophis­ti­cat­ed Ger­man tuto­r­i­al and in a short­er Eng­lish ver­sion.

Nev­er­the­less, I did not know how one could gen­er­ate musi­cal exam­ples with free soft­ware and embed them into LaTeX texts. The first rough inter­net recherche pre­sent­ed a lot of tools and meth­ods but did not pro­vide any man­u­al. It did not deliv­er any expli­ca­tion on how to suc­cess­ful­ly com­bine which tools and did not find any tuto­r­i­al on how one could link notes and har­mo­ny analy­ses.

So, I post­poned my orig­i­nal task and exam­ined the top­ic LaTeX and Musi­col­o­gy: I pre­ferred to know the best method before I start­ed to not back the wrong horse. Final­ly, my inves­ti­ga­tion was doc­u­ment­ed in a larg­er text: It reviews small­er tools, describes usable back­end sys­tems, dis­cuss­es fron­tends, tests con­vert­ers and deliv­ers a map of con­ceiv­able and real­ly pos­si­ble tool­chains.

mwm logo

As usu­al, I have pub­lished the sources of the eBook LaTeX und Musik­wis­senschaft as open-source-soft­ware. Addi­tion­al­ly, I have uploaded the com­piled pdf-file ‘Musik­wis­senschaft mit LaTeX’. The point is, that this inves­ti­ga­tion back­hand­ed­ly became a self-ref­er­en­tial tuto­r­i­al that explains, what it shows. This arti­cle sum­ma­rizes the core results of that study

Backends

We know three free back­end sys­tems for embed­ding scores into LaTeX texts: the ABC nota­tion method, Musix­TeX, and Lily­Pond. All these tech­niques cre­ate well-read­able scores. But Lily­Pond has the edge over the oth­ers.

The ABC back­end — as well as the Lily­Pond back­end — cre­ates pic­tures of scores that are embed­ded into the LaTeX text as graph­ics. Hence, it is sys­tem­at­i­cal­ly not pos­si­ble to com­ment or mod­i­fy the exam­ples on the LaTeX lev­el. Both back­ends use a sim­ple rep­re­sen­ta­tion lan­guage. But again, the Lily­Pond lan­guage is a bit smarter. And both back­end sys­tems only allow inte­grat­ing sim­ple har­mo­ny analy­sis sym­bols into the scores. They do not offer a method to rep­re­sent com­plex har­mon­ic rela­tion­ships on a lev­el that ful­fills the needs of musi­col­o­gy.

The alter­na­tive — Musix­TeX — works dif­fer­ent­ly: It rep­re­sents the notes on the LaTeX lev­el. That allows, to com­ment and improve the scores by LaTeX-based sym­bols. This capa­bil­i­ty is used by the LaTeX pack­age har­mo­ny. It offers the pos­si­bil­i­ty to inte­grate very sophis­ti­cat­ed sym­bols into the music score. But one has to pay a heavy price for using the method with its ele­gant results: the syn­tax of Musix­TeX is so com­plex and unwieldy, that it decreas­es the pro­duc­tiv­i­ty of its users.

Hence, the sit­u­a­tion was a bit incon­ve­nient, even if one only con­sid­ered the back­end sys­tems: A musi­col­o­gist had either to keep in mind, that he would need a lot of time to cre­ate his exam­ples. Or he could use a sim­pler rep­re­sen­ta­tion lan­guage and had to refrain from using the sym­bols his pro­fes­sion required

A way out

I could not accept one of these posi­tions. There­fore I inter­rupt­ed my run­ning inves­ti­ga­tion and devel­oped a library, which should at least be able to do that for Lily­Pond, what har­mo­ny did for Musix­TeX. Con­sis­tent­ly, I named it harmonyli.ly. As usu­al, I pub­lished harmonyli.ly as open-source soft­ware, cre­at­ed a harmonyli.ly inter­net page, and wrote a com­plete harmonyli.ly tuto­r­i­al. So, the method LaTeX + Lily­Pond + harmonyli.ly became a real alter­na­tive to LaTeX + Musix­TeX + har­mo­ny. Here comes the first exam­ple that indi­cates the poten­tial of harmonyli.ly:

an example cadence

Thanks to the help of the Lily­Pond com­mu­ni­ty, harmonyli.ly has become a tool for musi­col­o­gists, which func­tion­al­ly exceeds har­mo­ny and is doc­u­ment­ed on a lev­el, which eas­es its use.

Frontends

Musi­col­o­gists are also musi­cians; they pre­fer to read and write scores instead of hav­ing to deal with spe­cial rep­re­sen­ta­tion lan­guages. There­fore, I want­ed to learn, which fron­tend sys­tems resp. edi­tors could cre­ate input for which back­end sys­tem. An inter­net query pro­vid­ed a bunch of can­di­dates. I test­ed the rel­e­vant items with respect to their avail­abil­i­ty and usabil­i­ty. In the end, 7 can­di­dates remained: EasyABC, Den­emo, Rosegar­den, Mus­eScore, Canorus, Fres­cobal­di, and Ely­si­um. But at last, I found that

  • only the semi-graph­i­cal edi­tors Fres­cobal­di and Ely­si­um could direct­ly and suc­cess­ful­ly deal with Lily­Pond and harmonyli.ly
  • there did not exist a fron­tend for Musix­TeX — nei­ther direct­ly, nor indi­rect­ly by using a con­vert­er
  • one could use Mus­eScore as a graph­i­cal edi­tor for Lily­Pond if one accept­ed to export the results as MusicXml, to con­vert that result by using musicxml2ly, and to sub­se­quent­ly insert the har­mo­ny analy­sis sym­bols via Fres­cobal­di or Ely­si­um

Conclusion

So, final­ly, I met a very reduced result — even if I con­sid­ered the exis­tence of con­vert­ers:

  • In the end, one can­not set up an ABC based tool­chain for inte­grat­ing music exam­ples into LaTeX texts.
  • The advan­tage of the method LaTeX + Musix­TeX + har­mo­ny is its seam­less inte­gra­tion into the LaTeX envi­ron­ment and the pos­si­bil­i­ty to enrich the sym­bols by LaTeX syn­tagms.
  • The dis­ad­van­tage of the method LaTeX + Musix­TeX + har­mo­ny is the com­plex­i­ty and the unhandi­ness of Musix­TeX. That there does not exist any spe­cif­ic (graph­i­cal) Musix­TeX edi­tor does not sim­pli­fy the world.
  • The dis­ad­van­tage of the method LaTeX + Lily­Pond + harmonyli.ly is that the scores are only embed­ded as pre­pared images. There­fore, one has sep­a­rate­ly to con­sid­er the intend­ed res­o­lu­tion and scal­ing.
  • But there are sev­er­al advan­tages of the method LaTeX + Lily­Pond + harmonyli.ly:
    • The syn­tax of Lily­Pond is obvi­ous­ly more sim­ple than that of Musix­TeX.
    • Fres­cobal­di is an excel­lent semi-graph­i­cal Lily­Pond edi­tor.
    • Ely­si­um is an excel­lent Eclipse-based Lily­Pond edi­tor.
    • In the future, Canorus could become the third edi­tor.
    • Those, who need a graph­i­cal edi­tor, could use Mus­eScore, if they agree to export and con­vert their work and inte­grate the har­mo­ny analy­sis sym­bols in a sec­ond step.

Consequences

Hence, it should be clear, what I will use when I will start my task, which stood at the begin­ning of this adven­ture: I will use LaTeX + Lily­Pond + harmonyli.ly.

Over­all, I am hap­py that I could flood­light the jun­gle of oppor­tu­ni­ties pro­vid­ed by the inter­net and that I found real­ly usable ways. Now I know, what’s going on. And I need not fear that I could have to change the horse dur­ing my ride and lose results that I’ve cre­at­ed as part of the process.

But I wished, I had got this study by anoth­er guy instead of hav­ing to write it by myself. That would have saved a lot of time. Thus, I hope, that oth­ers can use my pre­work and spend the time they gain on more pro­duc­tive aspects of their life.


And in what way is this …

… arti­cle relat­ed to the top­ic ‘Sci­ences’? To write human­i­ties papers (on Lin­ux), you need an appro­pri­ate sci­en­tif­ic LaTeX frame­work. For papers on musi­col­o­gy in par­tic­u­lar, sci­en­tif­ic texts must be expand­ed by music exam­ples — most­ly writ­ten with Lily­Pond and its libraries. That is the top­ic also this post wants to sup­port.


To top