Overengineering, Overengraving
I have written a tool to convert ABC notation into Lilypond. Both formats render music. One already renders fine in the browser. The other I have to compile, then include the SVG by hand. So now there is another tool in the chain: abc-to-ly. And you know what, abc2ly already existed, but it wasn't perfectly what I wanted.
So the reasoning goes something like this: The tunes on this site exist to remind me which ones I like to play, nothing more. On the Saddle the Pony page I have a side-by-side of Lilypond's engraved SVG against the same tune rendered in the browser from ABC via short-codes and abc.js. The Lilypond version looks better. It also costs me a Lilypond file, a render step, and an include, where the ABC version costs me a couple of lines of typing.
But it is the same information. And in this context I only want Lilypond's engraving, not its general versatility. So a thin bridge from ABC to Lilypond seemed reasonable; perhaps even one that takes a chunk of Lilypond as a style input and threads it through to the output.
Whether any of this was a good use of my time is a different question. The site exists to kickstart my memory when I can't remember how a tune starts; the engraving exists to spare my eyes the work of reading ugly notation; abc-to-ly exists to spare me the work of writing the engraving. Each layer is a small honest convenience. Stacked, they are a tool that converts a format I already render to a format I do not need, so that the rendered output is slightly prettier on a page only I read.
Perfect, as they say... well almost perfect... for now.
For reference, the abc file for Saddle The Pony looks like...
X: 1
R: jig
M: 6/8
L: 1/8
K: Gmaj
|:D|GBA G2B|def gdB|GBA G2B|AFD AFD|
GBA G2B|def gfg|efe dBA|BGG G2:|
|:d|efe edB|def gfg|efe edB|dBA ABd|
efe edB|def gfg|efe dBA|BGG G2:|
...and with this a resuable lilypond style...
#(set-global-staff-size 18)
\paper {
%output-suffix = "web-inline"
fonts = # (make-pango-font-tree "EB Garamond" "Noto Sans" "Nimbus Mono PS" (/ (* staff-height pt) 2.5))
line-width = 140\mm
indent = 0\mm
%ragged-right = ##t
bookTitleMarkup = ##f
scoreTitleMarkup = ##f
oddHeaderMarkup = ##f
evenHeaderMarkup = ##f
oddFooterMarkup = ##f
evenFooterMarkup = ##f
print-page-number = ##f
tagline = ##f
}
...it is rendered as...
\version "2.24.0"
#(set-global-staff-size 18)
\paper {
%output-suffix = "web-inline"
fonts = # (make-pango-font-tree "EB Garamond" "Noto Sans" "Nimbus Mono PS" (/ (* staff-height pt) 2.5))
line-width = 140\mm
indent = 0\mm
%ragged-right = ##t
bookTitleMarkup = ##f
scoreTitleMarkup = ##f
oddHeaderMarkup = ##f
evenHeaderMarkup = ##f
oddFooterMarkup = ##f
evenFooterMarkup = ##f
print-page-number = ##f
tagline = ##f
}
\score {
\new Staff {
\key g \major
\time 6/8
\repeat volta 2 {
\partial 8
d'8 |
g'8 b'8 a'8 g'4 b'8 |
d''8 e''8 fis''8 g''8 d''8 b'8 |
g'8 b'8 a'8 g'4 b'8 |
a'8 fis'8 d'8 a'8 fis'8 d'8 |
g'8 b'8 a'8 g'4 b'8 |
d''8 e''8 fis''8 g''8 fis''8 g''8 |
e''8 fis''8 e''8 d''8 b'8 a'8 |
b'8 g'8 g'8 g'4 |
}
\repeat volta 2 {
\partial 8
d''8 |
e''8 fis''8 e''8 e''8 d''8 b'8 |
d''8 e''8 fis''8 g''8 fis''8 g''8 |
e''8 fis''8 e''8 e''8 d''8 b'8 |
d''8 b'8 a'8 a'8 b'8 d''8 |
e''8 fis''8 e''8 e''8 d''8 b'8 |
d''8 e''8 fis''8 g''8 fis''8 g''8 |
e''8 fis''8 e''8 d''8 b'8 a'8 |
b'8 g'8 g'8 g'4 |
}
}
}
...which is almost identical to the handwritten version I made. Although there is a little extra \partial 8 which might have been unrequired.