]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/auto-change-iterator.cc: move contents from
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Feb 2004 16:35:49 +0000 (16:35 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Feb 2004 16:35:49 +0000 (16:35 +0000)
new-auto-change-iterator.cc from

* scm/part-combiner.scm: determine split-list from Scheme.

* lily/parser.yy (part_combined_music): remove old PC cruft.

* ly/engraver-init.ly: remove old
PC cruft.

* Documentation/user/refman.itely (The Lyrics context): note about
extender lines.

* scm/part-combiner.scm (determine-split-list): many bugfixes.

* input/regression/new-part-combine-solo-global.ly: new file.

* scm/part-combiner.scm: rewrite.

27 files changed:
ChangeLog
Documentation/user/refman.itely
input/puer-fragment.ly
input/regression/auto-change.ly
input/regression/grace-part-combine.ly
input/regression/part-combine-a2.ly
input/regression/part-combine-global.ly
input/regression/part-combine-solo-global.ly
input/regression/part-combine-solo.ly
input/regression/part-combine-text.ly
input/regression/part-combine.ly
input/test/ancient-font.ly
input/test/gregorian-scripts.ly
input/test/vaticana.ly
lily/auto-change-iterator.cc
lily/gregorian-ligature-engraver.cc
lily/include/auto-change-iterator.hh [deleted file]
lily/ligature-engraver.cc
lily/main.cc
lily/parser.yy
ly/engraver-init.ly
mf/parmesan-clefs.mf
mf/parmesan-heads.mf
mf/parmesan-rests.mf
scm/music-functions.scm
scm/part-combiner.scm
scripts/convert-ly.py

index 13ff20532d4ce6c91be1f7506be26ea3de3f7834..5073100ec5fcf54d7348fce8731ee2faff369c00 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-02-04  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/auto-change-iterator.cc: move contents from
+       new-auto-change-iterator.cc from
+
+       * scm/part-combiner.scm: determine split-list from Scheme. 
+
+       * lily/new-auto-change-iterator.cc (process): new file.
+
        * lily/parser.yy (part_combined_music): remove old PC cruft.
 
        * ly/engraver-init.ly: remove old
 
        * scm/part-combiner.scm: rewrite.
 
+2004-02-03  Juergen Reuter  <reuter@ipd.uka.de>
+
+       * Documentation/user/refman.itely, input/puer-fragment.ly,
+       input/test/vaticana.ly, ly/engraver-init.ly: ancient examples
+       updated for proper use of lyricsto; replaced "(" and ")" ->
+       "\melisma" and "\melismaEnd"
+
+       * input/test/ancient-font.ly: small updates to reduce compile
+       warnings (TODO: junk this file)
+
+       * input/test/gregorian-scripts.ly: added comment about bug
+
+       * lily/gregorian-ligature-engraver.cc, lily/ligature-engraver.cc:
+       tiny robustness fix
+
+       * mf/parmesan-clefs.mf: exact_center fixes (this broke due to
+       recent changes in the feta code); temporarily mapped mensural g
+       clef to a copy of petrucci g clef until mensural g clef will have
+       been rewritten
+
+       * mf/parmesan-heads.mf: bugfix: solved character name clashing
+       between mensural and neo-mensural heads (this broke quite a while
+       ago)
+
+       * mf/parmesan-rests.mf: still more tiny set_char_box() fixes
+
 2004-02-03  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scripts/filter-lilypond-book.py: Handle @include.  Add progress
index ddebd09cf1ad6b007c2780f65a557ae502bc628b..1bc941c76559d9752684617d93cb5ddedca41762 100644 (file)
@@ -3114,7 +3114,7 @@ Dynamics are not centered, but kludges do exist. See
 Voices can switch automatically between the top and the bottom
 staff. The syntax for this is
 @example
-  \autochange Staff \context Voice @{ @dots{}@var{music}@dots{} @}
+  \autochange \context Voice @{ @dots{}@var{music}@dots{} @}
 @end example
 The two staffs of the piano staff must be named @code{up} and
 @code{down}.
@@ -3126,8 +3126,8 @@ advance. Here is a practical example:
 @lilypond[verbatim,singleline,quote]
 \score { \notes \context PianoStaff <<
   \context Staff = "up" {
-    \autochange Staff \context Voice = VA << \relative c' {
-       g4 a  b c d r4 a g } >> }
+    \autochange \new Voice \relative c' {
+       g4 a  b c d r4 a g } }
   \context Staff = "down" {
        \clef bass
        s1*2
@@ -3153,6 +3153,7 @@ The staff switches often do not end up in optimal places. For high
 quality output, staff switches should be specified manually.
 
 
+
 @node Manual staff switches
 @subsection Manual staff switches
 
@@ -4528,7 +4529,7 @@ voices, and stem directions are set automatically.  Also, solo and
 The syntax for part combining is
 
 @example
-  \newpartcombine @var{musicexpr1} @var{musicexpr2}
+  \partcombine @var{musicexpr1} @var{musicexpr2}
 @end example
 
 The music expressions will be interpreted as @internalsref{Voice}
@@ -4539,7 +4540,7 @@ combiner: putting parts on one staff, and setting stem directions and
 polyphony:
 
 @lilypond[verbatim,singleline,fragment,relative 1]
-  \new Staff \newpartcombine 
+  \new Staff \partcombine 
       {
         g a( b) r
       }
@@ -4561,7 +4562,7 @@ may set the property @var{soloADue} to false:
 @lilypond[verbatim,singleline,fragment]
    \new Staff <<
     \property Staff.soloADue = ##f
-    \newpartcombine 
+    \partcombine 
       {
         g a( b) r
       }
@@ -4581,7 +4582,7 @@ Internals: @internalsref{PartCombineMusic},
 
 In @code{soloADue} mode, when the two voices play the same notes on and
 off, the part combiner may typeset @code{a2} more than once in a
-measure:
+measure.
 
 
 
@@ -5136,6 +5137,11 @@ For the @code{TAB} clef, see @ref{Tablatures}.
 
 Internals: for modern clefs, see @ref{Clef}.
 
+@refbugs
+
+The mensural g clef is temporarily mapped to the Petrucci g clef,
+until a new mensural g clef will have been implemented.
+
 
 
 @node Ancient flags
@@ -7368,15 +7374,15 @@ entering the chant, as the following short excerpt demonstrates:
 \include "gregorian-init.ly"
 \score {
 <<
-  \context VaticanaVoice {
+  \context VaticanaVoice = "cantus" {
     \property Score.BarNumber \set #'transparent = ##t
     \notes {
-      \[ c'( c' \flexa a \] \[ a \flexa \deminutum g) \] f \divisioMinima
-      \[ f( \pes a c' c' \pes d') \] c' \divisioMinima \break
-      \[ c'( c' \flexa a \] \[ a \flexa \deminutum g) \] f \divisioMinima
+      \[ c'\melisma c' \flexa a \] \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
+      \[ f\melisma \pes a c' c' \pes d'\melismaEnd \] c' \divisioMinima \break
+      \[ c'\melisma c' \flexa a \] \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima
     }
   }
-  \lyricsto "" \new LyricsVoice \lyrics {
+  \lyricsto "cantus" \new LyricsVoice \lyrics {
     San- ctus, San- ctus, San- ctus
   } >>
   
index 4dbb109c80e4d16e72ca4d865b34e0e75bda7a20..66ac122c758e3ffe9daf9a11d39a714804a7c405 100644 (file)
@@ -24,77 +24,66 @@ before the ligature (not demonstrated in this example)."
 %%% but this is intentional for editorial purposes (simplifies some
 %%% global search/replace operations in emacs).
 
-cantus = \notes {
-  \[ g4
-    (          %%% Pu-
+cantus = \context VaticanaVoice = "cantus" \notes {
+  \[ g4\melisma %%% Pu-
     \pes
-    d')
+    d'\melismaEnd
   \]
   d'           %%% er
-  \[ d'
-    (          %%% na-
+  \[ d'\melisma %%% na-
     \pes e' \flexa
-    d')
+    d'\melismaEnd
   \]
   c'           %%% tus
-  \[ c'
-    (          %%% est
+  \[ c'\melisma %%% est
     c'
-    c')
+    c'\melismaEnd
   \]
-  \[ d'
-    (          %%% no-
+  \[ d'\melisma %%% no-
     \flexa c' e' \flexa
-    d')
+    d'\melismaEnd
   \]
   d'            %%% bis,
   \divisioMaior
-  \[ g
-    (          %%% et
+  \[ g\melisma %%% et
     \pes \deminutum
-    d')
+    d'\melismaEnd
   \]
-  \[ d'
-    (          %%% fi-
+  \[ d'\melisma %%% fi-
     \pes e' \flexa
-    d')
+    d'\melismaEnd
   \]
-  \[ c'
-    (          %%% li-
+  \[ c'\melisma %%% li-
     \flexa
-    b)
+    b\melismaEnd
   \]
   a            %%% us
-  \[ c'
-    (          %%% da-
+  \[ c'\melisma %%% da-
     c' \pes
-    d')
+    d'\melismaEnd
   \]
   c'           %%% tus-
   c'           %%% est
-  \[ c'
-    (          %%% no-
+  \[ c'\melisma %%% no-
     \pes d' \flexa c'
-    c')
+    c'\melismaEnd
   \]
-  \[ g
-    (          %%% bis:
+  \[ g\melisma %%% bis:
     \pes a \flexa
-    g)
+    g\melismaEnd
   \]
   \divisioMaxima
 }
 
-verba = \context Lyrics = verba \lyrics {
+verba = \context Lyrics = "verba" \lyrics {
   Pu- er na- tus est no- bis,
   et fi- li- us da- tus est no- bis:
 }
 
 \score {
-  \context VaticanaVoice <<
-    \addlyrics
+  <<
     \cantus
-    \verba
+    \lyricsto "cantus" \verba
   >>
   \paper {
     linethickness = \staffspace / 7.0
@@ -103,8 +92,6 @@ verba = \context Lyrics = verba \lyrics {
     indent = 0.0
     raggedright = ##t
     packed = ##t
-%   width = 15.0 \cm %%% no effect?
-
     \translator {
       \ScoreContext
       \remove Bar_number_engraver
index 8e9d6b4eeb11b5518c413d93425c641e6967b7af..3f5c9f8b438ffab2ed84941d2bfe1c914716e09f 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.1.7"
+\version "2.1.18"
 
 \header {
 
@@ -14,7 +14,7 @@ note. When central C is reached, we don't switch (by default).
 \score {
        \notes \context PianoStaff <<
        \context Staff = "up" {
-               \autochange Staff \context Voice = VA << \relative c' { g4 c e d c r4 a g } >>
+               \autochange  \context Voice = VA << \relative c' { g4 c e d c r4 a g } >>
        }
        \context Staff = "down" {
                \clef bass 
index 8bf714bb543621f9f95f4b5123e6926da461a94b..6530118f17c8d7a7f599f88fdf12b874afa283c6 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "2.1.7"
+\version "2.1.18"
 \header {
     texidoc = "Partcombiner and grace notes can go together."
 }
@@ -8,7 +8,7 @@
 
 \score {
     \new Staff
-           \newpartcombine 
+           \partcombine 
             \notes \relative c'' {
                c4 d e f  \grace f16 g1
            }
index ad91a0b26f20020f6e3939cef0367430de9eb998..e49b9f92e52587c190c99e0e2816310a3b7d45db 100644 (file)
@@ -1,4 +1,5 @@
 
+\version "2.1.18"
 \header {
     texidoc ="The a2 string is only printed on notes, not on rests,
 and only after chords, solo or polyphony."
@@ -10,7 +11,7 @@ vtwo = \notes \relative a' { R1*2 g2 r2 g2 r2 f4 r4 g }
 
 \score {
     << \property Score.skipBars = ##t 
-   \newpartcombine \vone \vtwo
+   \partcombine \vone \vtwo
        >>
 }
  
index b39d9e03f0047d2c6a3900ca72e3eea86031bb23..15df3513f80c76b35a7d41146ca196b0c9883ce1 100644 (file)
@@ -11,7 +11,7 @@ voices.
   
 "
     }
-\version "1.9.8"
+\version "2.1.18"
 
 vone =\notes
 
@@ -30,5 +30,5 @@ vtwo =\notes
 }
 
 \score {
-    \newpartcombine \vone \vtwo
+    \partcombine \vone \vtwo
     }
index 3e6dfd6098b29522a65c719896894bfcd0377be7..47c1a2ff862cbfc386a4872caa914e8026a8ba62 100644 (file)
@@ -5,10 +5,11 @@
 
 }
 
+\version "2.1.18"
 
 \score {
     \new Staff
-    \newpartcombine \notes \relative c'' {
+    \partcombine \notes \relative c'' {
        bes2(
         a4)
        }
index be212b8a0d0ea5c70e59c196fb9366331e483e3b..fa7b8eaf59833bcf628fb918cd45b614423065d2 100644 (file)
@@ -17,10 +17,12 @@ Solo 1/2 can not be used when a spanner is active, so there is no solo
 vone = \notes \relative a' { g4 r8 g8 g8 r8 g8 r8 g2 ~ g2 ~ g4 }
 vtwo = \notes \relative g' { e4.   e8 r2          e4 r4 r2  e4 } 
 
+\version "2.1.18"
+
 \score {
     
     << \property Score.skipBars = ##t
-   \newpartcombine \vone \vtwo
+   \partcombine \vone \vtwo
        >>
 }
  
index 09d4b78ad6febf4263b4d781b4bf99cfd5a57f4b..ac3f7bd719c55e991cb4ba863eee0ea454ae2eed 100644 (file)
@@ -10,10 +10,12 @@ Detect a2, solo1, solo2  and print texts accordingly.
     }
 
 
+\version "2.1.18"
+
 vone = \notes \relative a' { R1 a2    r4 r a a a a }
 vtwo = \notes \relative a' { R1 f4 f4 f4 f f f a a  }
 
 \score {
-   \newpartcombine \vone \vtwo
+   \partcombine \vone \vtwo
 }
  
index dfc3cb5d873238639a4d444ffd4bfb45a2caa5f2..77b7510c3f4938d415e9f73842fec880071c0a06 100644 (file)
@@ -10,6 +10,8 @@ Apart for:
 "
     }
 
+\version "2.1.18"
+
 vone = \notes \relative a' { g2 g    g  g4 g f' c c( c) c c  c ~ c
                             c2. c4   c
                         }
@@ -19,6 +21,6 @@ vtwo = \notes \relative a' { f2 f4 f f2 g4 g c, f f  f  f f~ f ~ f
                         }
 
 \score {
-   \newpartcombine \vone \vtwo
+   \partcombine \vone \vtwo
 }
  
index 295cf63f1370f1c020500380476ee7c20c5d65d4..5d71a461a4bc61084eb6074c7a197766ef90e07d 100644 (file)
@@ -29,18 +29,18 @@ upperStaff =  \context GregorianStaff = upperStaff <<
        \property Staff.BarLine \override #'bar-size = #3.0 \bar "|"
 %      \break % 1 (8*1)
 
-       \property Voice.NoteHead \override #'style = #'vaticana_virga
+       \property Voice.NoteHead \override #'style = #'vaticana_quilisma
        b! des'! ges! fes!
        \breathe
        \clef "vaticana_fa1"
-       \property Voice.NoteHead \override #'style = #'vaticana_quilisma
+       \property Voice.NoteHead \override #'style = #'vaticana_plica
        es d
-       \property Voice.NoteHead \override #'style = #'vaticana_rvirga
+       \property Voice.NoteHead \override #'style = #'vaticana_reverse_plica
        c d
        \property Staff.BarLine \override #'bar-size = #3.0 \bar "|"
 %      \break %2 (8*1)
 
-       \property Voice.NoteHead \override #'style = #'vaticana_rvirga
+       \property Voice.NoteHead \override #'style = #'vaticana_punctum_cavum
        es f
        \property Voice.NoteHead \override #'style = #'vaticana_lpes
        g as
@@ -48,7 +48,7 @@ upperStaff =  \context GregorianStaff = upperStaff <<
        bes as
        \property Voice.NoteHead \override #'style = #'vaticana_vupes
        g f
-       \property Voice.NoteHead \override #'style = #'vaticana_plica
+       \property Voice.NoteHead \override #'style = #'vaticana_linea_punctum
        \property Staff.BarLine \override #'bar-size = #2.0 \bar "|"
 %      \break % 3 (8*1)
 
index 5a52dc3c62133b0d5018731c6eddeead17d568de..b0b6ef9f9fec0b4f98c0b50a854a5ab7c7cd61b2 100644 (file)
@@ -17,6 +17,8 @@ FIXME: horizontal spacing (ragged right mode).
 
 FIXME: padding/minimum-distance is fragile.
 
+FIXME: episem stops one notehead too early.
+
 "}
 
 \include "gregorian-init.ly"
index f6cbb808a5122e226e2a86def20cffacddacb201..c395bfdb73af4596edbc4b0b1358ef3bb68525ca 100644 (file)
@@ -7,24 +7,24 @@ Vaticana ligature test. "
 
 \include "gregorian-init.ly"
 
-cantus = \notes {
+cantus = \context VaticanaVoice = "cantus" \notes {
   \clef "vaticana_fa2"
-  \[ f \quilisma g \auctum \descendens a \]
-  \[ \virga a g \pes a \inclinatum f \inclinatum d
+  \[ f\melisma \quilisma g \auctum \descendens a\melismaEnd \]
+  \[ \virga a\melisma g \pes a \inclinatum f \inclinatum d
      c \pes d \quilisma e \pes f \virga g
-     a \flexa f \pes g \inclinatum f \inclinatum e \]
-  \[ d \quilisma e f \flexa e \pes f \]
-  \[ e \flexa d \]
+     a \flexa f \pes g \inclinatum f \inclinatum e\melismaEnd \]
+  \[ d\melisma \quilisma e f \flexa e \pes f\melismaEnd \]
+  \[ e\melisma \flexa d\melismaEnd \]
 }
 
-verba = \context Lyrics = verba \lyrics {
-  Al-4*3 le-4*15 lu-4*5 ia.4*2
+verba = \context Lyrics = "verba" \lyrics {
+  Al- le- lu- ia.
 }
 
 \score {
-  \context VaticanaVoice <<
+  <<
     \cantus
-    \verba
+    \lyricsto "cantus" \verba
   >>
   \paper {
     linethickness = \staffspace / 7.0
@@ -33,7 +33,6 @@ verba = \context Lyrics = verba \lyrics {
     indent = 0.0
     raggedright = ##t
     packed = ##t
-    % packed = ##t %%%% FIXME
     \translator {
       \ScoreContext
       \remove Bar_number_engraver
index 030e7444401d8f94cc1396e84c617a7290604983..f7da5c27803815aa11e26df9973361eb295340f8 100644 (file)
@@ -8,9 +8,28 @@
  */
 
 #include "music.hh"
-#include "auto-change-iterator.hh"
 #include "translator-group.hh"
 #include "event.hh"
+#include "music-wrapper-iterator.hh"
+#include "direction.hh"
+
+class Auto_change_iterator : public Music_wrapper_iterator
+{
+public:
+  VIRTUAL_COPY_CONS (Music_iterator);
+  DECLARE_SCHEME_CALLBACK(constructor, ());
+  
+  Auto_change_iterator ();
+
+protected:
+  virtual void construct_children ();
+  virtual void process (Moment);  
+  Array<Pitch> pending_pitch (Moment)const;
+private:
+  SCM split_list_;
+  Direction where_dir_;
+  void change_to (Music_iterator* , SCM, String);
+};
 
 
 
@@ -57,84 +76,38 @@ Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
          We could change the current translator's id, but that would make 
          errors hard to catch
          
-          last->translator_id_string_  = get_change ()->change_to_id_string_;
        */
-       //      error (_ ("I'm one myself"));
       }
   else
-    ; //    error (_ ("none of these in my family"));
-
-}
-
-/*
-  Look ahead to find first pitches to determine staff position.
-  WARNING: this means that
-
-  \autochange Staff \notes { .... \context Staff = otherstaff { .. } .. }
-
-  will confuse the autochanger, since it will not notice that the
-  music for OTHERSTAFF is not his.
-
-  PRECONDITION: this->ok () holds.
-*/
-Array<Pitch>
-Auto_change_iterator::pending_pitch (Moment m) const
-{
-  Music_iterator * iter = child_iter_ ->clone ();
-  Array<Pitch> ps;
-  while (1)
-    {
-      SCM muses = iter->get_pending_events (m);
-      for (SCM s = muses; gh_pair_p (s); s=ly_cdr (s))
-       {
-         Music * m = unsmob_music (ly_car (s));
-         if (m && m->is_mus_type ("note-event"))
-           {
-             ps.push (*unsmob_pitch (m->get_mus_property ("pitch")));
-           }
-       }
-      
-      if (ps.size ())
-       break;
+    ;
 
-      iter->skip (m);
-      if (!iter->ok ())
-       break;
-      
-      m = iter->pending_moment ();
-    }
-
-  scm_gc_unprotect_object (iter->self_scm());
-
-  return ps;
 }
 
 void
 Auto_change_iterator::process (Moment m)
 {
-  /*
-    first we get the pitches, then we do the real work.
-    Music_wrapper_iterator::process () might process (and throw away)
-    pitches we need.  */
-  Array<Pitch> ps = pending_pitch (m);
-
   Music_wrapper_iterator::process (m);
-  if (ps.size ())
-    {
-      Pitch p = ps[0];
-      Direction s = Direction (sign (p.steps ()));
-      /*
-       Don't change for central C.
 
-       TODO: make this tunable somehow. Sometimes, you'd want to
-       switch for C.C. as well.
+  
+  Moment now = report_to ()->now_mom ();
+  Moment *splitm = 0;
+  
+  for (; gh_pair_p (split_list_); split_list_ = gh_cdr (split_list_))
+    {
+      splitm = unsmob_moment (gh_caar (split_list_));
+      if (*splitm > now)
+       break ;
 
-      */
-      if (s && s != where_dir_)
+      SCM tag = gh_cdar (split_list_);
+      Direction d = to_dir  (tag);
+      
+      if (d && d != where_dir_)
        {
-         where_dir_ = s;
-         String to_id = (s >= 0) ?  "up" : "down";
-         change_to (child_iter_, get_music ()->get_mus_property ("what"), to_id);        
+         where_dir_ = d;
+         String to_id = (d >= 0) ?  "up" : "down";
+         change_to (child_iter_,
+                    ly_symbol2scm ("Staff"),
+                    to_id);
        }
     }
 }
@@ -142,6 +115,14 @@ Auto_change_iterator::process (Moment m)
 Auto_change_iterator::Auto_change_iterator ()
 {
   where_dir_ = CENTER;
+  split_list_ = SCM_EOL;
+}
+
+void
+Auto_change_iterator::construct_children ()
+{
+  Music_wrapper_iterator::construct_children ();
+  split_list_ =  get_music ()->get_mus_property ("split-list");
 }
 
 IMPLEMENT_CTOR_CALLBACK (Auto_change_iterator);
index 98e7fddc5c40968a74132d614166dc18accb2b58..20c5cd06e56d7937009e8664af35a8072a588501 100644 (file)
@@ -208,7 +208,12 @@ provide_context_info (Array<Grob_info> primitives)
     int prefix_set = gh_scm2int (primitive->get_grob_property ("prefix-set"));
 
     if (prefix_set & PES_OR_FLEXA)
-      if (pitch > prev_pitch) // pes
+      if (!i) // ligature may not start with 2nd head of pes or flexa
+         {
+           primitive->warning ("may not apply `\\~' on first head of "
+                               "ligature; ignoring `\\~'");
+         }
+      else if (pitch > prev_pitch) // pes
        {
          prev_context_info |= PES_LOWER;
          context_info |= PES_UPPER;
diff --git a/lily/include/auto-change-iterator.hh b/lily/include/auto-change-iterator.hh
deleted file mode 100644 (file)
index 896de1b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*   
-  auto-change-iterator.hh -- declare Auto_change_iterator
-  
-  source file of the GNU LilyPond music typesetter
-  
-  (c)  1999--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
-
-#ifndef AUTO_CHANGE_ITERATOR_HH
-#define AUTO_CHANGE_ITERATOR_HH
-
-#include "music-wrapper-iterator.hh"
-#include "direction.hh"
-
-class Auto_change_iterator : public Music_wrapper_iterator
-{
-public:
-  VIRTUAL_COPY_CONS (Music_iterator);
-  DECLARE_SCHEME_CALLBACK(constructor, ());
-  
-  Auto_change_iterator ();
-
-protected:
-  virtual void process (Moment);  
-  Array<Pitch> pending_pitch (Moment)const;
-private:
-  Direction where_dir_;
-  void change_to (Music_iterator* , SCM, String);
-};
-
-#endif /* AUTO_CHANGE_ITERATOR_HH */
index 8f5972177393298a2aadb4c0d0a2b304dcf3f339..8a93f264343059be76375c96d88d5dc7024a5071 100644 (file)
@@ -231,8 +231,16 @@ Ligature_engraver::stop_translation_timestep ()
 {
   if (finished_ligature_)
     {
-      typeset_ligature (finished_ligature_, finished_primitives_);
-      finished_primitives_.clear ();
+      if (!finished_primitives_.size ())
+       {
+         finished_ligature_->programming_error ("Ligature_engraver::stop_translation_timestep (): "
+                                                "junking empty ligature");
+       }
+      else
+       {
+         typeset_ligature (finished_ligature_, finished_primitives_);
+         finished_primitives_.clear ();
+       }
       finished_ligature_ = 0;
     }
 
index 11a97fb92c9cc8daade683371c6f1f475156bf30..1203ed9030469371874d932730957c4ce33973d5 100644 (file)
@@ -373,7 +373,8 @@ main_prog (void *, int, char **)
     {
       printf ("Failed files: ");
       for (int i = 0; i < failed_files.size (); i++)
-       printf ("%s", failed_files[i].to_str0 ());
+       printf ("%s ", failed_files[i].to_str0 ());
+      printf ("\n");
     }
   exit (exit_status_global);
 }
index a611eebca9cd7c0cea913a43a6ebaafb8b440ca2..268c18715d17286b442ecb96c8b4372e82b33b8d 100644 (file)
@@ -74,7 +74,6 @@ TODO:
 #include "input.hh"
 #include "lilypond-input-version.hh"
 #include "scm-hash.hh"
-#include "auto-change-iterator.hh"
 #include "ly-modules.hh"
 #include "music-sequence.hh"
 #include "input-smob.hh"
@@ -381,7 +380,7 @@ yylex (YYSTYPE *s,  void * v)
 
 %type <scm>  embedded_scm scalar
 %type <music>  Music Sequential_music Simultaneous_music 
-%type <music>  relative_music re_rhythmed_music part_combined_music
+%type <music>  relative_music re_rhythmed_music 
 %type <music>  music_property_def context_change 
 %type <scm> Music_list
 %type <scm> property_operation context_mod translator_mod optional_context_mod
@@ -911,16 +910,29 @@ context_mod_list:
        ;
 
 Composite_music:
-       AUTOCHANGE STRING Music {
-               Music*chm = MY_MAKE_MUSIC("AutoChangeMusic");
-               chm->set_mus_property ("element", $3->self_scm ());
-               chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_proc);
+       AUTOCHANGE Music        {
+               static SCM proc ;
+               if (!proc)
+                       proc = scm_c_eval_string ("make-autochange-music");
+       
+               SCM res = scm_call_1 (proc,  $2->self_scm ());
+               scm_gc_unprotect_object ($2->self_scm ());
+               $$ = unsmob_music (res);
+               scm_gc_protect_object (res);
+               $$->set_spot (THIS->here_input())
+       }
+       | PARTCOMBINE Music Music {
+               static SCM proc;
+               if (!proc)
+                       proc = scm_c_eval_string ("make-part-combine-music");
 
+               SCM res = scm_call_1 (proc, gh_list ($2->self_scm (),
+                       $3->self_scm (), SCM_UNDEFINED));  
                scm_gc_unprotect_object ($3->self_scm ());
-               chm->set_mus_property ("what", scm_string_to_symbol ($2));
-
-               $$ = chm;
-               chm->set_spot (*$3->origin ());
+               scm_gc_unprotect_object ($2->self_scm ());
+               $$ = unsmob_music (res);
+               scm_gc_protect_object (res);
+               $$->set_spot (THIS->here_input());
        }
        | grace_head Music {
 #if 1
@@ -1072,7 +1084,6 @@ basic music objects too, since the meaning is different.
        }
        | relative_music        { $$ = $1; }
        | re_rhythmed_music     { $$ = $1; } 
-       | part_combined_music   { $$ = $1; }
        | TAG embedded_scm Music {
                tag_music ($3, $2, THIS->here_input ());
                $$ = $3;
@@ -1112,21 +1123,6 @@ re_rhythmed_music:
        }
        ;
 
-part_combined_music:
-       PARTCOMBINE Music Music {
-               static SCM proc;
-               if (!proc)
-                       proc = scm_c_eval_string ("make-part-combine-music");
-
-               SCM res = scm_call_1 (proc, gh_list ($2->self_scm (),
-                       $3->self_scm (), SCM_UNDEFINED));  
-               scm_gc_unprotect_object ($3->self_scm ());
-               scm_gc_unprotect_object ($2->self_scm ());
-               $$ = unsmob_music (res);
-               scm_gc_protect_object (res);
-       }
-       ;
-
 context_change:
        CHANGE STRING '=' STRING  {
                Music*t= MY_MAKE_MUSIC("TranslatorChange");
index adaf969bd838fa83677c7f9a487791dccd64dd9f..3a50e0caee094db9fbabdfe6fa641b389a09a07f 100644 (file)
@@ -663,26 +663,8 @@ EasyNotation = \translator {
   \alias "Voice"
   \description "Same as @code{Voice} context, except that it is accommodated for tyepsetting Gregorian Chant in the notational style of Editio Vaticana."
 
-  % We can not remove Slur_engraver, since \addlyrics depends on it.
-  % Instead, we make the grob transparent.
-  % Unfortunately, this gives us a lot of warnings ("Degenerate bow:
-  % infinite steepness reqd"), since in ligatures, all note heads are in
-  % the same paper column such that the (transparent) slurs eventually may
-  % start and end in the same column.
-  Slur \override #'transparent = ##t
-
-  % We can not remove Stem_engraver, since slurs depend on stems.  If
-  % we try anyway, lily will crash in slur.scm:16:6: "Wrong type argument
-  % in position 1 (expecting grob): ()".
-  % As a workaround, we make the grob transparent.
-  Stem \set #'transparent = ##t
-
-  % Since we do not remove stems, but only make it transparent, we have
-  % to set the length to 0.0.  Otherwise, articulation marks (such as
-  % ictus, circulus or accentus) may be vertically placed quite away from
-  % the note head.
-  Stem \set #'length = #'0.0
-
+  \remove "Slur_engraver"
+  \remove "Stem_engraver"
   \remove "Ligature_bracket_engraver"
   \consists "Vaticana_ligature_engraver"
 
@@ -755,26 +737,6 @@ EasyNotation = \translator {
   % transparent instead.
   LigatureBracket \set #'transparent = ##t
 
-  % We can not remove Slur_engraver, since \addlyrics depends on it.
-  % Instead, we make the grob transparent.
-  % Unfortunately, this gives us a lot of warnings ("Degenerate bow:
-  % infinite steepness reqd"), since in ligatures, all note heads are in
-  % the same paper column such that the (transparent) slurs eventually may
-  % start and end in the same column.
-  Slur \override #'transparent = ##t
-
-  % We can not remove Stem_engraver, since slurs depend on stems.  If
-  % we try anyway, lily will crash in slur.scm:16:6: "Wrong type argument
-  % in position 1 (expecting grob): ()".
-  % As a workaround, we make the grob transparent.
-  Stem \set #'transparent = ##t
-
-  % Since we do not remove stems, but only make it transparent, we have
-  % to set the length to 0.0.  Otherwise, articulation marks (such as
-  % ictus, circulus or accentus) may be vertically placed quite away from
-  % the note head.
-  Stem \set #'length = #'0.0
-
   % Put some space before and after divisiones.
   % FIXME: This does not seem to show any effect.
   Script \set #'padding = #0.5
index 08c644f332f277328a4add3dda636b47f27ea405..d434c62d35fbca80e09878867e3fbda6108462b5 100644 (file)
@@ -3,7 +3,7 @@
 % 
 % source file of LilyPond's pretty-but-neat music font
 %
-% (c)  2001--2003 Juergen Reuter <reuter@ipd.uka.de>
+% (c)  2001--2004 Juergen Reuter <reuter@ipd.uka.de>
 %
 
 fet_begingroup ("clefs")
@@ -53,7 +53,6 @@ def draw_vaticana_do_clef(expr exact_center, reduction) =
        save reduced_il;
 
        reduced_il# = staff_space# * reduction;
-       
        set_char_box(0 - xpart exact_center,
                     0.5reduced_il# + xpart exact_center,
                     0.8reduced_il# - ypart exact_center,
@@ -66,12 +65,17 @@ def draw_vaticana_do_clef(expr exact_center, reduction) =
        save za, zb, zc, zd, ze, zf;
        pair za, zb, zc, zd, ze, zf;
 
-       rt  za = exact_center + (0.50reduced_il, -.45reduced_il);
-           zb = exact_center + (0.25reduced_il, -.50reduced_il);
-       lft zc = exact_center + (0.00reduced_il, -.25reduced_il);
-       lft zd = exact_center + (0.00reduced_il, +.25reduced_il);
-           ze = exact_center + (0.25reduced_il, +.50reduced_il);
-       rt  zf = exact_center + (0.50reduced_il, +.45reduced_il);
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
+       rt  za = (xoffs + 0.50reduced_il, yoffs - .45reduced_il);
+           zb = (xoffs + 0.25reduced_il, yoffs - .50reduced_il);
+       lft zc = (xoffs + 0.00reduced_il, yoffs - .25reduced_il);
+       lft zd = (xoffs + 0.00reduced_il, yoffs + .25reduced_il);
+           ze = (xoffs + 0.25reduced_il, yoffs + .50reduced_il);
+       rt  zf = (xoffs + 0.50reduced_il, yoffs + .45reduced_il);
        draw za .. zb .. zc --  % lower punctum
             zd .. ze .. zf;    % upper punctum
 enddef;
@@ -97,17 +101,22 @@ def draw_vaticana_fa_clef(expr exact_center, reduction) =
        save za, zb, zc, zd, ze;
        pair za, zb, zc, zd, ze;
 
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
        %left-handed punctum
        pickup pencircle xscaled 0.6linethickness yscaled 0.5reduced_il;
-       lft za = exact_center + (+0.00reduced_il, +0.00reduced_il);
-           zb = exact_center + (+0.25reduced_il, +0.05reduced_il);
-       rt  zc = exact_center + (+0.50reduced_il, -0.05reduced_il);
+       lft za = (xoffs + 0.00reduced_il, xoffs + 0.00reduced_il);
+           zb = (xoffs + 0.25reduced_il, xoffs + 0.05reduced_il);
+       rt  zc = (xoffs + 0.50reduced_il, xoffs - 0.05reduced_il);
        draw za .. zb .. zc;
 
        %stem
        pickup pencircle scaled 0.6linethickness;
        xpart zc = xpart zd = xpart ze;
-       ypart zd = ypart exact_center = bot ypart ze + 1.5reduced_il;
+       ypart zd = yoffs = bot ypart ze + 1.5reduced_il;
        draw zd -- ze;
 
        %right-handed puncta as in do clef
@@ -149,15 +158,17 @@ def draw_medicaea_do_clef(expr exact_center, reduction) =
        flag_height# = 0.5 reduced_il#;
        define_pixels(flag_height);
 
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
        %upper flag
        save za, zb;
        pair za, zb;
        pickup pencircle xscaled reduced_slt yscaled flag_height;
-       xpart exact_center
-               = lft xpart za
-               = rt xpart zb - reduced_il;
-       ypart za = ypart exact_center +
-               0.5 (reduced_il - flag_height - staff_space);
+       xoffs = lft xpart za = rt xpart zb - reduced_il;
+       ypart za = yoffs + 0.5 (reduced_il - flag_height - staff_space);
        ypart zb = ypart za - reduced_il + flag_height;
        draw za -- zb;
 
@@ -165,11 +176,8 @@ def draw_medicaea_do_clef(expr exact_center, reduction) =
        save za, zb;
        pair za, zb;
        pickup pencircle xscaled reduced_slt yscaled flag_height;
-       xpart exact_center
-               = lft xpart za
-               = rt xpart zb - reduced_il;
-       ypart za = ypart exact_center +
-                0.5 (reduced_il - flag_height + staff_space);
+       xoffs = lft xpart za = rt xpart zb - reduced_il;
+       ypart za = yoffs + 0.5 (reduced_il - flag_height + staff_space);
        ypart zb = ypart za - reduced_il + flag_height;
        draw za -- zb;
 
@@ -177,10 +185,8 @@ def draw_medicaea_do_clef(expr exact_center, reduction) =
        save za, zb;
        pair za, zb;
        pickup pencircle scaled reduced_slt;
-       lft xpart za = lft xpart zb = xpart exact_center;
-       ypart exact_center
-               = top ypart zb - 1.5 reduced_il
-               = bot ypart za + 1.5 reduced_il;
+       lft xpart za = lft xpart zb = xoffs;
+       yoffs = top ypart zb - 1.5 reduced_il = bot ypart za + 1.5 reduced_il;
        draw za -- zb;
 
        set_char_box(0 - xpart exact_center,
@@ -214,17 +220,21 @@ def draw_medicaea_fa_clef(expr exact_center, reduction) =
        save za, zb, zc, zd, ze;
        pair za, zb, zc, zd, ze;
 
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
        %stem
        pickup pencircle scaled linethickness;
-       xpart za = xpart zb =
-               xpart exact_center + 0.4reduced_il;
-       ypart za = ypart exact_center = bot ypart zb + 1.5reduced_il;
+       xpart za = xpart zb = xoffs + 0.4reduced_il;
+       ypart za = yoffs = bot ypart zb + 1.5reduced_il;
        draw za -- zb;
 
        %left-handed punctum
        pickup pencircle xscaled reduced_slt yscaled reduced_il;
-       lft zc = exact_center;
-       zd = exact_center + (0.4reduced_il, 0);
+       lft zc = (xoffs, yoffs);
+       zd = lft zc + (0.4reduced_il, 0);
        draw zc -- zd;
 
        %right-handed puncta as in do clef
@@ -265,9 +275,7 @@ fet_endchar;
 %
 def draw_brevis(expr exact_center, bwidth, bheight, blinethickness) =
 
-       save xoffs, yoffs, brevis_width, brevis_height, linethickness;
-       xoffs# = xpart exact_center;
-       yoffs# = ypart exact_center;
+       save brevis_width, brevis_height, linethickness;
        brevis_width# = bwidth; brevis_height# = bheight;
        linethickness# = blinethickness;
 
@@ -278,7 +286,12 @@ def draw_brevis(expr exact_center, bwidth, bheight, blinethickness) =
        serif_size# = (hole_height# - linethickness#)/2;
        serif_protrude# = 1.5 serif_size#;
 
-       define_pixels(xoffs, yoffs, brevis_width, brevis_height, linethickness);
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
+       define_pixels(brevis_width, brevis_height, linethickness);
        define_pixels(beam_width, beam_height, serif_size, serif_protrude);
 
        penpos1(beam_width, 0);
@@ -487,8 +500,8 @@ def draw_mensural_c_clef(expr exact_center, reduction) =
 
        set_char_box(0 - xpart exact_center,
                     2reduced_il# + xpart exact_center,
-                    -yoffs# + 2.2 half_reduced_il# + staff_space# - ypart exact_center,
-                    yoffs# + 2.2 half_reduced_il# + ypart exact_center);
+                    2.2 half_reduced_il# + staff_space# - 2 ypart exact_center,
+                    2.2 half_reduced_il# + 2 ypart exact_center);
 enddef;
 
 
@@ -503,16 +516,15 @@ fet_beginchar("mensural c clef", "mensural_c_change", "cmenscclef")
 fet_endchar;
 
 def draw_diamond(expr exact_center, reduction) =
-       save stem_width, reduced_il, reduced_nht, holeheight, beamheight;
+       save stem_width, reduced_nht, holeheight, beamheight;
        save rh_height, rh_width;
 
        stem_width# = 1.4 reduced_slt#;
-       reduced_il# = staff_space# * reduction;
        reduced_nht# = noteheight# * reduction;
        holeheight# = 3 reduced_slt#;
        beamheight# = 0.4(reduced_nht# - holeheight#);
 
-       rh_height# = 1.2reduced_il#;
+       rh_height# = 1.2 staff_space# * reduction;
        rh_width# / rh_height# = tand(30);
 
        define_pixels(beamheight);
@@ -520,16 +532,21 @@ def draw_diamond(expr exact_center, reduction) =
        define_pixels(rh_height);
        define_pixels(rh_width);
 
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
        pickup pencircle
                xscaled beamheight
                yscaled stem_width
                rotated 45;
 
        draw
-               exact_center + (-rh_width/2, 0) --
-               exact_center + (0, rh_height/2) --
-               exact_center + (+rh_width/2, 0) --
-               exact_center + (0, -rh_height/2) --
+               (xoffs - rh_width/2, yoffs) --
+               (xoffs, yoffs + rh_height/2) --
+               (xoffs + rh_width/2, yoffs) --
+               (xoffs, yoffs - rh_height/2) --
                cycle;
 enddef;
 
@@ -542,49 +559,50 @@ def draw_petrucci_f_clef(expr exact_center, reduction) =
        % col. 1649 ("Contredanse"), fig. 2.
        %
 
-       save reduced_il, reduced_slt;
+       save interline, reduced_il, reduced_slt;
+       interline# = staff_space#;
        reduced_il# = staff_space# * reduction;
        reduced_slt# = linethickness# * reduction;
-       define_pixels(reduced_il);
-       define_pixels(reduced_slt);
 
        draw_brevis(exact_center, reduced_il#, reduced_il#, reduced_slt#);
+       draw_diamond(exact_center + (1.6interline#*reduction, interline#/2),
+                    reduction);
+       draw_diamond(exact_center + (1.6interline#*reduction, -interline#/2),
+                    reduction);
 
-       save stem_width, interline;
+       define_pixels(interline);
+       define_pixels(reduced_il);
+       define_pixels(reduced_slt);
+
+       save stem_width;
        stem_width# = 1.4 reduced_slt#;
-       interline# = staff_space#;
        define_pixels(stem_width);
-       define_pixels(interline);
 
-       addto currentpicture also currentpicture
-               yscaled -1 shifted (0, 2*(ypart exact_center));
-       addto currentpicture also currentpicture 
-               xscaled -1 shifted (2x4l,0);
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
 
+       define_pixels(xoffs, yoffs);
 
        % brevis stem
        pickup pencircle xscaled stem_width yscaled blot_diameter;
-       rt z8 = exact_center + (reduced_il, 0);
+       rt z8 = (xoffs + reduced_il, yoffs);
        z9 = z8 + (0, -4reduced_il);
        draw z8 .. z9;
 
-       % upper diamond
-       draw_diamond(exact_center + (1.6interline*reduction, interline/2),
-                    reduction);
+       % upper diamond's stem
        pickup pencircle xscaled stem_width yscaled blot_diameter;
-       z10 = exact_center +
-            (1.6interline*reduction + stem_width/2, interline*reduction);
+       z10 = (xoffs + 1.6interline*reduction + stem_width/2,
+         yoffs + interline*reduction);
        top z11 = z10 + (0, 1.5interline*reduction);
-       draw z10 .. z11; % diamond stem
+       draw z10 .. z11;
 
-       % lower diamond
-       draw_diamond(exact_center + (1.6interline*reduction, -interline/2),
-                    reduction);
+       % lower diamond's stem
        pickup pencircle xscaled stem_width yscaled blot_diameter;
-       z12 = exact_center +
-             (1.6interline*reduction - stem_width/2, -interline*reduction);
+       z12 = (xoffs + 1.6interline*reduction - stem_width/2,
+         yoffs - interline*reduction);
        bot z13 = z12 + (0, -3.5interline*reduction);
-       draw z12 .. z13; % diamond stem
+       draw z12 .. z13;
 
        save reduced_il, rh_height, rh_width;
        reduced_il# = staff_space# * reduction;
@@ -623,6 +641,11 @@ def draw_mensural_f_clef(expr exact_center, reduction) =
        dot_diameter# = 0.1 reduction * staff_space#;
        define_pixels(width, stem_width, staff_space, dot_diameter);
 
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
        pickup pencircle
                xscaled 0.2width
                yscaled stem_width
@@ -631,12 +654,12 @@ def draw_mensural_f_clef(expr exact_center, reduction) =
        % half circle
        lft z5 = (0, 0);
        draw    halfcircle scaled width rotated -90
-               shifted (z5-exact_center);
+               shifted (z5-(xoffs, yoffs));
 
 
        % upper dot
-       rt x2 = xpart exact_center + width;
-       top y1 = ypart exact_center + 0.5width;
+       rt x2 = xoffs + width;
+       top y1 = yoffs + 0.5width;
        z2 - z1 = (dot_diameter, -dot_diameter);
        draw z1 -- z2;
 
@@ -663,119 +686,6 @@ fet_beginchar("mensural f clef", "mensural_f_change", "cmensfclef")
 fet_endchar;
 
 
-def draw_mensural_g_clef(expr exact_center, reduction) =
-       %
-       % TODO: Rewrite me!  This clef looks completely awful! --jr
-       %
-
-
-  %
-  % This code is completely undebuggable.
-  %
-  % the shift command is forbidden because (pen)labels come out
-  % completely wrong
-  % 
-  
-       %
-       % inspired by Francisco Guerrero, "Lib. 1.  Missarum" (1566),
-       % in: MGG, volume 3, col. 858 ("Ducis"); also by Stefano
-       % Fabri, "Quam speciosa veteranis" (1611), in: MGG, volume 3,
-       % col. 1698 ("Fabri"); also by Philippus Dulichius,
-       % "Fasciculus novus ..." (1598), in: MGG, volume 3, col. 919
-       % ("Dulichius"), fig. 1; also by Noe Faignient, "Ic sal de
-       % Heer myn God gebenedye" (1568), in: MGG, volume 3, col. 1735
-       % ("Faignient").
-       %
-       % Metafont code partially inspired by Schwabacher 'G' of yswab
-       % font.
-
-       save reduced_il, stem_width, height, width, apex_o, hair;
-
-       reduced_il#=staff_space#*reduction;
-
-       set_char_box(0 - xpart exact_center,
-                    1.2reduced_il# + xpart exact_center,
-                    0.8reduced_il# - ypart exact_center,
-                    1.5reduced_il# + ypart exact_center);
-
-       stem_width# = 0.17 reduced_il#;
-       height# = 1.5 reduced_il#;
-       width# = 1.13 reduced_il#;
-       apex_o# = 0.02 reduced_il#;
-       hair# =  3 linethickness#;
-       define_pixels(reduced_il, stem_width, height, width, apex_o, hair);
-
-       penpos1(2 stem_width, -142);
-       z1l = (0.715 width, 0.742 height);
-       penpos1'(hair, -90);
-       z1'l = z1r;
-       penpos2(1.179 stem_width, -142);
-       z2l = (width, 0.466 height);
-       penpos3(hair, 77);
-       z3 = (0.764 width, 0.067 height); 
-       z4 = (0.59 width, -apex_o);
-       penpos5(1.179 stem_width, 32);
-       z5l=(0, 0.457 height);
-       penpos6(hair, -56.5);
-       z7 = (x4 - 0.843 stem_width, height + apex_o);
-       z7 - z6l = whatever * dir33.5;
-       penpos8(1.286 stem_width, -130);
-       z8r = (0.715 width, 0.742 height) + (-apex_o, apex_o);
-       z6r - z8r = whatever * (z7 - z8l);
-       filldraw
-               z1'r{dir45} .. z2r{down} .. z3r{dir207} .. z5r{up} ..
-               z6r{z7-z6l} & z6r -- z8r -- z8l -- z7 --- z6l ...
-               z5l{down} .. z4{right} .. z3l{dir27} .. z2l{up} ..
-               z1l{1/3[z6l,z7]-z1l} & z1l -- z1r -- z1'r & cycle
-               shifted (-exact_center + (0, -0.75reduced_il));
-
-       penpos9(stem_width, 0);
-       x9r = x4; y9 = 0.3 height;
-
-       pickup pencircle
-               scaled stem_width
-               rotated 45;
-       draw    z9 -- (z9 + (0, -0.4reduced_il))
-               shifted (-exact_center + (0, -0.75reduced_il));
-
-       pickup pencircle
-               xscaled stem_width
-               yscaled hair
-               rotated 30;
-
-       draw halfcircle
-               scaled 0.5 reduced_il
-               rotated -90
-               shifted z8
-               shifted (0, 0.25reduced_il)
-               shifted (-exact_center + (0, -0.75reduced_il));
-
-       draw halfcircle
-               scaled 0.4 reduced_il
-               rotated 90
-               shifted (z8 + (0, 0.45 reduced_il))
-               shifted (0, 0.25reduced_il)
-               shifted (-exact_center + (0, -0.75reduced_il));
-enddef;
-
-
-if 0 = 1:
-  %
-  % This clef is switched due to path problems  at smaller sizes. 
-  %
-fet_beginchar("mensural g clef", "mensural_g", "mensgclef")
-       if test = 1:
-               draw_staff(-1,3, 0.0);
-       fi;
-       draw_mensural_g_clef((0,0), 1.0);
-fet_endchar;
-fet_beginchar("mensural g clef", "mensural_g_change", "cmensgclef")
-       draw_mensural_g_clef((0,0), .8);
-fet_endchar;
-
-fi;
-
-
 def draw_petrucci_g_clef(expr exact_center, reduction) =
        % inspired by Josquin Desprez, "Stabat Mater", Libro tertio,
        % 1519, printed by Petrucci, in: MGG, volume 7, Table 11.
@@ -794,21 +704,26 @@ def draw_petrucci_g_clef(expr exact_center, reduction) =
        save za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
        pair za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
 
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
        pickup pencircle
                xscaled 0.50 reduced_slt
                yscaled 0.22 reduced_il
                rotated -35;
 
-       lft za = exact_center + (0.80 reduced_il, +0.00 reduced_il);
-       lft zb = exact_center + (1.00 reduced_il, +1.20 reduced_il);
-       lft zc = exact_center + (0.70 reduced_il, +2.00 reduced_il);
-       lft zd = exact_center + (0.30 reduced_il, +3.00 reduced_il);
-       lft ze = exact_center + (0.80 reduced_il, +3.70 reduced_il);
-       lft zf = exact_center + (1.00 reduced_il, +3.00 reduced_il);
-       lft zg = exact_center + (0.60 reduced_il, +2.00 reduced_il);
-       lft zh = exact_center + (0.30 reduced_il, +1.70 reduced_il);
-       lft zi = exact_center + (0.00 reduced_il, +0.75 reduced_il);
-       lft zj = exact_center + (0.20 reduced_il, +0.60 reduced_il);
+       lft za = (xoffs + 0.80 reduced_il, yoffs + 0.00 reduced_il);
+       lft zb = (xoffs + 1.00 reduced_il, yoffs + 1.20 reduced_il);
+       lft zc = (xoffs + 0.70 reduced_il, yoffs + 2.00 reduced_il);
+       lft zd = (xoffs + 0.30 reduced_il, yoffs + 3.00 reduced_il);
+       lft ze = (xoffs + 0.80 reduced_il, yoffs + 3.70 reduced_il);
+       lft zf = (xoffs + 1.00 reduced_il, yoffs + 3.00 reduced_il);
+       lft zg = (xoffs + 0.60 reduced_il, yoffs + 2.00 reduced_il);
+       lft zh = (xoffs + 0.30 reduced_il, yoffs + 1.70 reduced_il);
+       lft zi = (xoffs + 0.00 reduced_il, yoffs + 0.75 reduced_il);
+       lft zj = (xoffs + 0.20 reduced_il, yoffs + 0.60 reduced_il);
 
        draw za{-1,2} .. zb .. zc .. zd .. ze .. zf .. zg .. zh .. zi .. zj;
 
@@ -820,12 +735,12 @@ def draw_petrucci_g_clef(expr exact_center, reduction) =
                yscaled 0.33 reduced_il
                rotated -35;
 
-       lft za = exact_center + (1.05 reduced_il, +0.45 reduced_il);
-       lft zb = exact_center + (0.55 reduced_il, +0.45 reduced_il);
-       lft zc = exact_center + (0.55 reduced_il, -0.45 reduced_il);
-       lft zd = exact_center + (1.05 reduced_il, -0.45 reduced_il);
-       lft ze = exact_center + (1.10 reduced_il, +0.00 reduced_il);
-       lft zf = exact_center + (0.80 reduced_il, +0.00 reduced_il);
+       lft za = (xoffs + 1.05 reduced_il, yoffs + 0.45 reduced_il);
+       lft zb = (xoffs + 0.55 reduced_il, yoffs + 0.45 reduced_il);
+       lft zc = (xoffs + 0.55 reduced_il, yoffs - 0.45 reduced_il);
+       lft zd = (xoffs + 1.05 reduced_il, yoffs - 0.45 reduced_il);
+       lft ze = (xoffs + 1.10 reduced_il, yoffs + 0.00 reduced_il);
+       lft zf = (xoffs + 0.80 reduced_il, yoffs + 0.00 reduced_il);
 
        draw za .. zb .. zc .. zd .. {up}ze -- zf;
 enddef;
@@ -842,6 +757,37 @@ fet_beginchar("petrucci g clef", "petrucci_g_change", "cpetruccigclef")
 fet_endchar;
 
 
+def draw_mensural_g_clef(expr exact_center, reduction) =
+  % TODO: Rewrite me.  The former mensural g clef looked ugly, and the
+  % code was removed when it broke for small font sizes after some
+  % global changes in the font.  Currently, the character is mapped to
+  % a copy of the petrucci g clef (which, after all, *is* a mensural g
+  % clef, but not the one that we have in mind here). -- jr
+  %
+  % Possible sources of inspiration for this clef include: Francisco
+  % Guerrero, "Lib. 1.  Missarum" (1566), in: MGG, volume 3, col. 858
+  % ("Ducis"); Stefano Fabri, "Quam speciosa veteranis" (1611), in:
+  % MGG, volume 3, col. 1698 ("Fabri"); Philippus Dulichius,
+  % "Fasciculus novus ..."  (1598), in: MGG, volume 3, col. 919
+  % ("Dulichius"), fig. 1; Noe Faignient, "Ic sal de Heer myn God
+  % gebenedye" (1568), in: MGG, volume 3, col. 1735 ("Faignient").
+enddef;
+
+%
+% FIXME: This clef is preliminarily mapped to the petrucci g clef
+% until the code for the mensural g clef will be rewritten.
+%
+fet_beginchar("mensural g clef", "mensural_g", "mensgclef")
+       if test = 1:
+               draw_staff(-1,3, 0.0);
+       fi;
+       draw_petrucci_g_clef((0,0), 1.0);
+fet_endchar;
+fet_beginchar("mensural g clef", "mensural_g_change", "cmensgclef")
+       draw_petrucci_g_clef((0,0), .8);
+fet_endchar;
+
+
 
 %%%%%%%%
 %
@@ -869,12 +815,17 @@ def draw_hufnagel_do_clef(expr exact_center, reduction) =
        save za, zb, zc, zd, ze, zf;
        pair za, zb, zc, zd, ze, zf;
 
-       za = exact_center + (0.90reduced_il, +.45reduced_il);
-       zb = exact_center + (0.80reduced_il, +.45reduced_il);
-       zc = exact_center + (0.50reduced_il, +.60reduced_il);
-       zd = exact_center + (0.20reduced_il, +.45reduced_il);
-       ze = exact_center + (0.20reduced_il, -.45reduced_il);
-       zf = exact_center + (0.40reduced_il, -.55reduced_il);
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
+       za = (xoffs + 0.90reduced_il, yoffs + .45reduced_il);
+       zb = (xoffs + 0.80reduced_il, yoffs + .45reduced_il);
+       zc = (xoffs + 0.50reduced_il, yoffs + .60reduced_il);
+       zd = (xoffs + 0.20reduced_il, yoffs + .45reduced_il);
+       ze = (xoffs + 0.20reduced_il, yoffs - .45reduced_il);
+       zf = (xoffs + 0.40reduced_il, yoffs - .55reduced_il);
        draw za .. zb .. zc -- zd -- ze -- zf;
 
        set_char_box(0 - xpart exact_center,
@@ -913,20 +864,25 @@ def draw_hufnagel_fa_clef(expr exact_center, reduction) =
        save za, zb, zc, zd, ze, zf;
        pair za, zb, zc, zd, ze, zf;
 
-       za = exact_center + (0.90reduced_il, +0.70reduced_il);
-       zb = exact_center + (0.80reduced_il, +0.70reduced_il);
-       zc = exact_center + (0.50reduced_il, +0.85reduced_il);
-       zd = exact_center + (0.20reduced_il, +0.70reduced_il);
-       ze = exact_center + (0.20reduced_il, -1.10reduced_il);
+       save xoffs, yoffs;
+       xoffs# = xpart exact_center;
+       yoffs# = ypart exact_center;
+       define_pixels(xoffs, yoffs);
+
+       za = (xoffs + 0.90reduced_il, yoffs + 0.70reduced_il);
+       zb = (xoffs + 0.80reduced_il, yoffs + 0.70reduced_il);
+       zc = (xoffs + 0.50reduced_il, yoffs + 0.85reduced_il);
+       zd = (xoffs + 0.20reduced_il, yoffs + 0.70reduced_il);
+       ze = (xoffs + 0.20reduced_il, yoffs - 1.10reduced_il);
        draw za .. zb .. zc -- zd -- ze;
 
        save zg, zh, zi, zj;
        pair zg, zh, zi, zj;
 
-       zg = exact_center + (0.90reduced_il, -0.05reduced_il);
-       zh = exact_center + (0.80reduced_il, -0.05reduced_il);
-       zi = exact_center + (0.50reduced_il, +0.10reduced_il);
-       zj = exact_center + (0.20reduced_il, -0.05reduced_il);
+       zg = (xoffs + 0.90reduced_il, yoffs - 0.05reduced_il);
+       zh = (xoffs + 0.80reduced_il, yoffs - 0.05reduced_il);
+       zi = (xoffs + 0.50reduced_il, yoffs + 0.10reduced_il);
+       zj = (xoffs + 0.20reduced_il, yoffs - 0.05reduced_il);
        draw zg .. zh .. zi -- zj;
 
        set_char_box(0 - xpart exact_center,
index af1db475204427a094b5fd4579472718924412ab..f85885dad9a0e8829610fd51e4ac5b6d7c3771ce 100644 (file)
@@ -33,6 +33,7 @@ fet_begingroup ("noteheads")
 % * height: Should match the top edge of the head.  Affects vertical
 %   collision handling.
 %
+% TODO: should depth/height include appendages/stems?
 
 overdone_heads = 0;
 noteheight# := staff_space# + (1 + overdone_heads)*stafflinethickness#;
@@ -128,15 +129,15 @@ enddef;
 %
 % (ze is wel breed)
 % 
-fet_beginchar("Maxima notehead", "-3neo_mensural", "mensuralmaximahead");
+fet_beginchar("Maxima notehead", "-3neo_mensural", "neomensuralmaximahead");
        draw_neo_longa (2.6 staff_space#)
 fet_endchar;
 
-fet_beginchar("Longa notehead", "-2neo_mensural", "mensurallongahead");
+fet_beginchar("Longa notehead", "-2neo_mensural", "neomensurallongahead");
        draw_neo_longa (2 staff_space#)
 fet_endchar;
 
-fet_beginchar("Brevis notehead", "-1neo_mensural", "mensuralbrevishead")
+fet_beginchar("Brevis notehead", "-1neo_mensural", "neomensuralbrevishead")
        draw_neo_brevis(2 staff_space#);
 fet_endchar;
 
index 1e1d0e6562995cf0de6f7eb46a5b4c0836066ffd..9e69b6f3be1b27d6840121227dd3cddbdacae229 100644 (file)
@@ -1,4 +1,4 @@
-% -*-Fundamental-*-
+% -%-Fundamental-%- -*-Metafont-*-
 % parmesan-rests.mf -- implement ancient rests
 % 
 % source file of LilyPond's pretty-but-neat music font
@@ -35,23 +35,24 @@ def neomens_half_block_rest =
        enddef;
 
 fet_beginchar("Neo-mensural maxima rest", "-3neo_mensural", "neomensmaximarest");
-       set_char_box(0, neomens_block_rest_x#,
-                   neomens_block_rest_y#, 2 neomens_block_rest_y#);
-       draw_block ((0,-neomens_block_rest_y),
-                  (neomens_block_rest_x, 2 neomens_block_rest_y));
+       set_char_box(0, 3 neomens_block_rest_x#,
+                    neomens_block_rest_y#, neomens_block_rest_y#);
+       draw_block ((0,-neomens_block_rest_y),
+                    (neomens_block_rest_x, neomens_block_rest_y));
+       addto currentpicture also currentpicture shifted (2 neomens_block_rest_x, 0);
 fet_endchar;
 
 fet_beginchar("Neo-mensural longa rest", "-2neo_mensural", "neomenslongarest");
-       set_char_box(0, neomens_block_rest_x#,
-                   neomens_block_rest_y#, neomens_block_rest_y#);
-       draw_block ((0,-neomens_block_rest_y),
-                  (neomens_block_rest_x, neomens_block_rest_y));
+       set_char_box(0, neomens_block_rest_x#,
+                    neomens_block_rest_y#, neomens_block_rest_y#);
+       draw_block ((0,-neomens_block_rest_y),
+                   (neomens_block_rest_x, neomens_block_rest_y));
 fet_endchar;
 
 fet_beginchar("Neo-mensural breve rest", "-1neo_mensural", "neomensbreverest");
-       set_char_box(0, neomens_block_rest_x#,
-                   0, neomens_block_rest_y#);
-       draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
+       set_char_box(0, neomens_block_rest_x#,
+                    0, neomens_block_rest_y#);
+       draw_block ((0,0), (neomens_block_rest_x, neomens_block_rest_y));
 fet_endchar;
 
 fet_beginchar("Neo-mensural whole rest", "0neo_mensural", "neomenssemibrevisrest");
@@ -142,53 +143,53 @@ define_pixels(mens_block_rest_y, mens_half_block_rest_y,
              pen_width, pen_height);
 
 fet_beginchar("Mensural maxima rest", "-3mensural", "mensmaximarest");
-       set_char_box(0.7pen_width#, 0.7pen_width#,
+       set_char_box(0pen_width#,
                     mens_block_rest_y#, 2mens_block_rest_y#);
        pickup pencircle
                xscaled pen_width
                yscaled pen_height
                rotated slight_pen_rotation;
-       draw (0, -mens_block_rest_y) -- (0, 2 mens_block_rest_y);
+       draw (w/2, -mens_block_rest_y) -- (w/2, 2 mens_block_rest_y);
 fet_endchar;
 
 fet_beginchar("Mensural longa rest", "-2mensural", "menslongarest");
-       set_char_box(0.7pen_width#, 0.7pen_width#,
+       set_char_box(0pen_width#,
                     mens_block_rest_y#, mens_block_rest_y#);
        pickup pencircle
                xscaled pen_width
                yscaled pen_height
                rotated slight_pen_rotation;
-       draw (0, -mens_block_rest_y) -- (0, mens_block_rest_y);
+       draw (w/2, -mens_block_rest_y) -- (w/2, mens_block_rest_y);
 fet_endchar;
 
 fet_beginchar("Mensural breve rest", "-1mensural", "mensbreverest");
-       set_char_box(0.7pen_width#, 0.7pen_width#,
+       set_char_box(0pen_width#,
                     0, mens_block_rest_y#);
        pickup pencircle
                xscaled pen_width
                yscaled pen_height
                rotated slight_pen_rotation;
-       draw (0, 0) -- (0, mens_block_rest_y);
+       draw (w/2, 0) -- (w/2, mens_block_rest_y);
 fet_endchar;
 
 fet_beginchar("Mensural whole rest", "0mensural", "menssemibrevisrest");
-       set_char_box(0.7pen_width#, 0.7pen_width#,
+       set_char_box(0pen_width#,
                     mens_half_block_rest_y#, 0);
        pickup pencircle
                xscaled pen_width
                yscaled pen_height
                rotated slight_pen_rotation;
-       draw (0, 0) -- (0, -mens_half_block_rest_y);
+       draw (w/2, 0) -- (w/2, -mens_half_block_rest_y);
 fet_endchar;
 
 fet_beginchar("Mensural half rest", "1mensural", "mensminimahalfrest");
-       set_char_box(0.7pen_width#, 0.7pen_width#,
+       set_char_box(0pen_width#,
                     0, mens_half_block_rest_y#);
        pickup pencircle
                xscaled pen_width
                yscaled pen_height
                rotated slight_pen_rotation;
-       draw (0, 0) -- (0, mens_half_block_rest_y);
+       draw (w/2, 0) -- (w/2, mens_half_block_rest_y);
 fet_endchar;
 
 mensrestsize# = .8staff_space#;
index 46fe30b49f7b3cd8ae83c3cdc0f399be03d75d85..9dc18d1621f71eb7bb861c8bbd84dd69c5f12e02 100644 (file)
@@ -786,3 +786,4 @@ Rest can contain a list of beat groupings
 
      ))))
 
+
index 3d3c796cf288f7dec58a91c18ca4da8a5bb40ced..80bc8245179f61f0617bec5107cadaa22a621ec2 100644 (file)
@@ -255,7 +255,7 @@ Voice-state objects
 (define-public (notice-the-events-for-pc context lst)
   (set! noticed (acons (ly:context-id context) lst noticed)))
 
-(define-public (make-new-part-combine-music music-list)
+(define-public (make-part-combine-music music-list)
   (let*
      ((m (make-music-by-name 'PartCombineMusic))
       (m1 (context-spec-music (car music-list) 'Voice "one"))
@@ -271,8 +271,8 @@ Voice-state objects
     (ly:run-translator m2 part-combine-listener)
     (ly:run-translator m1 part-combine-listener)
     (ly:set-mus-property! m 'split-list
-                        (determine-split-list (reverse (cdr (assoc "one" noticed)))
-                                              (reverse (cdr (assoc "two" noticed)))))
+                        (determine-split-list (reverse! (cdr (assoc "one" noticed)) '())
+                                              (reverse! (cdr (assoc "two" noticed)) '())))
     (set! noticed '())
     
     m))
@@ -561,9 +561,57 @@ Only set if not set previously.
    (analyse-solo12 0)
 ;   (if pc-debug (display result))
 
-   (set! result    (map
-                   (lambda (x) (cons (when x) (configuration x)))
-                   (vector->list result)))
+   (set! result (map
+                (lambda (x) (cons (when x) (configuration x)))
+                (vector->list result)))
 
    (if pc-debug (display result))
    result))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; autochange - fairly related to part combining.
+
+(define-public (make-autochange-music music)
+
+  (define (generate-split-list event-list)
+    (if (null? event-list)
+       '()
+       (let*
+           ((evs (map car (cdar event-list)))
+            (now (caar event-list))
+            (notes (filter (lambda (x)
+                             (equal? (ly:get-mus-property  x 'name) 'NoteEvent))
+                             evs))
+            (pitch (if (pair? notes)
+                       (ly:get-mus-property (car notes) 'pitch)
+                       #f))
+            )
+
+
+       ;; tail recursive.
+       (if (and pitch (not (= (ly:pitch-steps pitch) 0)))
+           (cons (cons now (sign (ly:pitch-steps pitch)))
+                 (generate-split-list (cdr event-list)))
+           (generate-split-list (cdr event-list)))
+       )))
+
+  (set! noticed '())
+  
+  (let*
+      ((m (make-music-by-name 'AutoChangeMusic))
+       (context (ly:run-translator music part-combine-listener))
+       (evs (last-pair noticed))
+       )
+
+    (ly:set-mus-property! m 'element music)
+    (ly:set-mus-property!
+     m 'split-list
+     (generate-split-list (if (pair? evs) (reverse! (cdar evs) '()) '()))
+     )
+    
+    (set! noticed '())
+    m
+  ))
+
+
index 22f0ce9c9e5cd8fc12c6c9908884e98804071c0f..986f58877852a70d3d5ad0e84bbde4901a0d22ba 100644 (file)
@@ -1744,12 +1744,28 @@ conversions.append (((2,1,16), conv, """\\musicglyph #"accidentals-NUM" -> \\sha
 
 
 def conv (str):
+
+       if re.search (r'\\partcombine', str):
+               sys.stderr.write ('Warning: \\partcombine has been changed. '
+                                 +'Check conversion manually!')
+       
        str = re.sub (r'\\context\s+Voice\s*=\s*one\s*\\partcombine\s+Voice\s*\\context\s+Thread\s*=\s*one(.*)\s*'
                      + r'\\context\s+Thread\s*=\s*two',
                      '\\\\newpartcombine\n\\1\n', str)
+       
+       
        return str
 
-conversions.append (((2,1,17), conv, """\\partcombine -> \\newpartcombine"""))
+conversions.append (((2,1,17), conv, """\\partcombine syntax change to \\newpartcombine"""))
+
+def conv (str):
+       str = re.sub (r'\\newpartcombine', r'\\partcombine', str)
+       str = re.sub (r'\\autochange\s+Staff', r'\\autochange ', str)
+       return str
+
+conversions.append (((2,1,18), conv, """\\newpartcombine -> \\partcombine,
+\\autochange Staff -> \\autochange
+"""))
 
 ################################
 #      END OF CONVERSIONS