Hello Jan-Peter, Thanks, that allows cross-selection between source code and resulting image.
JM > Le 4 oct. 2018 à 20:49, Jan-Peter Voigt <jp.vo...@gmx.de> a écrit : > > 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 <imj-muz...@bluewin.ch >> <mailto:imj-muz...@bluewin.ch <mailto:imj-muz...@bluewin.ch>>> 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 <lilyp...@hillvisions.com >>> <mailto:lilyp...@hillvisions.com> >>> <mailto:lilyp...@hillvisions.com <mailto:lilyp...@hillvisions.com>>> 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 >>> > > _______________________________________________ > lilypond-user mailing list > lilypond-user@gnu.org <mailto:lilypond-user@gnu.org> > https://lists.gnu.org/mailman/listinfo/lilypond-user > <https://lists.gnu.org/mailman/listinfo/lilypond-user>
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user