Re: Ties across voices; tried two methods

2024-01-24 Thread Charlie Ma
I just joined this group and have learned so much already. First time
answering. Hope this is right (works for me anyway.)

Butter Cream:
for the first tie put the first b-flat in the same "voice."
for the 2nd tie use \repeatTie.

\repeat volta 2 {
4 8 ~  r8  << { bes4~ } \\ { s4 } >> |
\alternative {
{ << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2
| }
{ << { bes'8\repeatTie g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }
}
}

[image: image.png]


Re: Incipit with default noteheads possible?

2024-01-24 Thread Werner LEMBERG


>> This works for the note heads, but if there happen to be
>> accidentals around (in my project this is the case), they remain
>> mensural style. Is there another override for this, too?
> 
> How about this?

Nice!  David, what do you think about converting this code into a
proper MR?


Werner



RE: Ties across voices; tried two methods

2024-01-24 Thread Mark Stephen Mrotek
Welcome!

 

From: Butter Cream  
Sent: Wednesday, January 24, 2024 4:29 PM
To: Leo Correia de Verdier ; Mark Stephen 
Mrotek 
Cc: lilypond-user@gnu.org
Subject: Re: Ties across voices; tried two methods

 

Thank you! I will implement your suggestions.

 

Sent via the Samsung Galaxy S20 FE 5G, an AT 5G smartphone
Get Outlook for Android  

  _  

From: Leo Correia de Verdier mailto:leo.correia.de.verd...@gmail.com> >
Sent: Wednesday, January 24, 2024 7:21:29 PM
To: Mark Stephen Mrotek mailto:carsonm...@ca.rr.com> >
Cc: Butter Cream mailto:but...@inversityinc.com> >; 
lilypond-user@gnu.org   mailto:lilypond-user@gnu.org> >
Subject: Re: Ties across voices; tried two methods 

 

Also: your tie needs to end in the same voice it started. \new Voice and the 
<<\\>> construct both create other voices. If you remove \new Voice = “melody” 
from your first attempt it will work, as the last note of the tie is then in 
the same voice as the first. 

 

25 jan. 2024 kl. 00:37 skrev Mark Stephen Mrotek mailto:carsonm...@ca.rr.com> >:

 

Butter,

 

Use
\repeatTie

See
https://lilypond.org/doc/v2.22/Documentation/notation/long-repeats#normal-repeats

 

Mark

 

From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
  
mailto:lilypond-user-bounces+carsonmark=ca.rr@gnu.org> > On Behalf Of 
Butter Cream
Sent: Wednesday, January 24, 2024 1:29 PM
To: lilypond-user@gnu.org  
Subject: Ties across voices; tried two methods

 

Hi ponders, I have a piece of music with alternative ending. The last measure 
prior to the alternative is a single voice has a tied note to both endings. I'v 
e tried two methods but both methods produce similar error: {with no tie} Any 
help would be appreciated.

 

*.ly:100:42: warning: unterminated tie

4 8 ~ 4 r8 bes

 ~ | % m19

 

[16][16]

 

 

I've tried both these methods: 

4 8 ~ 4 r8 bes~ | % m19   <-Last measure single voice

  } <- end of repeat Volta 2

  \alternative {

% method one using \new Voice 

 { \new Voice = "melody" {

<< { \voiceOne bes8 g4 g8~ g2 }

   \new Voice { \voiceTwo 2 2 }

>> \oneVoice

} | 4 r r2 | % m

   }

{ { \new Voice = "melody" {

<< { \voiceOne bes'8 g4 g8~ g2 }

   \new Voice { \voiceTwo 2 2 }

>> \oneVoice

} | % m

   } 4 r r2 | }

  }

  }

 

\alternative {

% method two using \\

  { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }

  { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }

 }

 

produces this. with notes not tied.



 

Thank you.



Re: Incipit with default noteheads possible?

2024-01-24 Thread David Kastrup
Hajo Baess  writes:

> This works for the note heads, but if there happen to be accidentals
> around (in my project this is the case), they remain mensural style. Is
> there another override for this, too?
>
> Am Mittwoch, dem 24.01.2024 um 16:14 +0200 schrieb YTG 1234:
>> > I have tried an override ( \override
>> > Staff.NoteHead.style = #'default )
>> 
>> Note heads are drawn in Voice, so you can just omit the context name.
>> \override NoteHead.style = #'default
>> 
>> The more fundamental issue here, though, is that \incipit is
>> hardcoded 
>> to create a MensuralStaff context. Does anyone know how to replicate
>> its 
>> effect with a normal Staff, short of just substituting in its source
>> code?

How about this?

\version "2.24.2"

incipit =
#(define-music-function (incipit-music) (ly:music?)
  (_i "Output @var{incipit-music} as an incipit.

@var{incipit-music} is typeset within a @code{MensuralStaff} context; 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)))

 (unless (and (music-is-of-type? incipit-music 'context-specification)
  (assq (ly:music-property incipit-music 'context-type)
(ly:output-find-context-def (ly:grob-layout grob) 'Staff)))
   ;; not a staff-like context
   (set! incipit-music (context-spec-music incipit-music 'MensuralStaff)))
 (set! (ly:music-property incipit-music 'create-new) #t)
 (set! (ly:music-property incipit-music 'property-operations)
   (append (ly:music-property incipit-music 'property-operations)
   `((push InstrumentName ,align-x self-alignment-X)
 (push InstrumentName ,align-y self-alignment-Y)
 (assign instrumentName ,instrument-name
 (set! (ly:grob-property grob 'long-text)
   #{ \markup \score { #incipit-music   
   \layout {
$(ly:grob-layout grob)
 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)))
#}
  )

\language "deutsch"

Incipit = \relative c'' {
	\clef treble \time 4/4
	\omit Staff.TimeSignature
	\hide Stem
	%\mark "A D FIS CIS"
	< a, d fis cis' >

}

noten =  \relative c'' {
	\clef treble \key f \major \time 4/4
	c4 d e f \bar "|."
}

\score {

	\new Staff
	<<
		\incipit \new Staff \Incipit
		\set Staff.instrumentName = "Violino discordato"
		\noten
	>>


	\layout {
		indent = 4\cm
		incipit-width = 1\cm
	}
}


-- 
David Kastrup


Re: Ties across voices; tried two methods

2024-01-24 Thread Butter Cream
Thank you! I will implement your suggestions.

Sent via the Samsung Galaxy S20 FE 5G, an AT 5G smartphone
Get Outlook for Android

From: Leo Correia de Verdier 
Sent: Wednesday, January 24, 2024 7:21:29 PM
To: Mark Stephen Mrotek 
Cc: Butter Cream ; lilypond-user@gnu.org 

Subject: Re: Ties across voices; tried two methods

Also: your tie needs to end in the same voice it started. \new Voice and the 
<<\\>> construct both create other voices. If you remove \new Voice = “melody” 
from your first attempt it will work, as the last note of the tie is then in 
the same voice as the first.

25 jan. 2024 kl. 00:37 skrev Mark Stephen Mrotek :



Butter,



Use
\repeatTie

See
https://lilypond.org/doc/v2.22/Documentation/notation/long-repeats#normal-repeats



Mark



From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
 On Behalf Of Butter Cream
Sent: Wednesday, January 24, 2024 1:29 PM
To: lilypond-user@gnu.org
Subject: Ties across voices; tried two methods



Hi ponders, I have a piece of music with alternative ending. The last measure 
prior to the alternative is a single voice has a tied note to both endings. I'v 
e tried two methods but both methods produce similar error: {with no tie} Any 
help would be appreciated.



*.ly:100:42: warning: unterminated tie

4 8 ~ 4 r8 bes

 ~ | % m19



[16][16]





I've tried both these methods:

4 8 ~ 4 r8 bes~ | % m19   <-Last measure single voice

  } <- end of repeat Volta 2

  \alternative {

% method one using \new Voice

 { \new Voice = "melody" {

<< { \voiceOne bes8 g4 g8~ g2 }

   \new Voice { \voiceTwo 2 2 }

>> \oneVoice

} | 4 r r2 | % m

   }

{ { \new Voice = "melody" {

<< { \voiceOne bes'8 g4 g8~ g2 }

   \new Voice { \voiceTwo 2 2 }

>> \oneVoice

} | % m

   } 4 r r2 | }

  }

  }



\alternative {

% method two using \\

  { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }

  { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }

 }



produces this. with notes not tied.





Thank you.


Re: Ties across voices; tried two methods

2024-01-24 Thread Leo Correia de Verdier
Also: your tie needs to end in the same voice it started. \new Voice and the 
<<\\>> construct both create other voices. If you remove \new Voice = “melody” 
from your first attempt it will work, as the last note of the tie is then in 
the same voice as the first. 

> 25 jan. 2024 kl. 00:37 skrev Mark Stephen Mrotek :
> 
> 
> Butter,
>  
> Use
> \repeatTie
> See
> https://lilypond.org/doc/v2.22/Documentation/notation/long-repeats#normal-repeats
>  
> Mark
>  
> From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org 
>  On Behalf Of Butter Cream
> Sent: Wednesday, January 24, 2024 1:29 PM
> To: lilypond-user@gnu.org
> Subject: Ties across voices; tried two methods
>  
> Hi ponders, I have a piece of music with alternative ending. The last measure 
> prior to the alternative is a single voice has a tied note to both endings. 
> I'v e tried two methods but both methods produce similar error: {with no tie} 
> Any help would be appreciated.
>  
> *.ly:100:42: warning: unterminated tie
> 4 8 ~ 4 r8 bes
>  ~ | % m19
>  
> [16][16]
>  
>  
> I've tried both these methods: 
> 4 8 ~ 4 r8 bes~ | % m19   <-Last measure single 
> voice
>   } <- end of repeat Volta 2
>   \alternative {
> % method one using \new Voice 
>  { \new Voice = "melody" {
> << { \voiceOne bes8 g4 g8~ g2 }
>\new Voice { \voiceTwo 2 2 }
> >> \oneVoice
> } | 4 r r2 | % m
>}
> { { \new Voice = "melody" {
> << { \voiceOne bes'8 g4 g8~ g2 }
>\new Voice { \voiceTwo 2 2 }
> >> \oneVoice
> } | % m
>} 4 r r2 | }
>   }
>   }
>  
> \alternative {
> % method two using \\
>   { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }
>   { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }
>  }
>  
> produces this. with notes not tied.
> 
>  
> Thank you.


Re: Incipit with default noteheads possible?

2024-01-24 Thread Hajo Baess
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)) 
> >          #{ { 

RE: Ties across voices; tried two methods

2024-01-24 Thread Mark Stephen Mrotek
Butter,

 

Use
\repeatTie

See
https://lilypond.org/doc/v2.22/Documentation/notation/long-repeats#normal-re
peats

 

Mark

 

From: lilypond-user-bounces+carsonmark=ca.rr@gnu.org
 On Behalf Of Butter
Cream
Sent: Wednesday, January 24, 2024 1:29 PM
To: lilypond-user@gnu.org
Subject: Ties across voices; tried two methods

 

Hi ponders, I have a piece of music with alternative ending. The last
measure prior to the alternative is a single voice has a tied note to both
endings. I'v e tried two methods but both methods produce similar error:
{with no tie} Any help would be appreciated.

 

*.ly:100:42: warning: unterminated tie

4 8 ~ 4 r8 bes

 ~ | % m19

 

[16][16]

 

 

I've tried both these methods: 

4 8 ~ 4 r8 bes~ | % m19   <-Last measure single
voice

  } <- end of repeat Volta 2

  \alternative {

% method one using \new Voice 

 { \new Voice = "melody" {

<< { \voiceOne bes8 g4 g8~ g2 }

   \new Voice { \voiceTwo 2 2 }

>> \oneVoice

} | 4 r r2 | % m

   }

{ { \new Voice = "melody" {

<< { \voiceOne bes'8 g4 g8~ g2 }

   \new Voice { \voiceTwo 2 2 }

>> \oneVoice

} | % m

   } 4 r r2 | }

  }

  }

 

\alternative {

% method two using \\

  { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }

  { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }

 }

 

produces this. with notes not tied.



 

Thank you.



image001.png
Description: Binary data


Re: Incipit with default noteheads possible?

2024-01-24 Thread Hajo Baess
This works for the note heads, but if there happen to be accidentals
around (in my project this is the case), they remain mensural style. Is
there another override for this, too?

Am Mittwoch, dem 24.01.2024 um 16:14 +0200 schrieb YTG 1234:
> > I have tried an override ( \override
> > Staff.NoteHead.style = #'default )
> 
> Note heads are drawn in Voice, so you can just omit the context name.
> \override NoteHead.style = #'default
> 
> The more fundamental issue here, though, is that \incipit is
> hardcoded 
> to create a MensuralStaff context. Does anyone know how to replicate
> its 
> effect with a normal Staff, short of just substituting in its source
> code?
> 




Re: Incipit with default noteheads possible?

2024-01-24 Thread 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)))
  
    #}
  
  )

  




Ties across voices; tried two methods

2024-01-24 Thread Butter Cream
Hi ponders, I have a piece of music with alternative ending. The last measure 
prior to the alternative is a single voice has a tied note to both endings. I'v 
e tried two methods but both methods produce similar error: {with no tie} Any 
help would be appreciated.

*.ly:100:42: warning: unterminated tie
4 8 ~ 4 r8 bes
 ~ | % m19

[16][16]


I've tried both these methods:
4 8 ~ 4 r8 bes~ | % m19   <-Last measure single voice
  } <- end of repeat Volta 2
  \alternative {
% method one using \new Voice
 { \new Voice = "melody" {
<< { \voiceOne bes8 g4 g8~ g2 }
   \new Voice { \voiceTwo 2 2 }
>> \oneVoice
} | 4 r r2 | % m
   }
{ { \new Voice = "melody" {
<< { \voiceOne bes'8 g4 g8~ g2 }
   \new Voice { \voiceTwo 2 2 }
>> \oneVoice
} | % m
   } 4 r r2 | }
  }
  }

\alternative {
% method two using \\
  { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }
  { << { bes8 g4 g8~ g2 } \\ { 2 2 } >> | 4 r r2 | }
 }

produces this. with notes not tied.
[cid:e6adac20-74ec-4c19-baf0-ca776f33d2d9]

Thank you.


Re: Incipit with default noteheads possible?

2024-01-24 Thread YTG 1234
Here's my attempt at this (I don't know how to check for staff-like 
contexts, so I just put them all in a list). It's just \incipit but with 
an additional condition and the context mods moved to \layout.




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)))
  #}
)



David Kastrup wrote:

YTG 1234  writes:


I have tried an override ( \override
Staff.NoteHead.style = #'default )

Note heads are drawn in Voice, so you can just omit the context
name. \override NoteHead.style = #'default

The more fundamental issue here, though, is that \incipit is hardcoded
to create a MensuralStaff context. Does anyone know how to replicate
its effect with a normal Staff, short of just substituting in its
source code?

I think there might be a point in modifying incipit such that if it is
called as

\incipit \new staff-like-context ...

that it will not do a \new MensuralStaff but just take what is given,
add its specific context creation mods to any that might already be
there, and work with that.





Re: Incipit with default noteheads possible?

2024-01-24 Thread David Kastrup
YTG 1234  writes:

>> I have tried an override ( \override
>> Staff.NoteHead.style = #'default )
>
> Note heads are drawn in Voice, so you can just omit the context
> name. \override NoteHead.style = #'default
>
> The more fundamental issue here, though, is that \incipit is hardcoded
> to create a MensuralStaff context. Does anyone know how to replicate
> its effect with a normal Staff, short of just substituting in its
> source code?

I think there might be a point in modifying incipit such that if it is
called as

\incipit \new staff-like-context ...

that it will not do a \new MensuralStaff but just take what is given,
add its specific context creation mods to any that might already be
there, and work with that.

-- 
David Kastrup



Re: Incipit with default noteheads possible?

2024-01-24 Thread YTG 1234

I have tried an override ( \override
Staff.NoteHead.style = #'default )


Note heads are drawn in Voice, so you can just omit the context name. 
\override NoteHead.style = #'default


The more fundamental issue here, though, is that \incipit is hardcoded 
to create a MensuralStaff context. Does anyone know how to replicate its 
effect with a normal Staff, short of just substituting in its source code?