]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/test/markup-score.ly: Remove \notes.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 9 May 2004 15:21:10 +0000 (15:21 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 9 May 2004 15:21:10 +0000 (15:21 +0000)
* lily/parser.yy (book_body): Grok Composite_music and \header.
(markup): Push NOTES mode before score_block.

ChangeLog
Documentation/topdocs/NEWS.texi
Documentation/user/tutorial.itely
input/regression/newaddlyrics.ly
input/test/markup-score.ly
lily/include/music.hh
lily/music.cc
lily/parser.yy
lily/score-engraver.cc

index 4667ce63143ef66a4f85ffe8515a0511b972db05..a4c6f54b3659addbc8d4eb784e85eba58f7d7da9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2004-05-09  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * input/test/markup-score.ly: Remove \notes.
+
+       * lily/parser.yy (book_body): Grok Composite_music and \header.
+       (markup): Push NOTES mode before score_block.
+
        * mf/feta-klef.mf: 
        * mf/feta-bolletjes.mf: Oops.  Comment-out canvast test code.
 
index bf83c31e99a7906dfb0d33f30cda8d73c8b7336b..379e6629aae03655a49ca7b816d33caf986b299e 100644 (file)
@@ -23,8 +23,8 @@ here is the new implementation @code{\applymusic},
 @item @code{\apply} has been renamed to @code{\applymusic}.
 
 @item Music can be used as a markup.
-When inserting a @code{score} block as part of a @code{\markup},
-it produces a rendered markup of the music.
+When inserting a @code{\score} block as part of a @code{\markup}, it
+produces a rendered markup of the music.
 
 @example
 @c TODO, see input/test/markup-score.ly
@@ -41,22 +41,23 @@ introduced using a @code{$} character (@code{$$} results in a single
    (ly:export
      #@{ \override Voice.TextScript #'extra-offset = #(cons $dx $dy) #@}))
 
-\score @{
-  \notes @{
-    c'^"normal text"
-    %% the following statement is the same as
-    %% \override Voice.TextScript #'extra-offset = #(cons 2 -3)
-    #(textoffset 2 -3)
-    c'^"text with offset" 
-  @}
+@{
+  c'^"normal text"
+  %% The following embedded scheme call is the same as
+  %% \override Voice.TextScript #'extra-offset = #(cons 2 -3)
+  #(textoffset 2 -3)
+  c'^"text with offset" 
 @}
 @end example
 
-@item Music lists are allowed at toplevel.
+@item A music list at toplevel is interpreted as implicit @code{\score}
+a @code{\score} block at toplevel is interpreted as an implicit
+@code{\book} and @code{\notes} mode is the default lexer mode.  The
+result is that
 
 @example
 \header @{ title = "The Title" @}
-\notes @{ a b c @}
+@{ a b c @}
 @end example
 
 is the same as
@@ -70,11 +71,12 @@ is the same as
 @}    
 @end example
 
-These toplevel forms are handled by
-@code{default-toplevel-music-handler}.  Similarly, a @code{score}
+Actually, a toplevel music list is now handled quite flexibly by
+@code{default-toplevel-music-handler}.  Similarly, a @code{\score}
 block at toplevel is handled by @code{default-toplevel-score-handler}
 and a @code{book} at toplevel is handled by
-@code{default-toplevel-book-handler}.
+@code{default-toplevel-book-handler}.  The default behavior of these
+handlers produces the results described above.
 
 @ignore
 
@@ -113,8 +115,8 @@ Syntactically, @code{\newlyrics} acts like an infix operator.
 @code{ly:parse-file}, so the following fragment processes two files
 
 @verbatim
-  #(ly:parse-file "another.ly")
-  \score { \notes  { c4 }}
+#(ly:parse-file "another.ly")
+\score { \notes { c4 }}
 @end verbatim
 
 @item The @code{font-encoding} property can now be used to select
index c47c79cf9614fb2e31df3cce1d2ae8d231a36982..45c0f78ab0330466c6b39a6470e8109c2276f4bc 100644 (file)
@@ -1258,10 +1258,25 @@ The header for each piece of music can be put inside the @code{\score}
 block.  The @code{piece} name from the header will be printed before
 each movement.
 
-@c FIXME: introduce \BOOK
+@ignore
+
+FIXME: introduce \BOOK
+
+FIXME: Using "Adagio" as a name is confusing, it's more common to be
+a plain tempo indication.
+
+Since today (CVS-1.211) we also allow headers and composite music
+inside book:
 
-@c FIXME: Using "Adagio" as a name is confusing, it's more common to be
-@c a plain tempo indication.
+  \header { ... }
+  \book {
+    \header { ... }
+    { ... }
+    \header { ... }
+    { ... }
+  }
+
+@end ignore
 
 @cindex Engraved by LilyPond
 @cindex signature line
index 9c8d78d4f20ec14f5925c0c6206e88a10278bd13..c38d6bc13d7eada61f188aa373679b9b9fc52def 100644 (file)
@@ -4,8 +4,15 @@
     
 }
 
-%%\new PianoStaff <<
- <<
+%% FIXME:
+%% THIS does not parse:
+%\new PianoStaff <<
+
+%% and THIS: gives incorrect results (all lyrics below pianostaff)
+%\context PianoStaff <<
+
+%% only this works as advertised...
+<<
     \new Staff \relative {
        d'2 d c4 bes a2 \break
        c2 c d4 f g2
@@ -28,8 +35,8 @@
        NOT MUCH CAN GO WRONG!
     }
     \newlyrics {
-       My next Li -- ly verse
-       Not much can go wrong!
+       MY NEXT LI -- LY VERSE
+       NOT MUCH CAN GO WRONG!
     }
 >>
 
index 049862a8d647681007d9421bb45c8149ad9d15e0..7ab00df56ba114f496728ce916c8f2feec303415 100644 (file)
@@ -1,9 +1,13 @@
 \header {
-    %% WIP
 
-    %% this would be more useful as a footnote, but we don't have
-    %% (sensible) header/footer+footnotes yet (2.3.1).
+    %% When vertical dimension and stacking works properly, this
+    %% should be broken up into a few regression tests.
+
+    %% Too bad that '{' is overloaded, we need something (the bit arbitrary
+    %% `\score' now, to introduce to-markup-stencil-rendered music.
+    
     texidoc = "Use \\score block as markup command."
+    
 }
 
 \version "2.3.1"
@@ -77,7 +81,7 @@ noCruftInBed = \paper {
 }
 
 tuning = \markup {
-    \score { \notes { \clef bass  <c, g, d g>1 } \paper{ \inBed }}
+    \score { { \clef bass  <c, g, d g>1 } \paper{ \inBed }}
 }
 
 #(define-public (my-footer paper page-number)
@@ -89,9 +93,9 @@ tempoChange = \markup {
     %% wtf, no horizontal shift?
     "" %%\kern #-10 
     \translate #'(-15 . 0)
-    \score { \notes \times 2/3 { c'8 c' c' } \paper { \noCruftInBed }}
+    \score { \times 2/3 { c'8 c' c' } \paper { \noCruftInBed }}
     " ="
-    \score { \notes { c'8[ c'] } \paper { \noCruftInBed } }
+    \score { { c'8[ c'] } \paper { \noCruftInBed } }
 }
 
 \header {
index 902c151b89dcf64647e00e38d389edd4e84d91e3..5d95c29103e15386a3dcd8211c4fea971c411051 100644 (file)
@@ -6,8 +6,6 @@
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
-
 #ifndef MUSIC_HH
 #define MUSIC_HH
 
@@ -73,5 +71,6 @@ DECLARE_UNSMOB(Music,music);
 
 Music* make_music_by_name (SCM sym);
 SCM ly_deep_mus_copy (SCM);
+SCM ly_music_scorify (SCM);
 
-#endif // MUSIC_HH
+#endif /* MUSIC_HH */
index 21356b6745c894acaa58caddd247d13e42637743..4d882ba98339d42d9b2237309a6bbbb94bd11f4c 100644 (file)
@@ -371,7 +371,6 @@ LY_DEFINE (ly_music_compress, "ly:music-compress",
   return sc->self_scm ();
 }
 
-
 LY_DEFINE (ly_music_scorify, "ly:music-scorify",
           1, 0, 0,
           (SCM music),
@@ -391,4 +390,3 @@ LY_DEFINE (ly_music_scorify, "ly:music-scorify",
   scm_gc_unprotect_object (score->self_scm ());
   return score->self_scm ();
 }
-
index d9b2dd85db8085cab11abc918999d37282e4c990..5d181da880d914d5f867f3cc32225d8ac597834d 100644 (file)
@@ -624,14 +624,28 @@ book_block:
        }
        ;
 
+/* FIXME:
+   * Use 'handlers' like for toplevel-* stuff?
+   * grok \paper and \midi?  */
 book_body:
        {
                $$ = new Book;
                $$->set_spot (THIS->here_input ());
        }
        | book_body score_block {
-               $$->scores_.push ($2);
-               scm_gc_unprotect_object ($2->self_scm ());
+               Score *score = $2;
+               $$->scores_.push (score);
+               scm_gc_unprotect_object (score->self_scm ());
+       }
+       | book_body Composite_music {
+               Music *music = $2;
+               Score *score
+                       = unsmob_score (ly_music_scorify (music->self_scm ()));
+               $$->scores_.push (score);
+               scm_gc_unprotect_object (music->self_scm ());
+       }
+       | lilypond_header {
+               THIS->header_ = $1;
        }
        | book_body error {
        }
@@ -2520,12 +2534,18 @@ markup:
        | STRING_IDENTIFIER {
                $$ = $1;
        }
-       | score_block {
+       | {
+               SCM nn = THIS->lexer_->lookup_identifier ("pitchnames");
+               THIS->lexer_->push_note_state (alist_to_hashq (nn));
+       }
+       /* cont */ score_block {
                /* WIP this is a bit arbitrary,
                   we should also allow \book or Composite_music.
                   However, you'd typically want to change paper
                   settings, and need a \score block anyway.  */
-               Score *score = $1;
+
+               THIS->lexer_->pop_state ();
+               Score *score = $2;
                Book *book = new Book;
                book->scores_.push (score);
 
index 7df239b5844e5005f20b9d756762c3e3c3550906..b8e1e9370d241a1e36fc8dcf7ffa88b8f7b962dc 100644 (file)
@@ -157,6 +157,7 @@ Score_engraver::announce_grob (Grob_info info)
 void
 Score_engraver::typeset_grob (Grob *elem)
 {
+  (void) elem;
   //  elems_.push (elem);
 }