From a261a3fff527d16310f29cdb283a9222b269a9ff Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 00:56:51 +0000 Subject: [PATCH] lilypond-1.3.134 --- Documentation/user/refman.itely | 120 +++++++++++++++++++++++++++--- NEWS | 2 + lily/include/lily-guile.hh | 1 + lily/line-of-score.cc | 51 +++++++------ ps/lily.ps | 47 ++++++++++++ scm/grob-property-description.scm | 2 + scm/ps.scm | 50 +++++-------- 7 files changed, 208 insertions(+), 65 deletions(-) diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 955435ac63..e4f278c778 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -33,6 +33,7 @@ has been revised for LilyPond 1.3.131 * Music notation:: * Polyphony:: * Spanners:: +* Ornaments:: * Repeats:: * Piano music:: * Lyrics:: @@ -452,8 +453,8 @@ This command sets @code{Staff.keySignature}. @cindex @code{keySignature} -@c . {Clef changes} -@subsubsection Clef changes +@c . {Clef} +@subsection Clef changes @cindex @code{\clef} @example \clef @var{clefname} @code{;} @@ -609,9 +610,6 @@ set different shift values. * Beam:: * Slur :: * Phrasing slur:: -* Ornaments:: -* Grace notes:: -* Bar check:: @end menu @@ -972,16 +970,18 @@ The slur syntax with parentheses is a shorthand for this. @c . {Ornaments} @node Ornaments -@subsection Ornaments +@section Ornaments @cindex Ornaments @menu * Articulation:: * Text scripts:: +* Grace notes:: +* Bar check:: @end menu @c . {Articulation} @node Articulation -@subsubsection Articulation +@subsection Articulation @cindex Articulation @cindex articulations @@ -1030,9 +1030,9 @@ name of the corresponding symbol appearing underneath. @end lilypond -@c . {Text scripts} +@c . {Text scripts} @node Text scripts -@subsubsection Text scripts +@subsection Text scripts @cindex Text scripts In addition, it is possible to place arbitrary strings of text or markup @@ -1046,7 +1046,7 @@ note ornaments appear in the printed output but have no effect on the MIDI rendering of the music. @c . {Fingerings} -@unnumberedsubsubsec Fingerings +@subsubsection Fingerings @cindex Fingerings To save typing, fingering instructions (digits 0 to 9 are @@ -2453,8 +2453,100 @@ multimeasure rest. @node Automatic part combining @subsection Automatic part combining +@cindex automatic part combining +@cindex part combiner -[TODO] +You will already have seen that LilyPond can combine several Threads +into one Voice, and put several Voices onto one Staff. The automatic +part combiner takes this a step further. Two parts of music can be +combined together in an intelligent way, ie, when the two parts are +identical for a period of time, only one can be showed. In places where +the two parts differ, stem directions can be set automatically. That is +why the part combiner is of great use for the typesetting of Hymns and +orchestral scores. + + +@subsubsection Part combine syntax + +The syntax for part combining is + +@example + \partcombine @var{context} @var{musicexpr1} @var{musicexpr2} +@end example + +where the pieces of music @var{musicexpr1} and @var{musicexpr2} will be +combined into one context @var{context}. The names of the music +expressions must start with the prefixes @code{one} and @code{two}. + +@subsubsection Part combine usage + +@cindex @code{Thread_devnull_engraver} +@cindex @code{Voice_engraver} +@cindex @code{A2_engraver} + +The most useful function of the part combiner to combining threads into +one voice, as common for wind parts in orchestral scores: + +@lilypond[verbatim,singleline,fragment] + \context Staff < + \context Voice=one \partcombine Voice + \context Thread=one \notes\relative c'' { + g a b r + } + \context Thread=two \notes\relative c'' { + g r2 f4 + } + > +@end lilypond + +If you have developed a bit of a feel for LilyPond's functioning, you +will notice that what you see above is quite unusual. The first +@code{g} appears only once, although it was specified twice (once in +each Thread). That is the work of the +@code{Thread_devnull_engraver}@footnote{On unix systems, the file +@file{/dev/null} is special device: anything written to it is +discarded.}, that works closely together with the part combiner. When +the part combiner notices that two threads are identical, it tells the +@code{Thread_devnull_engraver} to discard everything in the second +thread. + +Similarly, the markings @emph{@`{a}2}, @emph{Solo} and @emph{Solo II}, +are created by the @code{A2_engraver}. The @code{A2_engraver} also acts +upon instructions of the part combiner. Another thing that the +@code{A2_engraver} does, is forcing of stem, slur and tie directions, +always when both threads are not identical; up for the musicexpr called +@code{one}, down for the musicexpr called @code{two}. + +There is actually a third engraver involved in part combining; the +@code{Voice_devnull_engraver}. This one takes care of removing +redundant spanners such as beams, slurs, ties, crescendi, etc. + +If you just want the splitting of Threads and setting of directions, and +not the textual markings, you may set the property @var{soloADue} to false: + +@lilypond[verbatim,singleline] + \score { + \notes \context Staff < + \context Voice=one \partcombine Voice + \context Thread=one\relative c'' { + b4 a c g + } + \context Thread=two\relative c'' { + d,2 a4 g' + } + > + \paper{ + \translator { + \VoiceContext + soloADue = ##f + } } + } +} +@end lilypond + +There are a number of other properties that you can use to tweak the +behavior of part combining, refer to the automatically generated +documentation of the involved engravers and the examples in the tutorial. @c . {Custodes} @@ -3006,6 +3098,12 @@ Context definitions follow precisely the same syntax as within the \paper block. Translation modules for sound are called performers. The contexts for MIDI output are defined in @file{ly/performer.ly}. +[Volume control] +[Instrument Equaliser] + +FIXME: would it be useful to refer to files like scm/midi.scm, +or to give examples of how to tweak MIDI output volume? + @c . {MIDI instrument names} @node MIDI instrument names diff --git a/NEWS b/NEWS index f307b3f3fd..ca0c0f2de9 100644 --- a/NEWS +++ b/NEWS @@ -45,3 +45,5 @@ internals: LilyPond is smaller, cleaner, more flexible, etc. * AsciiScript: ASCII-art output * Translations into Japanese, French and Russian + +* EZ play notation diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index ebb7e70c3f..d2cf5074ee 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -49,6 +49,7 @@ SCM ly_parse_scm (char const* s, int* n); SCM ly_quote_scm (SCM s); SCM ly_type (SCM); bool type_check_assignment (SCM val, SCM sym, SCM type_symbol) ; +SCM ly_number2string (SCM s); /* display and print newline. diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index 3a1222d833..c662d33599 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -321,28 +321,35 @@ Line_of_score::post_processing (bool last_line) gh_double2scm (height), SCM_UNDEFINED)); - /* - all elements. - */ - for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s)) - { - Grob *sc = unsmob_grob (gh_car (s)); - Molecule *m = sc->get_molecule (); - if (!m) - continue; - - Offset o (sc->relative_coordinate (this, X_AXIS), - sc->relative_coordinate (this, Y_AXIS)); - - SCM e = sc->get_grob_property ("extra-offset"); - if (gh_pair_p (e)) - { - o[X_AXIS] += gh_scm2double (gh_car (e)); - o[Y_AXIS] += gh_scm2double (gh_cdr (e)); - } - - output_molecule (m->get_expr (), o); - } + /* Output elements in three layers, 0, 1, 2. + The default layer is 1. */ + for (int i = 0; i < 3; i++) + for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); + s = gh_cdr (s)) + { + Grob *sc = unsmob_grob (gh_car (s)); + Molecule *m = sc->get_molecule (); + if (!m) + continue; + + SCM s = sc->get_grob_property ("layer"); + int layer = gh_number_p (s) ? gh_scm2int (s) : 1; + if (layer != i) + continue; + + Offset o (sc->relative_coordinate (this, X_AXIS), + sc->relative_coordinate (this, Y_AXIS)); + + SCM e = sc->get_grob_property ("extra-offset"); + if (gh_pair_p (e)) + { + o[X_AXIS] += gh_scm2double (gh_car (e)); + o[Y_AXIS] += gh_scm2double (gh_cdr (e)); + } + + output_molecule (m->get_expr (), o); + } + if (last_line) { output_scheme (gh_list (ly_symbol2scm ("stop-last-line"), SCM_UNDEFINED)); diff --git a/ps/lily.ps b/ps/lily.ps index c94a3706f7..de0f845dd0 100644 --- a/ps/lily.ps +++ b/ps/lily.ps @@ -77,6 +77,53 @@ stroke } bind def +/difficult_draw_ez_ball % ch letter_col ball_col font +{ + % font + findfont 0.7 scalefont setfont + 0.1 setlinewidth + 0 0 moveto + 0 setgray + 0.5 0 0.5 0 360 arc closepath fill stroke + % ball_col + 1 eq { + 0.01 setlinewidth + 1 setgray + 0.5 0 0.4 0 360 arc closepath + fill stroke + } if + % letter_col + setgray + % 0.25 is empiric centering. Change to taste + 0.25 -0.25 moveto + % ch + show +} bind def + +% simple, but does it work everywhere? +/draw_ez_ball % ch letter_col ball_col font +{ + % font + findfont 0.85 scalefont setfont + /origin { 0.45 0 } def + 0 setgray + 1.1 setlinewidth + origin moveto + origin lineto stroke + % ball_col + setgray + 0.9 setlinewidth + origin moveto + origin lineto stroke + % letter_col + setgray + % 0.25 is empiric centering. Change to taste + origin moveto + -0.28 -0.30 rmoveto + % ch + show +} bind def + /draw_volta % h w thick vert_start vert_end { /vert_end exch def diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 0430b0f73e..0c3306f56e 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -179,6 +179,7 @@ FIXME: in Tie this is a pair of grob pointers, pointing to the two heads of the For text, this is `relative'(?) to the current alignment. For barline, space after a thick line.") +(grob-property-description 'layer number? "The output layer [0..2]. The default is 1.") (grob-property-description 'left-padding number? "space left of accs.") (grob-property-description 'length number? "Stem length for unbeamed stems, only for user override.") (grob-property-description 'lengths list? "Stem length given multiplicity of flag.") @@ -208,6 +209,7 @@ Also works as a scaling parameter for the length of hyphen. .") (grob-property-description 'no-spacing-rods boolean? "read from grobs: boolean that makes Separation_item ignore this item (MOVE ME TO ITEM).") (grob-property-description 'no-stem-extend boolean? "should stem not be extended to middle staff line?.") (grob-property-description 'non-default boolean? "not set because of existence of a bar?.") +(grob-property-description 'note-character string? "character to print in a note head.") (grob-property-description 'note-width number? "unit for horizontal translation, measured in staff-space.") (grob-property-description 'number-gap number? "size of the gap for the number in a tuplet.") (grob-property-description 'old-accidentals list? "list of (pitch, accidental) pairs.") diff --git a/scm/ps.scm b/scm/ps.scm index d4442ecb39..d17843731e 100644 --- a/scm/ps.scm +++ b/scm/ps.scm @@ -35,7 +35,7 @@ (ly-warn (string-append "Programming error: No such font known " (car name-mag-pair) " " - (number->string (cdr name-mag-pair)) + (ly-number->string (cdr name-mag-pair)) )) "") ; issue no command @@ -48,7 +48,7 @@ " { /" (car name-mag) " findfont " - "12 " (number->string (cdr name-mag)) " mul " + "12 " (ly-number->string (cdr name-mag)) " mul " "lilypondpaperoutputscale div scalefont setfont } bind def " "\n")) @@ -76,24 +76,24 @@ (define (dashed-slur thick dash l) (string-append (apply string-append (map control->string l)) - (number->string thick) + (ly-number->string thick) " [ " - (number->string dash) + (ly-number->string dash) " " - (number->string (* 10 thick)) ;UGH. 10 ? + (ly-number->string (* 10 thick)) ;UGH. 10 ? " ] 0 draw_dashed_slur")) (define (dashed-line thick on off dx dy) (string-append - (number->string dx) + (ly-number->string dx) " " - (number->string dy) + (ly-number->string dy) " " - (number->string thick) + (ly-number->string thick) " [ " - (number->string on) + (ly-number->string on) " " - (number->string off) + (ly-number->string off) " ] 0 draw_dashed_line")) (define (decrescendo thick w h cont) @@ -149,16 +149,16 @@ (define (invoke-dim1 s d) (string-append - (number->string (* d (/ 72.27 72))) " " s )) + (ly-number->string (* d (/ 72.27 72))) " " s )) (define (placebox x y s) (string-append - (number->string x) " " (number->string y) " {" s "} placebox ")) + (ly-number->string x) " " (ly-number->string y) " {" s "} placebox\n")) (define (bezier-sandwich l thick) (string-append (apply string-append (map control->string l)) - (number->string thick) + (ly-number->string thick) " draw_bezier_sandwich")) (define (start-line height) @@ -191,26 +191,12 @@ lilypondpaperoutputscale lilypondpaperoutputscale scale (define (unknown) "\n unknown\n") -;; note heads with letters. (define (ez-ball ch letter-col ball-col) - (string-append " -/Helvetica-Bold findfont -0.7 scalefont -setfont -0.1 setlinewidth - 0 0 moveto -0 setgray -0.5 0 0.5 0 360 arc -closepath " - (if (equal? ball-col 0) " fill " " stroke ") - (number->string letter-col) - " -setgray -% 0.25 is empiric centering. Change to taste -0.25 -0.25 moveto - (" ch ") show -showpage ") - ) + (string-append + " (" ch ") " + (numbers->string (list letter-col ball-col)) + " /Helvetica-Bold " ;; ugh + " draw_ez_ball")) (define (define-origin a b c ) "") (define (no-origin) "") -- 2.39.5