A while back I built a music publishing company (long defunct) and used LilyPond to engrave all of our scores. I received comments from quite a few established composers that the engraving was the best they'd seen from any publisher.
I ended up with a collection of macros I used for common tasks. Probably the most-used was a macro that manually overrode the positioning of an element to be more visually pleasing or less confusing. Of course, it could be argued that the need for this indicates a deficiency of the engraving engine (and this was sometimes the case), but a manual final pass makes the difference between functional and professional-looking results. LilyPond's markup language made this easy.
LilyPond's test suite taught me the value of comprehensive test-driven development: every bug starts as an addition to the test suite, and a visual diff—including a numerical value indicating the amount of change—is taken of the entire suite in between versions. In this way, regressions are quickly identified.
I'd love to see your macros if you have them online somewhere. I've lately started spending lots of time notating music in LilyPond and am seeing the need to build tooling along the way.
I started a personal folk song collection using ABC notation. For simple tunes ABC is fantastic, but now that I'm doing more choral/four-part works, I'm reaching for the more powerful tool. Yet there seems to be a huge gap between ABC (simple things done simply and in one way) and LilyPond (do literally anything you want following any format you want, dropping into Scheme as necessary). Ease-of-use/quality-of-life tooling to fill that gap is appealing.
P.S. I'd also love to hear the story of your music publishing venture. It sounds intriguing!
You don't. Arguably, as far as the software is concerned, karma points are a signal for meaning but of course it doesn't work that way in practice. Maybe you could sort by a ratio of upvotes to comments, or recency, obviously leaving flagged threads out, possibly also leaving out threads that can no longer be commented on. But all of that is just sorting by a bad heuristic (karma) with extra steps.
I don't think you should bother trying to find "meaningful" threads at all, since there is no objective definition for that in context, other than "relatedness" to the current thread. I have a browser plugin that does it, it doesn't need to be that deep. Let readers decide what is meaningful to them. You can't automate everything.
Personal story: Over a decade ago, when I was learning to play the piano, I made an arrangement of Twinkle Twinkle Little Star for my girlfriend (now my wife). While the arrangement was pretty basic, I also wanted to present a printed score and that's when I turned to LilyPond.
Here are the files if anyone is interested to take a peek: <https://susam.net/files/music/twinkle-twinkle-little-star/>. The .ly file has the LilyPond code. The .midi and .pdf files were generated from it automatically. The .mp3 and .ogg have the audio recording of the music played manually on an electronic keyboard.
Please note that the LilyPond code might not reflect optimal or idiomatic practices, given that I was new to both music and LilyPond at that time. Nevertheless, it was very satisfying to see the polished output generated by LilyPond. I remember getting the same kind of satisfaction when I discovered LaTeX about two decades ago and realised that I could finally render mathematical formulas beautifully that look exactly how they should look.
Interesting. A few years ago I had a bunch of music to learn fast, and was having real trouble with reading. I had a longish commute at the time and spent a big chunk of it re-transcribing the music to lilypond so I could get score and midi. The act of translating the original notes to its letter, typing it in then re-rendering and listening to the MIDI improved my sight reading massively.
As a matter of fact, I started learning LilyPond last weekend using Frescobaldi, because of its awesome midi input, and because I figured I might get more efficient with code than with a WYSIWYG editor (I use MuseScore).
Frescobaldi is a very nice way of getting started. It generates code that you see, you can use buttons for features you don't know yet and then you can type code directly when you know it. Frescobaldi then remains useful for at least these reasons:
- midi input and output
- the rendered view and mapping between this view and the code when you click on stuff, quite like those latex IDEs
- new feature discovery. I discovered the concept of the UI that shows you what code is generated and where recently with LuCI for OpenWrt, which shows what config file is going to be updated and how; I love it and Frescobaldi has the same quality. I find it lets you get started and then master a new complex system efficiently and painlessly.
Of course I suspect I will reach for my usual text editor at some point... and maybe I need a midi input plugin for it (Kate, if anybody happens to know something about this)
Of course storing repeated notes in variable is incredibly useful, and managing different voices on the same clef is surprisingly easier than with MuseScore.
One thing I dislike is how stuff applying to several notes need to be "opened" after the first note. I needed to do such a thing to a group of notes that was also used elsewhere and storing this group of notes in a variable was only natural but then it's difficult to open something after the first note. But this is easily overcome by using an empty chord ( <> ) to start the grouping thing. Feels hacky but seems to work, I hope it doesn't have unintended consequences. I'm sure there's a very sensible reason for this that I will discover later and will make me think that it was an obvious design choice after all.
I'm not sure it's for everyone though. MuseScore is better at this, LilyPond has started being for me at a time WYSIWYG started being frustrating and when I started wishing the UI didn't get in the way of my note input (before this, I absolutely didn't want to write code to make a music sheet - just let me click already). But I'm used to code and to please compilers. Code scares a lot of people. I wish it didn't.
The fact that slurs and grouping must be appended after the note hasn't always been so. I have been a user since its first versions, and at the beginning you would write a legato scale like this:
(c d e f g a b c)
which indeed looks more natural because resembles the way parentheses are used in mathematics and programming.
If I remember correctly, the change happened ~20 years ago because it made the notation more consistent: everything related to the note happens after the note name (durations, staccato, marcato, slurs, etc.). I remember that it took me several months to get acquainted with the new syntax.
LilyPond is the best way to integrate sheet music into the text-only formats (Markdown, wiki markups, org-mode). MediaWiki supports LilyPond. Emacs org-mode supports LilyPond. In fact LilyPond is way more simple to make small score snippets than any WYSIWYG score editor.
I tried to learn LilyPond once but it was a bit too arcane for my taste. Now I use MuseScore, WYSIWYG notation program which is a lot more intuitive (and, like LilyPond, also released under the GPL).
I write relatively simple music, though, mostly lead sheets. I always imagined LilyPond would shine in more complex scoring situations.
LilyPond rules when you want to manipulate music algorithmically. Like make a music reading training app that creates examples based on your performance so far.
I've had a few attempts with algorithmic lilypond for some technical exercises. It's generally good for getting the basics out, but you either lose the advantages of `relative` mode, or end up with unreadable nonsense. So I find it's good for getting things started / 80% of the work done but then needs tweaks.
I only use LilyPond for engraving, and MuseScore for input. They complement each other that way as a free software replacement for the usual commercial options.
The (former, IIRC) product manager for MuseScore (aka @tantacrul) has claimed that he thinks that MuseScore is now doing better engraving than LilyPond. He has a vested interest, obviously, but he's also a smart and conscientious human being.
I’ve tried MuseScore several times over the years and just this year realized that 4 is actually pretty dang good. I haven’t reached for anything in awhile.
Over a decade ago, I was doing some composing and so I tried every free composition program, as well as trials of commercial ones.
In the end, only LilyPond was easy and intuitive to use, due to relying on text editing that you already know, instead of incomprehensible editing paradigms where weird, invisible things happen.
I was easily able to find out how to include everything I wanted in the output, like fingering indications and chord diagrams.
The start of that set, has, to put it blunty, moved in.
Dorico, in particular, is light years ahead, having an actually useable GUI while still being able to do advanced layout stuff, some of which would take hundreds of lines of custom macros in lilypond.
I can enter 100 bars in Dorico faster than I could 5 in lilypond… 10+ years ago when I was using it at least weekly.
Lily pond is great! I used it to be able to script the creation of musical examples to be put on PowerPoint slides and instructional videos. With a little bit of tinkering, you can get Lily pond output as an SVG to play nicely with Manim, and get some really interesting computational animations.
Excuse my ignorance, I'm about to ask stupid questions.
* What type of person uses this? I guess the intersection of people interested in composing and people able to typeset? I would have thought it wasn't that popular, but it has the polish of a popular tool. What am I missing?
* Do people typically use this to compose their own music, or are they recreating music they know?
* How similar is sheet music to source code? Does any software interpret it to output audio?
* Are there any open git repos where people collaborate on an open collection of sheet music?
* How expressive is sheet music? How constrained do you feel trying to convey your idea onto this format? Does it support abstraction, or making your own abstractions?
A lot of older classical scores have poor scans, low res, or are hand written. If I enjoy a piece, I'll redo the notation and upload it (generally to IMSLP).
I have a MIDI piano so I end up using the keys to input, which can be fairly quick, depending on the piece.
I have published one complete work in Lilypond which I estimate has been downloaded about 50k times (and those downloads were probably reused for multiple people, because it was an instructional work). I guess that qualifies me to answer?
* I have a background in LaTeX, so that's why I picked it up. The work I transcribed is a set of six French baroque sonatas for two violins which are commonly used in intermediate-to-advanced teaching.
* At the time I did it, there was no freely available score that showed both parts on the same page, just reproductions of the original handwritten manuscript, so I did it to have a cleaner copy where you can see both parts at the same time. I had to edit slightly because it turned out the original contained a handful of errors.'
* Very similar. Lilypond started life as LaTeX macros, and while it's now well beyond that, you can see the roots. Lilypond can output MIDIs from source.
* I don't know about git repos, but there's no reason you couldn't. I did publish the source alongside the finished PDF on IMSLP (the International Music Score Library Project, a wiki of public domain music).
* For my purposes (playing European music using the 12 tones in the traditional style from Renaissance to modern, both classical and folk), perfectly expressive. I'm not sure what you mean by abstraction in this context, but if you want to do something for which there isn't common notation, you can just write words.
I would use Lilypond without hesitation if I had a new work I wanted to publish, just as I would use LaTeX to publish a book or document. It's a typesetting system, and if you're using it, you're already committed to the form of traditional European sheet music.
I started setting up a piano blog once, which used lilypond to generate an image of the sheet music (then trimmed with image magic) and a midi file (rendered to wav with fluid synth and compressed to mp3). This would have been for small snippets (2-3 bars) of rock/pop/etc music, with some brief commentary. I guess I got distracted along the way. The output looked and sounded good though!
* What type of person uses this? I guess the intersection of people interested in composing and people able to typeset? I would have thought it wasn't that popular, but it has the polish of a popular tool. What am I missing?
--I think people who play/practice musical instruments regularly, esp. in an ensemble, esp. in classical music (where the written notes are referred to a lot); to make arrangements, transcriptions, instrument parts, etc. out of the originals to perform for fun. I'dn't be surprised if programmer folks are overrepresented in this group. (I am one of them).
* How similar is sheet music to source code? Does any software interpret it to output audio?
--I'd like to say quite similar, but upon further thought, maybe not. e.g. In sheet music, there's no ready equivalent to functions taking arguments and returning values.
Maybe the similarity is with compiled/machine code (which I am not familiar with).
* How expressive is sheet music? How constrained do you feel trying to convey your idea onto this format? Does it support abstraction, or making your own abstractions?
--It is quite expressive. Most musical material that people come up with in their minds will likely be adequately represented in sheet music. I haven't seen "user-defined" sheet music notation, which I think is what you may mean by abstractions. I suppose it could be done (and supported by LilyPond).
> In sheet music, there's no ready equivalent to functions taking arguments and returning values.
Sounds like an interesting idea for a music major somewhere. Plus, with conductor or local condition inputs, might make for entertaining sight reading. If sunny, && morning, play notes this way : If dusk || rain, play this way : play default.
I use it to typeset songs that my son wants to learn on the guitar. I can tailor the difficulty and add some "special" things based on what he's learning, for example customizing chords or changing the key signature.
I also used it to typeset a simple song that I arranged and played at a funeral service. I could have written it by hand, but given I was a bit anxious about the performance it helped to have an extremely readable version.
Writing lilypond source code is about the same difficulty as LaTeX. The midi output helps stomping out mistakes and it's easy to follow the source as it plays. Sheet music is pretty expressive, it's a good balance between showing what to play and how, and lilypond is about 1:1 with sheet music.
That said in lilypond you can add some kind of abstraction through both macros and typesetter settings. For example it can calculate automatically which frets and strings correspond to notes, and generate guitar tablature (fret+string notation) and sheet music from the same source. Also, instead of specifying by hand how to play each note, you can basically tell lilypond "I want the left hand to be roughly here on the fretboard" and that affects the strings it tells the player to pluck.
* I don't know "what type of person uses this" in general, but I use it whenever I need to typeset music, which happens when I need to sing something with others. This includes be re-creating sheet music I have for better readability. I've never done any composing.
* It's not very similar to the source code. Basically you put in note names (c d e f ...) and durations (c4 e8 g8 c2). The rest is commands and markup to deal with the remaining very complex needs music typesetting has. Think Latex for music.
* I've never seen any git repos for that, but there are sites like CPDL and IMSLP that sometimes also include Lilypond source (or other sources).
* "How expressive is sheet music": I guess the easiest way to find out is to actually play an instrument or sing? It's a bit like asking "how expressive is the written word, like books and these things".
I've also used VexFlow to good effect producing web-friendly music notation. Given I've had to invent my own syntax for producing pieces with any rapidity, but it seems less complicated than this.
In 2009, I made Velato, an esolang where code is written in pitch values (https://github.com/rottytooth/Velato) encoded as MIDI files. So sort of the opposite of writing algorithmic music (where the human programmer writes music to satisfy conditions of the program). Before switching to LilyPond, I'd used GUIDO with a GUIDO-to-MIDI generator, but it was always awkward. Part of the challenge is that notes can be sounded simultaneously to make the score work better musically, but still need to appear in the correct sequence in the MIDI file for the program to succeed; something that LilyPond handles correctly. There's a transparency to how LilyPond functions that is not always there with programs that try to be "helpful" and clean-up or rearrange information.
I developed the most feature-rich editor for Lilypond (as a plugin for jEdit). It had midi, virtual keyboard, integrated pdf viewer, templates, snippets, autocomplete, lots of cool stuff. I also built an on-the-fly syntax checker.
However, Lilypond development gradually turned to a direction that made it impossible to create a useful syntax checker. As you could actually change the language itself in your source file, by actually changing the enormous amount of Scheme code that provided the Lilypond features. So at the end one couldn't provide reliable edit time autocomplete or error checking, because they needed to actually run the Lilypond interpreter. So I gave up and switched to MuseScore. I even got time to create scores and learn my instruments :)
The problem with lilypond is that it's a write-only language. Due to so many macros, it can't be parsed, only executed.
So its main value to me is as an intermediate output format. Because its output is amazing.
(to me, an ideal music representation should be 2-dimensional, consisting of multiple parallel data and markup channels, then each rendering should be able to select a subset)
I've been using LilyPond for ages to typeset music, to the point where I find other tools cumbersome
My current workflow is vscode, with a plug-in that handles auto compile and displays a PDF in an editor pane, and handles midi input from a small keyboard I've got next to my desk
Interesting that Music notation even seems to be a “challenge” to do with a computer, speaking as a complete layman. It seems like there is only a few note symbols to draw, at fixed positions. Can someone explain what makes good engraving good?
https://lilypond.org/doc/v2.24/Documentation/essay.pdf is a really good explanation - simplistic "make music notes like characters in a font" gets you the information, but it is NOT at all beautiful and actively fights against you, the same way badly typeset and kerned text is hard to read.
I'm a professional engraver. How much time you got? lol There's about 200-300 "standard" symbols for music notation, but that can balloon to upwards of 2,000 when factoring in all the nooks and crannies of the artform. Then you have to know what they all mean in order to convey the musical meaning the composer intends. Then you have to understand the psychology of players and what they would expect on a sheet of music and account for that. The "fixed positions" are very mailable depending on context, especially once we start factoring in accidentals and multiple voices on a single staff which can change the horizontal spacing in all sorts of dramatic ways. Then we have to deal with layout of the score so its density looks even and flows well, and has good page turns. Oh, and transposing instruments, cuz we still do that. And I haven't even mentioned lyrics for singers yet, which add tons and tons of new problems to solve.
It's a grueling art form, frankly, but I love it and I wouldn't do anything else.
Context: I'm Senior Product Designer for Sibelius and founder of Music Engraving Tips on Facebook/YouTube.
Western notation is a complex written language developed over centuries. It's easy to render the symbols in isolation, but not the meaning they convey to the musician who's expected to perform it. Even something like whether to render a flat or a sharp depends on context and intended use.
^ This is "the problem". A lot of music students try to "solve" it after getting frustrated with the staff, but eventually decide that couple hundred years of bad notation still has most of the bugs worked out.
You're really looking for patterns on the staff rather than the exact pedantic notes that are present in the notation.
Me? Still learn best by ear. Unfortunately this is also the slowest method....
Learning by ear is the best by far, and we live in a period where we can listen to every music every produced. When I learned music, music wasn't as available so you had to learn the pieces the hard way.
There is also the problem that human memory has limitations, and if I stop playing something, I will forget it after a couple of weeks, so again musical notation is very helpful.
> You're really looking for patterns on the staff rather than the exact pedantic notes that are present in the notation.
Exactly. Playing the exact tune becomes boring after a while; music is a fun creative exercise for me, so the notes and chords are a general direction, not a precise roadmap. If I wanted a perfect interpretation, I'd listen to the recorded piece instead of play it.
Positions, orientation and spaced aren't fixed and can vary a lot. To get a bit of the detail involved on it you can check the videos for Musescore 3.6 engraving updates [0] or the "Overhaul" and "Notation" sections for the 4.0 update [1].
The problem is closely related to computational typesetting, e.g. TeX, which is an extremely complicated piece of software. While it might be true that music notation is ultimately "simpler" than document typesetting, I wouldn't stake money on that claim.
A somewhat ignorant TL;DR:
- It's probably not too difficult to render simple music in a bland, ugly way, in the same way that it's not too difficult to render ASCII text documents with a monospace font.
- When notation gets complicated it is tedious but somewhat routine to render music in a way that looks like total garbage: things are awkwardly smooshed together or spaced way too far apart; some symbols look "too small" alongside others when using uniform scaling; long lines that have to travel over multiple notes end up clashing and making the score unreadable; etc etc etc.
- Actually getting things right in a general-purpose musical notation program is hard hard work. I don't have any direct experience here but I am sure it's a nightmare and takes constant testing to figure all this stuff out.
I play jazz and don't fully believe in Western music notation :) So I can't speak too directly here on the intricacy. But I would highly recommend reading Knuth's TeX Book (and skimming the WEB source of TeX itself) just to get a sense of how many different decisions a typesetting / music notation program has to make.
> I play jazz and don't fully believe in Western music notation :)
My friend - accomplished classical musician and now pretty well known jazz musician tells me you can't write down latin music accurately. Personally I think while written language is largely about conveying a fairly unambiguous meaning, written music is really about providing enough for the player / or conductor to be able to infer what they need to do.
You can't write any music accurately. Ask her if she can write a later Miles Davis solo accurately so that anybody can perform it just as he plays it :)
I work in a much more notation-bound genre (I am an orchestra bassoon player) and I would say you would struggle a LOT to notate twinkle twinkle little star in a way that makes everyone perform it the same.
There are numerous symbols to represent pitch on a staff, numerous other symbols that can be attached to the pitch symbols that represent changes in duration, dynamics, various techniques and more. These symbols can be stacked above and below the pitch symbols, to the sides of the symbols and more. There are other symbols that can span multiple pitch symbols, groups of symbols and more. There are more symbols that control the tempo of the playback of the score, the number of times sections of the score should be repeated and other symbols that will move the current playback location of the score to some other place. The placement of all of these symbols have "rules" but these rules are really suggestions and composers will always want to adjust and bend these rules. If a system implements strict rules, that system will come under criticism as being inflexible. There seems to always an exception to every rule of music notation.
I have been working on music notation software for almost forty years and have seen programmers come and go with their attempts to "solve" the problem of music notation. It is a very difficult problem. Once upon a time SCORE [1] was considered the best of the best on music engraving software. I worked with Leland Smith to update the program to more platforms. Sadly, the SCORE source code is not available and the rights of the source code are unclear after Leland's passing. Many music publishing companies continued to maintain systems using SCORE for quite a while.
The notation engine of my iOS music notation program Komp [2] is available here: https://github.com/SemitoneGene/notation. This code is most certainly not the best or most complete, but it is easy to read and comprehend if you want to see the complexity involved. MuseScore has also been mentioned in other posts.
If I were to do a commercial engraving of a music score, I would use Dorico. It is being developed by who I would consider the most insightful and understanding group of developers who have a real desire to make the best music engraving program.
LilyPond produces very good output but offers its own series of challenges to use. MuseScore is a nice program, but it has a long way to go to meet the demands of the high professional composition and engraving market.
In addition to the elegance, there's also a functional side, which is that people are going to be reading your stuff, at speed. I'm a jazz player, but still play a lot from sheet music, and good layout can make arrangements a lot more readable.
Recently made some chord flashcards in an experiment to see if it will improve my sight reading on piano.
I originally planned to write a python script to generate Lilypond code for all the different chords I wanted, but found that Frescobaldi made it fast enough that I was able to generate them all manually. In retrospect I’m not sure the code would have panned out all that well because some of the chords needed manual fiddling.
Then I loaded them all up into Anki and have been plugging away. If not for Lilypond I probably would have made real flashcards by hand and that would have been a big ordeal by comparison.
I'm not a musician but have training as a printmaker so I was intrigued by the use of the term "engraved" to put down music on paper. Looks like the early reproduction of sheet music was the intaglio process of engraving the music into a metal plate and reproducing on an intaglio press, that is the ink is in the groves and the surface of the plate is wiped clean.
Text entry. I find Musescore terrible (even revisited it after their huge upgrade). Being able to freely enter text means I don't have to care about timing and just get the notes on the page, which most other notation apps are strict about.
Much more robust engraving support, and, frankly, being actually open source as opposed to owned by a big conglomerate who's gobbling up music companies right and left.
LilyPond is surprisingly good at producing high quality scores. I was surprised to learn recently that many people export from other music editors (e.g., Musescore) to LilyPond to compile the final output.
The biggest problem is so much of music notation's meaning is defined by it's graphical information, not just the content. This is where it differs significantly from code or even text typesetting. At some point, you have to get into the nitty gritty of where to place symbols on the page. Lillypond gets you part of the way, but the last part is really hard to do and most users are more comfortable with a WYSIWYG setup.
Even more than precision, you need consistency. You need to tweak the rules, not just the elements, to make a score look good. So WYSIWYG doesn't buy you that much.
Eh, but "rules" only get you so far. There's tons and tons of situations where a human with eyes just needs to make a decision to "make it work." That's where "systems-based" engraving falls apart. It comes with practice and experience of doing the art over and over, and encountering all those little nuances in real scores and figuring out how to solve them.
It's a pretty big leap to get from "notation isn't required for all forms of music" (what the person you're citing actually said) to "Lilypond is only for you if you're a classical musician". The music world isn't divided into a dichotomy of jazz players and classical players, and even many modern jazz players read and write musical notation.
I ended up with a collection of macros I used for common tasks. Probably the most-used was a macro that manually overrode the positioning of an element to be more visually pleasing or less confusing. Of course, it could be argued that the need for this indicates a deficiency of the engraving engine (and this was sometimes the case), but a manual final pass makes the difference between functional and professional-looking results. LilyPond's markup language made this easy.
LilyPond's test suite taught me the value of comprehensive test-driven development: every bug starts as an addition to the test suite, and a visual diff—including a numerical value indicating the amount of change—is taken of the entire suite in between versions. In this way, regressions are quickly identified.