On 27 November 2017 at 09:32, David Kastrup <d...@gnu.org> wrote:

> Gianmaria Lari <gianmarial...@gmail.com> writes:
>
> > On 27 November 2017 at 07:39, Gianmaria Lari <gianmarial...@gmail.com>
> > wrote:
> >
> >>
> >> On 27 November 2017 at 00:24, David Kastrup <d...@gnu.org> wrote:
> >>
> >>> Gianmaria Lari <gianmarial...@gmail.com> writes:
> >>>
> >>> > On 8 November 2017 at 18:15, David Kastrup <d...@gnu.org> wrote:
> >>> >
> >>> >> Gianmaria Lari <gianmarial...@gmail.com> writes:
> >>> >>
> >>> >> > Talking about midi, is there any way to to reduce or increase the
> >>> tempo
> >>> >> of
> >>> >> > some measures by a certain percentage instead of setting it to an
> >>> >> absolute
> >>> >> > value?
> >>>
> >>
> >
> > Another question. It would be also useful to have a function that
> increase
> > the tempo by a certain quantity (instead of a certain factor).
> >
> > I tried to modify the previous code in many ways using moment-add and
> > make-moment but without success. This is an example that does not work:
> >
> > (ly:moment-add (ly:context-property c 'tempoWholesPerMinute) value)
> >
> >
> > Any suggestion?
>
> Scheme has no types known as "quantity".  Neither has LilyPond.  You
> don't show how you get at `value'.
>
> <URL:http://lilypond.org/tiny-examples.html>
>

For example:

\version "2.19.80"
increaseTempo =
#(define-music-function (value)(number?) #{
  \context Timing \applyContext
  #(lambda (c)
     (set! (ly:context-property c 'tempoWholesPerMinute)
           (ly:moment-add (ly:context-property c 'tempoWholesPerMinute)
value)
           ))
   #} )


\score {
  {
    \tempo 4=100
    a b \increaseTempo 50 c' d'
  }
  \layout {} \midi{}
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to