]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/my-lily-lexer.cc (My_lily_lexer): don't crash
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 28 Aug 2003 09:43:47 +0000 (09:43 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 28 Aug 2003 09:43:47 +0000 (09:43 +0000)
on unquoted strings before \notenames.

* lily/parser.yy (lyric_element): allow markup as lyric text. This
increases the number of s/r reductions to 4.

* scm/new-markup.scm (fraction-markup): \fraction command.

* lily/lexer.ll: allow any string without \ { }  # and " in \markup
mode

* lily/lookup.cc (round_filled_box): rename function.
(LY_DEFINE): round-filled-box: change signature.

* Documentation/user/refman.itely: revise section explaining grace
notes.

* lily/my-lily-lexer.cc: add \accacciatura and \appoggiatura

* ly/grace-init.ly (stopGraceMusic): add slurs on grace note by
default

* ly/engraver-init.ly (ScoreContext): new property graceSettings.

26 files changed:
ChangeLog
Documentation/user/refman.itely
lily/ambitus.cc
lily/breathing-sign.cc
lily/cluster.cc
lily/include/lookup.hh
lily/lexer.ll
lily/lookup.cc
lily/mensural-ligature.cc
lily/my-lily-lexer.cc
lily/note-head.cc
lily/parser.yy
lily/vaticana-ligature.cc
ly/init.ly
ly/nederlands.ly
scm/lily.scm
scm/molecule.scm
scm/new-markup.scm
scm/output-ascii-script.scm
scm/output-lib.scm
scm/output-pdf.scm
scm/output-pdftex.scm
scm/output-ps.scm
scm/output-sketch.scm
scm/output-sodipodi.scm
scm/output-tex.scm

index 1274a9338ff5ed0d4c2c33763a3ba6053a82c8c6..bded514059ed3ba1deea1e590765940db4c67795 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
 2003-08-28  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * lily/my-lily-lexer.cc (My_lily_lexer): don't crash
+       on unquoted strings before \notenames.
+
+       * lily/parser.yy (lyric_element): allow markup as lyric text. This
+       increases the number of s/r reductions to 4.
+
+       * scm/new-markup.scm (fraction-markup): \fraction command.
+
+       * lily/lexer.ll: allow any string without \ { }  # and " in \markup
+       mode
+
+       * lily/lookup.cc (round_filled_box): rename function.
+       (LY_DEFINE): round-filled-box: change signature.
+
+       * Documentation/user/refman.itely: revise section explaining grace
+       notes.
+
        * lily/translator-scheme.cc (LY_DEFINE): add !
 
        * input/*/*.ly (vmus): use \new everywhere.
index ef2decf4842dfb1dea74732e780ae95179cd4db8..f9a4e53500c319befdbb842ad7f9c21b4138e1c9 100644 (file)
@@ -2153,27 +2153,55 @@ longer be computed.
 @cindex ornaments
 @cindex grace notes
 
-Grace notes are ornaments that are written out, like accaciatura and
-appogiatura notes.
+Grace notes are ornaments that are written out.  The most common ones
+are accacciatura, which should be played as very short.  It is denoted
+by a slurred small note with a slashed stem.  The appoggiatura is a
+grace note that takes a fixed fraction of the main note, is and
+denoted as a slurred note in small print without a slash.
+They are entered with the commands @code{\accacciatura} and
+@code{\appoggiatura}, as demonstrated in the following example:
+
+
+@cindex appoggiatura
+@cindex accacciatura
+
+@lilypond[relative=2,verbatim,fragment]
+b4 \accacciatura d8 c4 \appoggiatura e8 d4
+\accacciatura { g16 f } e4
+@end lilypond
+
+Both are special forms of the @code{\grace} command. By prefixing this
+keyword to a music expression, a new one is formed, which will be
+printed in a smaller font and takes up no logical time in a measure.
 @lilypond[relative=2,verbatim,fragment]
-c4 \grace c16 c4 \grace {
-c16[ d16] } c4
+  c4 \grace c16 c4 \grace {
+  c16[ d16] } c2 c4
 @end lilypond
+Unlike @code{\accacciatura} and @code{\appoggiatura}, the
+@code{\grace} command does not start a slur.
 
-From the point of view of typesetting, their characteristic is that
-grace notes take up take up no logical time in a measure.  Internally,
-timing for grace notes is done using a second time. Every point in
-musical time consists of two rational numbers: one denotes the logical
-time, one denotes the grace timing. The above example is shown here
-with timing tuples:
+Internally, timing for grace notes is done using a second, `grace'
+time. Every point in time consists of two rational numbers: one
+denotes the logical time, one denotes the grace timing. The above
+example is shown here with timing tuples:
 
-@lilypond[]
-\score { \notes \relative c''{ 
-  c4^"(0,0)"  \grace c16_" "_"(1/4,-1/16)"  c4^"(1/4,0)"  \grace {
-  c16_"(2/4,-1/8)"[  d16^"(2/4,-1/16)" ] } c4_" "_"(2/4,0)"
+@lilypond[singleline]
+<
+  \relative c''{ 
+  c4  \grace c16  c4  \grace {
+  c16[  d16] } c4
   }
-\paper {  linewidth = 12.\cm }
-}
+  \new Lyrics \lyrics {
+      \markup { (0,0)  } 4
+      \grace { \markup {
+         ( \fraction 1 4 ,  \fraction -1 16 ) } 16 }
+      \markup { (\fraction 1 4 , 0 ) } 4
+      \grace {
+         \markup { (\fraction 2 4 , \fraction "-1" 8 ) } 16
+         \markup { (\fraction 2 4 , \fraction "-1" 16 ) } 16
+         } 
+      \markup { ( \fraction 2 4 , 0 ) }
+  } >
 @end lilypond
 
 
@@ -2187,28 +2215,6 @@ every eighth grace note:
 @end lilypond
 
 
-Unbeamed eighth notes and shorter by default have a slash through the
-stem. These notes are called accaciaturas, and should generally be
-played as short as possible. An appogiatura takes a fixed fraction of
-the main note, is and denoted without a slash. 
-
-Such slashless notes are obtained by setting the object property
-@code{stroke-style} of the @internalsref{Stem} object:
-@cindex slash
-@cindex grace slash
-
-@lilypond[fragment,verbatim]
-\relative c'' \context Voice {
-  \grace c8 c4 \grace { c16[ c16] } c4
-  \grace { 
-    \property Voice.Stem \override #'stroke-style = #'() 
-    c16 
-    \property Voice.Stem \revert #'stroke-style
-  } c4
-}
-@end lilypond
-The @code{\override} is carefully matched with a @code{\revert}:
-
 
 If you want to end a note with a grace note, then the standard trick
 is to put the grace notes before a phantom ``space note'', e.g.
@@ -2224,29 +2230,42 @@ is to put the grace notes before a phantom ``space note'', e.g.
 By adjusting the duration of the skip note (here it is a half-note),
 the space between the main-note and the grace is adjusted.
 
-A @code{\grace} section has some default values, and LilyPond will
-use those default values unless you specify otherwise inside the
-@code{\grace} section.  For example, if you specify \slurUp
-@emph{before} your @code{\grace} section, a slur which starts inside
-the @code{\grace} will not be forced up, even if the slur ends outside
-of the @code{\grace}.  Note the difference between the first and
-second bars in this example:
 
-@lilypond[fragment,verbatim]
-\relative c'' \context Voice {
-    \slurUp
-    \grace {
-        a4( }
-    a4) a4( a2)
-    \slurBoth
-
-    \grace {
-        \slurUp
-        a4( }
-    a4) a4( a2)
-    \slurBoth
+A @code{\grace} section will introduce special typesetting settings,
+for example, to produce smaller type, and set directions. Hence, when
+introducing layout tweaks, they should be inside the grace section,
+for example,
+@lilypond[fragment,verbatim,relative 2]
+\new Voice {
+    \accacciatura {
+      \property Voice.Stem \override #'direction = #-1
+      f16->
+      \property Voice.Stem \revert #'direction
+    }
+    g4
 }
 @end lilypond
+The overrides should also be reverted inside the grace section.
+
+If the layout of grace sections must be changed throughout the music,
+then this can be accomplished through the function
+@code{add-grace-property}. The following example
+undefines the Stem direction  grace section, so stems do not always
+point up.
+
+@example
+  \new Staff @{
+     #(add-grace-property "Voice" Stem direction '())
+     @dots{}
+  @}
+@end example
+
+@noindent
+Another option is to change the variables @code{startGraceMusic},
+@code{stopGraceMusic}, @code{startAccacciaturaMusic},
+@code{stopAccacciaturaMusic}, @code{startAppoggiaturaMusic},
+@code{stopAppoggiaturaMstuic}.  More information is in the file
+@file{ly/grace-init.ly}
 
 
 @seealso
@@ -2274,9 +2293,8 @@ Grace sections should only be used within sequential music
 expressions.  Nesting or juxtaposing grace sections is not supported,
 and might produce crashes or other errors.
 
-Overriding settings for grace music globally cannot be done in a
-modular way. A kludge (@code{add-to-grace-init}) is defined in
-@file{ly/grace-init.ly}.
+Overriding settings cannot be done in separate styles for appoggiatura
+and accacciatura.
 
 
 @node Glissando 
@@ -2294,7 +2312,7 @@ A glissando line can be requested by attaching a @code{\glissando} to
 a note:
 
 @lilypond[fragment,relative,verbatim]
-  c'-\glissando c'
+  c'\glissando c'
 @end lilypond
 
 @seealso
@@ -2332,14 +2350,14 @@ Additional texts (such as @emph{gliss.}) is not supported.
 
 
 Absolute dynamic marks are specified using an variable after a
-note: @code{c4-\ff}.  The available dynamic marks are @code{\ppp},
+note: @code{c4\ff}.  The available dynamic marks are @code{\ppp},
 @code{\pp}, @code{\p}, @code{\mp}, @code{\mf}, @code{\f}, @code{\ff},
 @code{\fff}, @code{\fff}, @code{\fp}, @code{\sf}, @code{\sff},
 @code{\sp}, @code{\spp}, @code{\sfz}, and @code{\rfz}:
 
 @lilypond[verbatim,singleline,fragment,relative]
-  c'-\ppp c-\pp c -\p c-\mp c-\mf c-\f c-\ff c-\fff
-  c2-\sf c-\rfz
+  c'\ppp c\pp c \p c\mp c\mf c\f c\ff c\fff
+  c2\sf c\rfz
 @end lilypond
 
 @cindex @code{\cr}
@@ -2358,8 +2376,8 @@ with @code{\!}.  Because these marks are bound to notes, if you must
 use spacer notes if multiple marks during one note are needed:
 
 @lilypond[fragment,verbatim,center,quote]
-  c''-\< c''-\!   d''-\decr e''-\rced 
-  < f''1 { s4 s4-\< s4-\! \>  s4-\! } >
+  c''\< c''\!   d''\decr e''\rced 
+  < f''1 { s4 s4\< s4\! \>  s4\! } >
 @end lilypond
 This may give rise to very short hairpins. Use @code{minimum-length}
 in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for
@@ -2384,7 +2402,7 @@ You can also supply your own texts:
   \context Voice {
     \property Voice.crescendoText = \markup { \italic "cresc. poco" }
     \property Voice.crescendoSpanner = #'dashed-line
-    a'2-\mf-\< a a a-\!
+    a'2\mf\< a a a\!
   }
 @end lilypond
 
@@ -3090,7 +3108,7 @@ Piano pedal instruction can be expressed by attaching
 note or chord:
 
 @lilypond[fragment,verbatim]
-  c'4-\sustainDown c'4-\sustainUp
+  c'4\sustainDown c'4\sustainUp
 @end lilypond
 
 What is printed can be modified by setting @code{pedal@var{X}Strings},
@@ -3103,9 +3121,9 @@ Pedals can also be indicated by a sequence of brackets, by setting the
 
 @lilypond[fragment,verbatim]
  \property Staff.pedalSustainStyle = #'bracket
- c''4-\sustainDown d''4 e''4
- a'4-\sustainUp-\sustainDown
- f'4 g'4 a'4-\sustainUp
+ c''4\sustainDown d''4 e''4
+ a'4\sustainUp\sustainDown
+ f'4 g'4 a'4\sustainUp
 @end lilypond
 
 A third style of pedal notation is a mixture of text and brackets,
@@ -3113,9 +3131,9 @@ obtained by setting @code{pedal-type} to @code{mixed}:
 
 @lilypond[fragment,verbatim]
  \property Staff.pedalSustainStyle = #'mixed
-c''4-\sustainDown d''4 e''4
-c'4-\sustainUp-\sustainDown
- f'4 g'4 a'4-\sustainUp
+c''4\sustainDown d''4 e''4
+c'4\sustainUp\sustainDown
+ f'4 g'4 a'4\sustainUp
 @end lilypond
 
 The default `*Ped' style for sustain and damper pedals corresponds to
@@ -3123,7 +3141,7 @@ The default `*Ped' style for sustain and damper pedals corresponds to
 for a sostenuto pedal:
 
 @lilypond[fragment,verbatim]
-c''4-\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4-\sostenutoUp
+c''4\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4\sostenutoUp
 @end lilypond
 
 For fine-tuning of the appearance of a pedal bracket, the properties
@@ -3135,8 +3153,8 @@ may be extended to the end of the note head:
 @lilypond[fragment,verbatim]
 \property Staff.PianoPedalBracket \override
    #'shorten-pair = #'(0 . -1.0)
-c''4-\sostenutoDown d''4 e''4 c'4
-f'4 g'4 a'4-\sostenutoUp
+c''4\sostenutoDown d''4 e''4 c'4
+f'4 g'4 a'4\sostenutoUp
 @end lilypond
 
 @node Arpeggio
@@ -3151,7 +3169,7 @@ You can specify an arpeggio sign on a chord by attaching an
 
 
 @lilypond[fragment,relative,verbatim]
-  <<c e g c>>-\arpeggio
+  <<c e g c>>\arpeggio
 @end lilypond
 
 When an arpeggio crosses staves, you attach an arpeggio to the chords
@@ -3161,8 +3179,8 @@ in both staves, and set
 @lilypond[fragment,relative,verbatim]
   \context PianoStaff <
     \property PianoStaff.connectArpeggios = ##t
-    \new Staff  { <<c' e g c>>-\arpeggio }
-    \new Staff { \clef bass  <<c,, e g>>-\arpeggio }
+    \new Staff  { <<c' e g c>>\arpeggio }
+    \new Staff { \clef bass  <<c,, e g>>\arpeggio }
   >
 @end lilypond
 
@@ -3173,9 +3191,9 @@ arrowhead to the wiggly line.  This can be typeset by setting
 @lilypond[fragment,relative,verbatim]
   \context Voice {
      \property Voice.Arpeggio \set #'arpeggio-direction = #1
-     <<c e g c>>-\arpeggio
+     <<c e g c>>\arpeggio
      \property Voice.Arpeggio \set #'arpeggio-direction = #-1
-     <<c e g c>>-\arpeggio
+     <<c e g c>>\arpeggio
   }
 @end lilypond
 
@@ -3188,7 +3206,7 @@ arpeggiate the chord. To draw these brackets, set the
 @lilypond[fragment,relative,verbatim]
     \property PianoStaff.Arpeggio \override
         #'molecule-callback = \arpeggioBracket
-       <<c' e g c>>-\arpeggio
+       <<c' e g c>>\arpeggio
 @end lilypond
 
 @refcommands
index 0421a1e1137567cf911b78359737b57c0d8b98e8..62104d3ac158ee7f33af715afbd575779eeb80ce 100644 (file)
@@ -203,7 +203,7 @@ Ambitus::brew_molecule (SCM smob)
       Interval x_extent = 0.5 * Interval (-linethickness, +linethickness);
       Interval y_extent = 0.5 * Interval (p_min + 1.35, p_max - 1.35);
       Box line_box (x_extent, y_extent);
-      Molecule line = Lookup::roundfilledbox (line_box, blotdiameter);
+      Molecule line = Lookup::round_filled_box (line_box, blotdiameter);
       line.translate_axis (0.5 * head_min.extent (X_AXIS).length (), X_AXIS);
       molecule.add_molecule (line);
     }
index e78b5a50161b73a132a01dcf628334219dae964c..bd3bc598b11b9ebf49b326e03b8c7f57936a9489 100644 (file)
@@ -84,7 +84,7 @@ Breathing_sign::divisio_minima (SCM smob)
   Interval xdim (0, thickness);
   Interval ydim (-0.5 * staff_space, +0.5 * staff_space);
   Box b (xdim, ydim);
-  Molecule out = Lookup::roundfilledbox (b, blotdiameter);
+  Molecule out = Lookup::round_filled_box (b, blotdiameter);
   return out.smobbed_copy ();
 }
 
@@ -125,7 +125,7 @@ Breathing_sign::divisio_maior (SCM smob)
   Interval xdim (0, thickness);
   Interval ydim (-0.5 * height, +0.5 * height);
   Box b (xdim, ydim);
-  Molecule out = Lookup::roundfilledbox (b, blotdiameter);
+  Molecule out = Lookup::round_filled_box (b, blotdiameter);
   return out.smobbed_copy ();
 }
 
@@ -156,7 +156,7 @@ Breathing_sign::divisio_maxima (SCM smob)
   Interval xdim (0, thickness);
   Interval ydim (-0.5 * staff_size, +0.5 * staff_size);
   Box b (xdim, ydim);
-  Molecule out = Lookup::roundfilledbox (b, blotdiameter);
+  Molecule out = Lookup::round_filled_box (b, blotdiameter);
   return out.smobbed_copy ();
 }
 
@@ -187,7 +187,7 @@ Breathing_sign::finalis (SCM smob)
   Interval xdim (0, thickness);
   Interval ydim (-0.5 * staff_size, +0.5 * staff_size);
   Box b (xdim, ydim);
-  Molecule line1 = Lookup::roundfilledbox (b, blotdiameter);
+  Molecule line1 = Lookup::round_filled_box (b, blotdiameter);
   Molecule line2 (line1);
   line2.translate_axis (0.5 * staff_space, X_AXIS);
   line1.add_molecule (line2);
index af858ada863d9cb9bcd9ad9c4ba9d520a628c946..424e1d248bd8057cf400bd5b49d3df6ac880288b 100644 (file)
@@ -73,7 +73,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
          box.add_point (bottom_points[i] - hvpadding);
          box.add_point (Offset(top_points[i + 1][X_AXIS],
                                top_points[i][Y_AXIS]) + hvpadding);
-         out.add_molecule (Lookup::roundfilledbox (box, blotdiameter));
+         out.add_molecule (Lookup::round_filled_box (box, blotdiameter));
        }
     }
   else if (String::compare (shape, "rightsided-stairs") == 0)
@@ -84,7 +84,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
          box.add_point (Offset(bottom_points[i][X_AXIS],
                                bottom_points[i + 1][Y_AXIS]) - hvpadding);
          box.add_point (top_points[i + 1] + hvpadding);
-         out.add_molecule (Lookup::roundfilledbox (box, blotdiameter));
+         out.add_molecule (Lookup::round_filled_box (box, blotdiameter));
        }
     }
   else if (String::compare (shape, "centered-stairs") == 0)
@@ -99,7 +99,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
                         hvpadding);
          box.add_point (Offset (right_xmid, top_points[i][Y_AXIS]) +
                         hvpadding);
-         out.add_molecule (Lookup::roundfilledbox (box, blotdiameter));
+         out.add_molecule (Lookup::round_filled_box (box, blotdiameter));
          left_xmid = right_xmid;
        }
       Real right_xmid = bottom_points[size - 1][X_AXIS];
@@ -108,7 +108,7 @@ brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_poi
                     hvpadding);
       box.add_point (Offset (right_xmid, top_points[size - 1][Y_AXIS]) +
                     hvpadding);
-      out.add_molecule (Lookup::roundfilledbox (box, blotdiameter));
+      out.add_molecule (Lookup::round_filled_box (box, blotdiameter));
     }
   else if (String::compare (shape, "ramp") == 0)
     {
index c730a25acfe9669130e66526cafe45238cfd4229..02fcea0f8027d55c2b16b125f409304f4525d8ac 100644 (file)
@@ -30,7 +30,7 @@ struct Lookup
   static Molecule dashed_slur (Bezier, Real thick, Real dash);
   static Molecule blank (Box b);
   static Molecule filledbox (Box b);
-  static Molecule roundfilledbox (Box b, Real blotdiameter);
+  static Molecule round_filled_box (Box b, Real blotdiameter);
   static Molecule repeat_slash (Real w, Real slope, Real th);
   static Molecule line (Real th, Offset from, Offset to);
   static Molecule horizontal_line (Interval w, Real th);
index a9163c51b61febca23749223b5797db94ceb1d8c..7cf2e195d2093acb97e040019cc6a112300cdd35 100644 (file)
@@ -499,23 +499,23 @@ HYPHEN            --
                } else
                        return scan_escaped_word (str);
        }
-       {LYRICS} {
+       [{}]    {
+               return YYText()[0];
+       }
+       [^#{}"\\ \t\n\f]+ {
                String s (YYText ()); 
 
                char c = s[s.length () - 1];
                if (c == '{' ||  c == '}') // brace open is for not confusing dumb tools.
                        here_input ().warning (
-                               _ ("Brace found at end of lyric.  Did you forget a space?"));
+                               _ ("Brace found at end of markup.  Did you forget a space?"));
                yylval.scm = scm_makfrom0str (s.to_str0 ());
 
 
                return STRING;
        }
-       {WHITE} {
-
-       }
-       . {
-               return YYText ()[0];
+       .  {
+               return YYText()[0];
        }
 }
 
index 8fd4b2fb13c5dbb7b112419a5ab632312f08e9a8..9eeb6cbdb9b73737d66ea47fa5bceea18731c348 100644 (file)
@@ -166,7 +166,7 @@ Lookup::filledbox (Box b)
  *       Box extent(X_AXIS)
  */
 Molecule
-Lookup::roundfilledbox (Box b, Real blotdiameter)
+Lookup::round_filled_box (Box b, Real blotdiameter)
 {
   if (b.x ().length () < blotdiameter)
     {
@@ -179,7 +179,7 @@ Lookup::roundfilledbox (Box b, Real blotdiameter)
       blotdiameter = b.y ().length ();
     }
 
-  SCM at = (scm_list_n (ly_symbol2scm ("roundfilledbox"),
+  SCM at = (scm_list_n (ly_symbol2scm ("round-filled-box"),
                        gh_double2scm (-b[X_AXIS][LEFT]),
                        gh_double2scm (b[X_AXIS][RIGHT]),
                        gh_double2scm (-b[Y_AXIS][DOWN]),
@@ -190,24 +190,6 @@ Lookup::roundfilledbox (Box b, Real blotdiameter)
   return Molecule (b,at);
 }
 
-LY_DEFINE(ly_round_filled_box, "ly:round-filled-box",
-         2, 0,0,
-         (SCM b, SCM blot),
-         "Make a box with rounded corners. B is a pair of number-pairs, and BLOT a number")
-{
-  SCM_ASSERT_TYPE(gh_number_p (blot), blot, SCM_ARG2, __FUNCTION__, "number") ;
-  SCM_ASSERT_TYPE(gh_pair_p (b), b, SCM_ARG4, __FUNCTION__, "pair") ;
-
-  SCM_ASSERT_TYPE(ly_number_pair_p (gh_car (b)), gh_car (b), SCM_ARG1, __FUNCTION__, "number-pair") ;
-  SCM_ASSERT_TYPE(ly_number_pair_p (gh_cdr (b)), gh_cdr (b), SCM_ARG1, __FUNCTION__, "number-pair") ;
-
-  Interval x (ly_scm2interval (gh_car (b)));
-  Interval y (ly_scm2interval (gh_cdr (b)));
-  
-  return Lookup::roundfilledbox (Box (x,y),
-                                gh_scm2double (blot)).smobbed_copy();
-  
-}
          
 
 /*
@@ -770,4 +752,19 @@ LY_DEFINE(ly_bracket ,"ly:bracket",
                          gh_scm2double (t),
                          gh_scm2double (p)).smobbed_copy ();
 }
-  
+
+
+
+LY_DEFINE(ly_filled_box ,"ly:round-filled-box",
+         3, 0, 0,
+         (SCM xext, SCM yext, SCM blot),
+         "Make a filled-box of dimensions @var{xext}, @var{yext} and roundness @var{blot}.")
+{
+  SCM_ASSERT_TYPE(ly_number_pair_p (xext), xext, SCM_ARG1, __FUNCTION__, "number pair") ;
+  SCM_ASSERT_TYPE(ly_number_pair_p (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
+  SCM_ASSERT_TYPE(gh_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
+
+  return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
+                                  gh_scm2double (blot)).smobbed_copy ();
+}
+
index a60e2fe5ed274cf32751f1a3b1d5edaff118b59a..f62e3c29ca84c37af933361e216c4eb6786c25cb 100644 (file)
@@ -230,7 +230,7 @@ internal_brew_primitive (Grob *me, bool ledger_take_space)
        Interval (0, -join_left * 0.5 * staff_space);
       Box stem_box (x_extent, y_extent);
 
-      Molecule stem = Lookup::roundfilledbox (stem_box, blotdiameter);
+      Molecule stem = Lookup::round_filled_box (stem_box, blotdiameter);
       out.add_molecule (stem);
     }
 
index 48f08e8e98652677eede2f50e10bd6915c659954..c69f23c5fac0cb782f2a8f7261849747969cecc5 100644 (file)
@@ -93,7 +93,13 @@ static Keyword_ent the_key_tab[]={
 
 My_lily_lexer::My_lily_lexer ()
 {
+  //  yy_flex_debug = 1;
+  
   keytable_ = new Keyword_table (the_key_tab);
+
+  chordmodifier_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL);
+  pitchname_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL);
+  
   scopes_ = SCM_EOL;
   
   add_scope(ly_make_anonymous_module());
index b52a9a5ea105ab66a6aa28a8595ceafa7a6de865..4c291ae32d9c107f799ada95b4daa30724799c13 100644 (file)
@@ -86,7 +86,7 @@ Note_head::brew_ledger_lines (Grob *me,
       Box ledger_line (x_extent, y_extent);
 
       Molecule proto_ledger_line =
-       Lookup::roundfilledbox (ledger_line, blotdiameter);
+       Lookup::round_filled_box (ledger_line, blotdiameter);
       
       if (!take_space)
         proto_ledger_line.set_empty (true);
index 6ff5a07dc4e91961e6a997610141c3e0912b6512..5a7119fba26fd378019a80220280adea2a6fca8f 100644 (file)
@@ -10,7 +10,7 @@
 */
 
 /*
-  Two shift/reduce problems:
+  Four shift/reduce problems:
 
 1.     foo = bar.
 
        "bar" -> String -> string-assignment
 
 
+Similar problem for
+
+ * \markup identifier.
+ * \markup { }
+
+
 2.  \repeat
        \repeat .. \alternative
 
@@ -291,7 +297,8 @@ yylex (YYSTYPE *s,  void * v)
 
 %type <i>      exclamations questions dots optional_rest
 %type <i>       bass_mod
-%type <scm>    grace_head 
+%type <scm>    grace_head
+%type <scm>    lyric_element
 %type <scm>    bass_number br_bass_figure bass_figure figure_list figure_spec
 %token <i>     DIGIT
 %token <scm>   NOTENAME_PITCH
@@ -2054,8 +2061,11 @@ simple_element:
                scm_gc_protect_object (mus);
                $$ = unsmob_music (mus);
        }
-       | STRING optional_notemode_duration     {
+       
+       | lyric_element optional_notemode_duration      {
                Input i = THIS->pop_spot ();
+               if (!THIS->lexer_->lyric_state_b ())
+                       THIS->parser_error (_ ("Have to be in Lyric mode for lyrics"));
 
                Music * lreq = MY_MAKE_MUSIC("LyricEvent");
                 lreq->set_mus_property ("text", $1);
@@ -2075,6 +2085,11 @@ simple_element:
        }
        ;
 
+lyric_element:
+       full_markup { $$ = $1 }
+       | STRING {  $$ = $1 ; }
+       ;
+
 new_chord:
        steno_tonic_pitch optional_notemode_duration   {
                $$ = make_chord ($1, $2, SCM_EOL);
index 9a99e09943c387dfb32e11367997e30f6f93afc5..c58ca37c8b3a70df497469d87e8856ccc6f53e83 100644 (file)
@@ -263,7 +263,7 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space)
            Interval (0, -delta_pitch * 0.5 * staff_space); // descending join
          Box stem_box (x_extent, y_extent);
 
-         Molecule stem = Lookup::roundfilledbox (stem_box, blotdiameter);
+         Molecule stem = Lookup::round_filled_box (stem_box, blotdiameter);
          out.add_molecule (stem);
        }
       else
index 4608c01120ab40f777d3879e0d8fcbb78ede81d7..00084e627ef625a8082d9c0c9c64e4c238ba1770 100644 (file)
@@ -1,5 +1,7 @@
 % Toplevel initialisation file. 
 
+
+
 #(define-public point-and-click #f)
 #(define-public midi-debug #f)
 
@@ -9,6 +11,7 @@
 
 \include "declarations-init.ly"
 
+
 #(ly:set-option 'new-relative)
 #(ly:set-point-and-click #f)
 
index b54f85120653e99cdbb3c22f10de33dc2bf2f931..15e7f03e345e56af9cbfdcd803e5a10e3ac25803 100644 (file)
 
 
 
+
+foo= \notes {
+        <<c e g b>>-\markup { \normal-size-super
+    %                    \override #'(font-family . math) "N" }
+                         \override #'(font-family . math) "M" }
+}
+
index 5118e581100ddd6e51cfc7cea98d62ca87954b59..99e601fdbbfb007cb232dc34290338b805c9180f 100644 (file)
@@ -232,10 +232,15 @@ L1 is copied, L2 not.
   (remainder (+ a 1) 2))
   
 
-(define-public (widen-interval iv amount)
+(define-public (interval-widen iv amount)
    (cons (- (car iv) amount)
-         (+ (cdr iv) amount))
-)
+         (+ (cdr iv) amount)))
+
+
+(define-public (interval-union i1 i2)
+   (cons (min (car i1) (car i2))
+        (max (cdr i1) (cdr i2))))
+
 
 (define-public (write-me message x)
   "Return X.  Display MESSAGE and write X.  Handy for debugging, possibly turned off."
index 0c5510179b4255b700756658461f4419e34a991b..fb604872eda404fdb76160024eb415a84709d11a 100644 (file)
@@ -22,8 +22,7 @@
                                       (stack-lines dir padding baseline (cdr mols))
                                       padding baseline
                                       )
-         )
-  ))
+         )))
 
 (define-public (fontify-text font-metric text)
   "Set TEXT with font FONT-METRIC, returning a molecule."
 (define-public (bracketify-molecule mol axis thick protusion padding)
   "Add brackets around MOL, producing a new molecule."
 
-  (let* (
-        (ext (ly:molecule-get-extent mol axis))
+  (let* ((ext (ly:molecule-get-extent mol axis))
         (lb (ly:bracket axis ext thick (- protusion)))
-        (rb (ly:bracket axis ext thick protusion))
-        )
+        (rb (ly:bracket axis ext thick protusion)))
     (set! mol (ly:molecule-combine-at-edge mol (other-axis  axis) 1 lb padding))
     (set! mol (ly:molecule-combine-at-edge mol (other-axis  axis) -1 rb padding))
     mol
@@ -73,9 +70,9 @@ encloses the contents.
 (define-public (box-molecule mol thick padding)
   "Add a box around MOL, producing a new molecule."
   (let* (
-        (x-ext (widen-interval (ly:molecule-get-extent mol 0) padding))
-        (y-ext (widen-interval (ly:molecule-get-extent mol 1) padding))
-        (x-rule (make-filled-box-molecule (widen-interval x-ext thick)
+        (x-ext (interval-widen (ly:molecule-get-extent mol 0) padding))
+        (y-ext (interval-widen (ly:molecule-get-extent mol 1) padding))
+        (x-rule (make-filled-box-molecule (interval-widen x-ext thick)
                               (cons 0 thick)))
         (y-rule (make-filled-box-molecule (cons 0 thick) y-ext)))
     
index 03b3e1f0cf9b11e6919f2432c8a814d84d895a9c..aa5b5697c16316501eb9b1a53c895ec82ea60cd5 100644 (file)
@@ -73,6 +73,10 @@ for the reader.
   )
 
 (define-public (line-markup grob props . rest)
+  "A horizontal line of markups. Syntax:
+\\line << MARKUPS >>
+"
+  
   (stack-molecule-line
    (cdr (chain-assoc 'word-space props))
    (map (lambda (x) (interpret-markup grob props x)) (car rest)))
@@ -191,8 +195,32 @@ for the reader.
                               grob
                               props
                               (cadr rest))
-                             (car rest) Y)
-  )
+                             (car rest) Y))
+
+(define-public (fraction-markup grob props . rest)
+  "Syntax: \\fraction MARKUP1 MARKUP2."
+
+  (let*
+      ((m1 (interpret-markup grob props (car rest)))
+       (m2 (interpret-markup grob props (cadr rest))))
+
+    (ly:molecule-align-to! m1 X CENTER)
+    (ly:molecule-align-to! m2 X CENTER)
+    
+    (let*
+       ((x1 (ly:molecule-get-extent m1 X))
+        (x2 (ly:molecule-get-extent m2 X))
+        (line (ly:round-filled-box (interval-union x1 x2) '(-0.05 . 0.05) 0.0))
+
+        ;; should stack mols separately, to maintain LINE on baseline
+        (stack (stack-lines -1 0.2 0.6 (list m1 line m2))))
+
+      (ly:molecule-align-to! stack Y CENTER)
+      (ly:molecule-align-to! stack X LEFT)
+      ;; should have EX dimension
+      ;; empirical anyway
+      (ly:molecule-translate-axis stack 0.75 Y) 
+      )))
 
 
 (define-public (note-markup grob props . rest)
@@ -213,10 +241,10 @@ for the reader.
                    0))
        (attachy (* dir 0.28))
        (stemgl (if (> log 0)
-                  (ly:round-filled-box (cons
+                  (ly:round-filled-box
                                     (cons attachx (+ attachx  stemth))
                                     (cons (min stemy attachy)
-                                          (max stemy attachy)))
+                                          (max stemy attachy))
                                    (/ stemth 3)
                                    ) #f))
        (dot (ly:find-glyph-by-name font "dots-dot"))
@@ -544,6 +572,7 @@ for the reader.
    (cons hbracket-markup  (list markup?))
    (cons bracket-markup  (list markup?))
    (cons note-markup (list integer? integer? ly:dir?))
+   (cons fraction-markup (list markup? markup?))
    
    (cons column-markup (list markup-list?))
    (cons dir-column-markup (list markup-list?))
index db24d96eb00697473d6d1afcbbf8c8bc899dda42..03375c89e46f61c6ac770630b8a3163c34b08cd4 100644 (file)
                (if (<= dy 1) "-" "="))
          (func "h-line" dx))))))
 
-(define (roundfilledbox breapth width depth height blot)
+(define (round-filled-box breapth width depth height blot)
   (filledbox breapth width depth height))
 
 (define (draw-line thick x1 y1 x2 y2)
index 13fbfe9bd109708cb8b30088db530c3e3caa31ca..84e45228e4facaafaa6e1669cc1846a7078254c2 100644 (file)
@@ -77,9 +77,9 @@
   (let*
    (
     (mol    (callback grob))
-    (x-ext (widen-interval (ly:molecule-get-extent mol 0) x-padding))
-    (y-ext (widen-interval (ly:molecule-get-extent mol 1) y-padding))
-    (x-rule (make-filled-box-molecule (widen-interval x-ext line-thick)
+    (x-ext (interval-widen (ly:molecule-get-extent mol 0) x-padding))
+    (y-ext (interval-widen (ly:molecule-get-extent mol 1) y-padding))
+    (x-rule (make-filled-box-molecule (interval-widen x-ext line-thick)
                               (cons 0 line-thick)))
     (y-rule (make-filled-box-molecule (cons 0 line-thick) y-ext))
     )
index eaaca5fa5b7adec407bf3fdd2d17dd5c774f0ba7..96153a63ccfd41263efa3cbb2c9940ecd45cd6d0 100644 (file)
                 (ly:number->string (+ depth height))
                 " re f "))
 
-(define (roundfilledbox breadth width depth height blotdiam)
+(define (round-filled-box breadth width depth height blotdiam)
   (let* ((rad (/ blotdiam 2))
         (h (- height rad))
         (d (- depth rad))
                 "f "))
 
 
-(define (roundfilledbox breadth width depth height blot) 
+(define (round-filled-box breadth width depth height blot) 
   (filledbox breadth width depth height))
 
 (define (font-def i s) "")
index f89cda7c9d5814378b58a4322e0d9c5b5c68587a..1a325fc2c49007a913dfa3f6a12efbc165ebab1d 100644 (file)
                 (ly:number->string depth) "}{"
                 (ly:number->string height) "}"))
 
-(define (roundfilledbox x y width height blotdiam)
-  (embedded-pdf (list 'roundfilledbox  x y width height blotdiam)))
+(define (round-filled-box x y width height blotdiam)
+  (embedded-pdf (list 'round-filled-box  x y width height blotdiam)))
 
 (define (text s)
   (string-append "\\hbox{" (output-tex-string s) "}"))
index 22a9c9110718017bacac91b5e9267756f28b2c75..bd5a5df1f21a9466fd82e2f2e3aa586904d4a88b 100644 (file)
    (numbers->string (list wid slope thick))
    " draw_repeat_slash"))
 
-(define (roundfilledbox x y width height blotdiam)
+(define (round-filled-box x y width height blotdiam)
    (string-append
     " "
     (numbers->string
index c5fcd6c985cc42ceaf0c011451c17dcb448cf629..86cf11c949780f7b2324424669503255d216fa00 100644 (file)
@@ -63,7 +63,7 @@
 ; ((eq? keyword 'placebox)
 ;  (dispatch (+ x (cadr expr)) (+ y (caddr expr) (cadddr expr))))
 ; ((eq? keyword 'repeat-slash wid slope thick)
-; ((eq? keyword 'roundfilledbox x y dx dy w h b)
+; ((eq? keyword 'round-filled-box x y dx dy w h b)
 ; ((eq? keyword 'select-font name-mag-pair)
 ; ((eq? keyword 'start-system width height)
 ; ((eq? keyword 'stem x y z w) (filledbox x y z w))
   "")
 
 
-(define (roundfilledbox x y dx dy w h b)
+(define (round-filled-box x y dx dy w h b)
   (sketch-filled-rectangle w 0 0 h x y))
 
 (define (polygon points blotdiameter) "") ;; TODO
index 23afde99a610b4418cc6377c21a65910a1be3275..a14102659708d4e0add46c0198bc168fe0324120 100644 (file)
 ;  (draw-line th x1  0 x2 0))
 
 (define (filledbox breapth width depth height)
-  (roundfilledbox breapth width depth height line-thickness))
+  (round-filled-box breapth width depth height line-thickness))
 
 (define font-cruft
   "fill:black;stroke:none;text-anchor:start;writing-mode:lr;font-weight:normal;")
                        (number->string (- 0 (* output-scale y)))
                        ")"))))
 
-(define (roundfilledbox breapth width depth height blot-diameter)
+(define (round-filled-box breapth width depth height blot-diameter)
   (tagify "rect" ""
          ;;'(style . "fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-opacity:1;stroke-width:1pt;stroke-linejoin:miter;stroke-linecap:butt;")
            `(style . ,(format "fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-opacity:1;stroke-width:~f;stroke-linejoin:miter;stroke-linecap:butt;" line-thickness))
index 38612c8a08376a95954e1d8290dc8cc590daee9d..9d015948c11353e8c9be15b6bb823374c536b058 100644 (file)
                     (ly:number->string depth) "}{"
                     (ly:number->string height) "}")))
 
-(define (roundfilledbox x y width height blotdiam)
-  (embedded-ps (list 'roundfilledbox  x y width height blotdiam)))
+(define (round-filled-box x y width height blotdiam)
+  (embedded-ps (list 'round-filled-box  x y width height blotdiam)))
 
 (define (text s)
   (string-append "\\hbox{" (output-tex-string s) "}"))