lilypond-user
[Top][All Lists]
Advanced

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

Re: 3/2 unusual writing


From: Jan-Peter Voigt
Subject: Re: 3/2 unusual writing
Date: Thu, 4 Oct 2018 20:49:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Hello,

an engraver can set the duration-log property conditionally as a tweak:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.19.82"

\layout {
  \context {
    \Voice
    \consists #(make-engraver
                (listeners
                 ((note-event engraver event)
                  (let ((durlog (ly:duration-log (ly:event-property
event 'duration))))
                    (if (> durlog 1) (ly:event-set-property! event
'tweaks '(((NoteHead . duration-log) . 1)) ))
                    ))))
  }
}

\relative d {
  \clef bass \key d \major
  \time 3/2
  d1. | e1. | fis2 b,8*2[ cis d b] |
  e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
  e2. d8*2 cis2
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

HTH
Jan-Peter


Am 04.10.2018 um 20:20 schrieb Pierre Perol-Schneider:
> Hi All,
> Another option:
> 
> \version "2.19.82"
> 
> \relative d {
>    \clef bass \key d \major
>    \time 3/2
>    d1. | e1.
>    \override NoteHead.duration-log = #1
>    | fis2 b,8*2[ cis d b] |
>    \once\revert NoteHead.duration-log
>    e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>    e2. d8*2 cis2
> }
> 
> Cheers,
> Pierre
> 
> Le jeu. 4 oct. 2018 à 14:32, Jacques Menu <address@hidden
> <mailto:address@hidden>> a écrit :
> 
>     Hello Graham & Aaron,
> 
>     Thanks, both your solutions work fine. Lily is really great!
> 
>     Avoiding to use multiplying factors as in b,8*2 has the advantage
>     that Frescobaldi can select the code from the glyphs and vice-versa
>     alright.
> 
>     A nice day!
> 
>     JM
> 
>>     Le 4 oct. 2018 à 13:29, Aaron Hill <address@hidden
>>     <mailto:address@hidden>> a écrit :
>>
>>     On 2018-10-04 2:09 am, Jacques Menu wrote:
>>>     Hello folks,
>>>     I’ve found this in Charpentier’s Te Deum, as engraved by the
>>>     Centre de Musique Baroque de Versailles, which I had never seen
>>>     before:
>>>     It’s quite readable indeed, maybe more than using the modern
>>>     notation with quarters, and I’ve wondered if there a way to obtain
>>>     that with Lily.
>>
>>     Simplest option is to use a note scaling fraction:
>>
>>     d2*1/2
>>
>>     This produces a "half note" but it has been scaled in half so it
>>     only lasts as long as a quarter note.  The note head, however,
>>     will still render as a half.
>>
>>     The problem is that this does not let you do beaming:
>>
>>     d2*1/2[ e f g]
>>
>>     You will get an error because half notes do not support beams.
>>
>>     One way to get around this is to use something like an eighth note
>>     (which does support beams) and then scale it so it lasts as long
>>     as a quarter (which is what the music in question needs):
>>
>>     d8*2[ e f g]
>>
>>     But now we are back at the problem where the note heads are
>>     showing as solid.  Graham has provided a way to force the note
>>     head to render however you want.  Allow me to provide an alternative:
>>
>>     %%%%
>>     \version "2.19.82"
>>
>>     \relative d {
>>      \clef bass \key d \major
>>      \time 3/2
>>      \override NoteHead.stencil = #(lambda (grob)
>>        (let* ((dur (ly:event-property (event-cause grob) 'duration))
>>               (dur? (and (eqv? (ly:duration-log dur) 3) (eqv?
>>     (ly:duration-scale dur) 2))))
>>          (if dur? (ly:grob-set-property! grob 'text (markup
>>     #:musicglyph "noteheads.s1")))
>>          (if dur? ly:text-interface::print ly:note-head::print)))
>>      d1. | e1. | fis2 b,8*2[ cis d b] |
>>      e1. | fis2. gis8*2 ais2 | b2 b,8*2 cis d2 |
>>      e2. d8*2 cis2
>>     }
>>     %%%%
>>
>>     What I am doing here is providing a function that checks to see if
>>     you are using the 8*2 duration specifically and only then
>>     adjusting the way the note head is displayed.
>>
>>     -- Aaron Hill
>>



reply via email to

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