bell notificationshomepageloginNewPostedit profiledmBox

Hoots : Merge rests in lilypond I write a program which produces scores in lilypond. Due to some limitations in this program, the rests are written as if they were seperate notes: r2 r4. r8 | r2 r4. e''8 | r4 r4 e''2 Is there - freshhoot.com

10% popularity   0 Reactions

Merge rests in lilypond
I write a program which produces scores in lilypond. Due to some limitations in this program, the rests are written as if they were seperate notes:

r2 r4. r8 | r2 r4. e''8 | r4 r4 e''2

Is there a method native to Lilypond to merge these rests for each measure into code like:

r1 | r2.. e''8 | r2 e''2


Load Full (2)

Login to follow hoots

2 Comments

Sorted by latest first Latest Oldest Best

10% popularity   0 Reactions

No, there is not. Lilypond is just like a programming language: it outputs exactly what you instruct it to. Adding slurs doesn't work for rests, and while they'd make real notes longer, they wouldn't output them as merged notes.

Actually, the task you describe is just what I'd expect a program producing Lilypond files would do. It shouldn't be too hard to write an extra step combining rests; you could even try it with regular expressions I guess.


10% popularity   0 Reactions

Lilypond "knows" very little about the semantics of music notation. It knows the rhythmic duration of the symbols for notes and rests, and some rules for avoiding collisions between entities, and that's about it. Most other notation software that was originally designed in the 20th century is similar.

It is possible to write notation software which is based on semantics rather than the visual appearance of music notation. In that case, most "rests" don't really exist at all so far as the semantics are concerned. They are just marks made in the score to fill up the gaps between the notes, following a (rather complex) set of rules.

This has interesting (and time-saving!) consequences if you edit the music. The following example has all rests automatically (and correctly) generated:

If for some reason I decide to double the length of the first note, the entire passage is rewritten correctly with only two key strokes required, to select the first note and change its duration. The notes are split up and rebeamed as necessary, as well as rewriting the rests.

Of course you can override the default notation if you want to, but most of the time you shouldn't want to do that!

Whether or not it "shouldn't be too hard", it took a team of professional software developers, who all had more than a decade of experience working on music notation software, several years to produce "version 1.0" of this.

A hard part of the problem is actually figuring out what the "rules" should be, since there are many different conventions. In the software used to make these examples there are 20 or 30 situations with different user-selectable options - this a small sample, just for one time signature (6/8):

This sort of functionality is not likely to appear in Lilypond any time soon.


Back to top Use Dark theme