lilypond-user
[Top][All Lists]
Advanced

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

Re: Incipit with default noteheads possible?


From: Hajo Baess
Subject: Re: Incipit with default noteheads possible?
Date: Wed, 24 Jan 2024 23:38:46 +0000

That 'manual' solution is absolutely good enough for my purpose.
Furthermore it is easy to understand and to modify if necessary. I'll
adopt it for my project.

At any rate: thank you all for your very valuable advice and hints. I
already suspected as well that \incipit is hardcoded to mensural style
without knowing anything about its inner workings. You can assume it,
though, from its reluctance to accept or process any attempts at
changing the result.

Am Mittwoch, dem 24.01.2024 um 22:42 +0100 schrieb Mats Bengtsson:
>  I have to try it. So far, I've used the more manual solution
> available in https://lsr.di.unimi.it/LSR/Item?id=451
>     /Mats
> On 2024-01-24 18:39, YTG 1234 wrote:
>  > betterIncipit = 
> >   #(define-music-function (incipit-music) (ly:music?) 
> >     (_i "Output @var{incipit-music} as an incipit. 
> >   
> >   @var{incipit-music} is typeset within a @code{MensuralStaff} if
> > no other staff-like context is created; the result 
> >   is positioned before the main staff (as part of an
> > @code{InstrumentName} grob) 
> >   to indicate the music's original notation.") 
> >     #{ 
> >       \once \override Staff.InstrumentName.stencil = 
> >         #(lambda (grob) 
> >           (let* ((instrument-name (ly:grob-property grob 'long-
> > text)) 
> >                  (align-x (ly:grob-property grob 'self-alignment-X
> > 0)) 
> >                  (align-y (ly:grob-property grob 'self-alignment-Y
> > 0))) 
> >           (set! (ly:grob-property grob 'long-text) 
> >             #{ \markup { 
> >               \score 
> >               { 
> >                 $(if (member (ly:music-property incipit-music
> > 'context-type) '(ChoirStaff DrumStaff GrandStaff
> > GregorianTranscriptionStaff KievanStaff MensuralStaff OneStaff
> > PetrucciStaff PianoStaff RhythmicStaff Staff StaffGroup
> > StandaloneRhythmStaff TabStaff VaticanaStaff)) 
> >                   #{ { $incipit-music } #} 
> >                   #{ \new MensuralStaff { $incipit-music } #}) 
> >                 \layout { 
> >                   $(ly:grob-layout grob) 
> >                   \context { 
> >                     \Staff 
> >                     \override InstrumentName.self-alignment-X =
> > #align-x 
> >                     \override InstrumentName.self-alignment-Y =
> > #align-y 
> >                     instrumentName = #instrument-name 
> >                   } 
> >                   indent-incipit-default = 15\mm 
> >                   line-width = #(primitive-eval 
> >                     '(or (false-if-exception indent) 
> >                       indent-incipit-default)) 
> >                   indent = #(primitive-eval 
> >                              '(or (false-if-exception (- line-width
> > incipit-width)) 
> >                               (* 0.5 line-width))) 
> >                   ragged-right = ##f 
> >                   ragged-last = ##f 
> >                   system-count = 1 
> >                 } 
> >               } 
> >               } 
> >             #}) 
> >             (set! (ly:grob-property grob 'self-alignment-Y) #f) 
> >             ;; Do 'self-alignment-X RIGHT only for the first
> > InstrumentName, which 
> >             ;; actually is the incipit. Otherwise self-alignment-X
> > for the 
> >             ;; shortInstrumentName is not longer settable. 
> >             (let ((parts (ly:spanner-broken-into (ly:grob-original
> > grob)))) 
> >               (if (and (pair? parts) (equal? grob (car parts))) 
> >                   (ly:grob-set-property! grob 'self-alignment-X
> > RIGHT))) 
> >             (system-start-text::print grob))) 
> >     #} 
> >   ) 
>  
> I have to try it. So far, I've used the more manual solution
> available in https://lsr.di.unimi.it/LSR/Item?id=451
>     /Mats
> On 2024-01-24 18:39, YTG 1234 wrote:
>  
> > betterIncipit = 
> >  #(define-music-function (incipit-music) (ly:music?) 
> >    (_i "Output @var{incipit-music} as an incipit. 
> >  
> >  @var{incipit-music} is typeset within a @code{MensuralStaff} if no
> > other staff-like context is created; the result 
> >  is positioned before the main staff (as part of an
> > @code{InstrumentName} grob) 
> >  to indicate the music's original notation.") 
> >    #{ 
> >      \once \override Staff.InstrumentName.stencil = 
> >        #(lambda (grob) 
> >          (let* ((instrument-name (ly:grob-property grob 'long-
> > text)) 
> >                 (align-x (ly:grob-property grob 'self-alignment-X
> > 0)) 
> >                 (align-y (ly:grob-property grob 'self-alignment-Y
> > 0))) 
> >          (set! (ly:grob-property grob 'long-text) 
> >            #{ \markup { 
> >              \score 
> >              { 
> >                $(if (member (ly:music-property incipit-music
> > 'context-type) '(ChoirStaff DrumStaff GrandStaff
> > GregorianTranscriptionStaff KievanStaff MensuralStaff OneStaff
> > PetrucciStaff PianoStaff RhythmicStaff Staff StaffGroup
> > StandaloneRhythmStaff TabStaff VaticanaStaff)) 
> >                  #{ { $incipit-music } #} 
> >                  #{ \new MensuralStaff { $incipit-music } #}) 
> >                \layout { 
> >                  $(ly:grob-layout grob) 
> >                  \context { 
> >                    \Staff 
> >                    \override InstrumentName.self-alignment-X =
> > #align-x 
> >                    \override InstrumentName.self-alignment-Y =
> > #align-y 
> >                    instrumentName = #instrument-name 
> >                  } 
> >                  indent-incipit-default = 15\mm 
> >                  line-width = #(primitive-eval 
> >                    '(or (false-if-exception indent) 
> >                      indent-incipit-default)) 
> >                  indent = #(primitive-eval 
> >                             '(or (false-if-exception (- line-width
> > incipit-width)) 
> >                              (* 0.5 line-width))) 
> >                  ragged-right = ##f 
> >                  ragged-last = ##f 
> >                  system-count = 1 
> >                } 
> >              } 
> >              } 
> >            #}) 
> >            (set! (ly:grob-property grob 'self-alignment-Y) #f) 
> >            ;; Do 'self-alignment-X RIGHT only for the first
> > InstrumentName, which 
> >            ;; actually is the incipit. Otherwise self-alignment-X
> > for the 
> >            ;; shortInstrumentName is not longer settable. 
> >            (let ((parts (ly:spanner-broken-into (ly:grob-original
> > grob)))) 
> >              (if (and (pair? parts) (equal? grob (car parts))) 
> >                  (ly:grob-set-property! grob 'self-alignment-X
> > RIGHT))) 
> >            (system-start-text::print grob))) 
> >    #} 
> >  ) 
>  


reply via email to

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