lilypond-user
[Top][All Lists]
Advanced

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

Re: Scaled grace


From: Malte Meyn
Subject: Re: Scaled grace
Date: Tue, 21 Mar 2017 12:05:53 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0


Am 21.03.2017 um 11:44 schrieb Malte Meyn:
> Or if you don’t want variants for all \grace variants (i. e. \grace,
> \slashedGrace, \appoggiatura, \acciaccatura, \afterGrace), just make a
> function that takes a music expression and scales it to 1. Maybe this
> could also be nice for cadenza-like things in real time notes (if you
> combine it with \newSpacingSection or a duration argument):
> 
> […]

scaleToLength =
#(define-music-function (dur mus) (ly:duration? ly:music?)
   (let* ((real-len (ly:music-length mus))
          (mom (ly:duration-length dur))
          (ratio-mom (ly:moment-div mom real-len))
          (ratio (cons (ly:moment-main-numerator ratio-mom)
                   (ly:moment-main-denominator ratio-mom))))
     #{
       \scaleDurations #ratio #mus
     #}))

% from Chopin’s Nocturne op. 15 No. 2
\new PianoStaff <<
  \new Staff \relative {
    \time 2/4
    \key fis \major
    \teeny
    \scaleToLength 2 {
      b'8([ ais b) ais( a gis) a( gis a) gis( g fis) g( fis g)
      fis\( f e eis fis eis dis( eis fis) ais( gis eis fis dis gis)\)]
    }
  }
  \new Staff \relative {
    \clef bass
    \key fis \major
    << { s8 d4 } \\ { fis,8( d' <gis b> cis,) } >>
  }
>>



reply via email to

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