lilypond-user
[Top][All Lists]
Advanced

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

Re: trill & midi


From: peter
Subject: Re: trill & midi
Date: Wed, 07 Feb 2018 09:03:42 +1100
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/24.5 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

> I would like to change the trill speed in the midi output. I tried to
> change the "#(define..." like in the following code but without success.
> Any suggestion?

> \version "2.19.81"
> \include "articulate.ly"
> #(define ac:maxTwiddleTime (ly:make-moment 1/240))

> \score {
>   \articulate {\time 2/4 c'2 \trill}
>   \layout {}
>   \midi {}
> }

When I was writing the trill code, lily tended to crash when trying to
compress music so that the trill took the same length as the original
note. I worked around it by fixing a trill's note length as a
demisemiquaver in the current tempo.

You can try:


#(define ac:maxTwiddleTime (ly:make-moment 1/120))
#(define (ac:twiddletime music)
  (let* ((tr (filter (lambda (x)
                     (and (eq? 'ArticulationEvent (ly:music-property x 'name))
                      (string= "trill" (ly:music-property x 
'articulation-type))))
              (ly:music-property music 'elements)))
         (ac:targetTwiddleTime ac:maxTwiddleTime)
         (pre-t (if (pair? tr) (ly:music-property (car tr) 'twiddle)
                 '()))
         (hemisemimom ac:targetTwiddleTime))
   (if (ly:moment? pre-t)
    pre-t
    hemisemimom)))

but you may find durations incorrect.



reply via email to

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