From: fred Date: Tue, 26 Mar 2002 23:57:18 +0000 (+0000) Subject: lilypond-1.3.96 X-Git-Tag: release/1.5.59~1239 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9d3c23fed51f8bc9380c6240c882647cf600140f;p=lilypond.git lilypond-1.3.96 --- diff --git a/CHANGES b/CHANGES index 2092760b67..ee5e336d24 100644 --- 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. diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index 5d9ca9f197..63774881e4 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -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 diff --git a/Documentation/user/latex-mudela-example.latex b/Documentation/user/latex-mudela-example.latex index 5b6c08e80e..817a0f00e1 100644 --- a/Documentation/user/latex-mudela-example.latex +++ b/Documentation/user/latex-mudela-example.latex @@ -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 6693a290ce..e089428ecd 100644 --- 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 diff --git a/input/test/arpeggio.ly b/input/test/arpeggio.ly index 9e7f930ace..d2122aa777 100644 --- a/input/test/arpeggio.ly +++ b/input/test/arpeggio.ly @@ -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 } \context Staff=two \notes\relative c{ \clef bass; - g + \context Voice < g b d-\arpeggio > } > diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index 1e7253645c..7f889715db 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -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)); +} diff --git a/scripts/mudela-book.py b/scripts/mudela-book.py index ec3366a9d2..587a514b06 100644 --- a/scripts/mudela-book.py +++ b/scripts/mudela-book.py @@ -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\\begin(\[(?P.*?)\])?{mudela}(?P.*?)\\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^%.*$\n+)", + 'singleline-comment': r"(?m)^.*?(?P(?P^%.*$\n+))", 'numcols': r"(?P\\(?Pone|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')