key/clef/time signatures.
* input/test/ossia.ly: revise example.
* lily/span-bar.cc (evaluate_glyph): read 'glyph of self first.
cleanup.
* lily/grob-scheme.cc (LY_DEFINE): change a few function names to
comply to Scheme standard. Remove ly:get-paper-variable
+2004-02-17 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/note-spacing.cc (get_spacing): less space at EOL in case of
+ key/clef/time signatures.
+
+ * input/test/ossia.ly: revise example.
+
+ * lily/span-bar.cc (evaluate_glyph): read 'glyph of self first.
+ cleanup.
+
+ * lily/grob-scheme.cc (LY_DEFINE): change a few function names to
+ comply to Scheme standard. Remove ly:get-paper-variable
+
2004-02-17 Mats Bengtsson <mabe@drongo.s3.kth.se>
* scripts/convert-ly.py (2.1.22): Corrected documentation printout.
>> }
@end lilypond
+The above example shows verbose polyphonic notation. The short
+polyphonic notation, described in @ref{Polyphony}, can also be used if
+the @internalsref{DrumVoices} are instantiated by hand first. For example,
+
+@lilypond[fragment]
+\drums \new DrumStaff <<
+ \context DrumVoice = "1" { s1 *2 }
+ \context DrumVoice = "2" { s1 *2 }
+ {
+ bd4 sn4 bd4 sn4
+ <<
+ { \repeat unfold 16 hh16 }
+ \\
+ { bd4 sn4 bd4 sn4 }
+ >>
+ }
+>>
+@end lilypond
+
+
There are also other layout possibilities. To use these, set the
property @code{drumStyleTable} in context @internalsref{DrumVoice}.
The following variables have been predefined:
@cindex cross staff stem
@cindex stem, cross staff
-
-@c fixme: should have hyperlinks as well.
+The distance between the two staves is normally fixed across the
+entire score. It is possible to tune this per system, but it does
+require arcane command incantations. See
+@inputfileref{input/test,piano-staff-distance.ly}.
+
from the first page too, set @code{remove-first} to false
in @internalsref{RemoveEmptyVerticalGroup}.
+Another application is making ossia sections, i.e. alternative
+melodies on a separate piece of staff, with help of a Frenched
+staff. See @inputfileref{input/test,ossia.ly} for an example.
+
+
@node Different editions from one source
@subsection Different editions from one source
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=1
-PATCH_LEVEL=24
-MY_PATCH_LEVEL=hwn1
+PATCH_LEVEL=25
+MY_PATCH_LEVEL=
#(ly:set-option 'old-relative)
-\version "2.1.23"
+\version "2.1.25"
\header {
composer = "ARTHUR GRAY"
-\version "2.1.23"
+\version "2.1.25"
% #(ly:set-point-and-click 'line-column)
%% We want this to perfectly match the Baerenreiter spacing.
%% If we're not using 6 systems, there's definately a problem.
#(define (assert-system-count smob n)
- (let ((systems (length (ly:get-broken-into
- (ly:get-original
- (ly:get-system smob))))))
+ (let ((systems (length (ly:spanner-broken-into
+ (ly:grob-original
+ (ly:grob-system smob))))))
(if (not (equal? n systems))
(error
;;(warn
-\version "2.1.22"
+\version "2.1.25"
\header {
texidoc="
-\version "2.1.22"
+\version "2.1.25"
\header{
texidoc="
-\version "2.1.22"
+\version "2.1.25"
\header{
texidoc="
-\version "2.1.22"
+\version "2.1.25"
\header {
-\version "2.1.22"
+\version "2.1.25"
\header {
texidoc = "The @code{\applyoutput} expression is the most flexible way to
-\version "2.1.22"
+\version "2.1.25"
\header{
texidoc="
-\version "2.1.22"
+\version "2.1.25"
\header { texidoc=" You can write stencil callbacks in Scheme, thus
providing custom glyphs for notation elements. A simple example is
}
-\version "2.1.22"
+\version "2.1.25"
#(define (notes-to-skip m)
"Convert all stuff with duration (notes, lyrics, bass figures, etc.) to skips.
-\version "2.1.22"
+\version "2.1.25"
\header {
texidoc="Manual hack for nested tuplets, move outer tuplet up."
}
-\version "2.1.22"
+\version "2.1.25"
\header {
-\version "2.1.22"
+\version "2.1.25"
\header {
texidoc= "@cindex make-music Fingering
"
}
-\version "2.1.23"
+\version "2.1.25"
#(define (kill-ambitus grob grob-context apply-context)
(if (memq 'ambitus-interface (ly:get-grob-property grob 'interfaces))
-\version "2.1.22"
+\version "2.1.25"
\header{
texidoc="@cindex Count Systems
" }
#(define (display-systemno smob)
- (let* ((this-system (ly:get-system smob))
- (systems (ly:get-broken-into
- (ly:get-original this-system))))
+ (let* ((this-system (ly:grob-system smob))
+ (systems (ly:spanner-broken-into
+ (ly:grob-original this-system))))
(display smob)
(display (list-index systems this-system))
(newline)))
#(define (display-system-count smob)
(display (length
- (ly:get-broken-into
- (ly:get-original
- (ly:get-system smob))))))
+ (ly:spanner-broken-into
+ (ly:grob-original
+ (ly:grob-system smob))))))
\consists "Chord_tremolo_engraver"
\consists "Percent_repeat_engraver"
\consists "Slash_repeat_engraver"
- \consists "Melisma_engraver"
+ \consists "Melisma_translator"
%{
Must come before text_engraver, but after note_column engraver.
-\version "2.1.22"
+\version "2.1.25"
% possible rename to scheme- or something like that. -gp
\header { texidoc= "@cindex Scheme Manual Accidentals
(not (eq? #f (memq 'accidental-interface
(ly:get-grob-property elt 'interfaces))))
(eq? (ly:get-grob-property
- (ly:get-parent elt 1) 'staff-position) pos))))
+ (ly:grob-parent elt 1) 'staff-position) pos))))
\score {
\context Voice \notes \relative c'' {
-\version "2.1.22"
+\version "2.1.25"
% possible rename to scheme- or something like that. -gp
\header { texidoc = "@cindex Scheme Move Text
You can move objects around with scheme. This example shows how to
-\version "2.1.23"
+\version "2.1.25"
\include "deutsch.ly"
% possible rename to scheme- something. -gp
% TODO: ask if it needs to have so many empty bars in the middle. -gp
-\version "2.1.23"
+\version "2.1.25"
pat = \notes \transpose c c' \repeat unfold 2 {
<< { \context Staff=up {r8 e16 f g e f g } }
-\version "2.1.22"
-% pretty much a duplicate of extra-staff.ly. candidate for merge or delete. -gp
+\header { texidoc = "A temporary ossia in an instrumental part for
+ just a few bars on a separate staff. Here is an example using
+ proper short staffs. A simpler solution is to instantiate a full
+ staff, and let @code{RemoveEmptyStaffContext} take out the unused parts.
-\header { texidoc = "@cindex Ossia
-Ossias present alternatives for a piece. They are not
-really supported, but can be somewhat faked in lily. "
-}
+ Both solutions are demonstrated here.
+" }
+
+\version "2.1.22"
\score {
-\notes\relative c'' { c1 c1 <<
- {\clef "treble" c1 c1 }
- \new Staff { c1 c1 }
+ \notes\relative c''
+ \new StaffGroup \with {
+ \remove "System_start_delimiter_engraver"
+ \override SpanBar #'glyph = #":"
+ } <<
+
+ %% solution 1
+ { c1 c1
+ <<
+ { c1 c1 }
+ \new Staff \with {
+ \remove "Time_signature_engraver"
+ } {
+ c,4^"ossia" es f fis g1
+ }
>>
-}
- \paper {raggedright= ##t}
+ c1 \break c c }
+
+ %% solution 2
+ \new Staff { R1*2 c,4^"ossia" es f fis g1 R1 * 3 }
+ >>
+
+
+ \paper {
+ raggedright= ##t
+ \translator {\RemoveEmptyStaffContext}
+ \translator {
+ \ScoreContext
+ \remove System_start_delimiter_engraver
+ }
+ }
}
}
-\version "2.1.24"
+\version "2.1.25"
#(define ((futz-alignment-callback distance count) grob axis)
"Check if we're the system number COUNT, and if yes, set fixed distance to
DISTANCE; then call the original callback. "
(let*
- ((a (ly:get-parent grob axis))
- (o (ly:get-original a))
+ ((a (ly:grob-parent grob axis))
+ (o (ly:grob-original a))
(bs (if (ly:grob? o)
- (ly:get-broken-into o)
+ (ly:spanner-broken-into o)
#f))
)
-\version "2.1.22"
+\version "2.1.25"
\header{ texidoc="
-\version "2.1.22"
+\version "2.1.25"
% possible rename to scheme-something.
\header { texidoc="@cindex Scheme Reverse Music
Simple customised music apply. "
-\version "1.9.6"
+\version "2.1.25"
\header {
texidoc="@cindex Smart Transpose
(n (ly:pitch-notename p)))
(cond
- ((and (> a 1) (or (eq? n 6) (eq? n 2)))
- (set! a (- a 2)) (set! n (+ n 1)))
- ((and (< a -1) (or (eq? n 0) (eq? n 3)))
- (set! a (+ a 2)) (set! n (- n 1))))
+ ((and (> a 2) (or (eq? n 6) (eq? n 2)))
+ (set! a (- a 2))
+ (set! n (+ n 1)))
+ ((and (< a -2) (or (eq? n 0) (eq? n 3)))
+ (set! a (+ a 2))
+ (set! n (- n 1))))
(cond
- ((eq? a 4) (set! a 0) (set! n (+ n 1)))
+ ((eq? a 4) (set! a 0) (set! n (+ n 1)))
((eq? a -4) (set! a 0) (set! n (- n 1))))
(if (< n 0) (begin (set! o (- o 1)) (set! n (+ n 7))))
-\version "2.1.22"
+\version "2.1.25"
\header { texidoc = "@cindex Spanner after break
#(define (my-callback grob)
(let* (
- (o (ly:get-original grob))
- (b (if (ly:grob? o) (ly:get-broken-into o) '() ))
+ (o (ly:grob-original grob))
+ (b (if (ly:grob? o) (ly:spanner-broken-into o) '() ))
)
;; Call the equivalent of Tie::after_line_breaking
return sc->internal_get_grob_property (sym);
}
-LY_DEFINE (spanner_get_bound, "ly:get-spanner-bound", 2 , 0, 0,
+LY_DEFINE (spanner_get_bound, "ly:spanner-get-bound", 2 , 0, 0,
(SCM slur, SCM dir),
"Get one of the bounds of @var{spanner}. @var{dir} is @code{-1} "
"for left, and @code{1} for right.")
return sl->get_bound (to_dir (dir))->self_scm ();
}
-/* TODO: make difference between scaled and unscalead variable in
- calling (i.e different funcs.) */
-LY_DEFINE (ly_get_paper_var,"ly:get-paper-variable", 2, 0, 0,
- (SCM grob, SCM sym),
- "Get a variable from the \\paper block.")
-{
- Grob * sc = unsmob_grob (grob);
- SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
- SCM_ASSERT_TYPE (gh_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
-
- return sc->get_paper () ->lookup_variable (sym);
-}
-
/* TODO: make difference between scaled and unscalead variable in
calling (i.e different funcs.) */
LY_DEFINE (ly_grob_paper,"ly:grob-paper", 1, 0, 0,
-LY_DEFINE (ly_get_extent, "ly:get-extent", 3, 0, 0,
+LY_DEFINE (ly_get_extent, "ly:grob-extent", 3, 0, 0,
(SCM grob, SCM refp, SCM axis),
"Get the extent in @var{axis} direction of @var{grob} relative to "
"the grob @var{refp}")
return ly_interval2scm ( sc->extent (ref, Axis (gh_scm2int (axis))));
}
-LY_DEFINE (ly_get_parent, "ly:get-parent", 2, 0, 0, (SCM grob, SCM axis),
+LY_DEFINE (ly_get_parent, "ly:grob-parent", 2, 0, 0, (SCM grob, SCM axis),
"Get the parent of @var{grob}. @var{axis} is 0 for the X-axis, "
"1 for the Y-axis.")
{
}
LY_DEFINE (ly_get_system,
- "ly:get-system",
+ "ly:grob-system",
1, 0, 0, (SCM grob),
"Return the System Grob of @var{grob}.")
{
}
LY_DEFINE (ly_get_original,
- "ly:get-original",
+ "ly:grob-original",
1, 0, 0, (SCM grob),
"Return the unbroken original Grob of @var{grob}.")
{
logical for this list? */
LY_DEFINE (get_broken_into,
- "ly:get-broken-into", 1, 0, 0, (SCM spanner),
+ "ly:spanner-broken-into", 1, 0, 0, (SCM spanner),
"Return broken-into list for @var{spanner}.")
{
/// Spanner *me = unsmob_spanner (spanner);
*/
*space = (base_space - increment) + *fixed ;
- if (Item::breakable_b (right_col)
- || right_col->original_)
+ if (!extents[RIGHT].is_empty ()
+ && (Item::breakable_b (right_col)
+ || right_col->original_))
{
/*
This is for the situation
rest | 3/4 (eol)
-
+
+ Since we only take half of the right-object space above, the
+ barline will bump into the notes preceding it, if the right
+ thing is big. We add the rest of the extents here:
*/
- *space += -extents[RIGHT][LEFT];
- *fixed += -extents[RIGHT][LEFT];
+
+ *space += -extents[RIGHT][LEFT] / 2;
+ *fixed += -extents[RIGHT][LEFT] / 2;
}
stem_dir_correction (me, right_col, increment, space, fixed);
void
Span_bar::evaluate_glyph (Grob*me)
{
- SCM elts = me->get_grob_property ("elements");
- SCM glyph_symbol = ly_symbol2scm ("glyph");
- SCM gl = SCM_EOL;
+ SCM gl = me->get_grob_property ("glyph");
- while (gh_pair_p (elts))
+ if (gh_string_p (gl))
+ return ;
+
+ for (SCM s = me->get_grob_property ("elements");
+ !gh_string_p (gl) && gh_pair_p (s); s = gh_cdr (s))
{
- gl = unsmob_grob (gh_car (elts))
- ->internal_get_grob_property (glyph_symbol);
- if (gh_string_p (gl))
- break;
- elts =gh_cdr (elts);
+ gl = unsmob_grob (gh_car (s))
+ ->get_grob_property ("glyph");
}
if (!gh_string_p (gl))
}
gl = scm_makfrom0str (type.to_str0 ());
- if (scm_equal_p (me->internal_get_grob_property (glyph_symbol), gl)
+ if (scm_equal_p (me->get_grob_property ("glyph"), gl)
!= SCM_BOOL_T)
- me->internal_set_grob_property (glyph_symbol, gl);
+ me->set_grob_property ("glyph", gl);
}
Interval
#(define-public midi-debug #f)
-\version "2.1.22"
+\version "2.1.25"
\include "declarations-init.ly"
voicify-list :: [ [Music ] ] -> number -> [Music]
LST is a list music-lists.
+
+ NUMBER is 0-base, i.e. Voice=1 (upstems) has number 0.
"
(if (null? lst) '()
(make-voice-props-set number)
(make-simultaneous-music (car lst))))
- 'Voice (number->string number))
+ 'Voice (number->string (1+ number)))
(voicify-list (cdr lst) (1+ number))
))
)
ch
))
-(define (voicify-music m)
+(define-public (voicify-music m)
"Recursively split chords that are separated with \\ "
(if (not (ly:music? m))
(col (if (= dir 1) (car note-columns) (car (last-pair note-columns))))
(stem (ly:get-grob-property col 'stem)))
(and
- (eq? col (ly:get-spanner-bound slur dir))
+ (eq? col (ly:spanner-get-bound slur dir))
(ly:grob? stem)
(ly:get-grob-property stem 'heads))))
"Make a box of exactly the extents of the grob. The box precisely
encloses the contents.
"
- (let* ((xext (ly:get-extent grob grob 0))
- (yext (ly:get-extent grob grob 1))
+ (let* ((xext (ly:grob-extent grob grob 0))
+ (yext (ly:grob-extent grob grob 1))
(thick 0.1))
(ly:stencil-add (make-filled-box-stencil xext (cons (- (car yext) thick) (car yext) ))
conversions.append (((2,1,24), conv, """music-list? -> ly:music-list?"""))
+def conv (str):
+ str = re.sub (r'ly:get-spanner-bound', 'ly:spanner-get-bound', str)
+ str = re.sub (r'ly:get-extent', 'ly:grob-extent', str)
+ str = re.sub (r'ly:get-system', 'ly:grob-system', str)
+ str = re.sub (r'ly:get-original', 'ly:grob-original', str)
+ str = re.sub (r'ly:get-parent', 'ly:grob-parent', str)
+ str = re.sub (r'ly:get-broken-into', 'ly:spanner-broken-into', str)
+ str = re.sub (r'Melisma_engraver', 'Melisma_translator', str)
+ if re.search ("ly:get-paper-variable", str):
+ sys.stderr.write ('use (ly:paper-lookup (ly:grob-paper ))')
+ raise FatalConversionError()
+ return str
+
+conversions.append (((2,1,25), conv, """Scheme grob function renaming"""))
+
################################
# END OF CONVERSIONS