]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/stem.cc (thickness): new function.
authorhanwen <hanwen>
Wed, 21 Jan 2004 13:27:11 +0000 (13:27 +0000)
committerhanwen <hanwen>
Wed, 21 Jan 2004 13:27:11 +0000 (13:27 +0000)
* lily/staff-symbol.cc (get_ledger_line_thickness): new function:
compute thickness from ledger-line-thickness.

* lily/note-head.cc (brew_ledger_lines): use
Staff_symbol::get_ledger_line_thickness ().

* lily/beam.cc (rest_collision_callback): use
Staff_symbol_referencer::staff_space().

* lily/parser.yy (My_lily_lexer): change syntax: \newpartcombine
Mus1 Mus2

* lily/include/translator.hh (class Translator): add accepts_list_
so  \with { \denies / \accepts } also works.

* scm/music-functions.scm (determine-split-list): determine split
list from music events.

* lily/new-part-combine-iterator.cc: more states.

* lily/moment.cc (LY_DEFINE): new function ly:moment<?

48 files changed:
ChangeLog
Documentation/user/refman.itely
lily/beam.cc
lily/breathing-sign.cc
lily/engraver.cc
lily/event-chord-iterator.cc
lily/font-size-engraver.cc
lily/hairpin.cc
lily/horizontal-bracket.cc
lily/include/lily-guile.hh
lily/include/staff-symbol-referencer.hh
lily/include/staff-symbol.hh
lily/include/stem.hh
lily/include/translator-def.hh
lily/include/translator-group.hh
lily/include/translator.hh
lily/lily-guile.cc
lily/line-interface.cc
lily/line-spanner.cc
lily/measure-grouping-spanner.cc
lily/melisma-engraver.cc
lily/mensural-ligature.cc
lily/moment.cc
lily/new-part-combine-iterator.cc
lily/note-head.cc
lily/note-spacing.cc
lily/ottava-bracket.cc
lily/parser.yy
lily/pitch.cc
lily/slur.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/stem.cc
lily/swallow-engraver.cc
lily/tie.cc
lily/translator-def.cc
lily/translator-group.cc
lily/translator-scheme.cc
lily/translator.cc
lily/tuplet-bracket.cc
ly/declarations-init.ly
ly/engraver-init.ly
mf/parmesan-heads.mf
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/document-translation.scm
scm/lily.scm
scm/music-functions.scm

index 5aaba0f9e7c7f88b78ce3db9a60997bc236ede1b..5f97d1b6f42d1193a048c190f2dd5ae8438edd88 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2004-01-21  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/stem.cc (thickness): new function.
+
+       * lily/staff-symbol.cc (get_ledger_line_thickness): new function:
+       compute thickness from ledger-line-thickness.
+
+       * lily/note-head.cc (brew_ledger_lines): use
+       Staff_symbol::get_ledger_line_thickness ().
+
+       * lily/beam.cc (rest_collision_callback): use
+       Staff_symbol_referencer::staff_space().
+
+       * lily/parser.yy (My_lily_lexer): change syntax: \newpartcombine
+       Mus1 Mus2
+
+       * lily/include/translator.hh (class Translator): add accepts_list_
+       so  \with { \denies / \accepts } also works.
+
+       * scm/music-functions.scm (determine-split-list): determine split
+       list from music events.
+
+       * lily/new-part-combine-iterator.cc: more states.
+
+       * lily/moment.cc (LY_DEFINE): new function ly:moment<? 
+
 2004-01-20  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * lily/system.cc (set_loose_columns): use the right prebroken cols
index 83d2c3d9f37e693e80c192791c86b62b92a1fd8e..28c3d46a2688e71a9e7228b658e3045cbaac4adf 100644 (file)
@@ -1334,6 +1334,12 @@ Internals: @internalsref{Beam}.
 
 
 @cindex Automatic beams
+@menu
+* Manual beams::                
+* Setting automatic beam behavior::  
+@end menu
+
+@node Manual beams
 @subsection Manual beams
 @cindex beams, manual
 @cindex @code{]}
@@ -1407,28 +1413,6 @@ Automatically kneed beams cannot be used together with hidden staves.
 
 
 
-@menu
-* Setting automatic beam behavior::  
-@end menu
-
-@ignore
-@no de Beam typography
-@sub section Beam typography
-
-One of the strong points of LilyPond is how beams are formatted. Beams
-are quantized, meaning that the left and right endpoints beams start
-exactly on staff lines. Without quantization, small wedges of white
-space appear between the beam and staff line, and this looks untidy.
-
-Beams are also slope-damped: melodies that go up or down should also
-have beams that go up or down, but the slope of the beams should be
-less than the slope of the notes themselves.
-
-Some beams should be horizontal. These are so-called concave beams. 
-
-[TODO: some pictures.]
-@end ignore
-
 
 @node Setting automatic beam behavior
 @subsection Setting automatic beam behavior 
@@ -2146,7 +2130,7 @@ For finger changes, use markup texts:
 @cindex subscript
 
 You can use the thumb-script to indicate that a note should be
-played with your thumb (used in cello music):
+played with the thumb. (used in cello music):
 
 @lilypond[verbatim, singleline, fragment]
       <a' a''-3>8(_\thumb <b' b''-3>)_\thumb
@@ -2159,7 +2143,8 @@ of the chord by adding them after the pitches:
         < c-1  e-2 g-3 b-5 > 4
 @end lilypond
 
-Setting @code{fingeringOrientations} will put  fingerings next
+@noindent
+In this case, setting @code{fingeringOrientations} will put  fingerings next
 to note heads:
 
 @lilypond[verbatim,singleline,fragment,relative=1]
@@ -2173,6 +2158,7 @@ to note heads:
 
 Internals: @internalsref{FingerEvent}, and @internalsref{Fingering}.
 
+Examples: @inputfileref{input/regression,finger-chords.ly}
 
 @node Text scripts
 @subsection Text scripts
@@ -3450,7 +3436,7 @@ The definition of lyrics mode is too complex.
 @node The Lyrics context
 @subsection  The Lyrics context
 
-Lyrics are printed by interpreting them in @internalsref{LyricsVoice} context:
+Lyrics are printed by interpreting them in @internalsref{LyricsVoice} context:
 @example
  \context LyricsVoice \lyrics @dots{}
 @end example
@@ -3468,10 +3454,11 @@ melody and the lyrics with the @code{\lyricsto} expression:
 \lyricsto @var{name} \new LyricsVoice @dots{} 
 @end example
 
-This aligns the lyrics to the notes of the @internalsref{Voice}
-context called @var{name}, which has to exist. Therefore, normally
-the @code{Voice} is specified first, and then the lyrics are specified
-with @code{\lyricsto}. 
+This aligns the lyrics to the
+@c
+notes of the @internalsref{Voice} context called @var{name}, which has
+to exist. Therefore, normally the @code{Voice} is specified first, and
+then the lyrics are specified with @code{\lyricsto}.
 
 For different or more complex orderings, the best way is to setup the
 hierarchy of staves and lyrics first, e.g.
@@ -3488,7 +3475,41 @@ and then combine the appropriate melodies and lyric lines:
   \lyricsto "soprano" \new LyricsVoice @emph{the lyrics}
 @end example
 
-An example is in @inputfileref{input/template,satb.ly}.
+@noindent
+The final input would resemble
+
+@example
+  << \context ChoirStaff \notes << @emph{setup the music}  >>
+     \lyricsto "soprano" @emph{etc}
+     \lyricsto "alto" @emph{etc}
+     @emph{etc}
+  >>
+@end example 
+
+
+The @code{\lyricsto} command detects melismata: it only puts one
+syllable under a tied or slurred group of notes. If you want to force
+an unslurred group of notes to be a melisma, then insert
+@code{\melisma} after the first note of the group, and
+@code{\melismaEnd} after the last one, e.g.
+
+@lilypond[relative 1, singleline, fragment,verbatim]
+<<  \context Voice = "lala" { \time 3/4
+    f4 g8
+    \melisma 
+    f e f
+    \melismaEnd
+     e2 }
+  \lyricsto "lala" \new LyricsVoice \lyrics {
+    la di __ daah 
+  } >>
+@end lilypond
+
+In addition, notes are considered a melisma if they are manually
+beamed, and automatic beaming (See @ref{Setting automatic beam
+behavior}) is switched off.  The criteria for deciding melismata
+can be tuned with the property @code{melismaBusyProperties}. See
+@internalsref{Melisma_engraver} for more information.
 
 When multiple stanzas are put on the same melody, it can happen that
 two stanzas have melismata in different locations. This can be
@@ -3497,16 +3518,22 @@ remedied by switching off melismata for one
 the @code{ignoreMelismata} property to @code{#t}. An example is shown
 in @inputfileref{input/regression,lyric-combine-new.ly}.
 
-
 @cindex SATB
 @cindex choral score
 
 A complete example of a SATB score setup is in the file
 @inputfileref{input/template,satb.ly}.
 
+@refcommands
+
+@code{\melisma}, @code{\melismaEnd}
+@cindex @code{\melismaEnd}
+@cindex @code{\melisma}
+
 @seealso
 
-Internals: @internalsref{LyricCombineMusic}, @internalsref{Lyrics}
+Internals: @internalsref{LyricCombineMusic}, @internalsref{Lyrics},
+@internalsref{Melisma_engraver}.
 
 Examples: @inputfileref{input/template,satb.ly},
 @inputfileref{input/regression,lyric-combine-new.ly}.
index c000147a33591097d024d6b62cd4944985471f7b..e92c76ed7b4f1e52f62acb1a359337c1282c4f04 100644 (file)
@@ -1474,7 +1474,8 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
   Grob *common_x = rest->common_refpoint (beam, Y_AXIS);
   Real rest_dim = rest->extent (common_x, Y_AXIS)[d] / staff_space * d;
 
-  Real minimum_distance = robust_scm2double
+  Real minimum_distance =
+    staff_space * robust_scm2double
     (rest->get_grob_property ("minimum-beam-collision-distance"), 1);
 
   Real distance = beam_y - rest_dim;
@@ -1483,20 +1484,23 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
     shift = minimum_distance - distance;
   else if (minimum_distance > distance)
     shift = minimum_distance - distance;
-      
-  int stafflines = Staff_symbol_referencer::line_count (rest);
+
+  shift /= staff_space;
+  
+  Real rad = Staff_symbol_referencer::line_count (rest) * staff_space / 2;
 
   /* Always move discretely by half spaces */
-  Real discrete_shift = ceil (shift * 2.0) / 2.0;
+  shift = ceil (shift * 2.0) / 2.0;
 
   /* Inside staff, move by whole spaces*/
-  if ((rest->extent (common_x, Y_AXIS)[d] + discrete_shift) * d
-      < stafflines / 2.0
-      ||(rest->extent (common_x, Y_AXIS)[-d] + discrete_shift) * -d
-      < stafflines / 2.0)
-    discrete_shift = ceil (discrete_shift);
+  
+  if ((rest->extent (common_x, Y_AXIS)[d] + staff_space * shift) * d
+      < rad
+      || (rest->extent (common_x, Y_AXIS)[-d] + staff_space * shift) * -d
+      < rad)
+    shift = ceil (shift);
 
-  return gh_double2scm (-d * discrete_shift);
+  return gh_double2scm (-d * staff_space * shift);
 }
 
 bool
index 006682be8a4c41cead144d2f3652e748dbca3116..0935effb824856dbb249680f384af54bb845f7a9 100644 (file)
@@ -45,10 +45,9 @@ Breathing_sign::divisio_minima (SCM smob)
   Grob *me = unsmob_grob (smob);
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   Real staff_size;
-  Real thickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
-  SCM lt =  me->get_grob_property ("thickness");
-  if (gh_number_p (lt))
-    thickness *= gh_scm2double (lt);
+
+  Real thickness = Staff_symbol_referencer::line_thickness (me);
+  thickness *= robust_scm2double (me->get_grob_property ("thickness"), 1.0);
   if (Staff_symbol_referencer::get_staff_symbol (me))
     {
       staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space;
@@ -79,10 +78,9 @@ Breathing_sign::divisio_maior (SCM smob)
   Grob *me = unsmob_grob (smob);
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   Real staff_size;
-  Real thickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
-  SCM lt =  me->get_grob_property ("thickness");
-  if (gh_number_p (lt))
-    thickness *= gh_scm2double (lt);
+  Real thickness = Staff_symbol_referencer::line_thickness (me);
+  thickness *= robust_scm2double (me->get_grob_property ("thickness"), 1.0);
+
   if (Staff_symbol_referencer::get_staff_symbol (me))
     {
       staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space;
@@ -120,10 +118,9 @@ Breathing_sign::divisio_maxima (SCM smob)
   Grob *me = unsmob_grob (smob);
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   Real staff_size;
-  Real thickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
-  SCM lt =  me->get_grob_property ("thickness");
-  if (gh_number_p (lt))
-    thickness *= gh_scm2double (lt);
+  Real thickness = Staff_symbol_referencer::line_thickness (me);
+  thickness *= robust_scm2double (me->get_grob_property ("thickness"), 1.0);
+
   if (Staff_symbol_referencer::get_staff_symbol (me))
     {
       staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space;
@@ -151,10 +148,9 @@ Breathing_sign::finalis (SCM smob)
   Grob *me = unsmob_grob (smob);
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   Real staff_size;
-  Real thickness = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
-  SCM lt =  me->get_grob_property ("thickness");
-  if (gh_number_p (lt))
-    thickness *= gh_scm2double (lt);
+  Real thickness = Staff_symbol_referencer::line_thickness (me);
+  thickness *= robust_scm2double (me->get_grob_property ("thickness"), 1.0);
+
   if (Staff_symbol_referencer::get_staff_symbol (me))
     {
       staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space;
index e4a636721635e482dbc3d3a0f097d9c47e04feb0..65f161a9ce74ed7f3fbaa27c5be4ef0ad9195cda 100644 (file)
@@ -37,6 +37,9 @@ Engraver::announce_grob (Grob* e, SCM cause)
   i.grob_ = e;
   if (!i.origin_trans_)
     i.origin_trans_ = this;
+
+
+
   get_daddy_grav ()->announce_grob (i);
 }
 
index c417e55917b574271d7748070be27af11e8c04c0..ffb423bc6646c41a2da55ff6eb9661a83c7903a3 100644 (file)
@@ -25,7 +25,7 @@ Translator_group*
 Event_chord_iterator::get_req_translator ()
 {
   assert (report_to ());
-  if (report_to ()->is_bottom_translator_b ())
+  if (report_to ()->is_bottom_context ())
     return report_to ();
 
   set_translator (report_to ()->get_default_interpreter ());
index 369f1ca5bcd3294bcd1f0d79746778648cc526f7..39174d47d41bc74279bc41dc8c3f8a730a7a2c00 100644 (file)
@@ -25,25 +25,27 @@ Font_size_engraver::Font_size_engraver ()
 
 }
 
-/*
-  TODO: use fontSize = NUMBER as a scaling constant: find the closest
-  integer design size, and use magnification to do the fractional bit.
-*/
 void
 Font_size_engraver::acknowledge_grob (Grob_info gi)
 {
   SCM sz = get_property ("fontSize");
 
-  if (gh_number_p (sz)
-      && gh_scm2double (sz)
-      && !gh_number_p (gi.grob_->get_grob_property ("font-size")))
+  /*
+    We only want to process a grob once.
+   */
+  if (gi.origin_trans_->daddy_trans_ != daddy_trans_)
+    return ;
+  
+  if (gh_number_p (sz) && gh_scm2double (sz))
     {
-      gi.grob_->set_grob_property ("font-size", sz);
+      Real font_size = gh_scm2double (sz);
+      
+      font_size +=  robust_scm2double (gi.grob_->get_grob_property ("font-size"), 0);
+      gi.grob_->set_grob_property ("font-size", gh_double2scm (font_size));
     }
 }
 
 
-
 ENTER_DESCRIPTION(Font_size_engraver,
 /* descr */       "Puts fontSize into font-relative-size grob property.",
 /* creats*/       "",
index 869365001841233a21ef895d3c70a8b7b01d13bc..f773673f4c6fbc0f07ace4aed46860480fe7d5e0 100644 (file)
@@ -6,6 +6,7 @@
   (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include "staff-symbol-referencer.hh"
 #include "molecule.hh"
 #include "line-interface.hh"
 #include "hairpin.hh"
@@ -100,7 +101,8 @@ Hairpin::brew_molecule (SCM smob)
     }
 
   bool continued = broken[Direction (-grow_dir)];
-  Real height = robust_scm2double (me->get_grob_property ("height"), 0.2);
+  Real height = robust_scm2double (me->get_grob_property ("height"), 0.2) *
+    Staff_symbol_referencer::staff_space (me);
 
   Real starth, endh;
   if (grow_dir < 0)
index a172d85358199b156081a9f27427368edfe8d94f..ce9283060b6b221b1616e9abb62796cd2c0361ca 100644 (file)
@@ -51,14 +51,11 @@ Horizontal_bracket::brew_molecule (SCM smob)
   ext.unite (gs[0]->extent (cx, X_AXIS));
 
   Direction d = get_grob_direction (me);
-  Real lt =me->get_paper()->get_realvar (ly_symbol2scm ("linethickness"));
-  Real t = lt;
 
-  SCM lthick = me->get_grob_property ("thickness");
-  if (gh_number_p (lthick))
-    t *= gh_scm2double (lthick);
+  Real thickness = Staff_symbol_referencer::line_thickness (me);
+  thickness *= robust_scm2double (me->get_grob_property ("thickness"), 1.0);
   
-  Molecule b = Lookup::bracket (X_AXIS, ext, t, - d* 1.0, lt); 
+  Molecule b = Lookup::bracket (X_AXIS, ext, thickness, - d* 1.0, thickness/2); 
   
   b.translate_axis ( - sp->get_bound (LEFT)->relative_coordinate (cx, X_AXIS), X_AXIS);
 
index 19fed5950a9ed5aa23595f6a78081067ba8b85f4..353d1fe798bb6786a15d87203d2083a9da65a620 100644 (file)
@@ -160,6 +160,7 @@ Slice int_list_to_slice (SCM l);
 SCM ly_interval2scm (Drul_array<Real>);
 
 Real robust_scm2double (SCM, double);
+int robust_scm2int (SCM, int);
 Drul_array<Real> robust_scm2drul (SCM, Drul_array<Real>);
 Interval robust_scm2interval (SCM, Drul_array<Real>);
 Offset robust_scm2offset (SCM, Offset);
index d945de1492391326db8df3adcd0ff116937c81f3..24c8e099df2916fae26ea2c8d76bd767de1cea57 100644 (file)
@@ -32,6 +32,7 @@ public:
      typeface. ie. leading is vertical space.
   */
  
+  static Real line_thickness (Grob*);
   static Real staff_space (Grob*);
   static Grob * get_staff_symbol (Grob*);
   static bool on_staffline (Grob*);
index a9fa51dccfb74d485d3c6766c8d18dbb7e385bad..c27f633540ccfe974ebaff384dd3aef8fddb4605 100644 (file)
@@ -20,6 +20,9 @@ class Staff_symbol
 {
 public:
   static Real staff_space (Grob*) ;
+  static Real get_line_thickness (Grob*);
+  static Real get_ledger_line_thickness (Grob*);
+    
   static int get_steps (Grob*) ;
   static int line_count (Grob*);
   DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
index d4637beb42bb4e1753e154080d8fe33bbae468ed..05d07a7a1d4643fdf8463fade66c39efff748256 100644 (file)
@@ -30,7 +30,7 @@ public:
   static void set_stemend (Grob *,Real);
   static Direction get_default_dir (Grob *);
   static Slice Stem::beam_multiplicity (Grob *);
-
+  static Real thickness (Grob*);
   static int head_count (Grob *);
   static bool invisible_b (Grob *) ;
   static Interval head_positions (Grob *);
index ad47f9781c3c7177e28b0f443bbcad6b54f98237..5c39d2a4f3d0d689903a984eb3f2c6f27aefc583 100644 (file)
@@ -37,7 +37,7 @@ public:
   void add_context_mod (SCM);
   SCM default_child_context_name ();
   SCM get_context_name () const;
-  SCM get_accepted ()  const;
+  SCM get_accepted (SCM)  const;
   SCM get_property_ops ()  const { return property_ops_; }
   SCM get_translator_names (SCM) const;
   void set_acceptor (SCM accepts, bool add);
index 7703529da19b201157bbd8befc91cb297c520c16..4867c62a2b19c22be49d6ad9bb2156d5ce7d7937 100644 (file)
@@ -57,7 +57,7 @@ public:
   void add_used_group_translator (Translator *trans);
   
   int get_depth () const;
-  bool is_bottom_translator_b () const;
+  bool is_bottom_context () const;
   bool is_removable () const;
   void terminate_translator (Translator*r);
   Translator *remove_translator (Translator*trans);
index de045a56b3524d0d1aa5d15553bb7fa8255f28da..466405aea86e8e1acdc956d8c1a87b6dff4e2fe3 100644 (file)
@@ -59,7 +59,7 @@ public:
   SCM definition_;
   SCM properties_scm_;
   SCM trans_group_list_;
-
+  SCM accepts_list_;
   virtual SCM get_simple_trans_list ();
 public:
   DECLARE_SMOBS (Translator, dummy);
index 559aec578f6e0439a3daa1a705dd6ec9310aef8e..a7c8b58919ee7badfc53bd63077f245120943569 100644 (file)
@@ -751,3 +751,13 @@ robust_scm2offset (SCM k, Offset o)
 
   return o;
 }
+
+
+int
+robust_scm2int (SCM k, int o)
+{
+  if (scm_integer_p (k) == SCM_BOOL_T)
+    o = gh_scm2int (k);
+
+  return o;
+}
index 41f272c90aa9bf89ac233670c3e977d4c02c44e5..3340c8190d9324c3f4935cbbf68cc11bfbc9fe6c 100644 (file)
@@ -71,9 +71,7 @@ Line_interface::make_line (Real th, Offset from, Offset to)
 Molecule
 Line_interface::line (Grob *me, Offset from, Offset to)
 {
-  Real thick = me->get_paper()->get_realvar (ly_symbol2scm ("linethickness"));  
-  thick *= robust_scm2double (me->get_grob_property ("thickness"), 1.0); // todo: staff sym referencer? 
-
+  Real thick = Staff_symbol_referencer::line_thickness (me);
   SCM type = me->get_grob_property ("style");
 
   SCM dash_fraction = me->get_grob_property ("dash-fraction");
index 3b74fb149741b7715f1dab06164bcf47edb91aff..3daaab5557711e5dfcdf76c12b77571143edbf12 100644 (file)
@@ -30,7 +30,7 @@ zigzag_molecule (Grob *me,
   Real dx = dz[X_AXIS];
   Real dy = dz[Y_AXIS];
 
-  Real thick = me->get_paper()->get_realvar (ly_symbol2scm ("linethickness"));  
+  Real thick = Staff_symbol_referencer::thickness (me);
   thick *= robust_scm2double (me->get_grob_property ("thickness"), 1.0); // todo: staff sym referencer? 
   
   Real staff_space = Staff_symbol_referencer::staff_space (me);
index 9af72c3405334aee3949a8d9dbcb50686523e6eb..55a5417f4c8f3a8c353f284ec71ae6b35ec17bee 100644 (file)
@@ -22,10 +22,9 @@ Measure_grouping::brew_molecule (SCM grob)
     TODO: robustify.
    */
   SCM which = me->get_grob_property ("style");
-  SCM thick = me->get_grob_property ("thickness");
   SCM height = me->get_grob_property ("height");
 
-  Real t = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) * gh_scm2double (thick); 
+  Real t = Staff_symbol_referencer::thickness (me) * robust_scm2double (me->get_grob_property ("thickness"));
   Grob *common = me->get_bound(LEFT)->common_refpoint (me->get_bound (RIGHT),
                                                       X_AXIS);
 
index d63150f7e31b684c96fa034ee8c38bb30c996135..360c1f57c2242e62814d75c8c10a3369d05899ae 100644 (file)
@@ -29,7 +29,7 @@ Melisma_engraver::try_music (Music *)
   /*
     This can only be melisma-playing-event.
    */
-  return  melisma_busy (this);
+  return melisma_busy (this);
 }
 
 Melisma_engraver::Melisma_engraver()
index 10fa80d31cc935386e3869810e89d3871628b4b0..42e2638cca7d62ce486bf63936d08fc1f406992d 100644 (file)
@@ -143,34 +143,13 @@ internal_brew_primitive (Grob *me, bool ledger_take_space)
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   if (primitive & MLP_ANY)
     {
-      SCM thickness_scm = me->get_grob_property ("thickness");
-      if (thickness_scm != SCM_EOL)
-       {
-         thickness = gh_scm2double (thickness_scm);
-       }
-      else
-       {
-         programming_error (_f ("Mensural_ligature:"
-                                "thickness undefined on flexa %d; assuming 1.4",
-                                primitive));
-         thickness = 1.4 * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
-       }
+      thickness = robust_scm2double ( me->get_grob_property ("thickness"), .14);
     }
 
   if (primitive & MLP_FLEXA)
     {
-      SCM delta_pitch_scm = me->get_grob_property ("delta-pitch");
-      if (delta_pitch_scm != SCM_EOL)
-       {
-         delta_pitch = gh_scm2int (delta_pitch_scm);
-       }
-      else
-       {
-         programming_error (_f ("Mensural_ligature:"
-                                "delta-pitch undefined on flexa %d; assuming 0",
-                                primitive));
-         delta_pitch = 0;
-       }
+      delta_pitch = robust_scm2int (me->get_grob_property ("delta-pitch"),
+                                   0);
 
       flexa_width = robust_scm2double (me->get_grob_property ("flexa-width"), 2.0 * staff_space);
     }
index d3c6703c397554f14a9b2d6b986b9843b4ba721c..14afed0907bd50f64031dadcb8ab927ab0120112 100644 (file)
@@ -102,6 +102,17 @@ LY_DEFINE (div_moment,"ly:div-moment", 2,0,0, (SCM a, SCM b),
   return (*ma /  *mb).smobbed_copy();
 }
 
+LY_DEFINE (ly_moment_less_p,"ly:moment<?", 2,0,0, (SCM a, SCM b),
+          "Comparation.")
+{
+  Moment * ma = unsmob_moment (a);
+  Moment * mb = unsmob_moment (b);
+  SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
+  SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
+
+  return gh_bool2scm (*ma <  *mb);
+}
+
 
 
 SCM
index 544041579745ba072e4b33c32a13ea910c585dc3..328efd7572df079b8bb8fd24cef000a1546c90f0 100644 (file)
@@ -45,10 +45,14 @@ private:
 
   Interpretation_context_handle one_;
   Interpretation_context_handle two_;
+  Interpretation_context_handle null_;
   Interpretation_context_handle shared_;
 
-  void together ();
+  void chords_together ();
   void apart ();
+  void solo1 ();
+  void solo2 ();
+  void unisono ();
 };
 
 
@@ -131,16 +135,57 @@ New_pc_iterator::ok () const
 }
 
 void
-New_pc_iterator::together ()
+New_pc_iterator::chords_together ()
 {
   first_iter_->substitute_outlet (one_.report_to (), shared_.report_to ());
+  first_iter_->substitute_outlet (null_.report_to (), shared_.report_to ());
   second_iter_->substitute_outlet (two_.report_to (), shared_.report_to ());
+  second_iter_->substitute_outlet (null_.report_to (), shared_.report_to ());
+}
+
+
+void
+New_pc_iterator::solo1 ()
+{
+  first_iter_->substitute_outlet (null_.report_to (), shared_.report_to ());
+  first_iter_->substitute_outlet (one_.report_to (), shared_.report_to ());
+
+  second_iter_->substitute_outlet (two_.report_to (), null_.report_to ());
+  second_iter_->substitute_outlet (shared_.report_to (), null_.report_to ());
 }
 
+void
+New_pc_iterator::unisono ()
+{
+  /*
+    like solo1, but should set a2 string.
+   */
+  first_iter_->substitute_outlet (null_.report_to (), shared_.report_to ());
+  first_iter_->substitute_outlet (one_.report_to (), shared_.report_to ());
+
+  second_iter_->substitute_outlet (two_.report_to (), null_.report_to ());
+  second_iter_->substitute_outlet (shared_.report_to (), null_.report_to ());
+}
+
+
+void
+New_pc_iterator::solo2 ()
+{
+  second_iter_->substitute_outlet (null_.report_to (), shared_.report_to ());
+  second_iter_->substitute_outlet (two_.report_to (), shared_.report_to ());
+
+  first_iter_->substitute_outlet (one_.report_to (), null_.report_to ());
+  first_iter_->substitute_outlet (shared_.report_to (), null_.report_to ());
+}
+
+
 void
 New_pc_iterator::apart ()
 {
-  first_iter_->substitute_outlet (shared_.report_to (),one_.report_to ());
+  first_iter_->substitute_outlet (null_.report_to (), one_.report_to ());
+  first_iter_->substitute_outlet (shared_.report_to (), one_.report_to ());
+  
+  second_iter_->substitute_outlet (null_.report_to (), two_.report_to ());
   second_iter_->substitute_outlet (shared_.report_to (), two_.report_to ());
 }
 
@@ -151,10 +196,19 @@ New_pc_iterator::construct_children ()
   split_list_ =  get_music ()->get_mus_property ("split-list");
   SCM lst =  get_music ()->get_mus_property ("elements");
 
+  SCM props = scm_list_n (scm_list_n (ly_symbol2scm ("denies"), ly_symbol2scm ("Thread"), SCM_UNDEFINED),
+                         scm_list_n (ly_symbol2scm ("consists"), ly_symbol2scm ("Rest_engraver"), SCM_UNDEFINED),
+                         scm_list_n (ly_symbol2scm ("consists"), ly_symbol2scm ("Note_heads_engraver"), SCM_UNDEFINED),
+                         SCM_UNDEFINED);
+
   Translator_group *tr
     =  report_to ()->find_create_translator (ly_symbol2scm ("Voice"),
-                                            "shared", SCM_EOL);
+                                            "shared",props);
 
+  Translator_group *null
+    =  report_to ()->find_create_translator (ly_symbol2scm ("Devnull"),
+                                            "", SCM_EOL);
+  null_.set_translator (null);
   tr->execute_pushpop_property (ly_symbol2scm ("NoteHead"),
                                ly_symbol2scm ("font-size"), gh_int2scm (3));
 
@@ -163,7 +217,7 @@ New_pc_iterator::construct_children ()
   set_translator (tr);
 
   Translator_group *one = tr->find_create_translator (ly_symbol2scm ("Voice"),
-                                                     "one", SCM_EOL);
+                                                     "one", props);
 
   one_.set_translator (one);
   one->execute_pushpop_property (ly_symbol2scm ("Stem"),
@@ -174,7 +228,7 @@ New_pc_iterator::construct_children ()
 
 
   Translator_group *two = tr->find_create_translator (ly_symbol2scm ("Voice"),
-                                                     "two", SCM_EOL);
+                                                     "two", props);
   two_.set_translator (two);
   two_.report_to ()->execute_pushpop_property (ly_symbol2scm ("Stem"),
                                  ly_symbol2scm ("direction"), gh_int2scm (-1));
@@ -197,12 +251,23 @@ New_pc_iterator::process (Moment m)
       if (*splitm > now)
        break ;
 
-      if (gh_cdar (split_list_) == ly_symbol2scm ("together"))
-       together ();
-      else if (gh_cdar (split_list_) == ly_symbol2scm ("apart"))
+      SCM tag = gh_cdar (split_list_);
+      
+      if (tag == ly_symbol2scm ("chords"))
+       chords_together ();
+      else if (tag == ly_symbol2scm ("apart"))
        apart ();
+      else if (tag == ly_symbol2scm ("unisono"))
+       unisono ();
+      else if (tag == ly_symbol2scm ("solo1"))
+       solo1 ();
+      else if (tag == ly_symbol2scm ("solo2"))
+       solo2 ();
       else
-       programming_error ("Unknown split directive.");
+       {
+         String s =  "Unknown split directive: " + ly_symbol2string (tag);
+         programming_error (s);
+       }
     }
   
   if (first_iter_->ok ())
index 5c8688ef1970ec28609a0bf8befc2930845c7588..d21be5b0703f67b0d02867efef276e5d236f510f 100644 (file)
@@ -8,6 +8,7 @@
 #include <math.h>
 #include <ctype.h>
 
+#include "staff-symbol.hh"
 #include "misc.hh"
 #include "dots.hh"
 #include "note-head.hh"
@@ -69,6 +70,7 @@ Note_head::brew_ledger_lines (Grob *me,
                              Real left_shorten,
                              bool take_space)
 {
+  Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
   Real inter_f = Staff_symbol_referencer::staff_space (me)/2;
   int line_count = (abs (pos) < interspaces)
     ? 0
@@ -79,9 +81,8 @@ Note_head::brew_ledger_lines (Grob *me,
   if (line_count)
     {
       Real ledgerlinethickness =
-       (me->get_paper ()->get_realvar (ly_symbol2scm ("ledgerlinethickness")));
+       Staff_symbol::get_ledger_line_thickness (staff);
       Real blotdiameter = ledgerlinethickness;
-      //       (me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")));
       Interval y_extent =
        Interval (-0.5*(ledgerlinethickness),
                  +0.5*(ledgerlinethickness));
index 0cf786d7512bc5bd9b89bfa1c1a11c0254e1ab41..3c6fca58036d673c9bf1e905b6e407b5f5e32cd3 100644 (file)
@@ -355,8 +355,7 @@ Note_spacing::stem_dir_correction (Grob*me, Item * rcolumn,
 
              if (st)
                {
-                 Real thick = robust_scm2double (st->get_grob_property ("thickness"), 1)
-                   * st->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+                 Real thick = Stem::thickness (st);
 
                  note_head_width -= thick;
                }
index 2e991f7ec0924802105a4a68d9cf9413c3b7523e..d5b3dd56c01b3e1544c04d46668d9472ac304766 100644 (file)
@@ -146,7 +146,12 @@ Ottava_bracket::brew_molecule (SCM smob)
        |
        |
        
-   */
+
+    Just a small amount, yes.  In tight situations, it is even
+    possible to center the `8' directly below the note, dropping the
+    ottava line completely...
+
+  */
   
   b = Molecule (Box (b.extent (X_AXIS),
                     Interval (0.1,0.1)),
index fad5e954b7d7df9ab2c2e418e8ce80add819ef99..dde4cfa58c3dccea51aa02e5ef665db09fa97adc 100644 (file)
@@ -1125,14 +1125,17 @@ part_combined_music:
 
                $$ = p;
        }
-       | NEWPARTCOMBINE embedded_scm Music Music {
-               Music * p= MY_MAKE_MUSIC("NewPartCombineMusic");
-               p->set_mus_property ("elements", gh_list ($3->self_scm (),$4->self_scm (), SCM_UNDEFINED));  
-               p->set_mus_property ("split-list", $2);
-               scm_gc_unprotect_object ($3->self_scm ());
-               scm_gc_unprotect_object ($4->self_scm ());  
+       | NEWPARTCOMBINE Music Music {
+               static SCM proc;
+               if (!proc)
+                       proc = scm_c_eval_string ("make-new-part-combine-music");
 
-               $$ = p;
+               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);
        }
        ;
 
index 25a1d97c57a970f7809a85ffca118571278f2fe4..d4f9aae48f8c233b395093093ef28863790605d7 100644 (file)
@@ -408,7 +408,7 @@ LY_DEFINE(pitch_less, "ly:pitch<?", 2,0,0, (SCM p1, SCM p2),
 LY_DEFINE(ly_pitch_diff, "ly:pitch-diff", 2 ,0 ,0,
          (SCM pitch, SCM  root),
          "Return pitch with value DELTA =  PITCH - ROOT, ie, "
-         "ROOT == (ly:pitch-transpose root delta).")
+         "ROOT == (ly:pitch-transpose PITCH DELTA).")
 {
   Pitch *p = unsmob_pitch (pitch);
   Pitch *r = unsmob_pitch (root);
index 4e4150bc83eb474a370710fce0d76b69250704a4..1ccb8a861f51850dd8c827d707a3e304d7e45a82 100644 (file)
@@ -348,9 +348,7 @@ Slur::get_attachment (Grob *me, Direction dir,
              /*
                Default position is on stem X, at stem end Y
               */
-             Real stem_thickness =
-               robust_scm2double (stem->get_grob_property ("thickness"), 1)
-               * stem->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+             Real stem_thickness = Stem::thickness (stem);
              o += Offset (0.5 *
                           x_extent * (1 + Stem::get_direction (stem))
                           - ((dir + 1)/2) * stem_thickness
@@ -549,9 +547,7 @@ Slur::brew_molecule (SCM smob)
     }
 
   Real base_thick = robust_scm2double (me->get_grob_property ("thickness"), 1);
-
-  Real thick = base_thick *
-    me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+  Real thick = base_thick * Staff_symbol_referencer::line_thickness (me);
 
   Real ss = Staff_symbol_referencer::staff_space (me);
   Bezier one = get_curve (me);
index c59b50ce81e748a575b6803c489f357c05040af9..604eac7b3d837625d04012a2c9cb68aadb3e8006 100644 (file)
@@ -51,6 +51,16 @@ Staff_symbol_referencer::staff_space (Grob*me)
   return 1.0;
 }
 
+Real
+Staff_symbol_referencer::line_thickness (Grob*me) 
+{
+  Grob * st = get_staff_symbol (me);
+  if (st)
+    return Staff_symbol::get_line_thickness (st);
+
+  return me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+}
+
 Real
 Staff_symbol_referencer::get_position (Grob*me) 
 {
index 69a332b6a147dde767421812aae757e5a48c79f8..011e330c86aba03c7316bcc8694e270d7b361a95 100644 (file)
@@ -100,10 +100,27 @@ Staff_symbol::line_count (Grob*me)
 Real
 Staff_symbol::staff_space (Grob*me)
 {
-  return  robust_scm2double ( me->get_grob_property ("staff-space"), 1.0);
+  return robust_scm2double ( me->get_grob_property ("staff-space"), 1.0);
 }
 
+Real
+Staff_symbol::get_line_thickness (Grob* me)
+{
+  Real lt =  me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+
+  return robust_scm2double (me->get_grob_property ("thickness"), 1.0) * lt;
+}
+
+Real
+Staff_symbol::get_ledger_line_thickness (Grob * me)
+{
+  Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
 
+  SCM lt_pair = me->get_grob_property ("ledger-line-thickness");
+  Offset z = robust_scm2offset (lt_pair, Offset (1.0, 0.1));
+  
+  return z[X_AXIS] * get_line_thickness(me) + z[Y_AXIS]* staff_space (me);
+}
 
 
 ADD_INTERFACE (Staff_symbol,"staff-symbol-interface",
@@ -111,5 +128,4 @@ ADD_INTERFACE (Staff_symbol,"staff-symbol-interface",
 "or space) is position 0. The length of the symbol may be set by hand "
 "through the @code{width} property. ",
               
-  "width staff-space thickness line-count");
-
+  "ledger-line-thickness width staff-space thickness line-count");
index cda3175f7516353772685c5e3ea9124c22eff114..a8d9f390e2f1ebeeb8e991d437c3d150debd20e0 100644 (file)
@@ -451,8 +451,7 @@ Stem::position_noteheads (Grob*me)
     heads.reverse ();
 
 
-  Real thick = robust_scm2double (me->get_grob_property ("thickness"),1)
-     * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+  Real thick = thickness (me);
       
   Grob *hed = support_head (me);
   Real w = Note_head::head_extent (hed,X_AXIS)[dir];
@@ -683,14 +682,17 @@ Stem::dim_callback (SCM e, SCM ax)
   else
     {
       r = flag (me).extent (X_AXIS)
-       +
-        gh_scm2double (me->get_grob_property ("thickness"))
-       * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"))/2;
+       + thickness (me)/2;
     }
   return ly_interval2scm (r);
 }
  
-
+Real
+Stem::thickness (Grob* me)
+{
+  return gh_scm2double (me->get_grob_property ("thickness"))
+    * Staff_symbol_referencer::line_thickness (me);
+}
 
 MAKE_SCHEME_CALLBACK (Stem,brew_molecule,1);
 
@@ -700,11 +702,9 @@ Stem::brew_molecule (SCM smob)
   Grob*me = unsmob_grob (smob);
   Molecule mol;
   Direction d = get_direction (me);
-  
-  
      
   /*
-    TODO: make  the stem start a direction ?
+    TODO: make the stem start a direction ?
 
     This is required to avoid stems passing in tablature chords...
   */
@@ -715,9 +715,7 @@ Stem::brew_molecule (SCM smob)
     return SCM_EOL;
 
   if (invisible_b (me))
-    {
-      return SCM_EOL;
-    }
+    return SCM_EOL;
   
   Real y1 = Staff_symbol_referencer::get_position (lh);
   Real y2 = stem_end_position (me);
@@ -742,8 +740,7 @@ Stem::brew_molecule (SCM smob)
 
   
   // URG
-  Real stem_width = robust_scm2double (me->get_grob_property ("thickness"), 1)
-    * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+  Real stem_width = thickness (me);
   Real blot = 
        me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter"));
   
@@ -805,8 +802,7 @@ Stem::off_callback (SCM element_smob, SCM)
       if (attach)
        {
          Real rule_thick
-           = robust_scm2double (me->get_grob_property ("thickness"), 1)
-           * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+           = thickness (me);
          
          r += - d * rule_thick * 0.5;
        }
index 989e78c271fd4b569d7dd924b154a0a7bbf7c32a..674464220a9016bdaece4ca0b8af0b2f893a5191 100644 (file)
@@ -9,8 +9,6 @@
 #include "engraver.hh"
 
 /**
-  This engraver swallows everything given to it silently. The purpose of
-  this is to prevent spurious "event junked" warnings.
  */
 class Swallow_engraver : public Engraver
 {
@@ -27,3 +25,16 @@ Swallow_engraver::try_music (Music*)
 {
   return true;
 }
+
+Swallow_engraver::Swallow_engraver ()
+{
+}
+
+ENTER_DESCRIPTION(Swallow_engraver,
+/* descr */       "This engraver swallows everything given to it silently. The purpose of "
+                 "this is to prevent spurious \"event junked\" warnings.",
+/* creats*/       "",
+/* accepts */     "general-music",
+/* acks  */       "",
+/* reads */       "",
+/* write */       "");
index bd569c4f87b68cb5880fed8c0fbc56af57f1e5e8..ab1c43868fb55380f3f517edc847bfc7976a427c 100644 (file)
@@ -330,9 +330,9 @@ Tie::brew_molecule (SCM smob)
       me->set_grob_property ("control-points", cp);
     }
   
-  Real thick =
-    gh_scm2double (me->get_grob_property ("thickness"))
-    * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"));
+  Real thick
+    = Staff_symbol_referencer::thickness (me)
+    *  robust_scm2double (me->get_grob_property ("thickness"), 1);
 
   Bezier b;
   int i = 0;
index d83364751fc48dbf29a1b705adab2f3a9438daca..8ace8f7f54f32ff83c5aceb2ece96f876fb9d991 100644 (file)
@@ -144,11 +144,12 @@ Context_def::get_context_name () const
 }
 
 SCM
-Context_def::get_accepted () const
+Context_def::get_accepted (SCM user_mod) const
 {
-  SCM correct_order = scm_reverse (accept_mods_);
+  SCM mods = scm_reverse_x (scm_list_copy (accept_mods_),
+                           user_mod);
   SCM acc = SCM_EOL;
-  for (SCM s = correct_order; gh_pair_p (s); s = gh_cdr (s))
+  for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s))
     {
       SCM tag = gh_caar (s);
       SCM sym = gh_cadar (s);
@@ -166,7 +167,7 @@ Context_def::path_to_acceptable_translator (SCM type_sym, Music_output_def* odef
 {
   assert (gh_symbol_p (type_sym));
   
-  SCM accepted = get_accepted ();
+  SCM accepted = get_accepted (SCM_EOL);
 
   Link_array<Context_def> accepteds;
   for (SCM s = accepted; gh_pair_p (s); s = ly_cdr (s))
@@ -263,7 +264,7 @@ Context_def::instantiate (Music_output_def* md, SCM ops)
 
   SCM trans_names = get_translator_names (ops); 
   tg->simple_trans_list_ = names_to_translators (trans_names, tg);
-
+  tg->accepts_list_ = get_accepted  (ops);
   return tg;
 }
 
@@ -284,17 +285,6 @@ Context_def::make_scm ()
   return t->self_scm();
 }
 
-
-/*
-  Default child context as a SCM string, or something else if there is
-  none.
-*/
-SCM
-Context_def::default_child_context_name ()
-{
-  SCM d = get_accepted ();
-  return gh_pair_p (d) ? ly_car (scm_last_pair (d)) : SCM_EOL;
-}
 void
 Context_def::apply_default_property_operations (Translator_group *tg)
 {
@@ -310,7 +300,7 @@ Context_def::to_alist () const
                        get_translator_names (SCM_EOL)), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("description"),  description_), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("aliases"),  context_aliases_), l);
-  l = gh_cons (gh_cons (ly_symbol2scm ("accepts"),  get_accepted ()), l);
+  l = gh_cons (gh_cons (ly_symbol2scm ("accepts"),  get_accepted (SCM_EOL)), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"),  property_ops_), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("context-name"),  context_name_), l);
   l = gh_cons (gh_cons (ly_symbol2scm ("group-type"),  translator_group_type_), l);    
index 503f2a7b47cb75f8ca7633daf2dc986be01b110d..ce1f205b0741d194f7d61598428662044c669d68 100644 (file)
@@ -131,6 +131,10 @@ Translator_group::find_create_translator (SCM n, String id, SCM operations)
   if (existing)
     return existing;
 
+
+  /*
+    TODO: use accepts_list_.
+   */
   Link_array<Context_def> path
     = unsmob_context_def (definition_)->path_to_acceptable_translator (n, get_output_def ());
 
@@ -212,18 +216,32 @@ Translator_group::remove_translator (Translator*trans)
   return trans;
 }
 
+
+/*
+  Default child context as a SCM string, or something else if there is
+  none.
+*/
+SCM
+default_child_context_name (Translator_group const *tg)
+{
+  return gh_pair_p (tg->accepts_list_)
+    ? ly_car (scm_last_pair (tg->accepts_list_))
+    : SCM_EOL;
+}
+
+
 bool
-Translator_group::is_bottom_translator_b () const
+Translator_group::is_bottom_context () const
 {
-  return !gh_symbol_p (unsmob_context_def (definition_)->default_child_context_name ());
+  return !gh_symbol_p (default_child_context_name (this));
 }
 
 Translator_group*
 Translator_group::get_default_interpreter ()
 {
-  if (!is_bottom_translator_b ())
+  if (!is_bottom_context ())
     {
-      SCM nm = unsmob_context_def (definition_)->default_child_context_name ();
+      SCM nm = default_child_context_name (this);
       SCM st = get_output_def ()->find_translator (nm);
 
       Context_def *t = unsmob_context_def (st);
@@ -235,7 +253,7 @@ Translator_group::get_default_interpreter ()
       Translator_group *tg = t->instantiate (output_def_, SCM_EOL);
       add_fresh_group_translator (tg);
 
-      if (!tg->is_bottom_translator_b ())
+      if (!tg->is_bottom_context ())
        return tg->get_default_interpreter ();
       else
        return tg;
index b387276157200b0d5d98a2f363d34c18bccb2250..a3966378bf78d0e6e491b5101a7af1d8c368abbe 100644 (file)
@@ -203,6 +203,12 @@ Translator::print_smob (SCM s, SCM port, scm_print_state *)
   else
     scm_display (ly_translator_name (s), port);
 
+  if (Translator_group *td=dynamic_cast<Translator_group*> (sc))
+    {
+      scm_puts ("=", port);
+      scm_puts (td->id_string_.to_str0 (), port);
+    }
+  
   scm_display (sc->simple_trans_list_, port);
 
   /*
index aac514c3a106225e64a4aecc51841100e45a7197..d978032365697d1538c27448a8e42ffb044d1433 100644 (file)
@@ -28,6 +28,7 @@ Translator::init ()
   properties_scm_ = SCM_EOL;
   definition_ = SCM_EOL;
   daddy_trans_ =0;
+  accepts_list_ = SCM_EOL;
 }
 
 Translator::Translator ()
@@ -126,6 +127,7 @@ Translator::mark_smob (SCM sm)
   scm_gc_mark (me->trans_group_list_);
   scm_gc_mark (me->definition_);  
   scm_gc_mark (me->properties_scm_);  
+  scm_gc_mark (me->accepts_list_);
 
   return me->properties_scm_;
 }
index 9501413dd29aac80f72c8cdd496e8f8cb0cc9e97..351eed8fef81070122bef1aec3c34ea7945effa0 100644 (file)
@@ -197,7 +197,9 @@ Tuplet_bracket::brew_molecule (SCM smob)
   
   if (bracket_visibility)      
     {
-      SCM gap = me->get_grob_property ("gap");
+      Real ss =   Staff_symbol_referencer::staff_space (me);
+      Real gap = robust_scm2double (me->get_grob_property ("gap"), 1.0)
+       * ss;
       
       SCM fl = me->get_grob_property ("bracket-flare");
       SCM eh = me->get_grob_property ("edge-height");
@@ -208,20 +210,18 @@ Tuplet_bracket::brew_molecule (SCM smob)
       do {
        flare[d] =  height[d] = shorten[d] = 0.0;
        if (is_number_pair (fl))
-         flare[d] +=  gh_scm2double (index_get_cell (fl, d));
+         flare[d] +=  ss * gh_scm2double (index_get_cell (fl, d));
        if (is_number_pair (eh))
-         height[d] += gh_scm2double (index_get_cell (eh, d)) * - dir;
+         height[d] +=  - dir * ss *gh_scm2double (index_get_cell (eh, d));
        if (is_number_pair (sp))
-         shorten[d] +=  gh_scm2double (index_get_cell (sp, d));
+         shorten[d] +=  ss *gh_scm2double (index_get_cell (sp, d));
       }
       while (flip (&d) != LEFT);
       
       Molecule brack = make_bracket (me, Y_AXIS,
                                     Offset (w, ry - ly), 
-                                    height,
-                                    gh_scm2double (gap),
-                                    flare,
-                                    shorten);
+                                    height, gap,
+                                    flare, shorten);
       mol.add_molecule (brack);
     }
   
@@ -296,7 +296,6 @@ Tuplet_bracket::calc_position_and_height (Grob*me,Real *offset, Real * dy)
   Grob * commonx = common_refpoint_of_list (cols, me, X_AXIS);  
 
   Interval staff;
-
   if (Grob * st = Staff_symbol_referencer::get_staff_symbol (me))
     staff = st->extent (commony, Y_AXIS);
   
index ad5d6ab8365a1748cd24cba5394c36c4391bff38..3007e61932d4950f6e4805ff394b7795f292bbe7 100644 (file)
@@ -110,6 +110,20 @@ paperTwentysix = \paper {
 
 \paper { \paperTwenty }
 
+
+partCombineListener = \paper {
+ \translator {
+         \VoiceContext
+         \denies Thread
+         \consists Note_heads_engraver
+         \consists Rest_engraver
+         \type "Recording_group_engraver"
+         recordEventSequence = #notice-the-events-for-pc
+ }
+}
+
+#(set-part-combine-listener partCombineListener)
+
 \include "dynamic-scripts-init.ly"
 \include "spanners-init.ly"
 
index 2ee75e707813f879c352db07dbbeaec68b80c5bb..3a2feff62bc9a1c1e1b4a615a7ce167422a47523 100644 (file)
@@ -56,6 +56,7 @@
        instr = #'()
          
        \accepts "Voice"
+       \accepts "Devnull"
 }
 
 
        \alias "Staff"
        
        BarLine \override #'bar-size = #4
-       VoltaBracket \override #'minimum-space =  #15  % urg, in \pt
-       VoltaBracket \override #'padding =  #5  % urg, in \pt
+       VoltaBracket \override #'minimum-space =  #15
+       VoltaBracket \override #'padding =  #5
        StaffSymbol \override #'line-count = #1 
 
        Stem \override #'neutral-direction = #1
@@ -584,6 +585,13 @@ EasyNotation = \translator {
        \consistsend "Hara_kiri_engraver"
 }
 
+\translator {
+    \name "Devnull"
+    \type "Engraver_group_engraver"
+    \consists "Swallow_engraver"
+    \description "Silently discards all musical information given to this context. "
+    }
+
 \translator {
       \VoiceContext
       \name "TabVoice"
@@ -591,7 +599,8 @@ EasyNotation = \translator {
       \consists "Tab_note_heads_engraver"
       \remove "Fingering_engraver"
       \remove "New_fingering_engraver"
-      
+
+\description "Context for drawing notes in a Tab staff. "
       Slur \override #'font-family       = #'roman
       Slur \override #'molecule-callback = #hammer-molecule-callback
       Slur \override #'direction    = #-1
index 0db8f40c691547ef4ba81cd829b5d340dfd7b3a3..1847e663113a622aa52159a15a019541de0c9f8e 100644 (file)
@@ -184,7 +184,13 @@ fet_beginchar("Neo-mensural open head","0neo_mensural","neomensuralsemibrevishea
       draw_neo_mensural_open_head (staff_space#, noteheight#);
 fet_endchar;
 
-fet_beginchar("Harmonic notehead (Neo-mensural open)","0harmonic","harmonichead")
+%
+% WL says the thin lines should be thinner.
+%
+
+fet_beginchar("Harmonic notehead (Neo-mensural open)",
+               "0harmonic","harmonichead")
+
        draw_neo_mensural_open_head (1.3 staff_space#, 1.3 noteheight#);
        charwx := head_width#;
        charwy := 0;
index 3550de13ce640fbe8ac3f35a7b9bec7aa05f10f1..b80007074945257aedee7e02822f8c24498a919b 100644 (file)
@@ -297,6 +297,9 @@ space to add. For barline, space after a thick line.")
 (grob-property-description 'knee-spacing-correction number? "optical correction amount for knees. 0: no correction; 1: full correction.")
 (grob-property-description 'layer number? "The output layer [0..2].  The default is 1.")
 
+(grob-property-description 'ledger-line-thickness number-pair?
+                          "The thickness of ledger lines: it is the sum of 2 numbers.
+ The car is the factor for linethickness, and the cdr for staff space. Both contributions are added.")
 (grob-property-description 'left-position number? "position of left part of spanner.")
 (grob-property-description 'left-padding ly:dimension? "space left of accs.")
 
index 4c9a5ff024552dd74f73b81202c9c0ef7bf0e97f..2b6a3bdd28dad2995bde06da49c133754888b025 100644 (file)
        (self-alignment-Y . 0)
        (script-priority . 100)
        (font-family . number)
-       (font-size . -4)
+       (font-size . -5)                ; don't overlap when next to heads.
        (font-shape . upright)
        (meta . ((interfaces . (finger-interface font-interface text-script-interface text-interface side-position-interface self-alignment-interface item-interface ))))
        ))
      . (
        (molecule-callback . ,Staff_symbol::brew_molecule)
        (line-count . 5)
+       (ledger-line-thickness  (1.0 . 0.1))
        (layer . 0)
        (meta . ((interfaces . (staff-symbol-interface spanner-interface))))
        ))
index 25b08fc25f455f4cd6770ee5496b0d81025d594e..858c17b6f0567fffc106e6f21a81866f93366c26 100644 (file)
     grobs
     ))
 
-(define (symbol<? l r)
-  (string<? (symbol->string l) (symbol->string r)))
+
 
 (define (all-contexts-doc)
   (let* (
index a1d7552b1c6c80ec073c65c8df6d277c4c00920a..ba4fcd9eb3f600a8ca06d37d8c444ae8853af9d5 100644 (file)
@@ -24,7 +24,7 @@
     (begin
       (debug-enable 'debug)
       (debug-enable 'backtrace)
-      (read-enable 'positions)))
+      (read-enable 'positions) ))
 
 
 (define-public (line-column-location line col file)
@@ -296,6 +296,9 @@ L1 is copied, L2 not.
       0
       (if (< x 0) -1 1)))
 
+(define-public (symbol<? l r)
+  (string<? (symbol->string l) (symbol->string r)))
+
 (define-public (!= l r)
   (not (= l r)))
 
@@ -380,6 +383,7 @@ L1 is copied, L2 not.
        "define-grob-interfaces.scm"
 
        "paper.scm"
+       "bla.scm"
        ))
 
 
index 24986145f0b9e35a23099e001f3a5b886bc27da0..27269d495ee6023fe46e7073ef3bca6946eb4929 100644 (file)
@@ -794,9 +794,149 @@ Rest can contain a list of beat groupings
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;
+;; part-combiner.
+
+
+       
+(define noticed '())
+(define part-combine-listener '())
+(define-public (set-part-combine-listener x)
+  (set! part-combine-listener x))
+
+(define-public (notice-the-events-for-pc context lst)
+  (set! noticed (cons lst noticed)))
+
+(define-public (make-new-part-combine-music music-list)
+  (let*
+     ((m (make-music-by-name 'NewPartCombineMusic))
+      (m1 (context-spec-music (car music-list) 'Voice "one"))
+      (m2 (context-spec-music (cadr music-list) 'Voice "two"))
+      (props '((denies Thread)
+              (consists Rest_engraver)
+              (consists Note_heads_engraver)
+              ))
+      )
+
+    
+    (ly:set-mus-property! m 'elements (list m1 m2))
+    (ly:set-mus-property! m1 'property-operations props)
+    (ly:set-mus-property! m2 'property-operations props)
+    (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 (car noticed)) (reverse (cadr noticed))))
+    (set! noticed '())
+    
+    m))
+               
+(define-public (determine-split-list evl1 evl2)
+  "EVL1 and EVL2 should be ascending"
+  
+  (define ev1 (list->vector evl1))
+  (define ev2 (list->vector evl2))
+  (define (when v i)
+    (car (vector-ref v i)))
+  (define (what v i)
+    (cdr (vector-ref v i)))
+
+  (define chord-threshold 8)
+  
+  (define result
+    (list->vector
+     (map (lambda (x)
+           (cons x 'together))
+         (uniq-list
+         (merge (map car evl1) (map car evl2) ly:moment<?)))))
+
+  (define (analyse-events i1 i2 ri
+                         active1
+                         active2)
+
+    (define (analyse-span-event active ev)
+      (let*
+         ((name (ly:get-mus-property ev 'name))
+          (key (cond
+                ((equal? name 'SlurEvent) 'slur)
+                ((equal? name 'TieEvent) 'tie)
+                ((equal? name 'Beam) 'beam)
+                (else #f)))
+          (sp (ly:get-mus-property ev 'span-direction)))
+
+       (if (and (symbol? key) (ly:dir? sp))
+           ((if (= sp STOP) delete! cons) key active))
+       ))
+    
+    (define (get-note-evs v i)
+      (define (f? x)
+       (equal? (ly:get-mus-property  x 'name) 'NoteEvent))
+      (filter f? (map car (what v i))))
+    
+    (define (put x)
+      (set-cdr! (vector-ref result ri) x) )
+
+    (cond
+     ((= ri (vector-length result)) '())
+     ((= i1 (vector-length ev1)) (put 'apart))
+     ((= i2 (vector-length ev2)) (put 'apart))
+     (else
+      (let*
+         ((m1 (when ev1 i1))
+          (m2 (when ev2 i2)))
+
+       (if (not (or (equal? m1 (when result ri))
+                    (equal? m2 (when result ri))))
+           (begin
+             (display
+              (list "<? M1,M2 != result :"
+                    m1 m2 (when result ri)))
+             (scm-error "boem")))
+
+       (set! active1
+             (sort
+              (map (lambda (x) (analyse-span-event active1  (car x)))
+                   (what ev1 i1)) symbol<?))
+       (set! active2
+             (sort (map (lambda (x) (analyse-span-event active2 (car x)))
+                        (what ev2 i2)) symbol<?))
+       
+       (cond
+        ((ly:moment<? m1 m2)
+         (put 'apart)
+         (analyse-events (1+ i1) i2 (1+ ri) active1 active2))
+        ((ly:moment<? m2 m1)
+         (put 'apart)
+         (analyse-events i1 (1+ i2) (1+ ri) active1 active2))
+        (else
+         (if (not (equal? active1 active2))
+             (put 'apart)
+
+             (let*
+                 ((notes1 (get-note-evs ev1 i1))
+                  (pitches1 (sort
+                             (map (lambda (x) (ly:get-mus-property x 'pitch)) notes1) ly:pitch<?))
+                  (notes2 (get-note-evs ev2 i2))
+                  (pitches2 (sort
+                             (map (lambda (x) (ly:get-mus-property x 'pitch)) notes2) ly:pitch<?))
+                  )
+               (cond
+                ((equal? pitches1 pitches2) (put 'unisono))
+                ((> (length notes1) 1) (put 'apart))
+                ((> (length notes2) 1) (put 'apart))
+                (else
+                 (let* ((diff (ly:pitch-diff (car pitches1) (car pitches1))))
+                   (if (< (ly:pitch-steps diff) chord-threshold)
+                       (put 'chords)
+                       (put 'apart))
+                   ))))
+             )
+         (analyse-events (1+ i1) (1+ i2) (1+ ri) active1 active2))
+        )))))
+
+
+   (analyse-events 0 0  0 '() '())
+   (display result)
+   (vector->list result))
 
 
-(define-public (determine-split-list ev1 ev2 state)
 
-#f  )
+; (determine-split-list '((1 . 2) (3 . 4)) '((1 . 2) (3 . 4)))