lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \magnifyMusic stem-length enigma


From: Paul Morris
Subject: Re: \magnifyMusic stem-length enigma
Date: Wed, 2 Jul 2014 19:30:10 -0700 (PDT)

markpolesky wrote
> magnifyMusic =
> #(define-music-function (parser location mag mus) (number? ly:music?)
>    (_i "Magnify the notation of @var{mus} without changing the
> staff-size, using @var{mag} as a size factor.  Stems, beams, and
> horizontal spacing are adjusted automatically.")
>    #{
>      \set fontSize = #(magnification->font-size mag)
>      % gives beam-thickness=0.48 when mag=1 (like default),
>      % gives beam-thickness=0.35 when mag=0.63 (like CueVoice)
>      \temporary \override Beam.beam-thickness = #(+ 119/925 (* mag 13/37))
>      \temporary \override Beam.length-fraction = #mag
>      \temporary \override Stem.length-fraction = #mag
>      \temporary \override Stem.thickness = #(* 1.3 (max 1 mag))
>      \temporary \override Score.SpacingSpanner.spacing-increment = #(* 1.2
> mag)
>      #mus
>      \set fontSize = 0
>      \revert Beam.beam-thickness
>      \revert Beam.length-fraction
>      \revert Stem.length-fraction
>      \revert Stem.thickness
>      \revert Score.SpacingSpanner.spacing-increment
>    #})

Aha! So Beam.length-fraction is how you change the spacing between beams!  I
had figured out how to change beam thickness but hadn't had any luck with
spacing, and thought it couldn't be done.  Should have known, given
LilyPond's phenomenal flexibility.

I just submitted a snippet to document how it's done in case anyone else
should anyone else need to make these (rarely needed) changes:
http://lsr.di.unimi.it/LSR/Item?u=1&id=925

Also, just a quick thought on magnifyMusic.  It would be nice to somehow
capture and restore the current fontSize for cases like this:

\new Staff \with {
  fontSize = #2
} {
  c'4 d' e' f'
  \magnifyMusic 0.5 { c'4 d' e' f' }
  c'4 d' e' f'
}

But I'm not sure how to do that...  If you can access the current fontSize,
maybe it would make sense for the magnification to be relative to it?

Cheers,
-Paul



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/magnifyMusic-stem-length-enigma-tp163878p163911.html
Sent from the Dev mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]