]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.151.jcn3
authorJan Nieuwenhuizen <janneke@gnu.org>
Wed, 2 May 2001 21:39:54 +0000 (23:39 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Wed, 2 May 2001 21:39:54 +0000 (23:39 +0200)
Documentation/topdocs/INSTALL.texi
Documentation/user/GNUmakefile
Documentation/user/tutorial.itely
VERSION
input/test/bar-lines.ly
lily/include/span-bar.hh
lily/span-bar.cc
scm/grob-description.scm
scm/translator-property-description.scm
scripts/ly2dvi.py

index ae3deb325041baf2265491bdad73e7974d40f378..b7007656908ae33cd55dd0b4f3bf7f5323ab5d50 100644 (file)
@@ -196,7 +196,7 @@ by issuing
  
 @end example 
 
-Building the website requires  some additional tools: 
+Building the website requires some additional tools: 
 
 @itemize @bullet
 @item xpmtoppm (from the netpbm package: the Portable Bitmap Utilities).
@@ -219,6 +219,12 @@ man2html can be had from @uref{http://askdonald.ask.uni-karlsruhe.de/hppd/hpux/N
 The website will build without bib converter utility, but you will not
 see our hypertextified bibliography.
 
+@item texinfo (a development release)
+The documentation will build with texinfo-4.0, but if you want split
+html pages, you're best off using the lates pretest version from
+@uref{ftp://texinfo.org/texinfo/pretests/texinfo-4.0b.tar.gz,
+texinfo-4.0b} or
+@uref{ftp://alpha.gnu.org/gnu/texinfo-4.0b.tar.gz,texinfo-4.0b}
 @end itemize
 
 @section Building  LilyPond
index 89789e350bf6c0ea80b9edd54a35803df195920d..de3e14502549f22a766d2d27cf8edb5d0faabe6d 100644 (file)
@@ -53,7 +53,7 @@ info: $(INFO_FILES)
 # The new pretest version of makeinfo, 4.0a splits html files into their own
 # directory.  Available from
 # ftp://texinfo.org/texinfo/pretests/texinfo-4.0a.tar.gz
-SPLITTING_MAKEINFO = $(shell makeinfo --version | egrep '4.0((.jcn[2,3])|a)')
+SPLITTING_MAKEINFO = $(shell makeinfo --version | egrep '4.0((.jcn[2,3])|a|b)')
 
 
 # Generic rule using % twice not possible?
index df4d5782d79cb8b8d66b25b21d179be9f429574b..482d1b0b356bb0a5befc43e9022c753584707b7d 100644 (file)
@@ -2,7 +2,6 @@
 
 @c TODO: LilyPond Lilypond lilypond
 
-
 @node Tutorial
 @chapter Tutorial
   
@@ -10,23 +9,19 @@ LilyPond prints music from a specification that you, the user, supply.
 You have to give that specification using a textual @emph{language}.  
 This chapter is a gentle introduction to that language.
 
+[rewrite]
+@c gentle?
+@c the first section is gentle
+@c the later sections get rather high-brow, deep, detailed, thorough
+
+
 This tutorial will demonstrate how to use Lilypond by presenting
 examples of input along with resulting output.  We will use English
 terms for notation.  In case you are not familiar with those, you may
 consult the glossary that is distributed with LilyPond.
 
-@cindex examples, tutorial
-
-The examples discussed are included in the distribution, in the
-subdirectory @file{input/tutorial/}@footnote{When we refer
-to filenames, they are relative to the top directory of the source
-package.  In binary installations you should look in your doc section,
-eg, @code{/usr/share/doc/lilypond1.3/examples/input/tutorial}
-@cindex file names
-}. We recommend that you experiment with writing Lilypond input
-yourself, to get a feel for how the program behaves.
-
 @menu
+* Music language of LilyPond::  
 * Running LilyPond::            Getting started
 * The first tune::              The first tune
 * Lyrics and chords::           Lyrics and chords
@@ -38,6 +33,98 @@ yourself, to get a feel for how the program behaves.
 * end of tutorial::             The end
 @end menu
 
+@node Music language of LilyPond
+@section Music language of LilyPond
+
+
+simple notes
+@lilypond[verbatim, relative 1]
+a b c
+@end lilypond
+
+alterations
+@lilypond[verbatim, relative 0]
+fis as cisis beses
+@end lilypond
+
+durations
+@lilypond[verbatim, relative 1]
+a1 a2 a8 a4 a16 a8. a16
+@end lilypond
+
+octaves: high quote, low quote (comma)
+@lilypond[verbatim, relative 1]
+c c, c''
+@end lilypond
+
+@c normal use of LilyPond is \relative note entry
+@c so let's just show/explain that and make smart
+@c people look for non-\relative
+
+lilypond chooses nearest note
+@lilypond[verbatim, relative 1]
+c f c g c
+@end lilypond
+
+to go other way: add octaviation quote
+@lilypond[verbatim, relative 1]
+c f, c' g, c' 
+@end lilypond
+
+rests and skips
+@lilypond[verbatim, relative 1]
+r2 s4 r4
+@end lilypond
+
+
+meter
+@c \time -> \meter ?
+@lilypond[verbatim, relative 1]
+\time 3/4 c c c | R1 * 3/4
+@end lilypond
+
+key
+@lilypond[verbatim, relative 0]
+\key f \major es as bes
+@end lilypond
+
+slur, tie, phrasing slur
+@lilypond[verbatim, relative 1]
+c\( ( ) d  ~ d \) c
+@end lilypond
+
+simple chords
+@lilypond[verbatim, relative 1]
+<a c> <b d> <c e>
+@end lilypond
+
+suddenly lilypond gets really difficult:
+[explain about score -> \score and \notes]
+
+long chords; simultaneous music
+@lilypond[verbatim]
+% huh?
+% \singleLine
+% \paper { \singleLine }
+\paper { linewidth = -1.0 }
+\score {
+  \context Staff \notes \relative c'' <
+    { a b c }
+    { c d e }
+  >
+}
+@end lilypond
+
+@lilypond[verbatim]
+\paper { linewidth = -1.0 }
+\score {
+  \context GrandStaff \notes \relative c' <
+    { a' b c }
+    { \clef bass c d e }
+  >
+}
+@end lilypond
+
 
 @node Running LilyPond
 @section Running LilyPond
@@ -229,6 +316,19 @@ gsview32 /s test.ps
 @section The first tune
 
 
+@cindex examples, tutorial
+
+The examples discussed are included in the distribution, in the
+subdirectory @file{input/tutorial/}@footnote{When we refer
+to filenames, they are relative to the top directory of the source
+package.  In binary installations you should look in your doc section,
+eg, @code{/usr/share/doc/lilypond1.3/examples/input/tutorial}
+@cindex file names
+}. We recommend that you experiment with writing Lilypond input
+yourself, to get a feel for how the program behaves.
+
+
+
 To demonstrate what LilyPond input looks like, we start off with a
 full-fledged, yet simple example. It is a convoluted version
 of the famous minuet in J. S. Bach's @emph{Klavierb@"uchlein}. The file
diff --git a/VERSION b/VERSION
index 68ad4d2cd7f619f2de8f0b9086e9849557bf8bf4..bc3645f853f4bf7eae0027aadb44aa4afc323045 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=151
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=jcn3
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index 013bd21e6877be8199c4f06ab02ccb211e17f366..94b3d267a9f8cc711bc25a10c761b60312cf59ee 100644 (file)
@@ -1,6 +1,4 @@
 \version "1.3.146"
-
-
 \score
 {
 \notes \relative c'' {
index 1e7ea7eadd05d61ba30d097f8456d05e550467d5..f59f075a607f877b351bdd6a6ddfccaaf3134954 100644 (file)
@@ -29,6 +29,7 @@ public:
   static void evaluate_empty (Grob*);
   DECLARE_SCHEME_CALLBACK (width_callback, (SCM smob, SCM axis));
   DECLARE_SCHEME_CALLBACK (get_bar_size, (SCM ));
+  DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
   DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM ));
   DECLARE_SCHEME_CALLBACK (center_on_spanned_callback, (SCM element, SCM axis));
 };
index fddeb470fe339f9d0f1cf980bfc3cf9273acd1e2..d25fa7d5ba75b6e14877f7862cb392115e4b4fb6 100644 (file)
@@ -25,6 +25,131 @@ Span_bar::add_bar (Grob*me, Grob*b)
   me->add_dependency (b);
 }
 
+MAKE_SCHEME_CALLBACK (Span_bar,brew_molecule,1);
+
+/**
+ * Limitations/Bugs:
+ *
+ * (1) Elements from 'me->get_grob_property ("elements")' must be
+ * ordered according to their y coordinates relative to their common
+ * axis group parent.  Otherwise, the computation goes mad.  (TODO:
+ * apply a sort algorithm that ensures this precondition.)  However,
+ * until now, I have seen no case where lily has not fulfilled this
+ * precondition.
+ *
+ * (2) This method depends on bar_engraver not being removed from
+ * staff context.  If bar_engraver is removed, the size of the staff
+ * lines is evaluated as 0, which results in a solid span bar line
+ * with faulty y coordinate.
+ *
+ */
+SCM
+Span_bar::brew_molecule (SCM smobbed_me) 
+{
+  Grob *me = unsmob_grob (smobbed_me);
+  Span_bar::evaluate_glyph(me);
+  SCM glyph = me->get_grob_property (ly_symbol2scm ("glyph"));
+  String glyph_str = ly_scm2string (glyph);
+  SCM first_elt = me->get_grob_property ("elements");
+
+  // first walk: compute axis_group parent via common_refpoint () on all bars
+  Grob *refpoint = 0;
+  int staff_bar_count = 0;
+  for (SCM elts = first_elt;
+       elts != SCM_EOL;
+       elts = gh_cdr (elts))
+  {
+    SCM smobbed_staff_bar = gh_car (elts);
+    Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
+    refpoint = (staff_bar_count > 0) ?
+      staff_bar->common_refpoint (refpoint, Y_AXIS) :
+      staff_bar;
+    staff_bar_count++;
+  }
+  /* assert: refpoint is an axis-group object */
+  Grob *axis_group = refpoint;
+
+  // second walk: collect span bar components;
+  // compute extent of axis_group
+  Real last_staff_bar_length;
+  Real *interstaff_bar_length = new Real[staff_bar_count];
+  Real *interstaff_bar_yoffs = new Real[staff_bar_count];
+  Molecule *interstaff_bar_molecule = new Molecule[staff_bar_count];
+  Real axis_group_extent = 0.0;
+  staff_bar_count = 0;
+  for (SCM elts = first_elt;
+       elts != SCM_EOL;
+       elts = gh_cdr (elts))
+  {
+    SCM smobbed_staff_bar = gh_car (elts);
+    SCM smobbed_staff_bar_molecule =
+      Bar::brew_molecule (smobbed_staff_bar);
+    Grob *staff_bar = unsmob_grob (smobbed_staff_bar);
+    interstaff_bar_yoffs[staff_bar_count] =
+      staff_bar->relative_coordinate (axis_group, (Axis)Y_AXIS);
+    if (smobbed_staff_bar_molecule != SCM_EOL)
+    {
+      Real staff_bar_length =
+       unsmob_molecule (smobbed_staff_bar_molecule)->
+       extent (Y_AXIS).length ();
+      if (staff_bar_count > 0)
+      {
+       // clone bar_molecule and fix y extent
+       interstaff_bar_length[staff_bar_count] =
+         interstaff_bar_yoffs[staff_bar_count] -
+         interstaff_bar_yoffs[staff_bar_count - 1] -
+         last_staff_bar_length;
+       SCM smobbed_interstaff_bar_molecule = 
+         Bar::compound_barline (staff_bar, glyph_str,
+                                interstaff_bar_length[staff_bar_count]).
+         smobbed_copy ();
+       interstaff_bar_molecule[staff_bar_count] =
+         *unsmob_molecule (smobbed_interstaff_bar_molecule);
+      }
+      else
+      {
+       interstaff_bar_molecule[staff_bar_count] = Molecule::Molecule ();
+      }
+      last_staff_bar_length = staff_bar_length;
+    }
+    else
+    {
+      last_staff_bar_length = 0;
+      interstaff_bar_length[staff_bar_count] = 0;
+      interstaff_bar_molecule[staff_bar_count] = Molecule::Molecule ();
+    }
+    axis_group_extent += last_staff_bar_length;
+    axis_group_extent += interstaff_bar_length[staff_bar_count];
+    staff_bar_count++;
+  }
+  // assert(abs(axis_group_extent -
+  //           axis_group->extent (axis_group, Y_AXIS).length ()) < EPSILON);
+
+  // third walk: correct y axis on all span bar components;
+  // put all components into a single span bar molecule
+  Molecule span_bar_molecule = Molecule::Molecule ();
+  staff_bar_count = 0;
+  for (SCM elts = first_elt;
+       elts != SCM_EOL;
+       elts = gh_cdr (elts))
+  {
+    interstaff_bar_yoffs[staff_bar_count] +=
+      (axis_group_extent - interstaff_bar_length[staff_bar_count]) / 2;
+    interstaff_bar_molecule[staff_bar_count].//DEBUG
+      translate_axis (-1.0 PT, X_AXIS);//DEBUG
+    interstaff_bar_molecule[staff_bar_count].
+      translate_axis (interstaff_bar_yoffs[staff_bar_count], Y_AXIS);
+    span_bar_molecule.add_molecule (interstaff_bar_molecule[staff_bar_count]);
+    staff_bar_count++;
+  }
+
+  // clean-up & exit
+  delete interstaff_bar_length;
+  delete interstaff_bar_yoffs;
+  delete interstaff_bar_molecule;
+  return span_bar_molecule.smobbed_copy ();
+}
+
 MAKE_SCHEME_CALLBACK (Span_bar,width_callback,2);
 SCM
 Span_bar::width_callback (SCM element_smob, SCM scm_axis)
index fd4a146c8e772e375868c69981cbb47af2aaf0d9..09b8ea460af1d2d1424dbb7ff7e486d58de5f031 100644 (file)
        (SpanBar . (
                (break-align-symbol . Staff_bar)
                (bar-size-procedure . ,Span_bar::get_bar_size) 
-               (molecule-callback . ,Bar::brew_molecule)
+               (molecule-callback . ,Span_bar::brew_molecule)
                (visibility-lambda . ,begin-of-line-invisible)
                (X-extent-callback . ,Span_bar::width_callback)
                (Y-offset-callbacks . (,Span_bar::center_on_spanned_callback))
index 2dde1156dd4e161cacfd99eaefdf70ec646fe8ea..bb2743dab415bdba3b0eda52537f0b38a3f6e76a 100644 (file)
@@ -368,7 +368,7 @@ If not set explicitly (by property or @code{\bar}), this is set
 according to values of @code{defaultBarType}, @code{barAlways},
 @code{barNonAuto} and @code{measurePosition}.
 
-Legal values are described in @ref{(lilypond-internals)bar-line-interface}.
+Valid values are described in @ref{(lilypond-internals)bar-line-interface}.
 
 .")
 
index 8934a8373290e4b0645fd53d81a1ba401b680303..ab5ce0f5bf919011d6480b2a69311404a096ff28 100644 (file)
@@ -284,7 +284,7 @@ def system (cmd, ignore_error = 0):
                cmd = "sh -c \'%s\'" % cmd
        if verbose_p:
                progress (_ ("Invoking `%s\'") % cmd)
-       st = os.system (cmd) >> 8
+       st = os.system (cmd)
        if st:
                name = re.match ('[ \t]*([^ \t]*)', cmd).group (1)
                msg = name + ': ' + _ ("command exited with value %d") % st