Stemless music with slurs

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Stemless music with slurs

Michael Welsh Duggan
I've been trying to typeset some English chant in a sort-of
intermediate notation between standard notation and Vaticana neumes.
The follownig piece is an example:



Now, there have been situations (although not in this piece) where
slurs will look awkward due to their avoidance of the (invisible!)
stems.  Now, the best thing to do would be (IMHO) to remove the
Stem_engraver.  Unfortunatly, in its current incarnation, slurs
segfault when Stem objects are not created.

Example follows:



I have traced this to Slur_score_state::get_bound_info, where the
following segfaults:  

          extremes[d].stem_ = Note_column::get_stem (extremes[d].note_column_);
          extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_);

I would like to fix this, but have not yet been able to figure out
what all the elements in a Bound_info are for.  Any pointers would be
very welcome.

--
Michael Welsh Duggan
([hidden email])

_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

communion.ly (903 bytes) Download Attachment
test16.ly (830 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Mats Bengtsson-6
If you want to remove the stems completely but not the engraver, it should
work to set
\override Staff.Stem #'print-function = ##f

Wait a second, the above solution is for version 2.6 and you are using
version 2.7.14. Then I hope that the following works instead:
\override Staff.Stem #'stencil = ##f

   /Mats

Michael Welsh Duggan wrote:

>I've been trying to typeset some English chant in a sort-of
>intermediate notation between standard notation and Vaticana neumes.
>The follownig piece is an example:
>
>  
>
>------------------------------------------------------------------------
>
>\include "english.ly"
>\version "2.7.14"
>
>barOne = { \once \override Staff.BarLine #'bar-size = #2
>   \bar "|" }
>barTwo = { \once \override Staff.BarLine #'extra-offset = #'(0 . 2)
>   \once \override Staff.BarLine #'bar-size = #2
>   \bar "|" }
>
>chant = \relative c' {
>  \set Staff.autoBeaming = ##f
>  \set Score.timing = ##f
>  \override Staff.Stem #'transparent = ##t
>  \override Staff.TimeSignature #'transparent = ##t
>  \key f \major
>  \mark \markup {Antiphon \hspace #2 \italic{"Ps. 29"} }
>  f8 g( a) f( d) f( g f4.) \barTwo
>  f8 g( a) a4. \barOne
>  a8 f g a c( d c) c4. \barTwo
>  f,8( g) a( g) a f( g f4.) \bar "||"
>}
>
>text = \lyricmode {
>  The Lord will reign
>  for e -- ver;
>  and will give his peo -- ple
>  the gift of peace.
>}
>
>\score {
>  <<
>    \context Voice = staff \chant
>    \lyricsto "staff" \new Lyrics \text
>  >>
>  \layout{
>    indent = 0
>  }
>}  
>  
>
>------------------------------------------------------------------------
>
>
>Now, there have been situations (although not in this piece) where
>slurs will look awkward due to their avoidance of the (invisible!)
>stems.  Now, the best thing to do would be (IMHO) to remove the
>Stem_engraver.  Unfortunatly, in its current incarnation, slurs
>segfault when Stem objects are not created.
>
>Example follows:
>
>  
>
>------------------------------------------------------------------------
>
>\version "2.7.17"
>
>
>barOne = { \once \override Staff.BarLine #'bar-size = #2
>   \bar "|" }
>barTwo = { \once \override Staff.BarLine #'extra-offset = #'(0 . 2)
>   \once \override Staff.BarLine #'bar-size = #2
>   \bar "|" }
>
>chant = \relative c' {
>  \set Score.timing = ##f
>  \key f \major
>  \mark \markup {Antiphon \hspace #2 \italic{"Ps. 29"} }
>  f8 g( a) f( d) f( g f4.) \barTwo
>  f8 g( a) a4. \barOne
>  a8 f g a c( d c) c4. \barTwo
>  f,8( g) a( g) a f( g f4.) \bar "||"
>}
>
>text = \lyricmode {
>  The Lord will reign
>  for e -- ver;
>  and will give his peo -- ple
>  the gift of peace.
>}
>
>\score {
>  <<
>    \new Staff {
>      \chant
>    }
>%    \lyricsto "staff" \new Lyrics { \text }
>  >>
>  \layout {
>    indent = 0
>    \context {
>      \Voice
>      \remove "Stem_engraver"
>    }
>  }
>}
>  
>
>------------------------------------------------------------------------
>
>
>I have traced this to Slur_score_state::get_bound_info, where the
>following segfaults:  
>
>  extremes[d].stem_ = Note_column::get_stem (extremes[d].note_column_);
>  extremes[d].stem_dir_ = get_grob_direction (extremes[d].stem_);
>
>I would like to fix this, but have not yet been able to figure out
>what all the elements in a Bound_info are for.  Any pointers would be
>very welcome.
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>lilypond-devel mailing list
>[hidden email]
>http://lists.gnu.org/mailman/listinfo/lilypond-devel
>  
>

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
        Fax:   (+46) 8 790 7260
        Email: [hidden email]
        WWW: http://www.s3.kth.se/~mabe
=============================================



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Michael Welsh Duggan
Mats Bengtsson <[hidden email]> writes:

> If you want to remove the stems completely but not the engraver, it should
> work to set
> \override Staff.Stem #'print-function = ##f
>
> Wait a second, the above solution is for version 2.6 and you are using
> version 2.7.14. Then I hope that the following works instead:
> \override Staff.Stem #'stencil = ##f
>

Godd idea, but it doesn't work in practice.  The stems are gone, but
slurs still avoid them as if they were there, probably due to the same
code in slur-scoring.cc.

Example:


\version "2.7.17"

barOne = { \once \override Staff.BarLine #'bar-size = #2
           \bar "|" }
barTwo = { \once \override Staff.BarLine #'extra-offset = #'(0 . 2)
           \once \override Staff.BarLine #'bar-size = #2
           \bar "|" }

chant = \relative c' {
  \set Staff.autoBeaming = ##f
  \set Score.timing = ##f
  \key f \major
  \mark \markup {Antiphon \hspace #2 \italic{"Ps. 29"} }
  \override Staff.Stem #'stencil = ##f
  \override Staff.Beam #'stencil = ##f
  \slurUp
  f8 g( a) f( d) f( g f4.) \barTwo
  f8 g( a) a4. \barOne
  a8 f g a c( d c) c4. \barTwo
  f,8( g) a( g) a f( g f4.) \bar "||"
}

text = \lyricmode {
  The Lord will reign
  for e -- ver;
  and will give his peo -- ple
  the gift of peace.
}

\score {
  <<
    \new Staff {
      \chant
    }
%    \lyricsto "staff" \new Lyrics { \text }
  >>
  \layout {
    indent = 0
  }
}


--
Michael Welsh Duggan
([hidden email])

_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

test16.png (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Hans Forbrich
On November 15, 2005 11:30 am, Michael Welsh Duggan wrote:
>
> Godd idea, but it doesn't work in practice.  The stems are gone, but
> slurs still avoid them as if they were there, probably due to the same
> code in slur-scoring.cc.
>

What happens if you add a 'stem down' command as well?  Then the invisible
stems don't collide with the slurs
--
Proud user of Lilypond Music Typesetting Tools
http://www.lilypond.org


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Juergen Reuter
In reply to this post by Michael Welsh Duggan

I think the following does *almost* what you want (only almost, because
you get harmonic note heads instead of quarter note heads):


\version "2.7.17"

#(define-public (note-head::calc-glyph-name grob) "2")

barOne = { \once \override Staff.BarLine #'bar-size = #2
            \bar "|" }
barTwo = { \once \override Staff.BarLine #'extra-offset = #'(0 . 2)
            \once \override Staff.BarLine #'bar-size = #2
            \bar "|" }

chant = \relative c' {
   \set Staff.autoBeaming = ##f
   \set Score.timing = ##f
   \key f \major
   \mark \markup {Antiphon \hspace #2 \italic{"Ps. 29"} }
   \override Staff.NoteHead #'style = #'harmonic
   \slurUp
   f1 g( a) f( d) f( g f1.) \barTwo
   f1 g( a) a1. \barOne
   a1 f g a c( d c) c1. \barTwo
   f,1( g) a( g) a f( g f1.) \bar "||"
}

text = \lyricmode {
   The Lord will reign
   for e -- ver;
   and will give his peo -- ple
   the gift of peace.
}

\score {
   <<
     \new Staff {
       \chant
     }
%    \lyricsto "staff" \new Lyrics { \text }
   >>
   \layout {
     indent = 0
   }
}



The only thing that does _not_ work here is the "define-public" definition
at the very top: it has no effect.  It is supposed to replace the
definition in scm/output-lib.scm, such that you always get quarter note
heads, but it does not seem to be possible to override this definition (or
do I miss something?).  If you directly modify output-lib.scm accordingly,
than it perfectly works.  (Ideally, you probably would like to patch lily
such that you can say something like "\override Staff.NoteHead #'style =
#'4" or "\override Staff.NoteHead #'style = #'default4".)

The basic idea here is to use stemless whole note durations and override
NoteHead style such that whole notes are printed with quarter note heads.

Greetings,
Juergen


On Tue, 15 Nov 2005, Michael Welsh Duggan wrote:

> Mats Bengtsson <[hidden email]> writes:
>
>> If you want to remove the stems completely but not the engraver, it should
>> work to set
>> \override Staff.Stem #'print-function = ##f
>>
>> Wait a second, the above solution is for version 2.6 and you are using
>> version 2.7.14. Then I hope that the following works instead:
>> \override Staff.Stem #'stencil = ##f
>>
>
> Godd idea, but it doesn't work in practice.  The stems are gone, but
> slurs still avoid them as if they were there, probably due to the same
> code in slur-scoring.cc.
>
> Example:
>
>


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Juergen Reuter
On Tue, 15 Nov 2005, Juergen Reuter wrote:

>
> I think the following does *almost* what you want (only almost, because you
> get harmonic note heads instead of quarter note heads):
>
> ...
>  \override Staff.NoteHead #'style = #'harmonic
> ...

With attached patch, you can say

   \override Staff.NoteHead #'style = #'default2

and it will do want you want.

Should I apply this patch (Han-Wen/Jan?)?

Greetings,
Juergen
_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

lilypatch.diff (922 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Michael Welsh Duggan
In reply to this post by Hans Forbrich
Hans Forbrich <[hidden email]> writes:

> On November 15, 2005 11:30 am, Michael Welsh Duggan wrote:
>>
>> Godd idea, but it doesn't work in practice.  The stems are gone, but
>> slurs still avoid them as if they were there, probably due to the same
>> code in slur-scoring.cc.
>>
>
> What happens if you add a 'stem down' command as well?  Then the invisible
> stems don't collide with the slurs

That is true, but the reason for the \slurUp was to trigger the
problem, rather than because I wanted the slurs to be on the top.  I
could always specify on a group-per-group basis stem and slur
direction to side-step the problem.  I was hoping not to have to do
that, however.

--
Michael Welsh Duggan
([hidden email])


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Han-Wen Nienhuys
In reply to this post by Michael Welsh Duggan
Michael Welsh Duggan wrote:

> Mats Bengtsson <[hidden email]> writes:
>
>
>>If you want to remove the stems completely but not the engraver, it should
>>work to set
>>\override Staff.Stem #'print-function = ##f
>>
>>Wait a second, the above solution is for version 2.6 and you are using
>>version 2.7.14. Then I hope that the following works instead:
>>\override Staff.Stem #'stencil = ##f
>>
>
>
> Godd idea, but it doesn't work in practice.  The stems are gone, but
> slurs still avoid them as if they were there, probably due to the same
> code in slur-scoring.cc.

Try setting #'length to 0 too.


--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Han-Wen Nienhuys
In reply to this post by Juergen Reuter
Juergen Reuter wrote:

> On Tue, 15 Nov 2005, Juergen Reuter wrote:
>
>>
>> I think the following does *almost* what you want (only almost,
>> because you get harmonic note heads instead of quarter note heads):
>>
>> ...
>>  \override Staff.NoteHead #'style = #'harmonic
>> ...
>
>
> With attached patch, you can say
>
>   \override Staff.NoteHead #'style = #'default2
>
> and it will do want you want.
>
> Should I apply this patch (Han-Wen/Jan?)?
>

No. What does default2 mean?

--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Michael Welsh Duggan
In reply to this post by Han-Wen Nienhuys
Han-Wen Nienhuys <[hidden email]> writes:

> Michael Welsh Duggan wrote:
>> Mats Bengtsson <[hidden email]> writes:
>>
>>>If you want to remove the stems completely but not the engraver, it should
>>>work to set
>>>\override Staff.Stem #'print-function = ##f
>>>
>>>Wait a second, the above solution is for version 2.6 and you are using
>>>version 2.7.14. Then I hope that the following works instead:
>>>\override Staff.Stem #'stencil = ##f
>>>
>> Godd idea, but it doesn't work in practice.  The stems are gone, but
>> slurs still avoid them as if they were there, probably due to the same
>> code in slur-scoring.cc.
>
> Try setting #'length to 0 too.
Better and better.  But the shorter slurs now look very odd.  See, for
example, the first two instances.  Note: I am not specifically
requesting support to make this better.  In the best case, I will
achieve enough understanding of the code to make this work in a truely
stemless manner.



--
Michael Welsh Duggan
([hidden email])

_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

test16.png (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Juergen Reuter
Here's what my approach, as described, yields (see attachment).

Greetings,
Juergen

On Tue, 15 Nov 2005, Michael Welsh Duggan wrote:

> Han-Wen Nienhuys <[hidden email]> writes:
>
>> Michael Welsh Duggan wrote:
>>> Mats Bengtsson <[hidden email]> writes:
>>>
>>>> If you want to remove the stems completely but not the engraver, it should
>>>> work to set
>>>> \override Staff.Stem #'print-function = ##f
>>>>
>>>> Wait a second, the above solution is for version 2.6 and you are using
>>>> version 2.7.14. Then I hope that the following works instead:
>>>> \override Staff.Stem #'stencil = ##f
>>>>
>>> Godd idea, but it doesn't work in practice.  The stems are gone, but
>>> slurs still avoid them as if they were there, probably due to the same
>>> code in slur-scoring.cc.
>>
>> Try setting #'length to 0 too.
>
> Better and better.  But the shorter slurs now look very odd.  See, for
> example, the first two instances.  Note: I am not specifically
> requesting support to make this better.  In the best case, I will
> achieve enough understanding of the code to make this work in a truely
> stemless manner.
>
>
_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

antiphon.png (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Michael Welsh Duggan
Juergen Reuter <[hidden email]> writes:

> Here's what my approach, as described, yields (see attachment).

That does, indeed, look very nice.  I will probably move to your
solution until a better one comes along.  Thank you very much.

> On Tue, 15 Nov 2005, Michael Welsh Duggan wrote:
>
>> Han-Wen Nienhuys <[hidden email]> writes:
>>
>>> Michael Welsh Duggan wrote:
>>>> Mats Bengtsson <[hidden email]> writes:
>>>>
>>>>> If you want to remove the stems completely but not the engraver, it should
>>>>> work to set
>>>>> \override Staff.Stem #'print-function = ##f
>>>>>
>>>>> Wait a second, the above solution is for version 2.6 and you are using
>>>>> version 2.7.14. Then I hope that the following works instead:
>>>>> \override Staff.Stem #'stencil = ##f
>>>>>
>>>> Godd idea, but it doesn't work in practice.  The stems are gone, but
>>>> slurs still avoid them as if they were there, probably due to the same
>>>> code in slur-scoring.cc.
>>>
>>> Try setting #'length to 0 too.
>>
>> Better and better.  But the shorter slurs now look very odd.  See, for
>> example, the first two instances.  Note: I am not specifically
>> requesting support to make this better.  In the best case, I will
>> achieve enough understanding of the code to make this work in a truely
>> stemless manner.
>>
>>
>

--
Michael Welsh Duggan
([hidden email])


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Han-Wen Nienhuys
In reply to this post by Michael Welsh Duggan
Michael Welsh Duggan wrote:
> Better and better.  But the shorter slurs now look very odd.  See, for
> example, the first two instances.  Note: I am not specifically
> requesting support to make this better.  In the best case, I will
> achieve enough understanding of the code to make this work in a truely
> stemless manner.

The slur code tries to avoid flags which aren't there. Try using c4*1/2
iso. c8


--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Han-Wen Nienhuys
In reply to this post by Michael Welsh Duggan
Michael Welsh Duggan wrote:
> Better and better.  But the shorter slurs now look very odd.  See, for
> example, the first two instances.  Note: I am not specifically
> requesting support to make this better.  In the best case, I will
> achieve enough understanding of the code to make this work in a truely
> stemless manner.

Come to think of it: why are you using 8th notes at all?

--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stemless music with slurs

Michael Welsh Duggan
Han-Wen Nienhuys <[hidden email]> writes:

> Michael Welsh Duggan wrote:
>> Better and better.  But the shorter slurs now look very odd.  See, for
>> example, the first two instances.  Note: I am not specifically
>> requesting support to make this better.  In the best case, I will
>> achieve enough understanding of the code to make this work in a truely
>> stemless manner.
>
> Come to think of it: why are you using 8th notes at all?

Hmm...  Historical (hysterical?) reasons.  I am converting from music
which has been written out using 8th notes.  I am using this as an
intermediate notation on our way to having people read Vaticana square
neume notation.  There's no good reason for it anymore, so I will
switch to stemless quarter notes, in order to fool the slurs.

--
Michael Welsh Duggan
([hidden email])


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Vaticana ligatures / spacing / other...

Michael Welsh Duggan
In reply to this post by Juergen Reuter
I am coming up to a point where I am going to be needing to use
LilyPond to typeset a great deal of Editio Vaticana-style chant
notation.  I have been reading the associated code in preperation for
delving in and making some fixes, but I wanted to see what work
Juergen might already have on this outside of CVS before I started
reinventing the wheel.  Some of these may already be working; I have
not tested all of them in the current version.  Also note: my interest
in typesetting chant notation is in the nature of a hobby -- I should
not be considered an expert.  As a result, any suggestions below may
be the result of my misunderstanding of "the way things are really
supposed to be".  I certainly do not mind being corrected.

Ligature spacing: as has been mentioned before, coherent ligatures (at
least of the vaticana variety) should act like a single un-breakable
paper column, but should not receive extra spacing based on the number
of notes within the ligature.  I am interested in getting this
working.  I can start with the TODO notes in
coherent-ligature-engraver.cc.

Breaking: when typesetting chant notation, we should be allowed to
break after any note or ligature, but with preference on the breath
marks. (Actually, ideal would be to try to only break on word
boundaries, but there's no simple representation for that right now.
Something to think about later, I guess...)

Ligature melismata: the ligature should act as automatic melismata for
purposes of setting text.

Punctum-mora stacking: Punctum-mora (dots) should stack nicely.

Accidental engraving: Should act as mentioned in the TODO in
coherent-ligature-engraver.cc.

--
Michael Welsh Duggan
([hidden email])


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Vaticana ligatures / spacing / other...

Han-Wen Nienhuys
Michael Welsh Duggan wrote:

> I am coming up to a point where I am going to be needing to use
> LilyPond to typeset a great deal of Editio Vaticana-style chant
> notation.  I have been reading the associated code in preperation for
> delving in and making some fixes, but I wanted to see what work
> Juergen might already have on this outside of CVS before I started
> reinventing the wheel.  Some of these may already be working; I have
> not tested all of them in the current version.  Also note: my interest
> in typesetting chant notation is in the nature of a hobby -- I should
> not be considered an expert.  As a result, any suggestions below may
> be the result of my misunderstanding of "the way things are really
> supposed to be".  I certainly do not mind being corrected.

The current ligature code has not been reviewed by Jan and me at all,
and it's ancient.  It's not a good guide for implementing more
functionality. I think it will be quicker to restart from scratch, and
simply borrow the code bits that you might need.

> Ligature spacing: as has been mentioned before, coherent ligatures (at
> least of the vaticana variety) should act like a single un-breakable
> paper column, but should not receive extra spacing based on the number
> of notes within the ligature.  I am interested in getting this
> working.  I can start with the TODO notes in
> coherent-ligature-engraver.cc.

You should create a new ligature engraver. It should acknowledge all the
relevant notes/neume item grobs.  The engraver creates an Item at the
start of  the ligature. The Item is an X axis-group, and all
neumes/notes are added to the Item as children. The item determines the
positioning of its X-children  (see eg.
Dot_column::calc_positioning_done). In a first version, it can put the
children in a row.

For engravers, code reuse through shared super classes has always had
bad results. So, derive the engraver directly from the Engraver class.

I think this is the major task that you should focus on. The rest of
your items are comparatively simple. If you want, I can also implement
the above as a sponsored feature, or lay-out a framework for you to put
complex positioning rules in.

--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Vaticana ligatures / spacing / other...

Juergen Reuter
On Thu, 17 Nov 2005, Han-Wen Nienhuys wrote:

> ...
>> Ligature spacing: as has been mentioned before, coherent ligatures (at
>> least of the vaticana variety) should act like a single un-breakable
>> paper column, but should not receive extra spacing based on the number
>> of notes within the ligature.  I am interested in getting this
>> working.  I can start with the TODO notes in
>> coherent-ligature-engraver.cc.
>
> You should create a new ligature engraver. It should acknowledge all the
> relevant notes/neume item grobs.  The engraver creates an Item at the start
> of  the ligature. The Item is an X axis-group, and all neumes/notes are added
> to the Item as children. The item determines the positioning of its
> X-children  (see eg. Dot_column::calc_positioning_done). In a first version,
> it can put the children in a row.
>

I tried a similar approach long time ago around 1.9.x, but I failed, since
I would have needed to duplicate much code around the note head engraver
(e.g. handling of articulation scripts, ...).  However, lily has changed a
lot since then; hence, it may be worth trying again.

> For engravers, code reuse through shared super classes has always had bad
> results. So, derive the engraver directly from the Engraver class.
>

Well, the original idea was to have not only a vaticana engraver, but also
a medicea engraver, a gothic neumes (hufnagel) engraver, maybe even an
adiastematic neumes engraver, etc.  In that case, the amount of code reuse
would have been rather tremendously.

Please notice the idea of stacked abstraction layers.  Gregorian chant
notation exists in a plethora of notational styles.  If you write down the
same piece once in Vaticana style and once in gothic neumes, the
non-professional reader possibly would not even recognize that it is the
same piece of music.  However, the syntax was designed to be the same for
all common notational styles, such that you e.g. can switch between them
by just adding/removing a proper engraver to/from the voice context
(though this has not been proven so far since the gothic neumes engraver
has not yet been implemented).  This goal is achieved by internally
breaking down complex neumes into primitive ones, e.g. porrectus into
flexa+pes, or epiphonus into pes+deminutum.  The intention is to share
this approach between all Gregorian chant notation flavours.  The shared
super classes reflect this intention of hierarchical abstraction.

Btw. (off-topic), I also intended to implement the Gregorian square neumes
ligatures table (cp. lily v2.7.16 manual Sect. 7.7.10.2) slilghtly
generalized as scheme functions, such that you e.g. can say "\porrectus {
a b c }" which will translate to "\[ a \flexa g \pes b \]".  A "\ligature"
command that internally produces "\[" and "\]" is already defined in
ly/gregorian-init.ly.

> I think this is the major task that you should focus on. The rest of your
> items are comparatively simple.

What about the spacing *between* ligature items?  Even with packed and
raggedright options, lily's spacing engine heavily depends on note
durations, while neumes per se do not have any fixed duration.

Michael Welsh Duggan wrote:

> ...
> Breaking: when typesetting chant notation, we should be allowed to
> break after any note or ligature,

This should already work (assuming it's not currently broken):
"get_score_engraver ()->forbid_breaks ()" in
Ligature_engraver::process_music () forbids breaks within ligatures
(although Coherent_ligature_engraver may be a more apropriate place for
it); and "Score.timing = ##f" and "Score.barAlways = ##t" allows breaks
anywhere else.

> but with preference on the breath
> marks. (Actually, ideal would be to try to only break on word
> boundaries, but there's no simple representation for that right now.
> Something to think about later, I guess...)
>

This requires far more work, afaics.  Btw., interaction between lyrics and
breath marks is also required for correct aligning of directive signs like
versus, responsio, etc.  Maybe the stanza number engraver can be
generalized to handle such things; conceptually, stanza numbers are
strongly related.

> Ligature melismata: the ligature should act as automatic melismata for
> purposes of setting text.
>

In general, this is difficult to accomplish: usually, there may be at
most one syllable per ligature; however, there may be multiple ligatures
per syllable.  Hence, you would still have to tell which ligatures belong
to a single syllable.

> Punctum-mora stacking: Punctum-mora (dots) should stack nicely.
>

Right.  This task is similar to the accidental engraving: you have to
collect all dots and put them behind the ligature aligned in a column.
For mensural music, however, you often find the dots printed above the
ligature.  So, in general, you should be able to easily switch between
these two modes plus the conventional mode of dot engraving.

> Accidental engraving: Should act as mentioned in the TODO in
> coherent-ligature-engraver.cc.

I tried to write an according patch two months ago, but unfortunately I
failed.  I guess the main problem is that my code can deliver the
accidentals in a bunch only after the ligature has finished, while lily
seems to require the accidentals to be announced much earlier.  I also had
to duplicate some amount of private data structures and code of the
accidentals related engravers...

Greetings,
Juergen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Vaticana ligatures / spacing / other...

Han-Wen Nienhuys
Juergen Reuter wrote:
> I tried a similar approach long time ago around 1.9.x, but I failed,
> since I would have needed to duplicate much code around the note head
> engraver (e.g. handling of articulation scripts, ...).  However, lily
> has changed a lot since then; hence, it may be worth trying again.

I doubt that you used this approach. If you give the note heads (or
Note_columns) X-parents they are not put on the new PaperColumns. If you
attach scripts to note-heads (which is done by default, IIRC) with
grob::set_parent(), then the scripts are always over the heads,
whereever they are moved.

>> For engravers, code reuse through shared super classes has always had
>> bad results. So, derive the engraver directly from the Engraver class.
>
> Well, the original idea was to have not only a vaticana engraver, but
> also a medicea engraver, a gothic neumes (hufnagel) engraver, maybe even
> an adiastematic neumes engraver, etc.  In that case, the amount of code
> reuse would have been rather tremendously.

"would have been" is an example of the YAGNI principle of programming.
Code reuse is something you demonstrate by folding down common cases,
thereby diminishing complexity. If you do it beforehand, the glue to
achieve it mostly takes up more space than the reuse saves.

> Please notice the idea of stacked abstraction layers.  Gregorian chant
> notation exists in a plethora of notational styles.  If you write down
> the same piece once in Vaticana style and once in gothic neumes, the
> non-professional reader possibly would not even recognize that it is the
> same piece of music.  However, the syntax was designed to be the same
> for all common notational styles, such that you e.g. can switch between
> them by just adding/removing a proper engraver to/from the voice context
> (though this has not been proven so far since the gothic neumes engraver
> has not yet been implemented).  This goal is achieved by internally
> breaking down complex neumes into primitive ones, e.g. porrectus into
> flexa+pes, or epiphonus into pes+deminutum.  The intention is to share
> this approach between all Gregorian chant notation flavours.  The shared
> super classes reflect this intention of hierarchical abstraction.

I'm not saying that different chant notations are unrelated.  I'm just
saying that implementation inheritance is not the way to write
engravers. Breaking down ligatures in primitives does not necessitate
C++ class inheritance.

> What about the spacing *between* ligature items?  Even with packed and
> raggedright options, lily's spacing engine heavily depends on note
> durations, while neumes per se do not have any fixed duration.

If you put all neumes on a single X-axis group, they are spaced with
fixed distances. Spacing separate neumes/ligatures is a different issue,
but it would be a fairly local problem, architecturally. Let's work on
one problem at a time.

> This requires far more work, afaics.  Btw., interaction between lyrics
> and breath marks is also required for correct aligning of directive
> signs like versus, responsio, etc.  Maybe the stanza number engraver can
> be generalized to handle such things; conceptually, stanza numbers are
> strongly related.

The stanza engraver just puts numbers next to lyric syllables, so I
doubt that it would the right place to start.

>> Punctum-mora stacking: Punctum-mora (dots) should stack nicely.
>
> Right.  This task is similar to the accidental engraving: you have to
> collect all dots and put them behind the ligature aligned in a column.
> For mensural music, however, you often find the dots printed above the
> ligature.  So, in general, you should be able to easily switch between
> these two modes plus the conventional mode of dot engraving.

This sounds suspiciously similar to aligning dots after note heads.
What's the difference.

>> Accidental engraving: Should act as mentioned in the TODO in
>> coherent-ligature-engraver.cc.
>
> I tried to write an according patch two months ago, but unfortunately I
> failed.  I guess the main problem is that my code can deliver the
> accidentals in a bunch only after the ligature has finished, while lily
> seems to require the accidentals to be announced much earlier.  I also
> had to duplicate some amount of private data structures and code of the
> accidentals related engravers...

You can create an LigatureAccidentalPositioning item, at the same time
as the ligature, and then fill that with the appropriate accidentals.
If the positioning item is an X-axis group, it should work.

--
  Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel