Take the 2-minute tour ×
Music: Practice & Theory Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It's 100% free, no registration required.

I'm trying to make music-snippet images using lilypond, but I'd like each snippet to always have trailing "whitespace" so that each of these images is of the same width.

I'm following the suggestions from the documentation, so I have a .ly file something like:

    \paper{
    indent=0\mm
    line-width=120\mm
    oddFooterMarkup=##f
    oddHeaderMarkup=##f
    bookTitleMarkup = ##f
    scoreTitleMarkup = ##f
    }
    \relative c' { c4 d e f | g a b c } %insert whitespace to fill line here

and compile it using 'lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts --png test.ly' and it produces a file that is 241 pixels wide.

If I make the snippet three bars, with c4 d e f | g a b c | c b a g, I get a file that is 335 pixels wide.

Ultimately, I'm going to insert these images into a document, and I'd like to be able to use the same width for all of the images, and have the staff/notes be the same size.

I don't want to key off of the height of the images (which is the same) in this case, because some of the snippets will span multiple lines.

share|improve this question
1  
May I refer you to the LilyPond Users mailing list!? See also my answer on this question: meta.stackexchange.com/questions/168297/… –  PeterBjuhr Nov 5 '13 at 19:44
    
I am a novice when it comes to Lilypond, but I'd try to achieve this by padding the shorter snippets with invisible dummy notes. –  Meaningful Username Apr 25 at 18:44
    
I'm putting them into an org-mode document; I have found that in that context I always want to set the figure width; to keep myself sane, I want to be able to set the same width for all of the snippets -- thus I want Lilypond to do the padding for me. –  Dave Apr 25 at 22:45

1 Answer 1

You can fix this by adding in the \paper section:

  ragged-last = ##f

This will ensure that if your score is only one line, it will use the full line width you've specified.

share|improve this answer
    
True but not the solution I'm looking for -- short snippets get stretched out to fill the line, resulting in unattractively large spaces between the notes. –  Dave Apr 25 at 18:03
    
I see, so you really want completely white space to fill the right. I don't know what you're using to write the final document, but it seems like if you can left-justify your images to the desired margin, you should be all set with your original lilypond source. You'll end up with appropriate white space in the document itself rather than in the image you insert to the document, and you'll still have the peace of mind knowing that the line-width you set in lilypond will keep things from overflowing to the right. –  David Tresner-Kirsch Apr 25 at 21:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.