]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/music-functions.scm (skip-to-last): new function. Show only
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 21 Jul 2005 14:45:55 +0000 (14:45 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 21 Jul 2005 14:45:55 +0000 (14:45 +0000)
last showLastLength part of the \score.

* lily/moment-scheme.cc (LY_DEFINE): new function ly:moment-sub

* python/convertrules.py (conv): add ly:x-moment rule

* lily/moment-scheme.cc (LY_DEFINE): rename ly:X-moment  -> ly:moment-X

* Documentation/topdocs/NEWS.tely (Top): add new feature.

* Documentation/user/instrument-notation.itely (Flexibility in
alignment): options in subsections.

* lily/lyric-engraver.cc (process_music): don't typeset text for _
syllable text. Instead, assume that the previous lyric text is a
melismated text.

* Documentation/index.html.in: revert 800x600 change.

14 files changed:
ChangeLog
Documentation/index.html.in
Documentation/topdocs/NEWS.tely
Documentation/user/basic-notation.itely
Documentation/user/instrument-notation.itely
input/regression/lyric-melisma-manual.ly [new file with mode: 0644]
lily/accidental-engraver.cc
lily/lyric-engraver.cc
lily/moment-scheme.cc
lily/parser.yy
python/convertrules.py
scm/auto-beam.scm
scm/music-functions.scm
scm/safe-lily.scm

index 44198d866bf3cc9e339d36b9712f680ef5699b69..03824edec819b18efae7878809c42410baa2573a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2005-07-21  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/music-functions.scm (skip-to-last): new function. Show only
+       last showLastLength part of the \score.
+
+       * lily/moment-scheme.cc (LY_DEFINE): new function ly:moment-sub
+
+       * python/convertrules.py (conv): add ly:x-moment rule
+
+       * lily/moment-scheme.cc (LY_DEFINE): rename ly:X-moment  -> ly:moment-X
+
+       * Documentation/topdocs/NEWS.tely (Top): add new feature.
+
+       * Documentation/user/instrument-notation.itely (Flexibility in
+       alignment): options in subsections.
+
+       * lily/lyric-engraver.cc (process_music): don't typeset text for _
+       syllable text. Instead, assume that the previous lyric text is a
+       melismated text.
+
+       * Documentation/index.html.in: revert 800x600 change.
+
 2005-07-19  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/main.cc (main): Remove invalid handle kludge.
index a25cdcf9be5dc70a5363e45d6ea17de0cdec7cd8..79da4490689f9dafb16ef3d93f0c373fba941c79 100644 (file)
@@ -7,7 +7,6 @@
           content="Top-level index to the standard documentation for
                    LilyPond @TOPLEVEL_VERSION@">
     <style type="text/css">
-      body { width: 760px; }
     .navigation         { background-color: #e8ffe8;
                          padding: 2; border: #c0ffc0 1px solid;
                          text-align: center;
index 213ae0ff3b0b7cd42fc1266eec72ca386a07bf6e..45d26a476e85680287409777c30db74ec647048b 100644 (file)
@@ -32,6 +32,17 @@ See user manual, \NAME\
 
 
 @itemize @bullet
+@item
+Melismata can be specified simply in the lyrics now, eg.
+
+@lilypond[relative=1,verbatim,fragment]
+\relative {
+  c d( e) f e
+\addlyrics
+ { Ky -- _ _ ri e }
+@end lilypond 
+
+This feature was sponsored by Nancho Alvarez 
 
 @item
 Suggested accidentals (for notating musica ficta) may be switched on
index d5646c2ac8172cef3cf1ecb64983baf55b471b1f..e8e7c5c6641f2ff7d064155e659b3b8bd6841b84 100644 (file)
@@ -752,13 +752,28 @@ pipeSymbol = \bar "||"
 @node Skipping corrected music
 @subsection Skipping corrected music
 
+
 @cindex @code{skipTypesetting}
+@cindex @code{showLastLength}
+
+When entering or copying music, only the music near the end (where you
+are adding notes) is interesting to view and correct.  To speed up
+this correction process, it is possible to skip typesetting of all but
+the last few measures. This is achieved by putting
 
-The property @code{Score.skipTypesetting} can be used to switch on and
-off typesetting completely during the interpretation phase.  When
-typesetting is switched off, the music is processed much more
-quickly.  This can be used to skip over the parts of a score that
-have already been checked for errors
+@verbatim
+showLastLength = R1*5
+@end verbatim
+
+@noindent
+in your source file. This will render only the last 5 measures
+(assuming 4/4 time signature) of every @code{\score} in the input
+file. For longer pieces, rendering only a small part is often an order
+of magnitude quicker than rendering it completely
+
+Skipping parts of a score can be controlled in a more fine-grained
+fashing with the property @code{Score.skipTypesetting}.  When it is
+set, no typesetting is performed at all.
 
 @lilypond[quote,fragment,raggedright,verbatim]
 \relative c'' {
index 5c65a24b00978fb4c5aa7a145f212bc030e8ea67..3c8db87ffb9b103bba5c1236ad9fa2c883a62aab 100644 (file)
@@ -838,15 +838,15 @@ the @code{LyricHyphen} grob.
 
 @lilypond[quote,verbatim,raggedright]
 \score {
-<<
+ <<
   \new Staff \relative c'' {
     \time 1/4 c16 c c c c16 c c c c16 c c c
-  } % closes notes
+  }
   \lyricmode { \new Lyrics
     \with {
-    \override SeparationItem #'padding = #0.0
+      \override SeparationItem #'padding = #0.0
       % Otherwise lyrics are so far apart that hyphens don't disappear
-    } % closes with
+    } 
     {
       An -- ti -- cons -- ti --
       tu -- tion -- nel -- le --
@@ -854,17 +854,17 @@ the @code{LyricHyphen} grob.
       \override LyricHyphen  #'spacing-procedure =
         #Hyphen_spanner::set_spacing_rods
       men -- taire -- ment. ouf~!
-    } % closes lyrics
-  } %closes lyricmode
->>
-\layout   {
+    }
+  }
+ >>
+ \layout   {
   indent = 0.0 \cm
   linewidth = 3.4 \cm
   \context {
     \Staff \remove "Time_signature_engraver"
-  } % closes context
-} % closes layout
-} % closes score
+  }
+ }
+}
 @end lilypond
 
 @seealso
@@ -1033,11 +1033,13 @@ inserted by hand.
 @node Flexibility in alignment
 @subsection Flexibility in alignment
 
-
 Often, different stanzas of one song are put to one melody in slightly
 differing ways.  Such variations can still be captured with
 @code{\lyricsto}.
 
+@subsubsection Lyrics to multiple notes of a melisma 
+
+
 One possibility is that the text has a melisma in one stanza, but
 multiple syllables in another one.  One solution is to make the faster
 voice ignore the melisma.  This is done by setting
@@ -1085,6 +1087,11 @@ For example,
 }
 @end lilypond
 
+
+@subsection Switching the melody associated with a lyrics line
+
+
+
 More complex variations in text underlay are possible.  It is possible
 to switch the melody for a line of lyrics during the text.  This is
 done by setting the @code{associatedVoice} property.  In the example
@@ -1166,6 +1173,31 @@ The underlay is switched back to the starting situation by assigning
 
 
 
+@subsection Specifying melismata within the lyrics
+
+It is also possible to define melismata entirely in the lyrics. This
+can be done by entering @code{_} for every note that is part of the
+melisma. 
+
+@lilypond[relative=1,verbatim,fragment] 
+{ \set melismaBusyProperties = #'()
+  c d( e) f f( e) e e  }
+\addlyrics
+ { Ky -- _ _ ri __ _ _ _  e }
+@end lilypond
+
+In this case, you can also have ties and slurs in the melody, if you
+set @code{melismaBusyProperties}, as is done in the example above.
+
+@lilypond[relative=1,verbatim,fragment]
+{
+ \set melismaBusyProperties = #'()
+  c d( e) f f( e) e e
+}
+\addlyrics
+ { Ky -- _ _ ri __ _ _ _  e }
+@end lilypond
+
 
 @node More stanzas
 @subsection More stanzas
diff --git a/input/regression/lyric-melisma-manual.ly b/input/regression/lyric-melisma-manual.ly
new file mode 100644 (file)
index 0000000..1415ad4
--- /dev/null
@@ -0,0 +1,17 @@
+\header {
+
+  texidoc = "Melisma's may be entered manually by substituting
+  @code{_} for lyrics on notes that are part of the melisma."
+
+}
+
+\version "2.7.2"
+\paper {
+  raggedright = ##t
+}
+
+\relative {
+  \set melismaBusyProperties = #'()
+  c d( e) f f( e) e e  }
+\addlyrics
+ { Ky -- _ _ ri __ _ _ _  e }
index 2b6c3741d389ed14f61429ed24a7eb296ce0fadc..4033b8b2b06b92c5072e83fdfdff06f38f988b84 100644 (file)
@@ -372,7 +372,7 @@ Accidental_engraver::create_accidental (Accidental_entry *entry,
   Pitch *pitch = unsmob_pitch (note->get_property ("pitch"));
   
   
-  bool as_suggestion = get_property ("suggestAccidentals");
+  bool as_suggestion = to_boolean (get_property ("suggestAccidentals"));
   Grob *a = 0;
   if (as_suggestion)
     a = make_suggested_accidental (note, support, entry->origin_engraver_);
index 75c28f91174f47d51a9cb2b53f770dee94844aa3..2575553fe704beed8a6a965052def8626bca3fce 100644 (file)
@@ -32,7 +32,8 @@ public:
 private:
   Music *event_;
   Item *text_;
-
+  Item *last_text_;
+  
   Context *get_voice_context ();
 };
 
@@ -58,8 +59,18 @@ Lyric_engraver::process_music ()
 {
   if (event_)
     {
-      text_ = make_item ("LyricText", event_->self_scm ());
-      text_->set_property ("text", event_->get_property ("text"));
+      SCM text = event_->get_property ("text");
+      
+      if (ly_is_equal (text, scm_makfrom0str (" ")))
+       {
+         if (last_text_)
+           last_text_->set_property ("self-alignment-X", scm_int2num (LEFT));
+       }
+      else
+       {
+         text_ = make_item ("LyricText", event_->self_scm ());
+         text_->set_property ("text", text);
+       }
     }
 }
 
@@ -138,7 +149,8 @@ Lyric_engraver::stop_translation_timestep ()
                text_->set_property ("self-alignment-X", scm_int2num (LEFT));
            }
        }
-
+         
+      last_text_ = text_;
       text_ = 0;
     }
   event_ = 0;
index 831ace9215512d7e7f163698dc3cae3c0b95ee6d..cdedb19829f0ea82b02b42848f9494423f75aff2 100644 (file)
@@ -42,7 +42,19 @@ LY_DEFINE (ly_make_moment, "ly:make-moment",
                 Rational (grace_num, grace_den)).smobbed_copy ();
 }
 
-LY_DEFINE (ly_add_moment, "ly:add-moment",
+
+LY_DEFINE (ly_sub_moment, "ly:moment-sub",
+          2, 0, 0, (SCM a, SCM b),
+          "Subtract two moments.")
+{
+  Moment *ma = unsmob_moment (a);
+  Moment *mb = unsmob_moment (b);
+  SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
+  SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
+  return (*ma - *mb).smobbed_copy ();
+}
+
+LY_DEFINE (ly_moment_add, "ly:moment-add",
           2, 0, 0, (SCM a, SCM b),
           "Add two moments.")
 {
@@ -53,7 +65,7 @@ LY_DEFINE (ly_add_moment, "ly:add-moment",
   return (*ma + *mb).smobbed_copy ();
 }
 
-LY_DEFINE (ly_mul_moment, "ly:mul-moment",
+LY_DEFINE (ly_moment_mul, "ly:moment-mul",
           2, 0, 0, (SCM a, SCM b),
           "Multiply two moments.")
 {
@@ -64,7 +76,7 @@ LY_DEFINE (ly_mul_moment, "ly:mul-moment",
   return (*ma * * mb).smobbed_copy ();
 }
 
-LY_DEFINE (ly_div_moment, "ly:div-moment",
+LY_DEFINE (ly_moment_div, "ly:moment-div",
           2, 0, 0, (SCM a, SCM b),
           "Divide two moments.")
 {
@@ -75,7 +87,7 @@ LY_DEFINE (ly_div_moment, "ly:div-moment",
   return (*ma / * mb).smobbed_copy ();
 }
 
-LY_DEFINE (ly_mod_moment, "ly:mod-moment",
+LY_DEFINE (ly_moment_mod, "ly:moment-mod",
           2, 0, 0, (SCM a, SCM b),
           "Modulo of two moments.")
 {
index 1f2c0d863a1a0609041f280cf555eb209679e2d2..b83df69529939b0ca1b37ad86ba963e7cba86f20 100644 (file)
@@ -129,8 +129,7 @@ get_first_context_id (SCM type, Music *m)
 SCM
 make_simple_markup (SCM a)
 {
-       SCM simple = ly_lily_module_constant ("simple-markup");
-       return scm_list_2 (simple, a);
+       return a;
 }
 
 bool
@@ -2350,7 +2349,7 @@ lyric_element:
                $$ = $1;
        }
        | LYRICS_STRING {
-               $$ = make_simple_markup ($1);
+               $$ = $1;
        }
        ;
 
index 876b1a53545dd16eff79dcf2163246520ec2191b..746559d26ad1ce46fda9fe3dc9efaa0cbaf903d8 100644 (file)
@@ -2526,6 +2526,15 @@ Timing_engraver -> Timing_translator + Default_bar_line_engraver
 '''))
 
 
+def conv (str):
+       str = re.sub('ly:(add|mul|mod|div)-moment', r'ly:moment-\1', str)
+       return str
+
+conversions.append (((2, 7, 2), conv,
+                    '''ly:X-moment -> ly:moment-X'''))
+
+
+
 ################################################################
 
 def str_to_tuple (s):
index eed74f9c3ef507fcc2269564e5b6355bcbf25359..d11fb318c3dd56192062c3b72ec05a59101cce8b 100644 (file)
@@ -199,7 +199,7 @@ a fresh copy of the list-head is made."
             (measure-pos (get 'measurePosition (ly:make-moment 0 1)))
             (settings (get 'autoBeamSettings '()))
             (function (list (if (= dir START) 'begin 'end)))
-            (num-mom (ly:div-moment measure-length beat-length))
+            (num-mom (ly:moment-div measure-length beat-length))
             (num (inexact->exact
                   (round (/ (ly:moment-main-numerator num-mom)
                             (ly:moment-main-denominator num-mom)))))
@@ -209,7 +209,7 @@ a fresh copy of the list-head is made."
                         (ly:moment-main-denominator test)))
             (pos (if (>= (ly:moment-main-numerator measure-pos) 0)
                      measure-pos
-                     (ly:add-moment measure-length measure-pos)))
+                     (ly:moment-add measure-length measure-pos)))
             (lst (list
                   ;; Hmm, should junk user-override feature,
                   ;; or split this in user-override and config section?
@@ -231,4 +231,4 @@ a fresh copy of the list-head is made."
                ;; end at any beat
                (and (not (first-assoc lst settings))
                     (= (ly:moment-main-denominator
-                        (ly:div-moment pos beat-length)) 1)))))))
+                        (ly:moment-div pos beat-length)) 1)))))))
index 84ac716f197fbd9c477acfa384c6a68883b96774..2fe0bc373a8bee6feac641d30e68aa369c9c9315 100644 (file)
@@ -732,6 +732,39 @@ Syntax:
        (ly:music-length music))
   music)
 
+(define (skip-to-last music parser)
+
+  "Replace MUSIC by
+
+<< { \\set skipTypesetting = ##t
+     LENGTHOF(\\showLastLength)
+     \\set skipTypesetting = ##t  }
+    MUSIC >>
+
+if appropriate.
+ "
+  (let*
+      ((show-last  (ly:parser-lookup parser 'showLastLength)))
+    
+    (if (ly:music? show-last)
+       (let*
+           ((orig-length (ly:music-length music))
+            (skip-length (ly:moment-sub orig-length (ly:music-length show-last))))
+
+         (make-simultaneous-music
+          (list
+           (make-sequential-music
+            (list
+             (context-spec-music (make-property-set 'skipTypesetting #t) 'Score)
+             (make-music 'SkipMusic 'duration
+                         (ly:make-duration 0 0
+                                           (ly:moment-main-numerator skip-length)
+                                           (ly:moment-main-denominator skip-length)))
+             (context-spec-music (make-property-set 'skipTypesetting #f) 'Score)))
+           music)))
+       music)))
+    
+
 (define-public toplevel-music-functions
   (list
    (lambda (music parser) (voicify-music music))
@@ -745,8 +778,9 @@ Syntax:
    ;; switch-on-debugging
    (lambda (x parser) (music-map cue-substitute x))
  
-
-   ))
+   (lambda (x parser)
+     (skip-to-last x parser)
+   )))
 
 ;;;;;;;;;;;;;;;;;
 ;; lyrics
index 9e43ef1ab8ba231eba7e8a5bc4d16b6dfb78cc2f..e9310f6aed0fdef4236fdd70bcc5a8ffdcaa6787 100644 (file)
@@ -9,7 +9,7 @@
    (set! safe-objects (cons (cons sym (primitive-eval sym))
                             safe-objects)))
  '(ly:add-interface
-   ly:add-moment
+   ly:moment-add
    ly:all-grob-interfaces
    ly:all-output-backend-commands
    ly:all-stencil-expressions
@@ -26,7 +26,7 @@
    ly:context?
    ly:dimension?
    ly:dir?
-   ly:div-moment
+   ly:moment-div
    ly:duration-dot-count
    ly:duration-factor
    ly:duration-log
@@ -75,7 +75,7 @@
    ly:make-stencil
    ly:moment<?
    ly:moment?
-   ly:mul-moment
+   ly:moment-mul
    ly:music-compress
    ly:music-deep-copy
    ly:music-duration-compress