From: fred Date: Wed, 27 Mar 2002 01:19:08 +0000 (+0000) Subject: lilypond-1.4.1 X-Git-Tag: release/1.5.59~634 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=55a96d621a1534effc2d20c5958576f7b906f31d;p=lilypond.git lilypond-1.4.1 --- diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index d95171e7ff..55db0ae143 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -105,6 +105,7 @@ and documenting bugfixes. @lilypondfile[printfilename]{triplets.ly} + @section Slurs @lilypondfile[printfilename]{slur-nice.ly} @@ -119,10 +120,15 @@ and documenting bugfixes. @lilypondfile[printfilename]{slur-attachment-override.ly} +@lilypondfile[printfilename]{slur-stem-broken.ly} + @lilypondfile[printfilename]{drarn-slurs.ly} @lilypondfile[printfilename]{phrasing-slur.ly} +@lilypondfile[printfilename]{slur-staccato.ly} + + @section Ties @lilypondfile[printfilename]{tie.ly} diff --git a/Documentation/user/macros.itexi b/Documentation/user/macros.itexi index 7d8699e0b8..b817a23ab9 100644 --- a/Documentation/user/macros.itexi +++ b/Documentation/user/macros.itexi @@ -1,16 +1,46 @@ -@ifinfo +@ifnottex @macro reng {word} -@ref{ (lilypond-internals)Engraver \word\, \word\ }, +@ref{ (lilypond-internals)\word\, \word\ }, @end macro -@end ifinfo +@end ifnottex -@ifnotinfo +@iftex @macro reng {word} -@ref{ (lilypond-internals)Engraver \word\, \word\ } +\word\ @end macro -@end ifnotinfo +@end iftex + + +@ifnottex +@macro rgrob {word} +@ref{ (lilypond-internals)\word\, \word\ }, + +@end macro +@end ifnottex + +@iftex +@macro rgrob {word} +\word\ + +@end macro +@end iftex + + +@ifnottex +@macro rint {word} +@ref{ (lilypond-internals)\word\, \word\ }, + +@end macro +@end ifnottex + +@iftex +@macro rint {word} +\word\ + +@end macro +@end iftex @@ -18,7 +48,7 @@ @macro separate @tex -\\hbox to\\hsize{\\hfill\\vrule width1.4 cm height1.0pt\\hfill} +\\hbox to\\hsize{\\hfill\\smallrm*\\textrm*\\smallrm*\\hfill} @end tex @end macro diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 9315ae245c..b791f4e8fc 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -296,6 +296,7 @@ A reminder accidental can be forced by adding an exclamation mark @code{!} after the pitch. A cautionary accidental, @cindex cautionary accidental +@cindex parenthesized accidental i.e., an accidental within parentheses can be obtained by adding the question mark `@code{?}' after the pitch. @@ -474,7 +475,8 @@ printed. The shorthand is only available in Note and Chord mode. @cindex @code{\key} -Changing the key signature is done with the @code{\key} command. +Setting or changing the key signature is done with the @code{\key} +command. @example @code{\key} @var{pitch} @var{type} @end example @@ -498,7 +500,7 @@ The standard mode names @code{\ionian}, This command sets the context property @code{Staff.keySignature}. Non-standard key signatures can be specified by setting this property -directly, see the generated documentation. +directly, see the generated documentation for @rgrob{KeySignature}. The printed signature is a @code{KeySignature} grob. @@ -508,8 +510,10 @@ The printed signature is a @code{KeySignature} grob. @node Clef @subsection Clef @cindex @code{\clef} + +The clef can be set or changed with the @code{\clef} command. @example - \clef @var{clefname} @code{;} + \clef @var{clefname} @end example Shortcut for @@ -608,7 +612,8 @@ Editio XXX.'' @cindex meter @cindex @code{\time} -The time signature is changed by the @code{\time} command. Syntax: +The time signature is set or changed by the @code{\time} +command. Syntax: @example \time @var{n}@code{/}@var{d} @end example @@ -624,9 +629,26 @@ should be inserted, and how automatic beams should be generated. Changing the value of @code{timeSignatureFraction} also causes a -fraction to be printed. This grob is @code{TimeSignature}. There are -many options for the layout of this grob. They are selected through the -@code{style} grob property. See @file{input/test/time.ly} for examples. +fraction to be printed. This grob is @code{TimeSignature}. + +The actual symbol that's printed can be customised with the style +property. +@lilypond[fragment, verbatim, singleline] +\time 3/4 s2 +\property Staff.TimeSignature \override #'style = #'C +\time 4/4 s2 +\property Staff.TimeSignature \override #'style = #'() +\time 4/4 s2 +\property Staff.TimeSignature \override #'style = #'C +\time 2/2 s2 +@end lilypond + +There are many more options for the layout of this grob. They are +selected through the @code{style} grob property. + +@c FIXME: this isn't documented except in example? +See +@file{input/test/time.ly} for examples. @c . {Partial} @subsection Partial @@ -1086,7 +1108,7 @@ Metronome settings can be entered as follows: \tempo @var{duration} = @var{perminute} @end example -For example, @code{\tempo 4 = 76;} requests output with 76 quarter notes +For example, @code{\tempo 4 = 76} requests output with 76 quarter notes per minute. @refbugs @@ -1775,7 +1797,8 @@ c''4 \spanrequest \stop "Sustain" The symbols that are printed can be modified by setting @code{pedal@var{X}Strings}, where @var{X} is one of the pedal -types. Refer to the generated documentation for more information. +types. Refer to the generated documentation of @rgrob{PianoPedal} for +more information. @refbugs @@ -2535,9 +2558,10 @@ may set the property @var{soloADue} to false. There are a number of other properties that you can use to tweak the behavior of part combining, refer to the automatically generated -documentation. Look at the documentation of the responsible engravers, -@code{Thread_devnull_engraver}, @code{Voice_devnull_engraver} and -@code{A2_engraver}. +documentation of @reng{Thread_devnull_engraver} and +@reng{Voice_devnull_engraver}. Look at the documentation of the +responsible engravers, @code{Thread_devnull_engraver}, +@code{Voice_devnull_engraver} and @code{A2_engraver}. @refbugs @@ -3029,7 +3053,7 @@ overstrike text} The markup is broken down and converted into a list of grob properties, which are prepended to the property list. The @var{key}-@var{value} pair is a grob property. A list of properties available is included in -the generated documentation for @code{text-interface} +the generated documentation for @rint{Text_interface}. The following abbreviations are currently defined: @table @code @@ -3219,7 +3243,7 @@ The most important output definition is the @code{\paper} block, for music notation. The syntax is @example - @code{\paper @{} @var{[paperidentifier]} @var{items} @code{@}} + @code{\paper @{} [@var{paperidentifier}] @var{items} @code{@}} @end example where each of the items is one of @@ -4124,10 +4148,10 @@ identifiers called @var{name}@code{Context}, e.g. @code{StaffContext}, If you want to build a context from scratch, you must also supply the following extra information: @itemize @bullet - @item A name, specified by @code{\name @var{contextname};}. + @item A name, specified by @code{\name @var{contextname}}. @item A cooperation module. This is specified by @code{\type -@var{typename};}. +@var{typename}}. @end itemize This is an example: diff --git a/input/regression/slur-staccato.ly b/input/regression/slur-staccato.ly new file mode 100644 index 0000000000..53c31a4f37 --- /dev/null +++ b/input/regression/slur-staccato.ly @@ -0,0 +1,16 @@ +\header { +texidoc="Manual hack for slur and staccato." +} + +\paper { linewidth = -1.0 } + +\score { + \context Staff \notes\relative c'' { + \property Voice.Slur \override + #'attachment-offset = #'((0 . 1) . (0 . 1)) + a-.( g-. )a-. + \property Voice.Slur \override + #'attachment-offset = #'((0 . 1.5) . (0 . 1.5)) + b-.( a-. )b-. + } +} \ No newline at end of file diff --git a/input/test/slur-attachment-override.ly b/input/test/slur-attachment-override.ly index bf48d0bdaa..d747f24956 100644 --- a/input/test/slur-attachment-override.ly +++ b/input/test/slur-attachment-override.ly @@ -8,11 +8,12 @@ In some cases, you may want to set slur attachments by hand. fragment = \notes { + \property Voice.noAutoBeaming = ##t \property Voice.Stem \set #'direction = #1 \property Voice.Slur \set #'direction = #1 - d'32( d'4 )d8.. + d'32( f'4 )d8.. \property Voice.Slur \set #'attachment = #'(stem . stem) - d,32( d'4 )d8.. + d,32( f'4 )d8. } \paper { linewidth = -1. } diff --git a/lily/slur.cc b/lily/slur.cc index 3e2743385b..33d0ce5757 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -9,7 +9,6 @@ /* [TODO] - * fix broken interstaff slurs * should avoid stafflines with horizontal part. * begin and end should be treated as a/acknowledge Scripts. * smart changing of endings @@ -157,7 +156,9 @@ Slur::check_slope (Grob *me) o[LEFT] = ly_scm2offset (index_cell (a, LEFT)); o[RIGHT] = ly_scm2offset (index_cell (a, RIGHT)); o[d][Y_AXIS] -= (limit - slope) * dx * dir / staff_space; - //o[d][Y_AXIS] = attachment[-d][Y_AXIS] + (dx * limit * dir / staff_space); + + o[d][Y_AXIS] *= Directional_element_interface::get (me); + me->set_grob_property ("attachment-offset", gh_cons (ly_offset2scm (o[LEFT]), ly_offset2scm (o[RIGHT]))); @@ -279,6 +280,11 @@ Slur::get_attachment (Grob *me, Direction dir, Grob * n =sp->get_bound (dir); if ((stem = Note_column::stem_l (n))) { + Real x_extent; + if (Grob *head = Note_column::first_head (n)) + x_extent = head->extent (head, X_AXIS).length (); + else + x_extent = n->extent (n, X_AXIS).length (); if (str == "head") { @@ -287,7 +293,7 @@ Slur::get_attachment (Grob *me, Direction dir, /* Default position is centered in X, on outer side of head Y */ - o += Offset (0.5 * n->extent (n,X_AXIS).length (), + o += Offset (0.5 * x_extent, 0.5 * staff_space * Directional_element_interface::get (me)); } @@ -297,8 +303,7 @@ Slur::get_attachment (Grob *me, Direction dir, /* Default position is on stem X, on outer side of head Y */ - o += Offset (n->extent (n,X_AXIS).length () - * (1 + Stem::get_direction (stem)), + o += Offset (x_extent * (1 + Stem::get_direction (stem)), 0.5 * staff_space * Directional_element_interface::get (me)); } @@ -309,44 +314,39 @@ Slur::get_attachment (Grob *me, Direction dir, Default position is on stem X, at stem end Y */ o += Offset (0.5 * - (n->extent (n,X_AXIS).length () - - stem->extent (stem,X_AXIS).length ()) - * (1 + Stem::get_direction (stem)), - 0); + x_extent * (1 + Stem::get_direction (stem)), + 0); } } } - else if (str == "loose-end") + /* + If we're not a note_column, we can't be anything but a loose-end. + But if user has set (attachment . (stem . stem)), our string is + stem, not loose-end. + + Hmm, maybe after-line-breaking should set this to loose-end? */ + else // if (str == "loose-end") { SCM other_a = dir == LEFT ? gh_cdr (s) : gh_car (s); if (ly_symbol2string (other_a) != "loose-end") - { -#if 0 - /* - The braindead way: horizontal - */ - o = Offset (0, get_attachment (me, -dir, common)[Y_AXIS]); -#else - o = broken_trend_offset (me, dir); -#endif - - - } - + o = broken_trend_offset (me, dir); } SCM alist = me->get_grob_property ("extremity-offset-alist"); -int stemdir = stem ? Stem::get_direction (stem) : 1; + int stemdir = stem ? Stem::get_direction (stem) : 1; int slurdir = gh_scm2int (me->get_grob_property ("direction")); SCM l = scm_assoc - (scm_listify (a, - gh_int2scm (stemdir * dir), - gh_int2scm (slurdir * dir), + (scm_listify (a, + gh_int2scm (stemdir * dir), + gh_int2scm (slurdir * dir), SCM_UNDEFINED), alist); if (l != SCM_BOOL_F) { - o += ly_scm2offset (gh_cdr (l)) * staff_space * dir; + Offset off = ly_scm2offset (gh_cdr (l)) * staff_space; + off[X_AXIS] *= dir; + off[Y_AXIS] *= Directional_element_interface::get (me); + o += off; } /* @@ -359,8 +359,12 @@ int stemdir = stem ? Stem::get_direction (stem) : 1; - me->relative_coordinate (common[Y_AXIS], Y_AXIS); } - o += ly_scm2offset (index_cell (me->get_grob_property ("attachment-offset"), - dir)) * staff_space; + Offset off = ly_scm2offset (index_cell (me->get_grob_property + ("attachment-offset"), + dir)) * staff_space; + + off[Y_AXIS] *= Directional_element_interface::get (me); + o += off; return o; } @@ -387,8 +391,12 @@ Slur::encompass_offset (Grob*me, /* Simply set x to middle of notehead */ - - o[X_AXIS] -= 0.5 * stem_dir * col->extent (col,X_AXIS).length (); + Real x_extent; + if (Grob *head = Note_column::first_head (col)) + x_extent = head->extent (head, X_AXIS).length (); + else + x_extent = col->extent (col, X_AXIS).length (); + o[X_AXIS] -= 0.5 * stem_dir * x_extent; if ((stem_dir == dir) && !stem_l->extent (stem_l, Y_AXIS).empty_b ()) diff --git a/ly/property.ly b/ly/property.ly index 5fa998727d..058ffdd2c7 100644 --- a/ly/property.ly +++ b/ly/property.ly @@ -44,6 +44,20 @@ scriptBoth = { \property Voice.Script \revert #'direction } +tupletUp = { + \property Voice.TupletBracket \override #'direction = #1 + \property Voice.TupletBracket \override #'direction = #1 +} +tupletDown = { + \property Voice.TupletBracket \override #'direction = #-1 + \property Voice.TupletBracket \override #'direction = #-1 +} +tupletBoth = { + \property Voice.TupletBracket \revert #'direction + \property Voice.TupletBracket \revert #'direction +} + + cadenzaOn = \property Score.timing = ##f cadenzaOff = { diff --git a/scm/slur.scm b/scm/slur.scm index abfa9e2a89..28d1eb0cf1 100644 --- a/scm/slur.scm +++ b/scm/slur.scm @@ -94,12 +94,12 @@ (define default-slur-extremity-offset-alist '( ((head 1 1) . (-0.25 . 0.25)) - ((head 1 -1) . (-0.25 . -0.25)) + ((head 1 -1) . (-0.25 . 0.25)) ((head -1 1) . (-0.25 . 0.25)) - ((head -1 -1) . (-0.85 . -0.25)) + ((head -1 -1) . (-0.85 . 0.25)) ((stem 1 1) . (0 . 0.5)) - ((stem -1 -1) . (0 . -0.5)) + ((stem -1 -1) . (0 . 0.5)) ((loose-end 1 1) . (-0.4 . 0)) ((loose-end 1 -1) . (-0.4 . 0)) @@ -114,12 +114,12 @@ (define default-phrasing-slur-extremity-offset-alist '( ((head 1 1) . (-0.25 . 1.25)) - ((head 1 -1) . (-0.25 . -1.25)) + ((head 1 -1) . (-0.25 . 1.25)) ((head -1 1) . (-0.25 . 1.25)) - ((head -1 -1) . (-0.85 . -1.25)) + ((head -1 -1) . (-0.85 . 1.25)) ((stem 1 1) . (0 . 1.5)) - ((stem -1 -1) . (0 . -1.5)) + ((stem -1 -1) . (0 . 1.5)) ((loose-end 1 1) . (-0.4 . 0)) ((loose-end 1 -1) . (-0.4 . 0)) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index c4e0619901..6209e86e8b 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -777,7 +777,7 @@ if 1: if 1: def conv (str): - str = re.sub ('([Cc])horda', '\\1orda', str) + str = re.sub ('([Cc])hord([ea])', '\\1ord\\2', str) return str conversions.append (((1,3,144), conv, 'Chorda -> Corda'))