lilypond-user
[Top][All Lists]
Advanced

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

Re: trill & midi


From: Gianmaria Lari
Subject: Re: trill & midi
Date: Wed, 7 Feb 2018 07:46:55 +0100


On 6 February 2018 at 23:09, <address@hidden> wrote:
>>>>> "peter" == peter  <address@hidden> writes:

>> 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?


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

Sorry, forgot the scaling to current tempo.


#(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:abs->mom ac:maxTwiddleTime))
         (pre-t (if (pair? tr) (ly:music-property (car tr) 'twiddle)
                 '()))
         (hemisemimom ac:targetTwiddleTime))
   (if (ly:moment? pre-t)
    pre-t
    hemisemimom)))

 Peter, how should I use your code? How can I change the number of alternations between notes trill?

Thank you, Gianmaria

reply via email to

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