{"id":1105,"date":"2017-07-20T13:07:10","date_gmt":"2017-07-20T12:07:10","guid":{"rendered":"http:\/\/michael-edwards.org\/wp\/?p=1105"},"modified":"2017-10-18T13:11:37","modified_gmt":"2017-10-18T12:11:37","slug":"musicxml-output-from-slippery-chicken","status":"publish","type":"post","link":"https:\/\/michael-edwards.org\/wp\/?p=1105","title":{"rendered":"MusicXML output from slippery chicken"},"content":{"rendered":"<p>Back in 2011, after several years of using either<em>\u00a0<a href=\"https:\/\/ccrma.stanford.edu\/software\/cmn\/\">CMN<\/a>\u00a0<\/em>or <em>Sibelius<\/em> (the latter via MIDI file import), I was considering alternative score output formats for my algorithmic composition software\u00a0<a href=\"http:\/\/michael-edwards.org\/sc\"><i>slippery chicken<\/i><\/a>. With its 3.0 version status that year,\u00a0<a href=\"http:\/\/www.musicxml.com\/\">MusicXML<\/a>\u00a0was showing maturity and was definitely a contender for\u00a0<i>slippery chicken<\/i>\u00a0output. After playing around with mainly <em>Sibelius&#8217;s<\/em> MusicXML import functionality, however, I gave up on the idea. Though MusicXML could and still can capture microtonality and many other weird and wonderful things that go way beyond what MIDI can encapsulate, <em>Sibelius<\/em> didn&#8217;t even notate quarter-tone accidentals, never mind various marks and now fairly standard note-heads that my scores required. So I passed, with a view to look again at some point in the future.<\/p>\n<p><a href=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/ko-lanta.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-1108 alignleft\" src=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/ko-lanta-1024x768.jpg\" alt=\"\" width=\"620\" height=\"465\" srcset=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/ko-lanta-1024x768.jpg 1024w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/ko-lanta-300x225.jpg 300w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/ko-lanta-768x576.jpg 768w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/ko-lanta-1536x1152.jpg 1536w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/ko-lanta.jpg 2000w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Instead of MusicXML I developed\u00a0<a href=\"http:\/\/lilypond.org\/\"><i>Lilypond<\/i><\/a>\u00a0output instead. I remember I&#8217;d taken off to South-East Asia for an extended coding retreat and to work on\u00a0<a href=\"https:\/\/michael-edwards.org\/wp\/?p=46\"><i>you are coming into us who cannot withstand you<\/i><\/a>\u00a0for\u00a0<em><a href=\"http:\/\/www.ensemble-aventure.de\/\">Ensemble Aventure<\/a><\/em>. I wrote the vast majority of the Lilypond-generating code in 3-4 days in Ko Lanta Old Town, a small village on an island in Southwest Thailand. My room was in a house on stilts jutting out to sea.<\/p>\n<p><i>Lilypond<\/i>\u00a0did and continues to do well for me and a number of other\u00a0<i>slippery chicken<\/i>\u00a0users. The PDFs generated by\u00a0<i>Lilypond<\/i>\u00a0are nothing short of astounding in fact, particularly when it comes to the automatic and almost flawless layout it produces. See below the last system of\u00a0<i>you are coming,<\/i>\u00a0for example, noting the perfect legibility, with no overlapping items despite attached multiline text and custom graphics attached to notes.<\/p>\n<p><a href=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/coming-last-sys.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1110\" src=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/coming-last-sys-1024x715.png\" alt=\"\" width=\"620\" height=\"433\" srcset=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/coming-last-sys-1024x715.png 1024w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/coming-last-sys-300x210.png 300w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/coming-last-sys-768x536.png 768w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/coming-last-sys-1536x1073.png 1536w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/coming-last-sys.png 1622w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Without this near-perfect layout generated by Lilypond I wouldn&#8217;t have undertaken my\u00a0<a href=\"https:\/\/michael-edwards.org\/wp\/?tag=hyperboles\"><i>hyperboles<\/i><\/a>\u00a0series of works. These pieces allow musicians to tweak various fundamental parameters of the generative algorithms to produce a custom score and electronics. Again, notice below the near-perfect layout along with the use of more custom but still algorithmically-placed graphics, colours, note-heads, etc. All of this is generated first by\u00a0<i>slippery chicken<\/i>\u00a0then auto-rendered by\u00a0<i>Lilypond<\/i>\u00a0before being auto-imported into the <em>MaxMSP<\/em> environment for performance. Stellar work by the\u00a0<i>Lilypond<\/i>\u00a0developers:<\/p>\n<p><a href=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/hyperboles2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-1111\" src=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/hyperboles2-1024x715.png\" alt=\"\" width=\"620\" height=\"433\" srcset=\"https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/hyperboles2-1024x715.png 1024w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/hyperboles2-300x209.png 300w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/hyperboles2-768x536.png 768w, https:\/\/michael-edwards.org\/wp\/wp-content\/uploads\/hyperboles2.png 1467w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/a><\/p>\n<p>Of course there are times when 100% algorithmic score generation is just not possible or desirable. To this end I developed various\u00a0<i>slippery chicken<\/i>\u00a0methods to add\/alter score elements &#8220;by hand&#8221; before generating scores. Still, editing scores via <em>Common\u00a0<\/em><i>Lisp<\/i>\u00a0code is not everyone&#8217;s dream scenario. This is where WYSIWYG notation software like Finale and Sibelius come into their own of course.<\/p>\n<p>Fast forward to 2017 and a solo violin project I have just been working on for\u00a0<a href=\"https:\/\/www.uniarts.fi\/en\/newsroom\/mieko-kanno-appointed-professor-artistic-doctoral-studies-sibelius-academy\">Mieko Kanno<\/a>\u00a0demanded just such an editing approach. So I paused, pondered, took a deep breath, then bit the bullet and started coding the MusicXML output from\u00a0<i>slippery chicken<\/i>. This turned out to be a considerably longer job than the <em>Lilypond<\/em> implementation, mainly due to the rather complex nature of MusicXML.<\/p>\n<p><i>Finale<\/i>\u00a0proved invaluable here. Out of the top three candidates, from my perspective at least&#8212;<i>Finale<\/i>,\u00a0<i>Sibelius<\/i>, and Steinberg&#8217;s newcomer and\u00a0<i>Sibelius<\/i>-killer\u00a0<i>Dorico<\/i>&#8212;<i>Finale<\/i>\u00a0imported and rendered the most features of MusicXML. Of course, I would prefer to use an open-source project like\u00a0<i>MuseScore<\/i>\u00a0or an academic\/free project like\u00a0<i>noteAbilityPro<\/i>. Both of these import and export MusicXML but, to my disappointment, they both failed to deal with\u00a0nested tuplets\u00a0so were immediately ruled out.<\/p>\n<p><i>Finale<\/i>, then,\u00a0was instrumental in getting\u00a0<i>slippery chicken&#8217;s<\/i>\u00a0MusicXML output working properly. It seems to have the most complete import functionality and, very helpfully, gives informative error messages if there are any problems. Anyone who&#8217;s written code to write code knows how tricky this can be. Though well-documented, MusicXML is, like most similar systems, difficult to get your head around at first. Like\u00a0<i>Lilypond<\/i>\u00a0code, it&#8217;s nice that it&#8217;s a text file format, but being XML the code is extremely verbose (not that that&#8217;s a problem for users of course). The tag\/property system is well-known from a variety of coding systems but one of the first things that became apparent was that, unlike some more flexible approaches, MusicXML forces a certain tag order (I wasn&#8217;t expecting that at all). For example, accidentals must come after the rhythm type, it would seem. Rhythms themselves are their own mini-nightmare, especially when it comes to tuplets and nested tuplets. Just look at the following MusicXML code produced by <em>slippery chicken<\/em>. It&#8217;s all just aimed at defining the rhythmic aspects of a single note, albeit a nested tuplet:<\/p>\n<pre>&lt;duration&gt;4536&lt;\/duration&gt;\r\n&lt;type&gt;16th&lt;\/type&gt;\r\n&lt;time-modification&gt;\r\n &lt;actual-notes&gt;65&lt;\/actual-notes&gt;\r\n &lt;normal-notes&gt;72&lt;\/normal-notes&gt;\r\n&lt;\/time-modification&gt;\r\n&lt;beam number=\"1\"&gt;begin&lt;\/beam&gt;\r\n&lt;notations&gt;\r\n &lt;tuplet type=\"start\" bracket=\"yes\" number=\"1\" show-number=\"both\"&gt;\r\n &lt;tuplet-actual&gt;\r\n &lt;tuplet-number&gt;13&lt;\/tuplet-number&gt;\r\n &lt;tuplet-type&gt;16th&lt;\/tuplet-type&gt;\r\n &lt;\/tuplet-actual&gt;\r\n &lt;tuplet-normal&gt;\r\n &lt;tuplet-number&gt;12&lt;\/tuplet-number&gt;\r\n &lt;tuplet-type&gt;16th&lt;\/tuplet-type&gt;\r\n &lt;\/tuplet-normal&gt;\r\n &lt;\/tuplet&gt;\r\n &lt;tuplet type=\"start\" bracket=\"yes\" number=\"2\" show-number=\"both\"&gt;\r\n &lt;tuplet-actual&gt;\r\n &lt;tuplet-number&gt;5&lt;\/tuplet-number&gt;\r\n &lt;tuplet-type&gt;16th&lt;\/tuplet-type&gt;\r\n &lt;\/tuplet-actual&gt;\r\n &lt;tuplet-normal&gt;\r\n &lt;tuplet-number&gt;6&lt;\/tuplet-number&gt;\r\n &lt;tuplet-type&gt;16th&lt;\/tuplet-type&gt;\r\n &lt;\/tuplet-normal&gt;\r\n &lt;\/tuplet&gt;\r\n&lt;\/notations&gt;<\/pre>\n<p>Useful as it was, especially in importing all kinds of goodies like special note-heads and text marks,\u00a0<i>Finale&#8217;s<\/i>\u00a0post-import layout was, frankly, appalling. Pretty much everything but the notes was laid out on top of each other, meaning that a massive editing job would be necessary. Compare that to\u00a0<i>Lilypond,<\/i>\u00a0where layout is automatic and carried out along well-established notational principles.\u00a0<i>Sibelius<\/i>\u00a0did a slightly better job than\u00a0<i>Finale<\/i>\u00a0in terms of layout but ignored things like note-heads. Also, despite having used\u00a0<i>Sibelius<\/i>\u00a0for several projects in the past, the parent company&#8217;s policies seem to pretty much guarantee its obsolescence some time in the not-so-distant future.<\/p>\n<p><i>Dorico<\/i>\u00a0on the other hand is a brand new notation package from the team that brought us\u00a0<i>Sibelius<\/i>. Its very existence is due to Avid&#8217;s heavy-handed treatment of the London-based\u00a0<i>Sibelius<\/i>\u00a0team which\u00a0<i>Steinberg\u00a0<\/i>subsequently hired\u00a0<i>en masse<\/i>. At first I wasn&#8217;t impressed with <em>Dorico\u00a0<\/em>because the MusicXML import didn&#8217;t seem to be working (and there were no error messages). However, an email exchange with the indefatigable Daniel Spreadbury and <em>Dorico&#8217;s<\/em> in-house MusicXML expert revealed subtle errors in my XML code which weren&#8217;t being picked up elsewhere. (Yes, I learned even more about the intricacies of rhythm encoding in MusicXML.) Once I&#8217;d fixed these,\u00a0<i>Dorico<\/i>\u00a0did a beautiful job of importing and notating my MusicXML. Although, like\u00a0<i>Sibelius,<\/i>\u00a0it currently ignores a fair amount of encoded data, like note-heads and text marks, the automatic layout is immediately clear and, in my opinion, beautiful. Furthermore, whereas I&#8217;ve not much confidence that the <em>Sibelius <\/em>team will get around to improving import problems any time soon,\u00a0<em>Dorico\u00a0<\/em>promises to be more and more inclusive as it rapidly develops.\u00a0You can see the results of MusicXML import in <em>Dorico\u00a0<\/em>at the top of this post (from the score of my piece for Mieko), albeit after adding some special marks. The layout is all\u00a0<i>Dorico&#8217;s<\/i>\u00a0however. This is what convinced me to buy and switch,\u00a0even though\u00a0<i>Dorico <\/i>is still quite near the beginning of its development cycle (version 1.1 has just been released). Some essentials for me are still missing (e.g. artificial string harmonics) but I can find workarounds. I really appreciate the consistent workflow and, up to now, lack of kludges in the fundamental design. MusicXML finally looks really promising for people with special (notation) needs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back in 2011, after several years of using either\u00a0CMN\u00a0or Sibelius (the latter via MIDI file import), I was considering alternative score output formats for my algorithmic composition software\u00a0slippery chicken. With its 3.0 version status that year,\u00a0MusicXML\u00a0was showing maturity and was definitely a contender for\u00a0slippery chicken\u00a0output. After playing around with mainly Sibelius&#8217;s MusicXML import functionality, however, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1106,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,152,108],"tags":[159,157,160,161,156,158],"class_list":["post-1105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-algorithmic-composition","category-programming","category-slippery-chicken","tag-dorico","tag-finale","tag-lilypond","tag-music-notation","tag-music-xml","tag-sibelius"],"_links":{"self":[{"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1105"}],"version-history":[{"count":14,"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1105\/revisions"}],"predecessor-version":[{"id":1121,"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1105\/revisions\/1121"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=\/wp\/v2\/media\/1106"}],"wp:attachment":[{"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michael-edwards.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}