]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/lily.scm (postscript->png): use ~a iso. ~s
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 24 Aug 2004 20:37:59 +0000 (20:37 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 24 Aug 2004 20:37:59 +0000 (20:37 +0000)
* ly/property-init.ly (unHideNotes): hide accidentals at staff
level. Fixes: hideNotes-accidental.ly

21 files changed:
ChangeLog
Documentation/topdocs/INSTALL.texi
flower/include/interval.hh
lily/accidental-placement.cc
lily/context-scheme.cc
lily/lily-guile.cc
lily/ottava-bracket.cc
lily/paper-book.cc
lily/paper-outputter.cc
lily/script-interface.cc
lily/slur-engraver.cc
lily/slur-quanting.cc
lily/vaticana-ligature.cc
ly/chord-modifiers-init.ly
ly/property-init.ly
python/midi.c
scm/define-grob-properties.scm
scm/define-grobs.scm
scm/framework-ps.scm
scm/lily.scm
tex/GNUmakefile

index 3471e41d2323426305abcc03a2b4d811bf54b7bc..e46d4cd1898966734fe7fc753c0fbb639377a76a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-08-24  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * scm/lily.scm (postscript->png): use ~a iso. ~s 
+
+       * ly/property-init.ly (unHideNotes): hide accidentals at staff
+       level. Fixes: hideNotes-accidental.ly
+
 2004-08-23  Pedro Kroger  <kroeger@pedrokroeger.net>
 
        * scm/page-layout.scm (plain-header): fix bug that print page
@@ -5,6 +12,21 @@
 
 2004-08-23  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * scm/framework-ps.scm (define-fonts): use UPCASE for Bluesky
+       fonts. Fixes triangle markup for chords.
+
+       * lily/slur-quanting.cc (score_extra_encompass): make score depend
+       on distance. This fixes slur-tenuto.ly and slur-tie.ly
+       * flower/include/interval.hh (T>): add distance() function
+
+       * lily/ottava-bracket.cc (print): add dots to extent. Fixes
+       octaviation-dot.ly 
+
+       * lily/context-scheme.cc: ly_context_grob_definition: new function.
+
+       * VERSION (MY_PATCH_LEVEL): release 2.3.12
+
        * lily/new-slur.cc (add_column): remove set_interface()
 
 2004-08-22  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
 2004-08-03  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * VERSION: 2.3.11 released.
+
        * scripts/lilypond-book.py (Lilypond_file_snippet.ly): reinstate
        renameinput.
 
index b7609a07826ea4d7db999c2df45402658eda56cf..08aba505d450fae90e653b2e7bac1bb4313db62a 100644 (file)
@@ -93,7 +93,7 @@ Also, @TeX{}'s libkpathsea is used to find the fonts (@file{.mf},
 (1.0.6 is known to work).  You may need to install a tetex-devel (or
 tetex-dev or libkpathsea-dev) package too.
 
-@item @uref{ftp://ftp.gnu.org/gnu/texinfo/,Texinfo} (version 4.6 or newer).
+@item @uref{ftp://ftp.gnu.org/gnu/texinfo/,Texinfo} (version 4.7 or newer).
 
 @item The
 @uref{ftp://ftp.ctan.org/tex-archive/macros/latex/contrib/supported/geometry,geometry
index 5ccb91feaea3c1580857f776b9333fc942e5c501..c2d012c4f165b7d00e299650c157604d1a5194d6 100644 (file)
@@ -35,6 +35,15 @@ struct Interval_t : public Drul_array<T>
     elem_ref (RIGHT) += t;    
   }
   
+  T distance (T t) const
+  {
+    if (t > elem (RIGHT))
+      return T (t - elem (RIGHT));
+    else if (t < elem (LEFT))
+      return T (elem (LEFT) - t);
+    else
+      return T (0);
+  }
   /**
     PRE
     *this and h are comparable
index 12b21171615b84f7cec70bb190ca931b4dd9a438..9327253f6c7bdab5c7303ff6fe5d6c22b8359d0d 100644 (file)
@@ -25,7 +25,7 @@ MAKE_SCHEME_CALLBACK (Accidental_placement,alignment_callback, 2);
 SCM
 Accidental_placement::alignment_callback (SCM s, SCM )
 {
-  Grob * me =unsmob_grob (s);
+  Grob * me = unsmob_grob (s);
 
   Grob * par = me->get_parent (X_AXIS);
   if (!to_boolean (par->get_property ("positioning-done")))
@@ -45,7 +45,7 @@ Accidental_placement::add_accidental (Grob* me, Grob* a)
   a->add_offset_callback (alignment_callback_proc, X_AXIS);
   SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
 
-  Music *mcause =unsmob_music (cause); 
+  Music *mcause = unsmob_music (cause); 
   if (!mcause)
     {
       programming_error ("Note head has no music cause!");
@@ -271,7 +271,6 @@ Accidental_placement::position_accidentals (Grob * me)
       apes.push (ape);
     }
 
-
   Grob *common[] = {me, 0};
 
   /*
@@ -428,8 +427,6 @@ Accidental_placement::position_accidentals (Grob * me)
 
   
   left_extent[LEFT] -= robust_scm2double (me->get_property ("left-padding"), 0);
-
-  
   Interval width (left_extent[LEFT], right_extent[RIGHT]);
 
   SCM scm_width = ly_interval2scm (width);
index cbedf5ea3c484825d47fa5ae34fd57cba3aa428e..4288516f7a78fb46c967d05aa04a70ce8979443f 100644 (file)
@@ -33,6 +33,20 @@ LY_DEFINE (ly_context_name, "ly:context-name",
   return ly_symbol2scm (tr->context_name ().to_str0 ()); 
 }
 
+LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
+          1, 0, 0, (SCM context, SCM name),
+          "Return the definition of @var{name} (a symbol) within @var{context} "
+          "as an alist")
+{
+  Context *tr = unsmob_context (context);
+  SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
+  SCM_ASSERT_TYPE (ly_c_symbol_p (name), name, SCM_ARG2, __FUNCTION__, "symbol");
+
+    
+  return updated_grob_properties (tr, name);
+}
+
+
 LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
           3, 1, 0, (SCM context, SCM grob, SCM eltprop, SCM val),
           "Do a single @code{\\override} or @code{\\revert} operation "
index 2205bee0f3494cf899e1a6ea0aea0ea74316b2ff..9e759e7e9f93fccfb703bfc19e516c6552123e51 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <libintl.h>           // gettext on macos x
 #include <math.h>   /* isinf */
 #include <string.h> /* strdup, strchr */
 #include <ctype.h>
index 5e36048c3e291626ce0a24bd096464922294df97..aadf68a55b84026da6c6fddef669687e48ade2df 100644 (file)
@@ -20,6 +20,7 @@
 #include "note-column.hh"
 #include "directional-element-interface.hh"
 #include "tuplet-bracket.hh"
+#include "rhythmic-head.hh"
 
 struct Ottava_bracket
 {
@@ -30,26 +31,21 @@ struct Ottava_bracket
 
 /*
   TODO: the string for ottava shoudl depend on the available space, ie.
-
   
   Long: 15ma        Short: 15ma    Empty: 15
          8va                8va            8
          8va bassa          8ba            8
 
 */
-
 MAKE_SCHEME_CALLBACK (Ottava_bracket, print, 1);
 SCM
 Ottava_bracket::print (SCM smob)
 {
   Spanner*me  = dynamic_cast<Spanner*> (unsmob_grob (smob));
-  
-  
   Interval span_points;
   
   Grob *common = me->get_bound (LEFT)->common_refpoint (me->get_bound (RIGHT), X_AXIS);
   Output_def * paper = me->get_paper ();
-
   
   Drul_array<bool> broken;
   Direction d = LEFT;
@@ -88,7 +84,16 @@ Ottava_bracket::print (SCM smob)
       if (Note_column::has_interface (b))
        {
          for (SCM s = b->get_property ("note-heads"); ly_c_pair_p (s); s =ly_cdr (s))
-           ext.unite (unsmob_grob (ly_car (s))->extent (common, X_AXIS));
+           {
+             Grob * h = unsmob_grob (ly_car (s));
+             ext.unite (h->extent (common, X_AXIS));
+             Grob * dots = Rhythmic_head::get_dots (h);
+
+             if (dots && d == RIGHT)
+               {
+                 ext.unite (dots->extent (common, X_AXIS));  
+               }
+           }
        }
 
       if (ext.is_empty ())
index b90819a27489652102beac26d557e76beac5adf1..da5b2453c3f9089a067597841b45a4507a279381 100644 (file)
@@ -158,7 +158,11 @@ Paper_book::output (String outname)
   for (SCM s = formats; ly_c_pair_p (s); s = ly_cdr (s)) 
     {
       String format = ly_scm2string (ly_car (s));
-      String file_name = outname + "." + format;
+      String file_name = outname;
+      
+      if (file_name != "-")
+       file_name += "." + format;
+      
       Paper_outputter *out = get_paper_outputter (file_name, format);
   
       SCM scopes = SCM_EOL;
index 7976b17a478963f3443f67ef2acff220e99617a9..38faae2fff185934bdef7c5c81c1fc6171a14e98 100644 (file)
@@ -70,8 +70,11 @@ SCM
 Paper_outputter::file ()
 {
   if (file_ == SCM_EOL)
-    file_ = scm_open_file (scm_makfrom0str (filename_.to_str0 ()),
-                          scm_makfrom0str ("w"));
+    if (filename_ == "-")
+      file_ = scm_current_output_port();
+    else
+      file_ = scm_open_file (scm_makfrom0str (filename_.to_str0 ()),
+                            scm_makfrom0str ("w"));
   return file_;
 }
 
index 9a3d2544cabf56e9a7e74d77ed76b1d0b68278d4..6d6c67263b20a9de32e61ab38814694624963e77 100644 (file)
@@ -92,9 +92,9 @@ struct Text_script
 
 ADD_INTERFACE (Text_script,"text-script-interface",
   "An object that is put above or below a note",
-  "script-priority");
+  "script-priority inside-slur");
 
 ADD_INTERFACE (Script_interface, "script-interface",
   "An object that is put above or below a note",
-  "script-priority script-stencil");
+  "script-priority script-stencil inside-slur");
 
index d1749c96d6a38db1f37b980936b6da63ba1f9ae4..2f1cc065e8f5b6c87e310fd01f3debb35142e61b 100644 (file)
@@ -89,13 +89,16 @@ Slur_engraver::acknowledge_grob (Grob_info info)
     }
   else
     {
-      for (int i = slurs_.size (); i--; )
-       New_slur::add_extra_encompass (slurs_[i], e);
-      for (int i = end_slurs_.size (); i--; )
-       New_slur::add_extra_encompass (end_slurs_[i], e);
+      if (Tie::has_interface (e)
+         || to_boolean (e->get_property ("inside-slur")))
+       {
+         for (int i = slurs_.size (); i--; )
+           New_slur::add_extra_encompass (slurs_[i], e);
+         for (int i = end_slurs_.size (); i--; )
+           New_slur::add_extra_encompass (end_slurs_[i], e);
+       }
     }
 }
-
 void
 Slur_engraver::finalize ()
 {
@@ -147,6 +150,6 @@ ENTER_DESCRIPTION (Slur_engraver,
   /* descr */       "Build slurs grobs from slur events",
   /* creats*/       "Slur",
   /* accepts */     "slur-event",
-  /* acks  */      "note-column-interface accidental-interface fingering-interface script-interface",
+  /* acks  */      "note-column-interface accidental-interface fingering-interface script-interface tie-interface",
   /* reads */       "slurMelismaBusy doubleSlurs",
   /* write */       "");
index d145f59bbbf7d49afef3cf5d078f60084a356ccb..10c2aa29b89baefa6a9ab87cfee68a60c4a1c675 100644 (file)
@@ -65,6 +65,7 @@ struct Slur_score_parameters
   Real EXTRA_OBJECT_COLLISION;
   Real ACCIDENTAL_COLLISION;
   Real FREE_HEAD_DISTANCE;
+  Real EXTRA_ENCOMPASS_FREE_DISTANCE;
   Slur_score_parameters ();
 };
 
@@ -185,6 +186,7 @@ init_score_param (Slur_score_parameters *score_param)
   score_param->FREE_HEAD_DISTANCE = 0.3;
   score_param->EXTRA_OBJECT_COLLISION = 50;
   score_param->ACCIDENTAL_COLLISION = 3;
+  score_param->EXTRA_ENCOMPASS_FREE_DISTANCE = 0.5;
 }
 
 Slur_score_parameters::Slur_score_parameters()
@@ -381,12 +383,20 @@ get_bound_info (Spanner* me, Grob **common)
            = extremes[d].stem_->extent (common[Y_AXIS], Y_AXIS);
          extremes[d].slur_head_
            = Stem::extremal_heads (extremes[d].stem_)[dir];
-         extremes[d].slur_head_extent_
-           = extremes[d].slur_head_->extent (common[X_AXIS], X_AXIS);
+         if (!extremes[d].slur_head_
+             && Note_column::has_rests (extremes[d].bound_))
+           {
+             extremes[d].slur_head_ = Note_column::get_rest (extremes[d].bound_);
+           }
+
+         if (extremes[d].slur_head_)
+           extremes[d].slur_head_extent_
+             = extremes[d].slur_head_->extent (common[X_AXIS], X_AXIS);
+
          extremes[d].staff_ = Staff_symbol_referencer
-           ::get_staff_symbol (extremes[d].slur_head_);
+           ::get_staff_symbol (extremes[d].stem_);
          extremes[d].staff_space_ = Staff_symbol_referencer
-           ::staff_space (extremes[d].slur_head_);
+           ::staff_space (extremes[d].stem_);
        }
       else
        extremes[d].neighbor_y_ = broken_trend_y (me, common, d);
@@ -594,7 +604,10 @@ get_base_attachments (Spanner *me,
            y += 1.5 * staff_space * dir / 10;
 
          Grob * fh = Note_column::first_head (extremes[d].note_column_);
-         x = fh->extent (common[X_AXIS], X_AXIS).linear_combination (CENTER);
+         x =
+           (fh ? fh->extent (common[X_AXIS], X_AXIS)
+            : extremes[d].bound_->extent (common[X_AXIS], X_AXIS))
+           .linear_combination (CENTER);
        }
       base_attachment[d] = Offset (x, y);
 
@@ -956,14 +969,16 @@ score_extra_encompass (Grob *me, Grob *common[],
            {
              y = scores->elem (i).curve_.get_other_coordinate (X_AXIS, x);
            }
+
+         Real collision_demerit = 
+              (Accidental_interface::has_interface (encompasses[j]))
+           ? score_param->ACCIDENTAL_COLLISION
+           : score_param->EXTRA_OBJECT_COLLISION;
          
-         if (yexts[j].contains (y))
-           {
-             if (Accidental_interface::has_interface (encompasses[j]))
-               demerit += score_param->ACCIDENTAL_COLLISION;
-             else
-               demerit += score_param->EXTRA_OBJECT_COLLISION;
-           }
+         Real dist = yexts[j].distance (y);
+         demerit +=
+           fabs (0 >? (score_param->EXTRA_ENCOMPASS_FREE_DISTANCE - dist)) /
+           score_param->EXTRA_ENCOMPASS_FREE_DISTANCE  * collision_demerit;
        }
 #if DEBUG_SLUR_QUANTING
       (*scores)[i].score_card_ += to_string ("X%.2f", demerit);
index ff6289feb2982887f6b9db4d4e6db0c450c4e032..a298e95c973929b6003f8823ee9f59488b6895bc 100644 (file)
@@ -204,7 +204,6 @@ vaticana_brew_primitive (Grob *me)
   String glyph_name = ly_scm2string (glyph_name_scm);
 
   Stencil out;
-  int flexa_height = 0;
   Real thickness = robust_scm2double ( me->get_property ("thickness"), 1);
 
   Real line_thickness =
index e0ef33c2862efee184726d4a6f0df74882f9b421..9a2330a5b22528761a018797d2073e99c376b8a6 100644 (file)
@@ -2,9 +2,9 @@
 
 chordmodifiers = #default-chord-modifier-list
 
-whiteTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) "M" } 
+whiteTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) \char #77 } 
 
-blackTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) "N" }
+blackTriangleMarkup = \markup { \override #'(font-encoding . TeX-math) \char #78 }
 
 ignatzekExceptionMusic = {
        <c e gis>1-\markup { "+" }
index e5b0b0abb0f106b1a6ff9a894a795baa062915b3..b6b68f7877f87f40b41c549a068dc3f9ed8ac326 100644 (file)
@@ -143,12 +143,12 @@ hideNotes =\sequential {
     \override NoteHead  #'transparent = ##t
     \override Stem  #'transparent = ##t
     \override Beam  #'transparent = ##t
-    \override Staff.Accidental  #'transparent = ##t
+    \override Accidental  #'transparent = ##t
 }
 
 
 unHideNotes = \sequential {
-  \revert Staff.Accidental #'transparent
+  \revert Accidental #'transparent
   \revert Beam #'transparent
   \revert Stem #'transparent
   \revert NoteHead #'transparent
index fc2906cacdb707e91ab86163b2a70209abfb572f..a8d8d4b8bff5cfd874d2b09c2ddd57ed7a687b48 100644 (file)
@@ -399,6 +399,7 @@ static PyMethodDef MidiMethods[] =
   {0, 0}        /* Sentinel */
 };
 
+void
 initmidi ()
 {
   PyObject *m, *d;
index f766b8586e9fd5f2c9a2eaf007e7f87763a41917..25cb66762312fd2f419342cc53de4beb48af350c 100644 (file)
@@ -287,6 +287,7 @@ slur, the closer it is to this height.")
      (horizontal-shift ,integer? "An integer that identifies ranking
 of note-column for horizontal shifting. This is used by
 @internalsref{note-collision-interface}.")
+     (inside-slur ,boolean? "If set, this object should be inside the slur")
      (inspect-quants ,number-pair? "If debugging is set,
 set beam quant to this position, and print the respective scores.")
      
index 1e4f8a1bddbd83ea317a19aa746f83fe14c24eab..89cc2b752c5903191914b08781a8c38bcb075309 100644 (file)
@@ -22,8 +22,7 @@
        ))
     
     (AccidentalPlacement
-     . (
-       (X-extent-callback . ,Axis_group_interface::group_extent_callback)
+     . ((X-extent-callback . ,Axis_group_interface::group_extent_callback)
        (left-padding . 0.2)
 
        ;; this is quite small, but it is very ugly to have
index 288e36ad20153a3f4bab72637865f186efff4a98..67c35ebfc0871a09d37e8d197d362287115bde31 100644 (file)
@@ -82,6 +82,9 @@
        plain " " coding-vector " /" command " reencode-font\n"
        "/" command "{ /" command " findfont 1 scalefont } bind def\n")))
 
+  (define (standard-tex-font? x)
+    (or (equal? (substring x 0 2) "ms")
+       (equal? (substring x 0 2) "cm")))
  
   (define (font-load-command font)
     (let* ((specced-font-name (ly:font-name font))
           (ops (ly:output-def-lookup bookpaper 'outputscale))
           (scaling (* ops magnification designsize)))
 
+      ;; Bluesky pfbs have UPCASE names (sigh.)
+      ;;
+      (if (standard-tex-font? fontname)
+         (set! fontname (string-upcase fontname)))
+      
       ;; debugging: [output]encoding is broken
       ;; found so far: coding-alist is empty!
       (pdebug "font: ~S\n" font)
       ((defs (ly:paper-book-book-paper book))
        (size (ly:output-def-lookup defs 'papersize)))
 
-    (postscript->pdf (if (string? size) size "a4")
-                    name)))
-
+    (if (equal? name "-")
+       (ly:warn "Can't convert <stdout> to PDF")
+       (postscript->pdf (if (string? size) size "a4")
+                        name))))
+  
 (define-public (convert-to-png book name)
   (let*
       ((defs (ly:paper-book-book-paper book))
index a733a9f2e61204adc84dfda9f896da0b446fa34d..8c680eeda9afa341b7f9811c6dd1c5a9274f6a6a 100644 (file)
@@ -563,12 +563,12 @@ possibly turned off."
          (regexp-substitute/global #f "\\.ps" name 'pre ".pdf" 'post)))
 
     (newline (current-error-port))
-    (display (format (_ "Converting to ~s...") output-name)
+    (display (format (_ "Converting to `~a'...") output-name)
             (current-error-port))
     (newline (current-error-port))
     
     (if (ly:get-option 'verbose)
-       (display (format "Invoking `~s'..." cmd) (current-error-port)))
+       (display (format "Invoking `~a'..." cmd) (current-error-port)))
 
   (system cmd)))
 
@@ -585,7 +585,7 @@ possibly turned off."
           name)))
     (if (ly:get-option 'verbose)
        (begin
-         (display (format (_ "Invoking `~s'...") cmd) (current-error-port))
+         (display (format (_ "Invoking `~a'...") cmd) (current-error-port))
          (newline (current-error-port))))
     (system cmd)))
 
index 894856efabe7d846f36d7d1aadaca72daa06321c..82982372e32aac7e1340fcbf7c2c73c30822a201 100644 (file)
@@ -15,7 +15,7 @@ $(outdir)/music-drawing-routines.ps: $(depth)/ps/music-drawing-routines.ps
 
 $(outdir)/latin1.enc: GNUmakefile
        echo '/ISOLatin1Encoding ' > $@ 
-       echo 'ISOLatin1Encoding pstack' | gs -quiet -  >> $@
+       echo 'ISOLatin1Encoding pstack' | gs -sDEVICE=nullpage  -quiet -  >> $@
        echo ' def ' >> $@
 
 all: $(INSTALLATION_FILES)