lilypond-user
[Top][All Lists]
Advanced

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

Re: articulate.ly and trills


From: Gilberto Agostinho
Subject: Re: articulate.ly and trills
Date: Sat, 28 Nov 2015 03:25:42 -0700 (MST)

Hi Teoh, thanks for your reply,


H. S. Teoh wrote
> On Fri, Nov 27, 2015 at 05:32:37PM -0700, Gilberto Agostinho wrote:
> Currently, I use a workaround by
> separating the layout and midi scores, and use \tag to explicitly spell
> out trills
> [...]
> This is rather ugly [...] But it does let you insert things in the
> "midi score" that improves the midi rendering, without polluting the
> printed score.

Thanks for the workaround, but for my specific case I need something
automatic (I am generating scores using algorithms and I am not "allowed" to
manually change anything). 

I found a way of controlling the trill speed, and I'd love to have it as a
function but Scheme is quite complicated to me. Basically, I am copying part
of the code from articulate.ly and replacing the number which controls the
trill speed. All you have to do is to copy add the following code after your
\include "articulate.ly" and adjust the ly:make-moment argument:

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

The default is 1/64, and if you set it to 1/32 you will get half the speed
of the default trill. The great thing is that you can set it to numbers that
aren't powers of two, such as 1/47. Obviously one should use the \articulate
command only for the MIDI \score block because it will spell out the trills,
and when using this trick above the number of notes in a bar will be
visually wrong. So one should use something like this:

\score{
  \music
  \layout{}
}
\score{
  \articulate \music
  \midi{}
}

Cheers,
Gilberto



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/articulate-ly-and-trills-tp184205p184214.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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