]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.96
authorfred <fred>
Tue, 26 Mar 2002 23:57:18 +0000 (23:57 +0000)
committerfred <fred>
Tue, 26 Mar 2002 23:57:18 +0000 (23:57 +0000)
CHANGES
Documentation/regression-test.tely
Documentation/user/latex-mudela-example.latex
VERSION
input/test/arpeggio.ly
lily/arpeggio.cc
scripts/mudela-book.py

diff --git a/CHANGES b/CHANGES
index 2092760b675afb4fcada3f6a1bd38eef9faca25e..ee5e336d24a3d8c08ef6132dc382a70ead686315 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,40 @@
-1.3.94.uu1
-==========
+1.3.95.jcn5
+===========
+
+* Added friendly message for the clueless dvips user.
+
+* Clef-engraver: changed c0-position, clef-position and glyph into properties,
+  enabling ottava spanners: input/test/ottava.ly.
+
+* Added option for edge lines to Text spanner.
+
+* Bugfix for early initialisation of invalid (grace->voice) slur.
+
+* Dropped text support and padding of crescendo symbol.  Horizontal
+  alignment of dynamics is handled by side-support, Text crescendos
+  use the generic Text spanner.
+
+* Added a generic Text spanner.
+
+1.3.95.hwn1
+===========
+
+* Bugfix: octavate eight.
+
+* Rewrote arpeggio.
+
+* mudela-book fixes (Tom Cato)
+
+* Cleaned up Group_interface and Pointer_group_interface
+
+* Add accidentals to arpeggio support.
+
+* Stemup + barline combination gets extra space.
+
+* Score_element::extent () now takes a reference point argument.
+
+1.3.95
+======
 
 * Use music property for setting type. This prevents accidental
 forgotten copies.
index 5d9ca9f1978bd9f8b31c54e26a52ce8d6a102095..63774881e43a69a0e77c40a05c826bbdc6a2aaaf 100644 (file)
@@ -118,6 +118,13 @@ linked with (de)crescendi, they should be on the same line.
 
 @mudelafile{dyn-line.ly}
 
+
+Arpeggios are supported, both cross-staff and one-staff. 
+
+@mudelafile{arpeggio.ly}
+
+
+
 @section Chord names
 
 Chord names are generated from a list pitches, and are customisable
index 5b6c08e80e5166f7281ed10c40621349c748fe27..817a0f00e1fc3ce7c51e10e2bfc14cde3807a5be 100644 (file)
@@ -1,6 +1,8 @@
+% kommentar
 \documentclass[a4paper, 12pt]{article}
-%\def\pre MudelaExample{This if before}
-%\def\pre MudelaExample{This is after}
+%\def\preMudelaExample{}
+%\def\postMudelaExample{}
+%\usepackage{graphics}
 %\usepackage{landscape}
 \begin{document}
 %uncomment this to try twocolumn mode
diff --git a/VERSION b/VERSION
index 6693a290ce5970a30f3f4aae94eb9e2f4ca528c2..e089428ecdf5b25fe71ea46eeb108ad7fda26bf5 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,7 +1,7 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
-PATCH_LEVEL=95
+PATCH_LEVEL=96
 MY_PATCH_LEVEL=
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
index 9e7f930acec09ef6553909d73cf70533ffd8d9a9..d2122aa7778e927d20207b99b8380d996d3c04ec 100644 (file)
@@ -1,14 +1,14 @@
 \score{
     \context PianoStaff < 
         \context Staff=one \notes\relative c''{
-            fis,\arpeggio
+           \context Voice < fis,-\arpeggio  d a >
             %%\property PianoStaff.SpanArpeggio \push #'connect = ##t
             \property PianoStaff.connectArpeggios = ##t
             <fis,\arpeggio a c>
          }
         \context Staff=two \notes\relative c{
             \clef bass;
-            g
+           \context Voice < g b d-\arpeggio   >
             <g\arpeggio b d>
         }
     >
index 1e7253645c8a85e39fd60615222ae13610a79c72..7f889715db65160949f5a82e6353340c98bb5082 100644 (file)
@@ -13,6 +13,8 @@
 #include "score-element.hh"
 #include "stem.hh"
 #include "staff-symbol-referencer.hh"
+#include "staff-symbol.hh"
+#include "warn.hh"
 
 bool
 Arpeggio::has_interface (Score_element* me)
@@ -26,25 +28,71 @@ Arpeggio::brew_molecule (SCM smob)
 {
   Score_element *me = unsmob_element (smob);
   
-  Interval iv; 
+  Score_element * common = me;
   for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
     {
-      Score_element *stem = unsmob_element (gh_car (s));
-      iv.unite (Stem::head_positions (stem));
+      Score_element * stem =  unsmob_element (gh_car (s));
+      common =  common->common_refpoint (Staff_symbol_referencer::staff_symbol_l (stem),
+                                Y_AXIS);
     }
 
+  /*
+    TODO:
+    
+    Using stems here is not very convenient; should store noteheads
+    instead, and also put them into the support. Now we will mess up
+    in vicinity of a collision.
+
+  */
+  Interval heads;
+  Real my_y = me->relative_coordinate (common, Y_AXIS);
+      
+  for (SCM s = me->get_elt_property ("stems"); gh_pair_p (s); s = gh_cdr (s))
+    {
+      Score_element * stem = unsmob_element (gh_car (s));
+      Score_element * ss = Staff_symbol_referencer::staff_symbol_l (stem);
+      Interval iv =Stem::head_positions (stem);
+      iv *= Staff_symbol::staff_space (ss)/2.0;
+      
+      heads.unite (iv + ss->relative_coordinate (common, Y_AXIS)
+                  - my_y);
+    }
+
+  if (heads.empty_b ())
+    {
+      programming_error ("Huh? Dumb blonde encountered?");
+      /*
+       Nee Valerie, jij bent _niet_ dom. 
+       */
+      return SCM_EOL;
+    }
+  
   Molecule mol;
   Molecule arpeggio = me->paper_l ()->lookup_l (0)->afm_find ("scripts-arpeggio");
-  Real staff_space = Staff_symbol_referencer::staff_space (me);
-  for (int i = (int)iv[MIN]/ 2; i < (int)(iv[MAX] - 1)/ 2; i++)
+
+  Real y = heads[LEFT];
+  while (y < heads[RIGHT])
     {
-      Molecule a (arpeggio);
-      a.translate_axis (i * staff_space, Y_AXIS);
-      mol.add_molecule (a);
+      mol.add_at_edge (Y_AXIS, UP,arpeggio, 0.0);
+      y+= arpeggio. extent (Y_AXIS).length ();
     }
-  mol.translate (Offset (-2 * staff_space, 0));
+  mol.translate_axis (heads[LEFT], Y_AXIS);
 
   return mol.create_scheme (); 
 }
 
+/*
+  We have to do a callback, because brew_molecule () triggers a
+  vertical alignment if it is cross-staff.
+*/
+MAKE_SCHEME_CALLBACK(Arpeggio, width_callback,2);
+SCM
+Arpeggio::width_callback (SCM smob, SCM axis)
+{
+  Score_element * me = unsmob_element (smob);
+  Axis a = (Axis)gh_scm2int (axis);
+  assert (a == X_AXIS);
+  Molecule arpeggio = me->paper_l ()->lookup_l (0)->afm_find ("scripts-arpeggio");
 
+  return ly_interval2scm (arpeggio.extent (X_AXIS));
+}
index ec3366a9d225897f3f14e82ff3d9661f10ccc3c6..587a514b06b5728fbeb8e3a19e2bcd52eeac5628 100644 (file)
@@ -326,8 +326,9 @@ output_dict= {
 %s
 \end{mudela}""",
                'output-verbatim': "\\begin{verbatim}%s\\end{verbatim}",
-               'output-default-post': r"""\def\postMudelaExample{}""",
-               'output-default-pre': r"""\def\preMudelaExample{}""",
+               'output-default-post': "\\def\postMudelaExample{}\n",
+               'output-default-pre': "\\def\preMudelaExample{}\n",
+               'usepackage-graphics': '\\usepackage{graphics}\n',
                'output-eps': '\\noindent\\parbox{\\mudelaepswidth{%(fn)s.eps}}{\includegraphics{%(fn)s.eps}}',
                'output-tex': '\\preMudelaExample \\input %(fn)s.tex \\postMudelaExample\n',
                'pagebreak': r'\pagebreak',
@@ -391,9 +392,10 @@ re_dict = {
                  'mudela-block': r"(?sm)^[^%\n]*?(?P<match>\\begin(\[(?P<options>.*?)\])?{mudela}(?P<code>.*?)\\end{mudela})",
                  'def-post-re': r"\\def\\postMudelaExample",
                  'def-pre-re': r"\\def\\preMudelaExample",               
+                 'usepackage-graphics': r"\usepackage{graphics}",
                  'intertext': r',?\s*intertext=\".*?\"',
                  'multiline-comment': no_match,
-                 'singleline-comment': r"(?m)(?P<code>^%.*$\n+)",
+                 'singleline-comment': r"(?m)^.*?(?P<match>(?P<code>^%.*$\n+))",
                  'numcols': r"(?P<code>\\(?P<num>one|two)column)",
                  },
        
@@ -587,25 +589,35 @@ def scan_preamble (chunks):
                scan_latex_preamble(chunks)
                
 
-def completize_preamble (str):
-       m = get_re ('preamble-end').search( str)
-       if not m:
-               return str
-       
-       preamble = str [:m.start (0)]
-       str = str [m.start(0):]
-       
-       if not get_re('def-post-re').search (preamble):
-               preamble = preamble + get_output('output-default-post')
-       if not get_re ('def-pre-re').search(  preamble):
-               preamble = preamble + get_output ('output-default-pre')
-
-       # UGH ! BUG!
-       #if  re.search ('\\\\includegraphics', str) and not re.search ('usepackage{graphics}',str):
-
-       preamble = preamble + '\\usepackage{graphics}\n'
-
-       return preamble + str
+def completize_preamble (chunks):
+       if __main__.format == 'texi':
+               return chunks
+       pre_b = post_b = graphics_b = None
+       for chunk in chunks:
+               if chunk[0] == 'preamble-end':
+                       break
+               if chunk[0] == 'input':
+                       m = get_re('def-pre-re').search(chunk[1])
+                       if m:
+                               pre_b = 1
+               if chunk[0] == 'input':
+                       m = get_re('def-post-re').search(chunk[1])
+                       if m:
+                               post_b = 1
+               if chunk[0] == 'input':
+                       m = get_re('usepackage-graphics').search(chunk[1])
+                       if m:
+                               graphics_b = 1
+       x = 0
+       while chunks[x][0] != 'preamble-end':
+               x = x + 1
+       if not pre_b:
+               chunks.insert(x, ('input', get_output ('output-default-pre')))
+       if not post_b:
+               chunks.insert(x, ('input', get_output ('output-default-post')))
+       if not graphics_b:
+               chunks.insert(x, ('input', get_output ('usepackage-graphics')))
+       return chunks
 
 
 read_files = []
@@ -1022,10 +1034,8 @@ def do_file(input_filename):
                        else:
                                newchunks.append (c)
                chunks = newchunks
-
-       if chunks and chunks[0][0] == 'input':
-               chunks[0] = ('input', completize_preamble (chunks[0][1]))
-
+       x = 0
+       chunks = completize_preamble (chunks)
        foutn = os.path.join(g_outdir, my_outname + '.' + format)
        sys.stderr.write ("Writing `%s'\n" % foutn)
        fout = open (foutn, 'w')