12 December 2008

Scheme and Lily

A very interesting discussion is happening on the LilyPond Development mailing list (starting here) relating to improving LilyPond's support for tablature notation. LilyPond's syntax, as mandated by the parser, caters more to "note-centric" input; however it seems that tablature notation is best written in terms of "finger positions" without having to worry about what notes are indicated. This got me thinking about LilyPond's syntax in general. It's "surface" syntax resembles that of TeX or LaTeX, with commands beginning with backslashes and curly braces used as delimiters. But its "beneath-the-surface" syntax uses the Scheme programming language and shows the music events that are taking place. However, this syntax can get pretty wordy and complex. I think it would be very interesting to try implementing a macro language for the underlying Scheme language using Scheme! After all, that is what Scheme is useful for: building an abstraction on top of another, and another, and another, etc. IMO, this would look very elegant. So instead of typing this: \version "2.11.65" I could type this instead: (version 2.11.65) And instead of this: \relative c' { c4 d e f g1 } I could type: (relative-to C4 'sequential (c-quarter d e f g-whole)) I don't know yet, but I think it would be kind of neat. :-)

2 comments:

Anonymous said...

I'll give you a position you can finger.

Patrick said...

Haha...

I didn't get it until I reread my blog post.

:-)