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-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.
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;
@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
@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'' {
@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 --
\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
@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
}
@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
+@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
--- /dev/null
+\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 }
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_);
private:
Music *event_;
Item *text_;
-
+ Item *last_text_;
+
Context *get_voice_context ();
};
{
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);
+ }
}
}
text_->set_property ("self-alignment-X", scm_int2num (LEFT));
}
}
-
+
+ last_text_ = text_;
text_ = 0;
}
event_ = 0;
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.")
{
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.")
{
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.")
{
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.")
{
SCM
make_simple_markup (SCM a)
{
- SCM simple = ly_lily_module_constant ("simple-markup");
- return scm_list_2 (simple, a);
+ return a;
}
bool
$$ = $1;
}
| LYRICS_STRING {
- $$ = make_simple_markup ($1);
+ $$ = $1;
}
;
'''))
+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):
(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)))))
(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?
;; 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)))))))
(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))
;; switch-on-debugging
(lambda (x parser) (music-map cue-substitute x))
-
- ))
+ (lambda (x parser)
+ (skip-to-last x parser)
+ )))
;;;;;;;;;;;;;;;;;
;; lyrics
(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
ly:context?
ly:dimension?
ly:dir?
- ly:div-moment
+ ly:moment-div
ly:duration-dot-count
ly:duration-factor
ly:duration-log
ly:make-stencil
ly:moment<?
ly:moment?
- ly:mul-moment
+ ly:moment-mul
ly:music-compress
ly:music-deep-copy
ly:music-duration-compress