Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can staff size variable be something other than a counter? #1

Closed
rpspringuel opened this issue May 19, 2015 · 4 comments
Closed

Can staff size variable be something other than a counter? #1

rpspringuel opened this issue May 19, 2015 · 4 comments

Comments

@rpspringuel
Copy link
Collaborator

By default, Lilypond uses a staff size of 20 which prints the lyrics in 12pt font. Since I want the lyrics text size to match the font size of the rest of the document, this means that in documents where the font size isn't 12 pt, I have to change the Lilypond staff size.

First, the universal variable for default staffsize is already a big step up on lilypond-book (where the staffsize has to be specified for each inclusion separately). However, the fact that it's a counter limits what I can do with it since counters are limited to integers. In my current projects using lilypond-book, I use a scheme expression for the staff size in order to facilitate the scaling. For example staffsize=(* 20 17/12) rescales the music for a 17pt large-print edition. Would it be possible to change the staffsize variable so that it can hold something like this?

@jperon
Copy link
Owner

jperon commented May 20, 2015

Could you test last commit, please ? It should work like this. On a further step, I think I'll add a command to automatically scale default staffsize pending on document's font size.

@rpspringuel
Copy link
Collaborator Author

Tested and found that while \renewcommand{\staffsize}{(* 20 17/12)} doesn't work, \renewcommand{\staffsize}{(20*17/12)} does. Since the first is the Scheme syntax for the math (in particular the multiplication) and the second is Lua syntax, I'm guessing that Lua is trying to process the contents of \staffsize before passing it on to Lilypond rather than simply treating it as a string to be passed along. However, I actually don't mind, and indeed prefer, that in this case. Lua's syntax for mathematical operations is much more natural than Scheme's.

So, bottom line: what you did works and is, I think, better than the equivalent in lilypond-book.

@jperon
Copy link
Owner

jperon commented May 20, 2015

Perfect ! I leave this open till I've made what I told about auto scaling. Thank you !

@jperon
Copy link
Owner

jperon commented May 28, 2015

19d85ff should definitely fix this issue ; feel free to re-open it if there are bugs.
From now, if \staffsize is defined to 0, scores will be auto-scaled to stick with font size.

@jperon jperon closed this as completed May 28, 2015
jperon referenced this issue Jan 16, 2018
`\lilypondCmd` command.
`program` option to `\includely`, `\lily` and `ly` environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants