Feb 18, 2015

Panorama Mode

Do you come from a notation program that has a "Panarama" mode for viewing your score? Well, fear not! Such a feature exists even in LilyPond to make you feel right at home, but it's not called "Panorama". It's a layout algorithm called ly:one-line-breaking.

To have your score print on a single sheet that adjusts to the length of the score, use the following code:
\paper {
  page-breaking = #ly:one-line-breaking
}
For example, here are the first two pages from a 3-page score in "normal paper" mode:


And here's how it looks when we use the one-line-breaking algorithm (cropped slightly):


That's it! Now, there are some things to remember about using this mode (from the official docs):
  1. Each score gets its own line, but everything is on a single page.
  2. All text in the \header block is NOT typeset, which is fine since this is really more of a preview mode anyway.
  3. The width of the page will be adjusted so the longest score fits on one page.
  4. Some variables in the \paper block will be ignored (like paper-width, indent, line-width) while others will be honored (like left-margin, right-margin, etc.).
  5. The height of the page is un-changed, but honored to whatever you set it to be.
Personally, I wish the height of the page automatically fit to the scores, but oh-well.

Do you miss this mode? Do you find it useful? Let me know in the comments!

2 comments:

  1. What happens if you use that together with the -dpreview command line option? Wouldn't that make the page height fit the score, at least when you have only one score in the file?

    ReplyDelete
  2. Interesting idea! I tried it out and it works nicely (except it's a PNG file) a PDF would be nice. Actually, I just tried it again and discovered it can export to BOTH at the same time as long as you have the -dpreview and --pdf command line options. Very cool! Thanks for sharing!

    ReplyDelete