From: Han-Wen Nienhuys Date: Fri, 13 Feb 2004 00:32:24 +0000 (+0000) Subject: ($(outdir)/%.pdf): add DVIPS_FLAGS. This will X-Git-Tag: release/2.1.23~20 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=402045837e7134cdf90d1fcf31768c62227a4936;p=lilypond.git ($(outdir)/%.pdf): add DVIPS_FLAGS. This will create scalable PS and PDFs for input/{test,template,regression}. * lily/context.cc (is_alias): move function. (is_alias): add Bottom as context alias. (find_create_translator): add Bottom as a context alias for creation. * lily/stencil.cc: rename Molecule to Stencil. Changes throughout. * lily/parser.yy (music_property_def): new syntax for property assignments: \set A.B = #C , \unset A.B \override A.B #C = #D, \revert A.B #C * lily/my-lily-lexer.cc: remove \property --- diff --git a/ChangeLog b/ChangeLog index 1db881a0cf..1663e1b656 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2004-02-13 Han-Wen Nienhuys + + * make/ly-rules.make ($(outdir)/%.pdf): add DVIPS_FLAGS. This will + create scalable PS and PDFs for input/{test,template,regression}. + +2004-02-13 Han-Wen Nienhuys + + * lily/context.cc (is_alias): move function. + (is_alias): add Bottom as context alias. + (find_create_translator): add Bottom as a context alias for creation. + + * lily/stencil.cc: rename Molecule to Stencil. Changes throughout. + + * lily/parser.yy (music_property_def): new syntax for property + assignments: + + \set A.B = #C , \unset A.B + \override A.B #C = #D, \revert A.B #C + + * lily/my-lily-lexer.cc: remove \property + 2004-02-13 Heikki Junes * Documentation/user/refman.itely: add dots after seealso refs. @@ -6,6 +27,10 @@ * Documentation/user/music-glossary.itely: add Finnish author. +2004-02-12 Han-Wen Nienhuys + + * VERSION (PACKAGE_NAME): release 2.1.21 + 2004-02-12 Jan Nieuwenhuizen * Documentation/topdocs/NEWS.texi: Substitute Lyrics/LyricsVoice. diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index 303a9fd1dc..81db48e955 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -18,6 +18,36 @@ Version 2.1.13 @itemize @bullet +@item The syntax for setting properties has been simplified: +the following table lists the differences: + +@example +\property A.B = #C \set A.B = #C +\property A.B \unset \unset A.B +\property A.B \set #C = #D \override A.B #C = #D +\property A.B \override #C = #D (removed) +\property A.B \revert #C \revert A.B #C +@end example + +Furthermore, if @code{A} is left out, the bottommost context is used +by default. In other words, it is no longer necessary to explicitly +mention @code{Voice}, @code{Lyrics} or @code{ChordNames}. + +Old: + +@example + \property Voice.autoBeaming = ##f + \property Staff.TimeSignature \set #'style = #'C +@end example + +New: + +@example + \set autoBeaming = ##f + \override Staff.TimeSignature #'style = #'C +@end example + + @item Tweaks made with @code{\override} and @code{\revert} no longer hide tweaks at higher context levels. diff --git a/Documentation/user/appendices.itely b/Documentation/user/appendices.itely index 429c634401..902f5e7ba8 100644 --- a/Documentation/user/appendices.itely +++ b/Documentation/user/appendices.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @node Reference manual details @appendix Reference manual details diff --git a/Documentation/user/cheatsheet.itely b/Documentation/user/cheatsheet.itely index 3946457dc8..a5dbf28612 100644 --- a/Documentation/user/cheatsheet.itely +++ b/Documentation/user/cheatsheet.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @c -*-texinfo-*- @node Cheat sheet @@ -14,8 +15,8 @@ @tab durations @tab @lilypond[relative=1,notime] -\property Staff.autoBeaming = ##f -\property Staff.Clef = \turnOff +\set Staff.autoBeaming = ##f +\set Staff.Clef = \turnOff c1 c2 c8 c16 @end lilypond @@ -23,7 +24,7 @@ c1 c2 c8 c16 @tab augmentation dots @tab @lilypond[relative=1,notime] -\property Staff.Clef = \turnOff +\set Staff.Clef = \turnOff c4. c4.. @end lilypond @@ -55,7 +56,7 @@ s4_" " @tab time signature @tab @lilypond -\property Staff.Clef \set #'transparent = ##t +\override Staff.Clef #'transparent = ##t \time 3/4 s4_" " \time 4/4 @@ -67,7 +68,7 @@ s16_" " @tab rest @tab @lilypond[relative=1,notime] -\property Staff.Clef = \turnOff +\set Staff.Clef = \turnOff r4 r8 @end lilypond @@ -75,8 +76,8 @@ r4 r8 @tab tie @tab @lilypond[relative=1,notime] -\property Score.timing = ##f -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.autoBeaming = ##f d ~ d @end lilypond @@ -93,8 +94,8 @@ s4 @tab raise octave @tab @lilypond[relative=1,notime] -\property Score.timing = ##f -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.autoBeaming = ##f a a' @end lilypond @@ -102,8 +103,8 @@ a a' @tab lower octave @tab @lilypond[relative=1,notime] -\property Score.timing = ##f -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.autoBeaming = ##f c c, @end lilypond @@ -112,9 +113,9 @@ c c, @tab slur @tab @lilypond[fragment,relative=1] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff +\set Staff.autoBeaming = ##f c( d e) @end lilypond @@ -123,9 +124,9 @@ c( d e) @tab phrasing slur @tab @lilypond[fragment,relative=1] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff +\set Staff.autoBeaming = ##f c\( c( d) e\) @end lilypond @@ -134,9 +135,9 @@ c\( c( d) e\) @tab beam @tab @lilypond[fragment,relative=1] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff +\set Staff.autoBeaming = ##f a8-[ b-] @end lilypond @@ -154,7 +155,7 @@ a8-[ b-] @tab articulations @tab @lilypond[fragment,relative=1] -\property Staff.TimeSignature = \turnOff +\set Staff.TimeSignature = \turnOff c-> c-. @end lilypond @@ -163,7 +164,7 @@ c-> c-. @tab dynamics @tab @lilypond[fragment,relative=1] -\property Staff.TimeSignature = \turnOff +\set Staff.TimeSignature = \turnOff c\mf c\sfz @end lilypond @@ -172,9 +173,9 @@ c\mf c\sfz @tab crescendo @tab @lilypond[fragment,relative=1] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff +\set Staff.autoBeaming = ##f a\< a \!a @end lilypond @@ -182,9 +183,9 @@ a\< a \!a @tab decrescendo @tab @lilypond[fragment,relative=1] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff +\set Staff.autoBeaming = ##f a\> a a\! @end lilypond diff --git a/Documentation/user/converters.itely b/Documentation/user/converters.itely index d0d70609ef..939a7d8c91 100644 --- a/Documentation/user/converters.itely +++ b/Documentation/user/converters.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @c -*-texinfo-*- @node Converting from other formats @@ -195,7 +196,7 @@ There is a rudimentary facility for adding LilyPond code to the ABC source file. If you say: @example - %%LY voices \property Voice.autoBeaming=##f + %%LY voices \set autoBeaming = ##f @end example This will cause the text following the keyword ``voices'' to be inserted diff --git a/Documentation/user/dedication.itely b/Documentation/user/dedication.itely index 53779bb9a8..29534ae332 100644 --- a/Documentation/user/dedication.itely +++ b/Documentation/user/dedication.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @quotation We would like to dedicate this program to all the friends that we diff --git a/Documentation/user/internals.itely b/Documentation/user/internals.itely index cf5f347b08..235b3c3737 100644 --- a/Documentation/user/internals.itely +++ b/Documentation/user/internals.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @c -*-texinfo-*- @c Note: @c @@ -72,7 +73,7 @@ regularly. For example, beaming behavior is tuned with These use mixed-caps naming: @code{autoBeamSettings}, @code{ignoreMelismata}. They are assigned as follows: @example - \property Lyrics.ignoreMelismata = ... + \set ignoreMelismata = ... @end example @item Layout properties @@ -85,7 +86,7 @@ These properties use Scheme-style naming: @code{c0-position}, @code{break-align-symbol}. They most often assigned as follows: @example - \property Score.RehearsalMark \set #'break-align-symbol = ... + \override Score.RehearsalMark #'break-align-symbol = ... @end example @noindent @@ -244,7 +245,7 @@ file using the following expression: @cindex properties, context @example -\property @var{contextname}.@var{propname} = @var{value} +\set @var{contextname}.@var{propname} = @var{value} @end example @noindent @@ -267,7 +268,7 @@ but you can force another context with the @code{\property}-command. Hence the expressions @example -\property @var{contextname}.@var{propname} = @var{value} +\set @var{contextname}.@var{propname} = @var{value} @end example @noindent @@ -275,7 +276,7 @@ and @example \context @var{contextname} -\property Current.@var{propname} = @var{value} +\set Current.@var{propname} = @var{value} @end example @noindent @@ -285,7 +286,7 @@ without restriction to a specific context. Properties can be unset using the following statement. @example -\property @var{contextname}.@var{propname} \unset +\unset @var{contextname}.@var{propname} @end example @cindex properties, unsetting @@ -298,9 +299,6 @@ from a higher context), then this has no effect. @refbugs -The syntax of @code{\unset} is asymmetric: @code{\property \unset} is not -the inverse of @code{\property \set}. - The context @code{Current} is confusing. @@ -488,7 +486,7 @@ The complete list of context modifiers is the following: @itemize @bullet @item @code{\alias} @var{alternate-name}: This specifies a different name. In the above example, -@code{\property Staff.X = Y} will also work on @code{SimpleStaff}s. +@code{\set Staff.X = Y} will also work on @code{SimpleStaff}s. @item @code{\consistsend} @var{engravername}: Analogous to @code{\consists}, but makes sure that @@ -557,7 +555,7 @@ evaluated as Scheme. For example, the boolean value @var{true} is @code{#t} in Scheme, so for LilyPond @var{true} looks like @code{##t}, and can be used in property assignments: @example - \property Staff.autoBeaming = ##f + \set Staff.autoBeaming = ##f @end example @@ -661,7 +659,7 @@ During a run, transient objects are also created and destroyed. @item Scheme_hash_table @item Music_iterator -@item Molecule: Device-independent page output object, +@item Stencil: Device-independent page output object, including dimensions. @item Syllable_group diff --git a/Documentation/user/introduction.itely b/Documentation/user/introduction.itely index f86fed7764..53ddde1bdc 100644 --- a/Documentation/user/introduction.itely +++ b/Documentation/user/introduction.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @c -*-texinfo-*- @@ -311,14 +312,14 @@ and with some corrections. Can you spot which fragment is which? @cindex optical spacing @lilypond[noindent] \score { \notes { - \property Staff.NoteSpacing \set #'stem-spacing-correction + \override Staff.NoteSpacing #'stem-spacing-correction = #0.6 c'4 e''4 e'4 b'4 | \stemDown b'4 e''4 a'4 e''4| \stemBoth \bar "||" - \property Staff.NoteSpacing \override #'stem-spacing-correction + \override Staff.NoteSpacing #'stem-spacing-correction = #0.0 - \property Staff.StaffSpacing \override #'stem-spacing-correction + \override Staff.StaffSpacing #'stem-spacing-correction = #0.0 c'4 e''4 e'4 b'4 | \stemDown b'4 e''4 a'4 e''4| @@ -393,7 +394,7 @@ high note and the `f', as shown in this example: @lilypond \score { \notes \relative c'' { \stemUp - \once\property Voice. DynamicLineSpanner \override #'padding = #4.0 + \once\override DynamicLineSpanner #'padding = #4.0 a4_\f f,8 } \paper { raggedright = ##t } @@ -402,7 +403,7 @@ high note and the `f', as shown in this example: This was achieved with the following input statement: @example - \once \property Voice. DynamicLineSpanner \override #'padding = #4.0 + \once \override DynamicLineSpanner #'padding = #4.0 @end example It increases the amount of space (@code{padding}) between the note and the dynamic symbol to 4.0 (which is measured in staff space, so 4.0 @@ -423,13 +424,13 @@ require them to be twice the thickness of the staff lines. The same mechanism can be used to adjust a setting globally. By issuing the following command, the entire piece is now formatted with thicker stems: @example - \property Score.Stem \override #'thickness = #3.0 + \override Score.Stem #'thickness = #3.0 @end example @lilypond \score { \notes \relative c'' { - \property Score.Stem \override #'thickness = #3.0 - \once\property Voice. DynamicLineSpanner \override #'padding = #4.0 + \override Score.Stem #'thickness = #3.0 + \once\override DynamicLineSpanner #'padding = #4.0 \stemUp a4_\f f,8 } @@ -449,7 +450,7 @@ example above is calculated by the function @code{Side_position_interface::aligned_side}. If we want to replace this function by a more advanced one, we could issue @example - \property Voice.DynamicLineSpanner \override #'Y-offset-callbacks + \override DynamicLineSpanner #'Y-offset-callbacks = #(list gee-whiz-gadget) @end example diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index e0ad3a271e..9b34ad23aa 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @c -*-texinfo-*- @ignore diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index cba83e5918..b6821bda02 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -1,3 +1,4 @@ +\version "2.1.22" \input texinfo @c -*-texinfo-*- @setfilename lilypond.info @settitle GNU LilyPond @@ -94,7 +95,7 @@ Copyright @copyright{} 1999--2004 by the authors @lilypond[raggedright] \score { \context Lyrics \notes { - \property Score.RehearsalMark \set #'self-alignment-X = #LEFT + \override Score.RehearsalMark #'self-alignment-X = #LEFT \mark #(ly:export (string-append "(For LilyPond version " (lilypond-version) ")")) s2 diff --git a/Documentation/user/literature.itely b/Documentation/user/literature.itely index 74450e59a5..8d72521d22 100644 --- a/Documentation/user/literature.itely +++ b/Documentation/user/literature.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @node Literature list @chapter Literature list diff --git a/Documentation/user/music-glossary.tely b/Documentation/user/music-glossary.tely index 3c87375485..12d93573cc 100644 --- a/Documentation/user/music-glossary.tely +++ b/Documentation/user/music-glossary.tely @@ -1,3 +1,4 @@ +\version "2.1.22" \input texinfo @c -*-texinfo-*- @settitle Music Glossary @setfilename music-glosssary.info @@ -213,14 +214,14 @@ flat lowers it by a whole tone. A natural cancels the effect of a previous accidental. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Voice.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override TextScript #'font-style = #'large \addlyrics \context Staff \notes\relative c'' { gis1 s s gisis s s ges s s geses s s g! } \context Lyrics \lyrics { - \property Lyrics . LyricText \set #'self-alignment-X = #-1 + \override Lyrics .LyricText #'self-alignment-X = #-1 "sharp " "db. sharp " "flat " "db. flat " natural } @end lilypond @@ -323,7 +324,7 @@ FI: luonnollinen molliasteikko, N: ?. @lilypond[notime] -\property Score.automaticBars = ##f +\set Score.automaticBars = ##f \notes\relative c'' { a1 b c d e f g a } @end lilypond @@ -363,16 +364,16 @@ the duration of the long a. is proportional to that of the main note. \key d \major \time 4/4 -%\property Score.TextScript \set #'font-style = #'large +%\override Score.TextScript #'font-style = #'large 4_"notation" r -{ \property Voice.Stem \override #'flag-style = #'() +{ \override Stem #'flag-style = #'() \grace g16 - \property Voice.Stem \revert #'flag-style + \revert Stem #'flag-style } fis8 e16 fis -{ \property Voice.Stem \override #'flag-style = #'() +{ \override Stem #'flag-style = #'() \grace a16 - \property Voice.Stem \revert #'flag-style + \revert Stem #'flag-style } g8 fis16 g | \cadenzaOn a4 \bar "||" \cadenzaOff } @@ -387,7 +388,7 @@ An appoggiatura may have more notes preceding the main note. \notes\relative c'' { \key as \major \time 2/4 -% \property Score.TextScript \set #'font-style = #'large +% \override Score.TextScript #'font-style = #'large \grace { bes16 } as8_"notation" as16 bes as8 g | \grace { as16[( bes] } < c as >4-) \grace { as16[( bes] } < c as >4-) \bar "||" @@ -572,8 +573,8 @@ Line connecting a series of notes (shorter than a quarter note). The number of beams determine the note value of the connected notes. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Voice.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override TextScript #'font-style = #'large \notes\relative c'' { g8_"1/8"[ g g g] s16 g16_"1/16"[ g g g] s16 @@ -630,7 +631,7 @@ orchestral or choral score. @lilypond \context StaffGroup << -% \property StaffGroup.minVerticalAlign = #12 +% \set StaffGroup.minVerticalAlign = #12 \notes\relative c'' \context Staff = SA { \clef treble g4 e c2 } \notes\relative c \context Staff = SB { \clef bass c1 \bar "|." } >> @end lilypond @@ -677,7 +678,7 @@ N: ?. in pre-1650 music. @lilypond[notime] -\property Score.automaticBars = ##f +\set Score.automaticBars = ##f \notes\relative c'' { g\breve } @end lilypond @@ -707,9 +708,9 @@ Clef symbol indicating the position of the central C. Used on all note lines. @lilypond[notime] -\property Score.automaticBars = ##f -\property Score.Clef \override #'full-size-change = ##t -%\property Score.LyricText \set #'font-style = #'large +\set Score.automaticBars = ##f +\override Score.Clef #'full-size-change = ##t +%\override Score.LyricText #'font-style = #'large \addlyrics \context Staff \notes\relative c' { \clef soprano c1 s s @@ -719,7 +720,7 @@ lines. \clef baritone c s s } \context Lyrics \lyrics { - \property Lyrics . LyricText \override #'self-alignment-X = #-1 + \override Lyrics .LyricText #'self-alignment-X = #-1 "Soprano " "Mezzosoprano " "Alto " "Tenor " Baritone } @end lilypond @@ -806,8 +807,8 @@ third above the lower notes to define their quality as major or minor. Such chords are denoted open chords @lilypond[notime] -\property Score.automaticBars = ##f -%\property Voice.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override TextScript #'font-style = #'large \addlyrics \context Staff \notes\relative c'' { 1 s s @@ -818,7 +819,7 @@ chords are denoted open chords s s } \context Lyrics \lyrics{ - \property Lyrics . LyricText \set #'self-alignment-X = #-1 + \override Lyrics .LyricText #'self-alignment-X = #-1 "major " "minor " "diminished " "augmented " "seventh-chord " "ninth-chord " } @@ -838,7 +839,7 @@ N: ?. A scale consisting of all 11 @aref{semitone}s. @lilypond[notime] -\property Score.automaticBars = ##f +\set Score.automaticBars = ##f \notes\relative c' { c1 cis d dis e f fis g gis a ais b c } @end lilypond @@ -989,7 +990,7 @@ music of the baroque era, has been one of the most popular polyphonic composition methods. @lilypond[staffsize=11,noquote] -\property Score.TimeSignature \override #'style =\turnOff +\override Score.TimeSignature #'style =\turnOff \notes\context PianoStaff << \context Staff = SA \relative c' { \key bes \major @@ -1094,11 +1095,11 @@ of the 20th century @lilypond \score { \notes { - \property Staff.Custos \set #'neutral-position = #4 - \property Staff.Custos \set #'neutral-direction = #-1 - \property Staff.Custos \set #'adjust-if-on-staffline = ##t + \override Staff.Custos #'neutral-position = #4 + \override Staff.Custos #'neutral-direction = #-1 + \override Staff.Custos #'adjust-if-on-staffline = ##t - \property Staff.Custos \set #'style = #'hufnagel + \override Staff.Custos #'style = #'hufnagel c'1 \break < d' a' f''>1 } @@ -1152,8 +1153,8 @@ Abbreviated ``d.s.''. Repetition, not from the beginning, but from another place frequently near the beginning marked by a sign: @lilypond -%\property Voice.TextScript \set #'font-style = #'large -\property Voice.TextScript \set #'font-shape = #'italic +%\override TextScript #'font-style = #'large +\override TextScript #'font-shape = #'italic \key g \major \time 4/4 \notes\relative c'' { d1 | g,4^\segno a b c | b a g2_"d.s." \bar "|." } @end lilypond @@ -1210,13 +1211,13 @@ The church modes are used in gregorial chant and pre baroque early music but also to some extent in newer jazz music. @lilypond[notime,linewidth=110\mm] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \context Staff \notes\relative c' { c1 d - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 e^"~~ S" f g a b^"~~ S" c } \context Lyrics \lyrics { @@ -1225,13 +1226,13 @@ also to some extent in newer jazz music. @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \context Staff \notes\relative c' { d1 - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 e^"~~ S" f g a b^"~~ S" c d } \context Lyrics \lyrics { @@ -1240,12 +1241,12 @@ also to some extent in newer jazz music. @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \notes\relative c' { - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 e1^"~~ S" f g a b^"~~ S" c d e } \context Lyrics \lyrics { @@ -1254,13 +1255,13 @@ also to some extent in newer jazz music. @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \notes\relative c' { f1 g a - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 b^"~~ S" c d e^"~~ S" f } \context Lyrics \lyrics { @@ -1269,13 +1270,13 @@ also to some extent in newer jazz music. @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \notes\relative c'' { g1 a - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 b^"~~ S" c d e^"~~ S" f g } \context Lyrics \lyrics { Mixolydian @@ -1283,13 +1284,13 @@ also to some extent in newer jazz music. @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \notes\relative c'' { a1 - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 b^"~~ S" c d e^"~~ S" f g a } \context Lyrics \lyrics { @@ -1303,13 +1304,13 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and 7th tone. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \notes\relative c' { c1 d - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 e^"~~ S" f g a b^"~~ S" c } \context Lyrics \lyrics { @@ -1318,13 +1319,13 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \notes\relative c'' { a1 - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 b^"~~ S" c d e^"~~ S" f g a } \context Lyrics \lyrics { @@ -1333,13 +1334,13 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \notes\relative c'' { a1 - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 b^"~~ S" c d e^"~~ S" f!^"~~ A" gis^"~~ S" a } \context Lyrics \lyrics { @@ -1348,13 +1349,13 @@ harmonic minor scale type an augmented second (A) occurs between the 6th and @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \notes\relative c'' { a1 - \property Voice.TextScript \set #'padding = #-4 + \override TextScript #'padding = #-4 b^"~~ S" c d e fis gis^"~~ S" a g! f!^"~~ S" e d c^"~~ S" b a } @@ -1694,14 +1695,14 @@ Two notes, intervals, or scales are enharmonic if they have different names but equal pitch. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \addlyrics \context Staff \notes\relative c'' { gis1 s s as s s s s s s } \context Lyrics \lyrics { - \property Lyrics . LyricText \set #'self-alignment-X = #-1 + \override Lyrics .LyricText #'self-alignment-X = #-1 "g sharp " "a flat " "dim fifth " "augm fourth" } @end lilypond @@ -1765,9 +1766,9 @@ symbol indicates playing an octave lower (for example on double bass @aref{strings}). @lilypond[notime] -\property Score.automaticBars = ##f -\property Staff.Clef \override #'full-size-change = ##t -%\property Score.LyricText \set #'font-style = #'large +\set Score.automaticBars = ##f +\override Staff.Clef #'full-size-change = ##t +%\override Score.LyricText #'font-style = #'large \addlyrics \notes\relative c { \clef varbaritone @@ -1782,7 +1783,7 @@ symbol indicates playing an octave lower (for example on double bass f1 } \context Lyrics \lyrics { - \property Lyrics . LyricText \set #'self-alignment-X = #-1 + \override Lyrics .LyricText #'self-alignment-X = #-1 "baritone " "bass " "sub-bass " @@ -1858,8 +1859,8 @@ less than a quarter note. The number of flags determines the @aref{note value}. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \notes\relative c'' { g8_"1/8" s8 g16_"1/16" s8 @@ -1942,9 +1943,9 @@ dominant (D, the chord on the fifth note). Other are considered to be variants of the base chords. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \context Voice \notes\relative c'' { 1 < a f d > < b g e > @@ -1981,9 +1982,9 @@ indicates playing or singing an octave lower (most tenor parts in choral scores are notated like that). @lilypond[notime] -\property Score.automaticBars = ##f -\property Staff.Clef \set #'full-size-change = ##t -%\property Score.LyricText \set #'font-style = #'large +\set Score.automaticBars = ##f +\override Staff.Clef #'full-size-change = ##t +%\override Score.LyricText #'font-style = #'large \addlyrics \notes\relative c'' { \clef french @@ -1996,7 +1997,7 @@ scores are notated like that). g s s } \context Lyrics \lyrics { - \property Lyrics . LyricText \set #'self-alignment-X = #-1 + \override Lyrics .LyricText #'self-alignment-X = #-1 "french violin clef " "violin clef " "octaved up " @@ -2109,7 +2110,7 @@ section. @aref{functional harmony}. \partial 4 < c g e >4 | < c a f > < b g d > < c g e >2 } -% %\property Score.LyricText \set #'font-style = #'large +% %\override Score.LyricText #'font-style = #'large \addlyrics \context Staff = SB \relative c { \clef bass @@ -2139,8 +2140,8 @@ Tones sounding simultaneously. Two note harmonies fall into the categories Consonances: @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \context Voice \notes\relative c'' { 1_"unisone " s _"third " s @@ -2155,8 +2156,8 @@ Consonances: Dissonances: @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \context Voice \notes\relative c'' { 1_"second " s s _"seventh " s s @@ -2198,9 +2199,9 @@ because they consist of three @aref{whole tone}s. The addition of such two forms an octave. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \context Voice \notes\relative c'' { < g g >1 s @@ -2219,9 +2220,9 @@ of such two forms an octave. @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \context Staff \notes\relative c'' { < g c >^"perfect" s @@ -2240,9 +2241,9 @@ of such two forms an octave. @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \addlyrics \context Staff \notes\relative c'' { < gis f'! >1^"dimin" s @@ -2274,8 +2275,8 @@ N: ?. The difference between an interval and an octave. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \context Staff \notes\relative c'' { < g a >1_"second " s s < g' a, >_"seventh " s s \bar "||" < g, b >_"third " s s < g' b, >_"sixth " s s \bar "||" @@ -2368,7 +2369,7 @@ N: ?. A ledger line is an extension of the staff. @lilypond[notime] -\property Score.automaticBars = ##f +\set Score.automaticBars = ##f \notes\relative c'' { a,1 s c'' } @end lilypond @@ -2388,7 +2389,7 @@ unlike (b) @emph{leggiero} or @emph{non-legato}, (c) @emph{portato} and (d) @aref{staccato}. @lilypond[notime] -\property Score.automaticBars = ##f +\set Score.automaticBars = ##f \addlyrics \context Staff \notes\relative c'' { c4-( d e-) \bar "||" @@ -2397,7 +2398,7 @@ unlike (b) @emph{leggiero} or @emph{non-legato}, (c) @emph{portato} and c4-. d-. e-. \bar "||" } \context Lyrics \lyrics { -% \property Lyrics . LyricText \set #'font-style = #'large +% \override Lyrics .LyricText #'font-style = #'large a b "" "" c @@ -2463,9 +2464,9 @@ Note value: double length of @aref{breve}. @aref{note value}. @lilypond[notime] -\property Score.automaticBars = ##f +\set Score.automaticBars = ##f \notes\relative c'' { - \property Voice.NoteHead \set #'style = #'mensural + \override NoteHead #'style = #'mensural g\longa } @end lilypond @@ -2665,8 +2666,8 @@ N: ?. First C below the 440 Hz A. @lilypond[notime] -\property Score.automaticBars = ##f -\property Staff.Clef \set #'full-size-change = ##t +\set Score.automaticBars = ##f +\override Staff.Clef #'full-size-change = ##t \notes\relative c' { \clef bass c1 s \clef alto c s @@ -2756,8 +2757,8 @@ The briefest intelligible and self-contained fragment of a musical theme or subject. @lilypond -\property Score.TimeSignature \override #'style = \turnOff -%\property Score.TextScript \set #'font-style = #'large +\override Score.TimeSignature #'style = \turnOff +%\override Score.TextScript #'font-style = #'large \notes\relative c'' { \time 4/4 \key g \major @@ -2796,7 +2797,7 @@ N: ?. @lilypond \notes\relative c'' { a1 - \property Score.skipBars=##t R1*3 + \set Score.skipBars = ##t R1*3 a1 } @end lilypond @@ -2888,19 +2889,19 @@ but sometimes (mostly in pre baroque music) the double length note value @emph{longa} is used. @lilypond[notime] -%\property Score.TextScript \set #'font-style = #'large -\property Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large +\set Score.automaticBars = ##f \notes\relative c'' { - \property Voice.NoteHead \override #'style = #'mensural + \override NoteHead #'style = #'mensural g\longa_"longa" g\breve_"breve" - \property Voice.NoteHead \revert #'style + \revert NoteHead #'style g1_"1/1" g2_"1/2" g4_"1/4" s16 g8_"1/8" s16 g16_"1/16" s16 g32_"1/32" s16 g64_"1/64" s32 } @end lilypond @lilypond[notime] -%\property Score.TextScript \set #'font-style = #'large -\property Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large +\set Score.automaticBars = ##f \notes\relative c'' { r\longa_"longa" r\breve_"breve" r1_"1/1" r2_"1/2" r4_"1/4" s16 r8_"1/8" s16 @@ -2911,7 +2912,7 @@ An augmentation dot after a note multiplies the duration by one and a half. Another dot adds yet a fourth of the duration. @lilypond -%\property Score.TextScript \set #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \notes\relative c'' { \time 4/4 g4._"pointed" g8 g2 | g4 ~ g8 g g2 \bar "||" @@ -2924,7 +2925,7 @@ Subdivisions by@w{ }2 (@emph{tuplets}) or@w{ }4 (@emph{quadruplets}) of dotted notes are also frequently used. @lilypond -%\property Score.TextScript \set #'font-style = #'large +%\override Score.TextScript #'font-style = #'large \notes\relative c'' { \time 4/4 \times 2/3 {g8_"triplets" g g} g4 g8 g g4 \bar "||" @@ -2978,7 +2979,7 @@ the upper note is played first. @lilypond << \context Staff = sa { -% \property Score.TextScript \set #'font-style = #'large +% \override Score.TextScript #'font-style = #'large \notes\relative c'' { c2._"pre-1850" b4\trill | c1 \bar "||" c2._"post-1850" b4\trill | c1 \bar "||" @@ -2997,7 +2998,7 @@ Other frequently used ornaments are the @emph{turn}, the @emph{mordent} and the @lilypond << \context Staff = sa { -% \property Score.TextScript \set #'font-style = #'large +% \override Score.TextScript #'font-style = #'large \notes\relative c'' { a4_"turn" b\turn c2 \bar "||" g4_"mordent" a b\mordent a \bar "||" @@ -3269,8 +3270,8 @@ N: ?. with the same @aref{key signature}. @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \notes\relative c' { \key es \major es1_"e flat major" f g as bes c d es @@ -3279,8 +3280,8 @@ with the same @aref{key signature}. @end lilypond @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \notes\relative c' { \key es \major c1_"c minor" d es f g a! b! c \bar "||" @@ -3397,9 +3398,9 @@ roots of chords. The most important are degrees I = tonic (T), IV = sub@-do@-mi@-nant (S) and V = dominant (D). @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.LyricText \set #'font-style = #'large -%\property Lyrics.minVerticalAlign = #8 +\set Score.automaticBars = ##f +%\override Score.LyricText #'font-style = #'large +%\set minVerticalAlign = #8 \addlyrics \context Staff \notes\relative c' { c1 d e f g a b c @@ -3461,7 +3462,7 @@ semitone. An octave may be divided into 12@w{ }semitones. @aref{interval}, @aref{chromatic scale}. @lilypond[notime] -\property Score.automaticBars = ##f +\set Score.automaticBars = ##f \notes\relative c'' { g1 gis s a bes s b! c } @end lilypond @@ -3713,9 +3714,9 @@ Vertical line above or below a @aref{note head} shorter than a whole note. @aref{beam}. @lilypond[notime] -\property Score.autoBeaming = ##f -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.autoBeaming = ##f +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \notes\relative c'' { g2_"1/2" g' s16 g,4_"1/4" g' s16 @@ -4018,7 +4019,7 @@ with figures designating the chief @aref{interval}s and es8 c d bes c as bes16 as g f | es4 } \context Lyrics \lyrics { - \property Lyrics . VerticalAlign \override #'threshold = #'(6 . 12) + \override Lyrics .VerticalAlign #'threshold = #'(6 . 12) << { "" "6" "" "4" "" "6" "" "" "6" "4" } { "" "" "" "2" "" "" "" "" "" "2" } >> } @@ -4041,7 +4042,7 @@ connects two succesive notes of the same pitch, and which has the function of uniting them into a single sound equal to the combined durations. @lilypond[notime] -\property Score.automaticBars = ##f +\set Score.automaticBars = ##f \notes\relative c'' { g2 ~ g4. } @end lilypond @@ -4152,8 +4153,8 @@ a @aref{chord}, usually in the distance of a third (@aref{interval}). @lilypond[notime] -\property Score.automaticBars = ##f -%\property Score.TextScript \set #'font-style = #'large +\set Score.automaticBars = ##f +%\override Score.TextScript #'font-style = #'large \notes\relative c' { e2:32_"a" f:32 [ e8:16 f:16 g:16 a:16 ] s4 diff --git a/Documentation/user/preface.itely b/Documentation/user/preface.itely index 6e5647a982..26c489ee1e 100644 --- a/Documentation/user/preface.itely +++ b/Documentation/user/preface.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @comment @c -*-texinfo-*- diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index d1c0019eff..d8de08b5ed 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @c Note: -*-texinfo-*- @c This file is part of lilypond.tely @@ -481,7 +482,7 @@ example, there are two triplets shown, while @code{\times} was only used once: @lilypond[fragment,relative,raggedright,verbatim] -\property Voice.tupletSpannerDuration = #(ly:make-moment 1 4) +\set tupletSpannerDuration = #(ly:make-moment 1 4) \times 2/3 { c'8 c c c c c } @end lilypond @@ -710,9 +711,9 @@ been checked for errors: @lilypond[fragment,raggedright,verbatim] \relative c'' { c8 d -\property Score.skipTypesetting = ##t +\set Score.skipTypesetting = ##t e f g a g c, f e d -\property Score.skipTypesetting = ##f +\set Score.skipTypesetting = ##f c d b bes a g c2 } @end lilypond @@ -958,7 +959,7 @@ The @code{set-octavation} function also takes -1 (for 8va bassa) and 2 @example #(set-octavation 1) - \property Staff.ottavation = #"8" + \set Staff.ottavation = #"8" @end example @seealso @@ -1058,7 +1059,7 @@ The syntax for this command is @end example This is internally translated into @example - \property Timing.measurePosition = -@var{length of duration} + \set Timing.measurePosition = -@var{length of duration} @end example @cindex @code{|} The property @code{measurePosition} contains a rational number @@ -1138,7 +1139,7 @@ connected between different staves of a @internalsref{StaffGroup}: The command @code{\bar @var{bartype}} is a short cut for doing -@code{\property Score.whichBar = @var{bartype}} Whenever +@code{\set Score.whichBar = @var{bartype}} Whenever @code{whichBar} is set to a string, a bar line of that type is created. At the start of a measure it is set to @code{defaultBarType}. The contents of @code{repeatCommands} are used @@ -1225,7 +1226,7 @@ the @internalsref{NoteCollision} object, they are merged: @lilypond[verbatim,fragment,raggedright] \relative c'' \context Voice << { g8 g8 - \property Staff.NoteCollision \override + \override Staff.NoteCollision #'merge-differently-dotted = ##t g8 g8 } \\ { g8.[ f16] g8.[ f16] } @@ -1237,8 +1238,8 @@ Similarly, you can merge half note heads with eighth notes, by setting @lilypond[fragment,relative=2,verbatim] \context Voice << { c8 c4. - \property Staff.NoteCollision - \override #'merge-differently-headed = ##t + \override Staff.NoteCollision + #'merge-differently-headed = ##t c8 c4. } \\ { c2 c2 } >> @end lilypond @@ -1356,14 +1357,14 @@ point are marked with @code{[} and @code{]}: Normally, beaming patterns within a beam are determined automatically. When this mechanism fouls up, the properties -@code{Voice.stemLeftBeamCount} and @code{Voice.stemRightBeamCount} can +@code{stemLeftBeamCount} and @code{stemRightBeamCount} can be used to control the beam subdivision on a stem. If either property is set, its value will be used only once, and then it is erased. @lilypond[fragment,relative,verbatim] \context Staff { f8[ r16 f g a] - f8[ r16 \property Voice.stemLeftBeamCount = #1 f g a] + f8[ r16 \set stemLeftBeamCount = #1 f g a] } @end lilypond @cindex @code{stemRightBeamCount} @@ -1378,9 +1379,9 @@ but it take less typing: @lilypond[relative=1,verbatim,noindent] c16[ c c c c c c c] - \property Voice.subdivideBeams = ##t + \set subdivideBeams = ##t c16[ c c c c c c c] - \property Score.beatLength = #(ly:make-moment 1 8) + \set Score.beatLength = #(ly:make-moment 1 8) c16[ c c c c c c c] @end lilypond @cindex subdivideBeams @@ -1424,14 +1425,14 @@ Automatically kneed beams cannot be used together with hidden staves. In normal time signatures, automatic beams can start on any note but can only end in a few positions within the measure: beams can end on a beat, or at durations specified by the properties in -@code{Voice.autoBeamSettings}. The defaults for @code{autoBeamSettings} +@code{autoBeamSettings}. The defaults for @code{autoBeamSettings} are defined in @file{scm/auto-beam.scm}. The value of @code{autoBeamSettings} is changed using @code{\override} and restored with @code{\revert}: @example -\property Voice.autoBeamSettings \override #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) = @var{dur} -\property Voice.autoBeamSettings \revert #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) +\override autoBeamSettings #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) = @var{dur} +\property autoBeamSettings \revert #'(@var{BE} @var{P} @var{Q} @var{N} @var{M}) @end example Here, @var{BE} is the symbol @code{begin} or @code{end}. It determines whether the rule applies to begin or end-points. The quantity @@ -1443,7 +1444,7 @@ signatures). For example, if automatic beams should end on every quarter note, use the following: @example -\property Voice.autoBeamSettings \override +\override autoBeamSettings #'(end * * * *) = #(ly:make-moment 1 4) @end example Since the duration of a quarter note is 1/4 of a whole note, it is @@ -1452,7 +1453,7 @@ entered as @code{(ly:make-moment 1 4)}. The same syntax can be used to specify beam starting points. In this example, automatic beams can only end on a dotted quarter note: @example -\property Voice.autoBeamSettings \override +\override autoBeamSettings #'(end * * * *) = #(ly:make-moment 3 8) @end example In 4/4 time signature, this means that automatic beams could end only on @@ -1464,7 +1465,7 @@ should only be applied in @var{N}/@var{M} time signature is formed by replacing the second asterisks by @var{N} and @var{M}. For example, a rule for 6/8 time exclusively looks like @example -\property Voice.autoBeamSettings \override +\override autoBeamSettings #'(begin * * 6 8) = ... @end example @@ -1479,11 +1480,11 @@ accepting notes, this last beam will not be typeset at all. @cindex automatic beam generation @cindex autobeam -@cindex @code{Voice.autoBeaming} +@cindex @code{autoBeaming} @cindex lyrics For melodies that have lyrics, you may want to switch off -automatic beaming. This is done by setting @code{Voice.autoBeaming} to +automatic beaming. This is done by setting @code{autoBeaming} to @code{#f}. @refcommands @@ -1506,8 +1507,8 @@ end at 3 eights; the third beam can only be corrected by specifying manual beaming. @lilypond[raggedright,fragment,relative,noverbatim,quote] - \property Voice.autoBeamSettings - \override #'(end * * * *) = #(ly:make-moment 3 8) + \override autoBeamSettings + #'(end * * * *) = #(ly:make-moment 3 8) % rather show case where it goes wrong %\time 12/8 c'8 c c c16 c c c c c c[ c c c] c8[ c] c4 \time 12/8 c'8 c c c16 c c c c c c c c c c8 c c4 @@ -1768,7 +1769,7 @@ accidentals depending on the order in which the notes occur in the input file: @lilypond[raggedright,fragment,verbatim] -\property Staff.autoAccidentals = #'( Staff (any-octave . 0) ) +\set Staff.autoAccidentals = #'( Staff (any-octave . 0) ) cis'4 r2 | cis'4 r2 | r | r | @end lilypond @@ -1826,9 +1827,9 @@ the attachment type of the left and right end points: @lilypond[fragment,relative,verbatim] \slurUp - \property Voice.Stem \set #'length = #5.5 + \override Stem #'length = #5.5 g'8(g g4) - \property Voice.Slur \set #'attachment = #'(stem . stem) + \override Slur #'attachment = #'(stem . stem) g8( g g4) @end lilypond @@ -1839,7 +1840,7 @@ stems might look better: @lilypond[fragment,relative,verbatim] \stemUp \slurUp d32( d'4 d8..) - \property Voice.Slur \set #'attachment = #'(stem . stem) + \override Slur #'attachment = #'(stem . stem) d,32( d'4 d8..) @end lilypond @@ -1928,7 +1929,7 @@ The glyph of the breath mark can be tweaked by overriding the any markup text. For example, @lilypond[fragment,verbatim,relative] c'4 -\property Voice.BreathingSign \override #'text +\override BreathingSign #'text = #(make-musicglyph-markup "scripts-rvarcomma") \breathe d4 @@ -1982,8 +1983,8 @@ properties: @lilypond[fragment,relative,verbatim] \relative c' { c1 - \property Voice.TextSpanner \set #'direction = #-1 - \property Voice.TextSpanner \set #'edge-text = #'("rall " . "") + \override TextSpanner #'direction = #-1 + \override TextSpanner #'edge-text = #'("rall " . "") c2\startTextSpan b c\stopTextSpan a } @end lilypond @@ -2157,9 +2158,9 @@ In this case, setting @code{fingeringOrientations} will put fingerings next to note heads: @lilypond[verbatim,raggedright,fragment,relative=1] - \property Voice.fingeringOrientations = #'(left down) + \set fingeringOrientations = #'(left down) 4 - \property Voice.fingeringOrientations = #'(up right down) + \set fingeringOrientations = #'(up right down) 4 @end lilypond @@ -2304,9 +2305,9 @@ for example, @lilypond[fragment,verbatim,relative=1] \new Voice { \acciaccatura { - \property Voice.Stem \override #'direction = #-1 + \override Stem #'direction = #-1 f16-> - \property Voice.Stem \revert #'direction + \revert Stem #'direction } g4 } @@ -2447,7 +2448,7 @@ in @internalsref{Voice}.@internalsref{Hairpin} to lengthen them, for example: @example - \property Staff.Hairpin \override #'minimum-length = #5 + \override Staff.Hairpin #'minimum-length = #5 @end example You can also use a text saying @emph{cresc.} instead of hairpins. Here @@ -2463,8 +2464,8 @@ is an example how to do it: You can also supply your own texts: @lilypond[fragment,relative,verbatim] \context Voice { - \property Voice.crescendoText = \markup { \italic "cresc. poco" } - \property Voice.crescendoSpanner = #'dashed-line + \set crescendoText = \markup { \italic "cresc. poco" } + \set crescendoSpanner = #'dashed-line a'2\< a a a\!\mf } @end lilypond @@ -2650,9 +2651,9 @@ alphabetic characters. Or, @lilypond[verbatim,fragment,relative=2] c4 - \property Score.repeatCommands = #'((volta "93") end-repeat) + \set Score.repeatCommands = #'((volta "93") end-repeat) c4 c4 - \property Score.repeatCommands = #'((volta #f)) + \set Score.repeatCommands = #'((volta #f)) c4 c4 @end lilypond @@ -2709,7 +2710,7 @@ Tremolo marks can be printed on a single note by adding `@code{:}[@var{length}]' after the note. The length must be at least 8. A @var{length} value of 8 gives one line across the note stem. If the length is omitted, then then the last value (stored in -@code{Voice.tremoloFlags}) is used: +@code{tremoloFlags}) is used: @lilypond[verbatim,fragment,center] c'2:8 c':32 | c': c': | @@ -2973,8 +2974,8 @@ up = \drums { hh8 hh hh hh hhp4 hhp } down = \drums { bd4 sn bd toml8 toml } \score { \new DrumStaff << - \property DrumStaff.drumStyleTable - = #(alist->hash-table mydrums) + \set DrumStaff.drumStyleTable + = #(alist->hash-table mydrums) \new DrumVoice { \voiceOne \up } \new DrumVoice { \voiceTwo \down } >> @@ -3129,7 +3130,7 @@ Pedals can also be indicated by a sequence of brackets, by setting the @code{pedalSustainStyle} property to @code{bracket} objects: @lilypond[fragment,verbatim] - \property Staff.pedalSustainStyle = #'bracket + \set Staff.pedalSustainStyle = #'bracket c''4\sustainDown d''4 e''4 a'4\sustainUp\sustainDown f'4 g'4 a'4\sustainUp @@ -3140,7 +3141,7 @@ obtained by setting the @code{pedalSustainStyle} style property to @code{mixed}: @lilypond[fragment,verbatim] - \property Staff.pedalSustainStyle = #'mixed + \set Staff.pedalSustainStyle = #'mixed c''4\sustainDown d''4 e''4 c'4\sustainUp\sustainDown f'4 g'4 a'4\sustainUp @@ -3161,7 +3162,7 @@ For fine-tuning of the appearance of a pedal bracket, the properties bracket may be extended to the end of the note head: @lilypond[fragment,verbatim] -\property Staff.PianoPedalBracket \override +\override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0) c''4\sostenutoDown d''4 e''4 c'4 f'4 g'4 a'4\sostenutoUp @@ -3188,7 +3189,7 @@ in both staves, and set @lilypond[fragment,relative,verbatim] \context PianoStaff << - \property PianoStaff.connectArpeggios = ##t + \set PianoStaff.connectArpeggios = ##t \new Staff { \arpeggio } \new Staff { \clef bass \arpeggio } >> @@ -3200,9 +3201,9 @@ arrowhead to the wiggly line. This can be typeset by setting @lilypond[fragment,relative,verbatim] \context Voice { - \property Voice.Arpeggio \set #'arpeggio-direction = #1 + \override Arpeggio #'arpeggio-direction = #1 \arpeggio - \property Voice.Arpeggio \set #'arpeggio-direction = #-1 + \override Arpeggio #'arpeggio-direction = #-1 \arpeggio } @end lilypond @@ -3214,7 +3215,7 @@ arpeggiate the chord. To draw these brackets, set the @code{\arpeggio} statements within the chords as before: @lilypond[fragment,relative,verbatim] - \property PianoStaff.Arpeggio \override + \override PianoStaff.Arpeggio #'print-function = \arpeggioBracket \arpeggio @end lilypond @@ -3253,7 +3254,7 @@ can be printed automatically. This is enabled if the property @lilypond[fragment,relative,verbatim] \context PianoStaff << - \property PianoStaff.followVoice = ##t + \set PianoStaff.followVoice = ##t \context Staff \context Voice { c1 \change Staff=two @@ -3321,7 +3322,7 @@ Similarly, a period following a alphabetic sequence, is included in the resulting string. As a consequence, spaces must be inserted around @code{\property} commands: @example - \property Lyrics . LyricText \set #'font-shape = #'italic + \override Lyrics .LyricText #'font-shape = #'italic @end example @cindex @code{_} @@ -3524,10 +3525,10 @@ The complete example is shown here: << \notes \relative c'' \context Voice = duet { \time 3/4 g2 e4 a2 f4 g2. } \lyrics << \lyricsto "duet" \new Lyrics { - \property Lyrics . stanza = "1" + \set stanza = "1" Hi, my name is bert. } \lyricsto "duet" \new Lyrics { - \property Lyrics . stanza = "2" + \set stanza = "2" Ooooo, ch\'e -- ri, je t'aime. } >> >> } @@ -3537,16 +3538,16 @@ The complete example is shown here: @cindex singer's names @cindex name of singer -Stanza numbers can be added by setting @code{Lyrics.stanza}, e.g. +Stanza numbers can be added by setting @code{stanza}, e.g. @example - \property Lyrics . stanza = "Bert" + \set stanza = "Bert" @dots{} - \property Lyrics . stanza = "Ernie" + \set stanza = "Ernie" @end example Notice how dots are surrounded with spaces in @code{\lyrics} mode, to -prevent @code{Lyrics.stanza} being interpreted as a single +prevent @code{stanza} being interpreted as a single string. Names of the singers should be added using @code{Lyrics @@ -3709,14 +3710,14 @@ value for @code{minimumFret} is 0: @example e8 fis gis a b cis' dis' e' -\property TabStaff.minimumFret = #8 +\set TabStaff.minimumFret = #8 e8 fis gis a b cis' dis' e' @end example @lilypond[noindent] frag = \notes { \key e \major e8 fis gis a b cis' dis' e' - \property TabStaff.minimumFret = #8 + \set TabStaff.minimumFret = #8 e8 fis gis a b cis' dis' e' } \score { @@ -3756,7 +3757,7 @@ g: @lilypond[fragment,verbatim] \context TabStaff << - \property TabStaff.stringTunings = #'(-5 -10 -15 -20) + \set TabStaff.stringTunings = #'(-5 -10 -15 -20) \notes { a,4 c' a e' e c' a e' @@ -3968,7 +3969,7 @@ scheme = \chords { \score { \notes << \context ChordNames { - \property ChordNames.chordChanges = ##t + \set chordChanges = ##t \scheme } \context Staff \transpose c c' \scheme >> @@ -4003,8 +4004,8 @@ separators, e.g. @lilypond[fragment,verbatim] \context ChordNames \chords { c:7sus4 - \property ChordNames.chordNameSeparator - = \markup { \typewriter "|" } + \set chordNameSeparator + = \markup { \typewriter "|" } c:7sus4 } @end lilypond @@ -4149,11 +4150,11 @@ example, @code{markFormatter} is set to a canned procedure. After a few measures, it is set to function that produces a boxed number. @lilypond[verbatim,fragment,relative=1] - \property Score.markFormatter = #format-mark-numbers + \set Score.markFormatter = #format-mark-numbers c1 \mark \default c1 \mark \default - \property Score.markFormatter - = #(lambda (mark context) + \set Score.markFormatter + = #(lambda (mark context) (make-bold-markup (make-box-markup (number->string mark)))) c1 \mark \default c1 \mark \default @@ -4183,7 +4184,7 @@ In this case, during line breaks, marks must also be printed at the end of the line, and not at the beginning. Use the following to force that behavior: @example -\property Score.RehearsalMark \override +\override Score.RehearsalMark #'break-visibility = #begin-of-line-invisible @end example @@ -4253,7 +4254,7 @@ used, for the next ones @code{instr} is used: @quotation @lilypond[verbatim,raggedright] - \property Staff.instrument = "ploink " { c''4 } + \set Staff.instrument = "ploink " { c''4 } @end lilypond @end quotation @@ -4263,7 +4264,7 @@ names: @quotation @lilypond[fragment,verbatim,raggedright] \notes { - \property Staff.instrument = \markup { + \set Staff.instrument = \markup { \column < "Clarinetti" { "in B" \smaller \musicglyph #"accidentals--1" @@ -4365,7 +4366,7 @@ be expanded, and the appropriate number is added automatically: @lilypond[fragment,verbatim] \time 4/4 r1 | R1 | R1*2 - \property Score.skipBars = ##t R1*17 R1*4 + \set Score.skipBars = ##t R1*17 R1*4 @end lilypond The @code{1} in @code{R1} is similar to the duration notation used for @@ -4373,7 +4374,7 @@ notes. Hence, for time signatures other than 4/4, you must enter other durations. This can be done with augmentation dots or fractions: @lilypond[fragment,verbatim] - \property Score.skipBars = ##t + \set Score.skipBars = ##t \time 3/4 R2. | R2.*2 \time 13/8 @@ -4492,7 +4493,7 @@ may set the property @var{soloADue} to false: @lilypond[verbatim,raggedright,fragment] \new Staff << - \property Staff.soloADue = ##f + \set Staff.soloADue = ##f \partcombine { g a( b) r @@ -4572,7 +4573,7 @@ for the full score, and one with cue notes for the instrumental part: \tag #'part << R1 \\ @{ - \property Voice.fontSize = #-1 + \set fontSize = #-1 c4_"cue" f2 g4 @} >> \tag #'score R1 @@ -4628,8 +4629,8 @@ output: @cindex @code{transposing} @example - \property Staff.instrument = #"Cl. in B-flat" - \property Staff.transposing = #-2 + \set Staff.instrument = #"Cl. in B-flat" + \set Staff.transposing = #-2 @end example @@ -4723,7 +4724,7 @@ printings of the 16th century. The following example demonstrates the @code{neo_mensural} style: @lilypond[fragment,raggedright,verbatim] - \property Voice.NoteHead \set #'style = #'neo_mensural + \override NoteHead #'style = #'neo_mensural a'\longa a'\breve a'1 a'2 a'4 a'8 a'16 @end lilypond @@ -4840,7 +4841,7 @@ in historic prints of the 16th century. The following example demonstrates the @code{neo_mensural} style: @lilypond[fragment,raggedright,verbatim] - \property Voice.Rest \set #'style = #'neo_mensural + \override Rest #'style = #'neo_mensural r\longa r\breve r1 r2 r4 r8 r16 @end lilypond @@ -4889,7 +4890,7 @@ modern style mensural C clef @tab @code{neo_mensural_c1}, @code{neo_mensural_c2}, @code{neo_mensural_c3}, @code{neo_mensural_c4} @tab @lilypond[relative,notime] -\property Staff.TimeSignature \set #'transparent = ##t +\override Staff.TimeSignature #'transparent = ##t \clef "neo_mensural_c2" c @end lilypond @@ -4913,7 +4914,7 @@ petrucci style mensural C clefs, for use on different stafflines @tab @lilypond[relative,notime] -\property Staff.TimeSignature \set #'transparent = ##t +\override Staff.TimeSignature #'transparent = ##t \clef "petrucci_c2" c @end lilypond @@ -4922,7 +4923,7 @@ petrucci style mensural C clefs, for use on different stafflines petrucci style mensural F clef @tab @code{petrucci_f} @tab @lilypond[relative,notime] -\property Staff.TimeSignature \set #'transparent = ##t +\override Staff.TimeSignature #'transparent = ##t \clef "petrucci_f" c @end lilypond @@ -4931,7 +4932,7 @@ petrucci style mensural F clef @tab petrucci style mensural G clef @tab @code{petrucci_g} @tab @lilypond[relative,notime] -\property Staff.TimeSignature \set #'transparent = ##t +\override Staff.TimeSignature #'transparent = ##t \clef "petrucci_g" c @end lilypond @@ -4941,7 +4942,7 @@ historic style mensural C clef @tab @code{mensural_c1}, @code{mensural_c2}, @code{mensural_c3}, @code{mensural_c4} @tab @lilypond[relative,notime] -\property Staff.TimeSignature \set #'transparent = ##t +\override Staff.TimeSignature #'transparent = ##t \clef "mensural_c2" c @end lilypond @@ -4950,7 +4951,7 @@ historic style mensural C clef @tab historic style mensural F clef @tab @code{mensural_f} @tab @lilypond[relative,notime] -\property Staff.TimeSignature \set #'transparent = ##t +\override Staff.TimeSignature #'transparent = ##t \clef "mensural_f" c @end lilypond @@ -4959,7 +4960,7 @@ historic style mensural F clef @tab historic style mensural G clef @tab @code{mensural_g} @tab @lilypond[relative,notime] -\property Staff.TimeSignature \set #'transparent = ##t +\override Staff.TimeSignature #'transparent = ##t \clef "mensural_g" c @end lilypond @@ -4968,8 +4969,8 @@ historic style mensural G clef @tab Editio Vaticana style do clef @tab @code{vaticana_do1}, @code{vaticana_do2}, @code{vaticana_do3} @tab @lilypond[relative,notime] - \property Staff.StaffSymbol \set #'line-count = #4 -\property Staff.TimeSignature \set #'transparent = ##t + \override Staff.StaffSymbol #'line-count = #4 +\override Staff.TimeSignature #'transparent = ##t \clef "vaticana_do2" c @end lilypond @@ -4978,8 +4979,8 @@ Editio Vaticana style do clef @tab Editio Vaticana style fa clef @tab @code{vaticana_fa1}, @code{vaticana_fa2} @tab @lilypond[relative,notime] - \property Staff.StaffSymbol \set #'line-count = #4 -\property Staff.TimeSignature \set #'transparent = ##t + \override Staff.StaffSymbol #'line-count = #4 +\override Staff.TimeSignature #'transparent = ##t \clef "vaticana_fa2" c @end lilypond @@ -4988,8 +4989,8 @@ Editio Vaticana style fa clef @tab Editio Medicaea style do clef @tab @code{medicaea_do1}, @code{medicaea_do2}, @code{medicaea_do3} @tab @lilypond[relative,notime] - \property Staff.StaffSymbol \set #'line-count = #4 -\property Staff.TimeSignature \set #'transparent = ##t + \override Staff.StaffSymbol #'line-count = #4 +\override Staff.TimeSignature #'transparent = ##t \clef "medicaea_do2" c @end lilypond @@ -4998,8 +4999,8 @@ Editio Medicaea style do clef @tab Editio Medicaea style fa clef @tab @code{medicaea_fa1}, @code{medicaea_fa2} @tab @lilypond[relative,notime] - \property Staff.StaffSymbol \set #'line-count = #4 -\property Staff.TimeSignature \set #'transparent = ##t + \override Staff.StaffSymbol #'line-count = #4 +\override Staff.TimeSignature #'transparent = ##t \clef "medicaea_fa2" c @end lilypond @@ -5008,8 +5009,8 @@ Editio Medicaea style fa clef @tab historic style hufnagel do clef @tab @code{hufnagel_do1}, @code{hufnagel_do2}, @code{hufnagel_do3} @tab @lilypond[relative,notime] - \property Staff.StaffSymbol \set #'line-count = #4 -\property Staff.TimeSignature \set #'transparent = ##t + \override Staff.StaffSymbol #'line-count = #4 +\override Staff.TimeSignature #'transparent = ##t \clef "hufnagel_do2" c @end lilypond @@ -5018,8 +5019,8 @@ historic style hufnagel do clef @tab historic style hufnagel fa clef @tab @code{hufnagel_fa1}, @code{hufnagel_fa2} @tab @lilypond[relative,notime] - \property Staff.StaffSymbol \set #'line-count = #4 -\property Staff.TimeSignature \set #'transparent = ##t + \override Staff.StaffSymbol #'line-count = #4 +\override Staff.TimeSignature #'transparent = ##t \clef "hufnagel_fa2" c @end lilypond @@ -5028,7 +5029,7 @@ historic style hufnagel fa clef @tab historic style hufnagel combined do/fa clef @tab @code{hufnagel_do_fa} @tab @lilypond[relative,notime] -\property Staff.TimeSignature \set #'transparent = ##t +\override Staff.TimeSignature #'transparent = ##t \clef "hufnagel_do_fa" c @end lilypond @@ -5040,14 +5041,14 @@ historic style hufnagel combined do/fa clef @tab @c Supported clefs: @c @code{percussion} @c -@c @lilypond{\property Staff.TimeSignature \set #'transparent = ##t \clef "percussion" c'} +@c @lilypond{\override Staff.TimeSignature #'transparent = ##t \clef "percussion" c'} @c @c @item modern style tab clef (glyph: @code{clefs-tab}) @c @c Supported clefs: @c @code{tab} @c -@c @lilypond{\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #6 \property Staff.TimeSignature \set #'transparent = ##t \clef "tab" c'} +@c @lilypond{\context Staff \outputproperty #(make-type-checker 'staff-symbol-interface) #'line-count = #6 \override Staff.TimeSignature #'transparent = ##t \clef "tab" c'} @emph{Modern style} means ``as is typeset in contemporary editions of transcribed mensural music''. @@ -5089,9 +5090,9 @@ select ancient flags. Besides the @code{default} flag style, only @code{mensural} style is supported: @lilypond[fragment,raggedright,verbatim] - \property Voice.Stem \set #'flag-style = #'mensural - \property Voice.Stem \set #'thickness = #1.0 - \property Voice.NoteHead \set #'style = #'mensural + \override Stem #'flag-style = #'mensural + \override Stem #'thickness = #1.0 + \override NoteHead #'style = #'mensural \autoBeamOff c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32 @@ -5105,10 +5106,10 @@ of the end of each flare is different between notes on staff lines and notes between staff lines: @lilypond[fragment,raggedright] - \property Voice.Stem \set #'flag-style = #'mensural - \property Voice.Stem \set #'thickness = #1.0 - \property Voice.Stem \set #'adjust-if-on-staffline = ##f - \property Voice.NoteHead \set #'style = #'mensural + \override Stem #'flag-style = #'mensural + \override Stem #'thickness = #1.0 + \override Stem #'adjust-if-on-staffline = ##f + \override NoteHead #'style = #'mensural \autoBeamOff c'8 d'8 e'8 f'8 c'16 d'16 e'16 f'16 c'32 d'32 e'32 f'32 s8 c''8 d''8 e''8 f''8 c''16 d''16 e''16 f''16 c''32 d''32 e''32 f''32 @@ -5136,8 +5137,8 @@ following table: @lilypond \score { \notes { - \property Score.timing = ##f - \property Score.barAlways = ##t + \set Score.timing = ##f + \set Score.barAlways = ##t s_\markup { "$\\backslash$time 4/4" } ^\markup { " " \musicglyph #"timesig-neo_mensural4/4" } s @@ -5260,7 +5261,7 @@ The result looks like this: \score { \notes { a'1 - \property Staff.Custos \set #'style = #'mensural + \override Staff.Custos #'style = #'mensural \break g' } @@ -5500,10 +5501,10 @@ automatic transcription of the ligatures. For example, @example - \property Score.timing = ##f - \property Score.defaultBarType = "empty" - \property Voice.NoteHead \set #'style = #'neo_mensural - \property Staff.TimeSignature \set #'style = #'neo_mensural + \set Score.timing = ##f + \set Score.defaultBarType = "empty" + \override NoteHead #'style = #'neo_mensural + \override Staff.TimeSignature #'style = #'neo_mensural \clef "petrucci_g" \[ g\longa c\breve a\breve f\breve d'\longa \] s4 @@ -5512,10 +5513,10 @@ For example, @lilypond[raggedright] \score { \notes \transpose c c' { - \property Score.timing = ##f - \property Score.defaultBarType = "empty" - \property Voice.NoteHead \set #'style = #'neo_mensural - \property Staff.TimeSignature \set #'style = #'neo_mensural + \set Score.timing = ##f + \set Score.defaultBarType = "empty" + \override NoteHead #'style = #'neo_mensural + \override Staff.TimeSignature #'style = #'neo_mensural \clef "petrucci_g" \[ g\longa c\breve a\breve f\breve d'\longa \] s4 @@ -5538,10 +5539,10 @@ to the following: @lilypond[raggedright] \score { \notes \transpose c c' { - \property Score.timing = ##f - \property Score.defaultBarType = "empty" - \property Voice.NoteHead \set #'style = #'neo_mensural - \property Staff.TimeSignature \set #'style = #'neo_mensural + \set Score.timing = ##f + \set Score.defaultBarType = "empty" + \override NoteHead #'style = #'neo_mensural + \override Staff.TimeSignature #'style = #'neo_mensural \clef "petrucci_g" \[ g\longa c\breve a\breve f\breve d'\longa \] s4 @@ -7308,7 +7309,7 @@ entering the chant, as the following short excerpt demonstrates: \score { << \context VaticanaVoice = "cantus" { - \property Score.BarNumber \set #'transparent = ##t + \override Score.BarNumber #'transparent = ##t \notes { \[ c'\melisma c' \flexa a \] \[ a \flexa \deminutum g\melismaEnd \] f \divisioMinima \[ f\melisma \pes a c' c' \pes d'\melismaEnd \] c' \divisioMinima \break @@ -7542,7 +7543,7 @@ Do not confuse layout properties with translation properties. Translation properties always use a mixed caps style naming, and are manipulated using @code{\property}: @example - \property Context.propertyName = @var{value} + \set Context.propertyName = @var{value} @end example Layout properties are use Scheme style variable naming, i.e. lower @@ -7596,8 +7597,8 @@ Changing a variable for only one object is commonly achieved with @code{\once}: @example -\once \property @var{context}.@var{objectname} - \override @var{symbol} = @var{value} +\once \override @var{context}.@var{objectname} + @var{symbol} = @var{value} @end example Here @var{symbol} is a Scheme expression of symbol type, @var{context} and @var{objectname} is a string and @var{value} is a Scheme expression. @@ -7608,7 +7609,7 @@ changed from its original setting: @lilypond[verbatim,fragment,relative=1] c4 - \once \property Voice.Stem \set #'thickness = #4 + \once \override Stem #'thickness = #4 c4 c4 @end lilypond @@ -7617,7 +7618,7 @@ changed from its original setting: For changing more objects, the same command, without @code{\once} can be used: @example -\property @var{context}.@var{objectname} \override @var{symbol} = @var{value} +\override @var{context}.@var{objectname} @var{symbol} = @var{value} @end example This command adds @code{@var{symbol} = @var{value}} to the definition of @var{objectname} in the context @var{context}, and this definition @@ -7634,14 +7635,14 @@ The @code{\set} shorthand performs a revert followed by an override, and is often more convenient to use @example -\property @var{context}.@var{objectname} \set @var{symbol} = @var{value} +\override @var{context}.@var{objectname} @var{symbol} = @var{value} @end example Some examples: @lilypond[verbatim,quote] -c'4 \property Voice.Stem \override #'thickness = #4.0 +c'4 \override Stem #'thickness = #4.0 c'4 -c'4 \property Voice.Stem \revert #'thickness +c'4 \revert Stem #'thickness c'4 @end lilypond @@ -7649,9 +7650,9 @@ The following example gives exactly the same result as the previous one (assuming the system default for stem thickness is 1.3): @c @lilypond[verbatim,quote] - c'4 \property Voice.Stem \set #'thickness = #4.0 + c'4 \override Stem #'thickness = #4.0 c'4 - c'4 \property Voice.Stem \set #'thickness = #1.3 + c'4 \override Stem #'thickness = #1.3 c'4 @end lilypond @@ -7695,7 +7696,7 @@ list is a singly linked list, we can treat it as a stack, and @code{\override} and @code{\revert} are push and pop operations. The association list is stored in a normal context property, hence @example - \property Voice.NoteHead = #'() + \set NoteHead = #'() @end example will effectively erase @internalsref{NoteHead}s from the current @internalsref{Voice}. Typically, this will blank the object. However, @@ -7832,15 +7833,15 @@ By increasing the value of @code{padding}, we can move away the fingering. The following command inserts 3 staff spaces of white between the note and the fingering: @example -\once \property Voice.Fingering \set #'padding = #3 +\once \override Fingering #'padding = #3 @end example Inserting this command before the Fingering object is created, i.e. before @code{c2}, yields the following result: @lilypond[relative=2,fragment,verbatim] -\once \property Voice.Fingering - \set #'padding = #3 +\once \override Fingering + #'padding = #3 c-2 \stemUp f @@ -7862,7 +7863,7 @@ Fingering_engraver is part of contexts: Voice @end example so tuning the settings for Fingering should be done with @example - \property Voice.Fingering \set @dots{} + \override Fingering @dots{} @end example Of course, the tweak may also done in a larger context than @@ -7927,7 +7928,7 @@ negative numbers make the font smaller, positive numbers larger. An example is given below: @c @lilypond[fragment,relative=1,verbatim,quote] - c4 c4 \property Voice.fontSize = #-1 + c4 c4 \set fontSize = #-1 f4 g4 @end lilypond This command will set @code{font-size} (see below), and does @@ -7943,8 +7944,8 @@ notes. An elaborate example of those is in The font used for printing a object can be selected by setting @code{font-name}, e.g. @example - \property Staff.TimeSignature - \set #'font-name = #"cmr17" + \override Staff.TimeSignature + #'font-name = #"cmr17" @end example @noindent @@ -7988,9 +7989,9 @@ For any of these properties, the value @code{*} (i.e. the symbol @code{*}, entered as @code{#'*}), acts as a wildcard. This can be used to override default setting, which are always present. For example: @example - \property Lyrics . LyricText \override #'font-series = #'bold - \property Lyrics . LyricText \override #'font-family = #'typewriter - \property Lyrics . LyricText \override #'font-shape = #'* + \override Lyrics .LyricText #'font-series = #'bold + \override Lyrics .LyricText #'font-family = #'typewriter + \override Lyrics .LyricText #'font-shape = #'* @end example @cindex @code{font-style} @@ -8391,7 +8392,7 @@ done with the property @code{minimumVerticalExtent}. It takes a pair of numbers, so if you want to make it smaller from its, then you could set @example - \property Staff.minimumVerticalExtent = #'(-4 . 4) + \set Staff.minimumVerticalExtent = #'(-4 . 4) @end example This sets the vertical size of the current staff to 4 staff spaces on either side of the center staff line. The argument of @@ -8493,9 +8494,9 @@ exaggerated corrections: \score { \notes { c'4 e''4 e'4 b'4 | b'4 e''4 b'4 e''4| - \property Staff.NoteSpacing \override #'stem-spacing-correction + \override Staff.NoteSpacing #'stem-spacing-correction = #1.5 - \property Staff.StaffSpacing \override #'stem-spacing-correction + \override Staff.StaffSpacing #'stem-spacing-correction = #1.5 c'4 e''4 e'4 b'4 | b'4 e''4 b'4 e''4| diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 81cd61d2ac..b220d2ca0a 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1,3 +1,4 @@ +\version "2.1.22" @c -*-texinfo-*- @c This file is part of lilypond.tely @@ -100,8 +101,8 @@ a1 a2 a4 a16 a32 @end example @lilypond[notime] -\property Score.timing = ##f -\property Staff.autoBeaming = ##f +\set Score.timing = ##f +\set Staff.autoBeaming = ##f \transpose c c' { a1 a2 a4 a16 a32 s16_" " } @end lilypond @@ -112,7 +113,7 @@ a4 a a2 a @end example @lilypond[notime] -\property Score.timing = ##f +\set Score.timing = ##f \transpose c c' { a a a2 a s16_" " } @end lilypond @@ -126,9 +127,9 @@ r2 r4 r8 r16 @end example @lilypond[fragment] -\property Score.timing = ##f -\property Staff.Clef = \turnOff -\property Staff.TimeSignature = \turnOff +\set Score.timing = ##f +\set Staff.Clef = \turnOff +\set Staff.TimeSignature = \turnOff r2 r4 r8 r16 s16_" " @end lilypond @@ -143,7 +144,7 @@ a2. a4 a8. a16 @end example @lilypond[notime] -\property Score.timing = ##f +\set Score.timing = ##f \transpose c c' { a2. a4 a8. a16 s16_" " } @end lilypond @@ -159,7 +160,7 @@ The @rglos{meter} (or @rglos{time signature}) can be set with the @c a clef here may lead to confusion @lilypond -\property Staff.Clef \set #'transparent = ##t +\override Staff.Clef #'transparent = ##t \time 3/4 s4_" " \time 6/8 @@ -182,7 +183,7 @@ The @rglos{clef} can be set using the @code{\clef} command: @end example @lilypond[notime] -\property Score.timing = ##f +\set Score.timing = ##f \clef violin s4_" " \clef bass @@ -383,7 +384,7 @@ cis1 ees fisis aeses @end example @lilypond[notime] -\property Score.timing = ##f +\set Score.timing = ##f \transpose c c' { cis1 ees fisis aeses s16_" " } @end lilypond @@ -401,7 +402,7 @@ g @end example @lilypond[fragment] -\property Staff.TimeSignature = \turnOff +\set Staff.TimeSignature = \turnOff \key d \major g'1 \key c \minor @@ -427,7 +428,7 @@ not be added automatically, and you must enter what you want to hear. For example, in this example: @lilypond[fragment] -\property Staff.TimeSignature = \turnOff +\set Staff.TimeSignature = \turnOff \key d \major d' cis' fis' @end lilypond @@ -445,7 +446,7 @@ staff.'' Rather, it means: ``a note with pitch D-natural.'' In the key of A-flat, it gets an accidental: @lilypond[fragment] -\property Staff.TimeSignature =\turnOff +\set Staff.TimeSignature = \turnOff \key as \major d' @end lilypond @@ -566,8 +567,8 @@ c'4 c'' c''' \clef bass c c, @end example @lilypond[fragment] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff c'4 c'' c''' \clef bass c c, @end lilypond @end quotation @@ -599,8 +600,8 @@ one. For example, @code{c f} goes up while @code{c g} goes down: @end example @lilypond[fragment] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff \relative c'' { c f c g c } @@ -636,8 +637,8 @@ Larger intervals are made by adding octavation quotes. @end example @lilypond[fragment] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff \relative c'' { c f, f c' c g' c, } @@ -665,8 +666,8 @@ Here is an example of the difference between relative mode and @end example @lilypond[fragment] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff \relative a { \clef bass a d a e d c' d' @@ -682,8 +683,8 @@ Here is an example of the difference between relative mode and @end example @lilypond[fragment] -\property Score.timing = ##f -\property Staff.TimeSignature = \turnOff +\set Score.timing = ##f +\set Staff.TimeSignature = \turnOff \clef bass a d a e d c' d' @end lilypond @@ -1401,7 +1402,7 @@ accidentals to print, and where barlines must be placed, are stored in variables. These variables are called @emph{context properties}. The properties can also be manipulated from input files. Consider this input: @example -\property Staff.autoBeaming = ##f +\set Staff.autoBeaming = ##f @end example @noindent @@ -1411,7 +1412,7 @@ property controls whether beams are printed automatically: @c @lilypond[relative=1,fragment,verbatim] c8 c c c - \property Staff.autoBeaming = ##f + \set Staff.autoBeaming = ##f c8 c c c @end lilypond @@ -1425,23 +1426,23 @@ entered as follows: @itemize @bullet @item a string, enclosed in double quotes, for example, @example - \property Staff.instrument = #"French Horn" + \set Staff.instrument = #"French Horn" @end example @item a boolean: either @code{#t} or @code{#f}, for true and false respectively, e.g. @example - \property Voice.autoBeaming = ##f - \property Score.skipBars = ##t + \set autoBeaming = ##f + \set Score.skipBars = ##t @end example @item a number, such as @example - \property Score.currentBarNumber = #20 + \set Score.currentBarNumber = #20 @end example @item a symbol, which is introduced by a quote character, as in @example - \property Staff.crescendoSpanner = #'dashed-line + \set Staff.crescendoSpanner = #'dashed-line @end example @item a pair, which is also introduced by a quote character, like in @@ -1449,15 +1450,15 @@ the following statements, which set properties to the pairs (-7.5, 6) and (3, 4) respectively: @example - \property Staff.minimumVerticalExtent = #'(-7.5 . 6) - \property Staff.timeSignatureFraction = #'(3 . 4) + \set Staff.minimumVerticalExtent = #'(-7.5 . 6) + \set Staff.timeSignatureFraction = #'(3 . 4) @end example @item a list, which is also introduced by a quote character. In the following example, the @code{breakAlignOrder} property is set to a list of symbols: @example - \property Score.breakAlignOrder = + \set Score.breakAlignOrder = #'(left-edge time-signature key-signatures) @end example @@ -1489,14 +1490,14 @@ values, we can alter the look of a formatted score: @lilypond[verbatim,relative] c4 - \property Voice.Stem \override #'thickness = #3.0 + \override Stem #'thickness = #3.0 c4 c4 c4 @end lilypond @noindent In the example shown here, the layout property @code{thickness} (a symbol) is set to 3 in the @code{Stem} layout objects of the current -Voice. As a result, the notes following @code{\property} have thicker + As a result, the notes following @code{\property} have thicker stems. In most cases of manual overrides, only a single object must be @@ -1504,12 +1505,12 @@ changed. This can be achieved by prefixing @code{\once} to the @code{\property} statement, i.e. @example - \once \property Voice.Stem \set #'thickness = #3.0 + \once \override Stem #'thickness = #3.0 @end example @lilypond[relative] c4 - \once \property Voice.Stem \set #'thickness = #3.0 + \once \override Stem #'thickness = #3.0 c4 c4 c4 @end lilypond @@ -1547,8 +1548,8 @@ the left, and 1.8 staff space downwards: @lilypond[relative=1,verbatim] \stemUp f-5 -\once \property Voice.Fingering - \set #'extra-offset = #'(-0.3 . -1.8) +\once \override Fingering + #'extra-offset = #'(-0.3 . -1.8) f-5 @end lilypond @@ -1568,7 +1569,7 @@ in that voice, the tie appears to cross voices: @lilypond[fragment,relative=1,verbatim] c4 << { - \once \property Voice.Stem \set #'transparent = ##t + \once \override Stem #'transparent = ##t b8~ b8 } \\ { b[ g8] @@ -1585,7 +1586,7 @@ tweak}: @lilypond[relative=1,verbatim] c2\fermata - \property Voice.Script \set #'padding = #3 + \override Script #'padding = #3 b2\fermata @end lilypond @@ -1712,14 +1713,14 @@ When printing the part, the following @code{skipBars} property must be set to false, to prevent the rest from being expanded in three one bar rests: @example - \property Score.skipBars = ##t + \set Score.skipBars = ##t @end example Prepending the rest and the property setting above, leads to the following result: @lilypond[raggedright] \score {\notes { \transpose f c' \relative c { \time 2/4 -\property Score.skipBars = ##t +\set Score.skipBars = ##t R2*3 r4 f8 a cis4 f e d } }} @end lilypond diff --git a/VERSION b/VERSION index 10726fa34f..892d972eef 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=1 -PATCH_LEVEL=21 +PATCH_LEVEL=22 MY_PATCH_LEVEL= diff --git a/input/example-1.ly b/input/example-1.ly index 82095e1b9c..f636adeed6 100644 --- a/input/example-1.ly +++ b/input/example-1.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.22" % A simple scale in LilyPond % diff --git a/input/example-2.ly b/input/example-2.ly index b4bcb5c9ac..694483050f 100644 --- a/input/example-2.ly +++ b/input/example-2.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.22" % Some beamed and slurred notes of different taste in LilyPond % % Type: diff --git a/input/example-3.ly b/input/example-3.ly index 8714771e22..84c7f60c8e 100644 --- a/input/example-3.ly +++ b/input/example-3.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.22" one = \notes\relative c{ c'' d e f diff --git a/input/les-nereides.ly b/input/les-nereides.ly index a0f2465e0c..c30b847237 100644 --- a/input/les-nereides.ly +++ b/input/les-nereides.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.7" +\version "2.1.22" \header { composer = "ARTHUR GRAY" @@ -43,7 +43,7 @@ treble = \new Voice \notes\relative c''{ \change Staff=bass - \once\property Voice.TextScript \set #'extra-offset = #'(-3 . -4) %tweak + \once\override TextScript #'extra-offset = #'(-3 . -4) %tweak cis,16^2(^\markup {\small \italic "m.d." } 8 @@ -53,22 +53,22 @@ treble = \new Voice \notes\relative c''{ \change Staff=treble \slurUp - \property PianoStaff.connectArpeggios = ##t + \set PianoStaff.connectArpeggios = ##t #(set-octavation 1) - \once\property Voice.TextScript \set #'extra-offset = #'(-3 . -2) %tweak + \once\override TextScript #'extra-offset = #'(-3 . -2) %tweak \tieUp cis''''4^\markup { \small \italic "m.g." }\arpeggio~ \grace { - \property Voice.Stem \override #'stroke-style = #"grace" + \override Stem #'stroke-style = #"grace" cis8 %\stemBoth Hmm - \property Voice.Stem \set #'direction = #0 + \override Stem #'direction = #0 a16[-5( fis dis] #(set-octavation 0) @@ -77,7 +77,7 @@ treble = \new Voice \notes\relative c''{ % the small grace in lower staff comes after us s32 - \property Voice.Stem \revert #'stroke-style + \revert Stem #'stroke-style } @@ -88,10 +88,10 @@ treble = \new Voice \notes\relative c''{ r8 8(\mf % \fingerUp - \property Voice.Fingering \set #'direction = #1 + \override Fingering #'direction = #1 % Manual fix for collision with slur - \property Voice.Fingering \set #'extra-offset = #'(0 . 1) %tweak + \override Fingering #'extra-offset = #'(0 . 1) %tweak e)-1-4-5 r | %6 @@ -106,8 +106,8 @@ trebleTwo = \new Voice \notes\relative c''{ \stemDown \slurDown % \fingerDown - \property Voice.Fingering \set #'direction = #-1 - \property Voice.Fingering \set #'extra-offset = #'(0 . 1.2) + \override Fingering #'direction = #-1 + \override Fingering #'extra-offset = #'(0 . 1.2) s2 | %1 s1*2 @@ -132,8 +132,8 @@ bass = \new Voice \notes\relative c{ \key a \major % Allow ugly (highly blown-up) slurs - \property Voice.Slur \override #'beautiful = #5.0 %tweak - \property Voice.Slur \override #'attachment-offset = #'((0 . 3) . (0 . -4)) %tweak + \override Slur #'beautiful = #5.0 %tweak + \override Slur #'attachment-offset = #'((0 . 3) . (0 . -4)) %tweak \slurDown \dynamicUp @@ -143,35 +143,35 @@ bass = \new Voice \notes\relative c{ 4 \change Staff=treble \stemDown - \property Voice.Slur \override #'attachment = #'(stem . stem) %tweak + \override Slur #'attachment = #'(stem . stem) %tweak 4)\arpeggio - \property Voice.Slur \revert #'attachment %tweak + \revert Slur #'attachment %tweak \change Staff=bass \stemBoth - \property Voice.Slur \revert #'y-free %tweak - \property Voice.Slur \override #'y-free = #0.1 %tweak - \property Voice.Slur \revert #'attachment-offset %tweak - \property Voice.Slur \override #'attachment-offset = #'((0 . 3) . (0 . 8)) %tweak + \revert Slur #'y-free %tweak + \override Slur #'y-free = #0.1 %tweak + \revert Slur #'attachment-offset %tweak + \override Slur #'attachment-offset = #'((0 . 3) . (0 . 8)) %tweak r8. cis,,16( 8 | %3 - \property Voice.Stem \set #'length = #5 %tweak + \override Stem #'length = #5 %tweak 4 \change Staff=treble - \property Voice.Stem \revert #'length %tweak - \property Voice.Stem \revert #'direction - \property Voice.Stem \override #'direction = #-1 + \revert Stem #'length %tweak + \revert Stem #'direction + \override Stem #'direction = #-1 )\arpeggio \change Staff=bass - \property Voice.Stem \revert #'direction + \revert Stem #'direction r2 | %4 - \property Voice.Slur \revert #'beautiful %tweak - \property Voice.Slur \revert #'attachment-offset %tweak + \revert Slur #'beautiful %tweak + \revert Slur #'attachment-offset %tweak \stemDown 4 \clef treble @@ -182,7 +182,7 @@ bass = \new Voice \notes\relative c{ >> \grace { - \property Voice.Stem \override #'stroke-style = #"grace" + \override Stem #'stroke-style = #"grace" s8 s16 s s @@ -191,7 +191,7 @@ bass = \new Voice \notes\relative c{ \clef bass 32( - \property Voice.Stem \revert #'stroke-style + \revert Stem #'stroke-style } 2) @@ -199,18 +199,18 @@ bass = \new Voice \notes\relative c{ \slurUp % \fingerDown - \property Voice.Fingering \set #'direction = #-1 + \override Fingering #'direction = #-1 %%a,8 e'[-5(]) a,8 e'[-5(])-2-3 %%r b,-5 4 r b,-5 4-3-5 \slurBoth - \once \property Voice.Fingering \set #'extra-offset = #'(0 . -1) %tweak + \once \override Fingering #'extra-offset = #'(0 . -1) %tweak e,8[-5( | %6 - \once \property Voice.Fingering \set #'extra-offset = #'(0 . -1) %tweak + \once \override Fingering #'extra-offset = #'(0 . -1) %tweak a)-2] \slurUp e'[()] r b, 4 @@ -233,27 +233,27 @@ bassTwo = \new Voice \notes\relative c{ } middleDynamics = \notes{ - \property Dynamics.TextScript \set #'padding = #-1 %tweak + \override Dynamics.TextScript #'padding = #-1 %tweak s2 s1*2 | %4 s2 \grace { - \property Voice.Stem \override #'stroke-style = #"grace" + \override Stem #'stroke-style = #"grace" s8 s16 s s s32 s - \once\property Dynamics.Hairpin \set #'extra-offset = #'(0 . 2) %tweak + \once\override Dynamics.Hairpin #'extra-offset = #'(0 . 2) %tweak s\> s s32 s s s\! - \property Voice.Stem \revert #'stroke-style } + \revert Stem #'stroke-style } s32 s-"rall." s s s8 s4 | %5 s2-"a tempo" s8 - \once\property Dynamics.Hairpin \set #'extra-offset = #'(1 . 0) %tweak + \once\override Dynamics.Hairpin #'extra-offset = #'(1 . 0) %tweak s \> s s | %6 s8\! @@ -270,25 +270,25 @@ lowerDynamics = \notes{ s2\sustainDown s8. s16\sustainUp s4 | %4 s4\sustainDown - \property Dynamics.pedalSustainStrings = #'("Ped." "*Ped." "*") + \set Dynamics.pedalSustainStrings = #'("Ped." "*Ped." "*") % grace destroys pedal-line-spanner? % let's do manual tweak: - \once\property Dynamics.SustainPedal \set #'extra-offset = #'(10 . 0) %tweak + \once\override Dynamics.SustainPedal #'extra-offset = #'(10 . 0) %tweak s8\sustainUp - \once\property Dynamics.SustainPedal \set #'extra-offset = #'(16 . 0) %tweak + \once\override Dynamics.SustainPedal #'extra-offset = #'(16 . 0) %tweak s8\sustainDown %{ s4 \grace { - \property Voice.Stem \override #'stroke-style = #"grace" + \override Stem #'stroke-style = #"grace" s8 s16 s s s32 s s s\sustainUp s32 s s s\sustainDown - \property Voice.Stem \revert #'stroke-style } + \revert Stem #'stroke-style } %} s2 @@ -300,19 +300,19 @@ lowerDynamics = \notes{ % % that's what gray wants, anyway. - \property Dynamics.pedalSustainStyle = #'mixed + \set Dynamics.pedalSustainStyle = #'mixed s8\sustainDown s s s s\sustainUp\sustainDown s s - \once \property Dynamics.pedalSustainStyle = #'text + \once \set Dynamics.pedalSustainStyle = #'text s\sustainUp | %6 - \property Dynamics.pedalSustainStyle = #'mixed + \set Dynamics.pedalSustainStyle = #'mixed s8\sustainDown s s s s\sustainUp\sustainDown s s - \once \property Dynamics.pedalSustainStyle = #'text + \once \set Dynamics.pedalSustainStyle = #'text s\sustainUp | %7 } diff --git a/input/mutopia-header.ly b/input/mutopia-header.ly index f83fc41297..8a145e3944 100644 --- a/input/mutopia-header.ly +++ b/input/mutopia-header.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.22" \header { title = "Title" subtitle = "Subtitle" diff --git a/input/puer-fragment.ly b/input/puer-fragment.ly index c41f00d66c..772a3b35c3 100644 --- a/input/puer-fragment.ly +++ b/input/puer-fragment.ly @@ -1,4 +1,4 @@ -\version "2.1.21" +\version "2.1.22" \header { title = "Puer natus est nobis (excerptum)" subtitle = "Antiphona ad introitum VII" diff --git a/input/screech-boink.ly b/input/screech-boink.ly index 253e28a26b..2db75a5bd1 100644 --- a/input/screech-boink.ly +++ b/input/screech-boink.ly @@ -1,4 +1,4 @@ -\version "2.1.7" +\version "2.1.22" \header { title = "Screech and boink" subtitle = "Random complex notation" @@ -13,9 +13,9 @@ << { - \property Voice.Stem \revert #'direction + \revert Stem #'direction \change Staff = down - \property Voice.subdivideBeams = ##t + \set subdivideBeams = ##t g16.[ \change Staff = up c'''32 \change Staff = down @@ -23,8 +23,8 @@ c'''32 \change Staff = down g16] \change Staff = up - \property Voice.Stem \set #'direction = #1 - \property Voice.followVoice = ##t + \override Stem #'direction = #1 + \set followVoice = ##t c'''32([ b''16 a''16 gis''16 g''32)] } \\ { s4 \times 2/3 { d'16[ f' g'] } as'32[ b''32 e'' d''] } \\ { s4 \autoBeamOff d''8.. f''32 } \\ @@ -35,10 +35,10 @@ \context Staff = down { \clef bass \key c \minor - \property Voice.subdivideBeams = ##f - \property Voice.Stem \set #'french-beaming = ##t - \property Voice.Beam \set #'thickness = #0.3 - \property Voice.Stem \set #'thickness = #4.0 + \set subdivideBeams = ##f + \override Stem #'french-beaming = ##t + \override Beam #'thickness = #0.3 + \override Stem #'thickness = #4.0 g'16[ b16 fis16 g16] << \apply #notes-to-clusters { as16 @@ -46,7 +46,7 @@ } \\ { - \property Staff.Arpeggio \set #'arpeggio-direction =#-1 + \override Staff.Arpeggio #'arpeggio-direction =#-1 4\arpeggio } >> } diff --git a/input/twinkle-pop.ly b/input/twinkle-pop.ly index e740217980..80c4ea8f60 100644 --- a/input/twinkle-pop.ly +++ b/input/twinkle-pop.ly @@ -1,5 +1,5 @@ #(ly:set-option 'old-relative) -\version "2.1.21" +\version "2.1.22" \header{ filename = "twinkle-pop.ly" xtitle = "Ah, vous dirais-je, maman " @@ -34,7 +34,7 @@ acc = \chords { } text = \lyrics{ - \property Lyrics . LyricText \set #'font-shape = #'italic + \override LyricText #'font-shape = #'italic Ah!4 vous dir -- ai -- je ma man2 Ce4 qui cau -- se mon tour -- ment2 diff --git a/lily/accidental.cc b/lily/accidental.cc index dd5634d5d9..8c27bd2b2e 100644 --- a/lily/accidental.cc +++ b/lily/accidental.cc @@ -6,7 +6,7 @@ */ #include "font-interface.hh" #include "item.hh" -#include "molecule.hh" +#include "stencil.hh" #include "accidental-interface.hh" #include "paper-def.hh" #include "pitch.hh" @@ -21,13 +21,13 @@ */ -Molecule -parenthesize (Grob*me, Molecule m) +Stencil +parenthesize (Grob*me, Stencil m) { - Molecule open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-leftparen")); - Molecule close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-rightparen")); - m.add_at_edge (X_AXIS, LEFT, Molecule (open), 0,0); - m.add_at_edge (X_AXIS, RIGHT, Molecule (close), 0,0); + Stencil open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-leftparen")); + Stencil close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-rightparen")); + m.add_at_edge (X_AXIS, LEFT, Stencil (open), 0,0); + m.add_at_edge (X_AXIS, RIGHT, Stencil (close), 0,0); return m; } @@ -201,13 +201,13 @@ Accidental_interface::print (SCM smob) else fm = Font_interface::get_default_font (me); - Molecule mol; + Stencil mol; for (SCM s = me->get_grob_property ("accidentals"); gh_pair_p (s); s = gh_cdr (s)) { int alteration = gh_scm2int (gh_car (s)); String font_char = get_fontcharname (style, alteration); - Molecule acc (fm->find_by_name ("accidentals-" + font_char)); + Stencil acc (fm->find_by_name ("accidentals-" + font_char)); if (acc.is_empty ()) { diff --git a/lily/afm.cc b/lily/afm.cc index 26d9b252d9..db6ff87317 100644 --- a/lily/afm.cc +++ b/lily/afm.cc @@ -12,7 +12,7 @@ #include "warn.hh" // error() #include "libc-extension.hh" #include "afm.hh" -#include "molecule.hh" +#include "stencil.hh" #include "dimensions.hh" Adobe_font_metric::Adobe_font_metric (AFM_Font_info * fi) @@ -178,9 +178,9 @@ Adobe_font_metric::~Adobe_font_metric () } /* - return a molecule, without fontification + return a stencil, without fontification */ -Molecule +Stencil Adobe_font_metric::find_by_name (String s) const { AFM_CharMetricInfo const *cm = find_char_metric (s); @@ -191,7 +191,7 @@ Adobe_font_metric::find_by_name (String s) const Why don't we return empty? */ - Molecule m; + Stencil m; m.set_empty (false); return m; } @@ -203,5 +203,5 @@ Adobe_font_metric::find_by_name (String s) const // at= fontify_atom ((Font_metric*)this, at); Box b = afm_bbox_to_box (cm->charBBox); - return Molecule (b, at); + return Stencil (b, at); } diff --git a/lily/ambitus.cc b/lily/ambitus.cc index 9a9e3c6649..75e3dff62d 100644 --- a/lily/ambitus.cc +++ b/lily/ambitus.cc @@ -9,7 +9,7 @@ #include "staff-symbol-referencer.hh" #include "pitch.hh" #include "ambitus.hh" -#include "molecule.hh" +#include "stencil.hh" #include "note-head.hh" #include "item.hh" #include "font-interface.hh" @@ -100,14 +100,14 @@ number_accidentals (SCM key_signature, Pitch *pitch, } void -add_accidentals (Item *me, Molecule *head, int num_acc, +add_accidentals (Item *me, Stencil *head, int num_acc, Pitch *pitch, String accidentals_style, Real yoffs) { if (!num_acc) return; if (pitch->get_alteration()) { - Molecule accidental (Font_interface::get_default_font (me)-> + Stencil accidental (Font_interface::get_default_font (me)-> find_by_name (String ("accidentals-") + accidentals_style + to_string (pitch->get_alteration ()))); @@ -116,7 +116,7 @@ add_accidentals (Item *me, Molecule *head, int num_acc, } if (num_acc == 2) { - Molecule natural (Font_interface::get_default_font (me)-> + Stencil natural (Font_interface::get_default_font (me)-> find_by_name (String ("accidentals-") + accidentals_style + to_string ("0"))); @@ -130,7 +130,7 @@ SCM Ambitus::print (SCM smob) { Item *me = (Item *)unsmob_grob (smob); - Molecule molecule = Molecule (); + Stencil stencil = Stencil (); SCM scm_note_head_style = me->get_grob_property ("note-head-style"); String note_head_style; @@ -187,10 +187,10 @@ Ambitus::print (SCM smob) } // create heads - Molecule head_min = + Stencil head_min = Font_interface::get_default_font (me)->find_by_name (note_head_style); head_min.translate_axis (0.5*p_min, Y_AXIS); - Molecule head_max = + Stencil head_max = Font_interface::get_default_font (me)->find_by_name (note_head_style); head_max.translate_axis (0.5*p_max, Y_AXIS); @@ -203,9 +203,9 @@ Ambitus::print (SCM smob) Interval x_extent = 0.5 * Interval (-linethickness, +linethickness); Interval y_extent = 0.5 * Interval (p_min + 1.35, p_max - 1.35); Box line_box (x_extent, y_extent); - Molecule line = Lookup::round_filled_box (line_box, blotdiameter); + Stencil line = Lookup::round_filled_box (line_box, blotdiameter); line.translate_axis (0.5 * head_min.extent (X_AXIS).length (), X_AXIS); - molecule.add_molecule (line); + stencil.add_stencil (line); } // add ledger lines @@ -214,16 +214,16 @@ Ambitus::print (SCM smob) Real right_ledger_protusion = left_ledger_protusion; Interval l_extents = Interval (hd[LEFT] - left_ledger_protusion, hd[RIGHT] + right_ledger_protusion); - Molecule ledger_lines; + Stencil ledger_lines; int interspaces = Staff_symbol_referencer::line_count (me) - 1; ledger_lines = Note_head::brew_ledger_lines (me, p_min, interspaces, l_extents, 0,true); ledger_lines.translate_axis (0.5 * p_min, Y_AXIS); - molecule.add_molecule (ledger_lines); + stencil.add_stencil (ledger_lines); ledger_lines = Note_head::brew_ledger_lines (me, p_max, interspaces, l_extents, 0, true); ledger_lines.translate_axis (0.5 * p_max, Y_AXIS); - molecule.add_molecule (ledger_lines); + stencil.add_stencil (ledger_lines); // add accidentals SCM key_signature = me->get_grob_property ("key-signature"); @@ -247,10 +247,10 @@ Ambitus::print (SCM smob) accidentals_style, 0.5 * p_max); // add heads - molecule.add_molecule (head_min); - molecule.add_molecule (head_max); + stencil.add_stencil (head_min); + stencil.add_stencil (head_max); - return molecule.smobbed_copy (); + return stencil.smobbed_copy (); } ADD_INTERFACE (Ambitus, "ambitus-interface", diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index ee0c7ceab9..d2bc00f67b 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -6,7 +6,7 @@ (c) 2000--2004 Jan Nieuwenhuizen */ -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "arpeggio.hh" #include "grob.hh" @@ -72,11 +72,11 @@ Arpeggio::print (SCM smob) dir = to_dir (ad); } - Molecule mol; + Stencil mol; Font_metric *fm =Font_interface::get_default_font (me); - Molecule squiggle = fm->find_by_name ("scripts-arpeggio"); + Stencil squiggle = fm->find_by_name ("scripts-arpeggio"); - Molecule arrow ; + Stencil arrow ; if (dir) { arrow = fm->find_by_name ("scripts-arpeggio-arrow-" + to_string (dir)); @@ -128,7 +128,7 @@ Arpeggio::brew_chord_bracket (SCM smob) Real dy = heads.length() + sp; Real x = 0.7; - Molecule mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt)); + Stencil mol (Lookup::bracket (Y_AXIS, Interval (0, dy), lt, x, lt)); mol.translate_axis (heads[LEFT] - sp/2.0, Y_AXIS); return mol.smobbed_copy(); } @@ -146,7 +146,7 @@ Arpeggio::width_callback (SCM smob, SCM axis) Grob * me = unsmob_grob (smob); Axis a = (Axis)gh_scm2int (axis); assert (a == X_AXIS); - Molecule arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio"); + Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio"); return ly_interval2scm (arpeggio.extent (X_AXIS) * 1.5); } diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index b7ac5e3aac..3758ee9abb 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -93,9 +93,9 @@ Axis_group_interface::set_axes (Grob*me,Axis a1, Axis a2) /* why so convoluted ? (fixme/documentme?) */ - if (me->has_extent_callback_b (Grob::molecule_extent_proc, a1)) + if (me->has_extent_callback_b (Grob::stencil_extent_proc, a1)) me->set_extent (Axis_group_interface::group_extent_callback_proc,a1); - if (me->has_extent_callback_b (Grob::molecule_extent_proc, a2)) + if (me->has_extent_callback_b (Grob::stencil_extent_proc, a2)) me->set_extent (Axis_group_interface::group_extent_callback_proc,a2); } diff --git a/lily/balloon.cc b/lily/balloon.cc index 9bb11b2017..6c29895f4b 100644 --- a/lily/balloon.cc +++ b/lily/balloon.cc @@ -7,7 +7,7 @@ #include "line-interface.hh" #include "lookup.hh" #include "font-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "lily-guile.hh" #include "paper-def.hh" #include "misc.hh" @@ -34,7 +34,7 @@ Balloon_interface::print (SCM smob) scm_mol = scm_call_1 (cb, smob); } - if (!unsmob_molecule (scm_mol)) + if (!unsmob_stencil (scm_mol)) return scm_mol; SCM scm_off = me->get_grob_property ("balloon-text-offset"); @@ -43,7 +43,7 @@ Balloon_interface::print (SCM smob) return scm_mol; Offset off = ly_scm2offset (scm_off); - Molecule * m = unsmob_molecule (scm_mol); + Stencil * m = unsmob_stencil (scm_mol); Box orig_extent = m->extent_box (); Box box_extent = orig_extent; @@ -51,10 +51,10 @@ Balloon_interface::print (SCM smob) box_extent.widen (w, w); - Molecule fr = Lookup::frame (box_extent, 0.1, 0.05); + Stencil fr = Lookup::frame (box_extent, 0.1, 0.05); - fr.add_molecule (*m); + fr.add_stencil (*m); @@ -66,7 +66,7 @@ Balloon_interface::print (SCM smob) SCM text = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain, bt); - Molecule *text_mol = unsmob_molecule (text); + Stencil *text_mol = unsmob_stencil (text); Offset z1; @@ -79,12 +79,12 @@ Balloon_interface::print (SCM smob) Offset z2 = z1 + off; - fr.add_molecule (Line_interface::line (me, z1, z2)); + fr.add_stencil (Line_interface::line (me, z1, z2)); text_mol->translate (z2); - fr.add_molecule (*text_mol); + fr.add_stencil (*text_mol); - fr = Molecule (orig_extent, fr.get_expr ()); + fr = Stencil (orig_extent, fr.get_expr ()); return fr.smobbed_copy (); } diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 6bf140efec..39934f72f2 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -13,7 +13,7 @@ #include "grob.hh" #include "bar-line.hh" #include "string.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "font-interface.hh" @@ -44,7 +44,7 @@ Bar_line::print (SCM smob) } -Molecule +Stencil Bar_line::compound_barline (Grob*me, String str, Real h) { Real kern = robust_scm2double (me->get_grob_property ("kern"), 1); @@ -60,17 +60,17 @@ Bar_line::compound_barline (Grob*me, String str, Real h) hair *= staffline; fatline *= staffline; - Molecule thin = simple_barline (me, hair, h); - Molecule thick = simple_barline (me, fatline, h); - Molecule dot = Font_interface::get_default_font (me)->find_by_name ("dots-dot"); + Stencil thin = simple_barline (me, hair, h); + Stencil thick = simple_barline (me, fatline, h); + Stencil dot = Font_interface::get_default_font (me)->find_by_name ("dots-dot"); Real dist = ( Staff_symbol_referencer::line_count (me) & 1 ? 1 : (staff_space<2 ? 2 : .5) ) * staff_space; - Molecule colon (dot); + Stencil colon (dot); colon.translate_axis(dist,Y_AXIS); - colon.add_molecule(dot); + colon.add_stencil(dot); colon.translate_axis(-dist/2,Y_AXIS); - Molecule m; + Stencil m; if (str == "") { @@ -130,16 +130,16 @@ Bar_line::compound_barline (Grob*me, String str, Real h) for (int i = 0 ; i < c - 1; i++) { Real y = (- (c-1.0) / 2 + 0.5 + i * staff_space); - Molecule d (dot); + Stencil d (dot); d. translate_axis (y,Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); } } return m; } -Molecule +Stencil Bar_line::simple_barline (Grob *me,Real w, Real h) { Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); diff --git a/lily/beam.cc b/lily/beam.cc index 0e2553fc80..0d34e2ff72 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -28,7 +28,7 @@ Notes: #include // tanh. -#include "molecule.hh" +#include "stencil.hh" #include "directional-element-interface.hh" #include "beaming.hh" #include "beam.hh" @@ -350,7 +350,7 @@ Beam::print (SCM grob) Real gap_length =robust_scm2double ( me->get_grob_property ("gap"), 0.0); - Molecule the_beam; + Stencil the_beam; Real lt = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); for (int i = 0; i<= stems.size(); i++) @@ -414,8 +414,8 @@ Beam::print (SCM grob) Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); - Molecule whole = Lookup::beam (dydx, w, thick, blot); - Molecule gapped; + Stencil whole = Lookup::beam (dydx, w, thick, blot); + Stencil gapped; int gap_count = 0; if (gh_number_p (me->get_grob_property ("gap-count"))) @@ -431,7 +431,7 @@ Beam::print (SCM grob) int k = 0; for (int j = full_beams.size (); j--;) { - Molecule b (whole); + Stencil b (whole); if (k++ < gap_count) { @@ -441,7 +441,7 @@ Beam::print (SCM grob) b.translate_axis (last_xposn - x0 + stem_offset, X_AXIS); b.translate_axis (dydx * (last_xposn - x0) + bdy * full_beams[j], Y_AXIS); - the_beam.add_molecule (b); + the_beam.add_stencil (b); } @@ -466,20 +466,20 @@ Beam::print (SCM grob) Real w = (i>0 && st) ? (xposn - last_xposn) : break_overshoot; w = w/2 get_paper ()->self_scm (), properties, quant_score)); the_beam.add_at_edge (Y_AXIS, UP, tm, 5.0, 0); } diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 8805654b19..a4180549ff 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -14,7 +14,7 @@ #include "directional-element-interface.hh" #include "breathing-sign.hh" #include "string.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "lookup.hh" @@ -64,7 +64,7 @@ Breathing_sign::divisio_minima (SCM smob) Interval xdim (0, thickness); Interval ydim (-0.5 * staff_space, +0.5 * staff_space); Box b (xdim, ydim); - Molecule out = Lookup::round_filled_box (b, blotdiameter); + Stencil out = Lookup::round_filled_box (b, blotdiameter); return out.smobbed_copy (); } @@ -104,7 +104,7 @@ Breathing_sign::divisio_maior (SCM smob) Interval xdim (0, thickness); Interval ydim (-0.5 * height, +0.5 * height); Box b (xdim, ydim); - Molecule out = Lookup::round_filled_box (b, blotdiameter); + Stencil out = Lookup::round_filled_box (b, blotdiameter); return out.smobbed_copy (); } @@ -134,7 +134,7 @@ Breathing_sign::divisio_maxima (SCM smob) Interval xdim (0, thickness); Interval ydim (-0.5 * staff_size, +0.5 * staff_size); Box b (xdim, ydim); - Molecule out = Lookup::round_filled_box (b, blotdiameter); + Stencil out = Lookup::round_filled_box (b, blotdiameter); return out.smobbed_copy (); } @@ -164,10 +164,10 @@ Breathing_sign::finalis (SCM smob) Interval xdim (0, thickness); Interval ydim (-0.5 * staff_size, +0.5 * staff_size); Box b (xdim, ydim); - Molecule line1 = Lookup::round_filled_box (b, blotdiameter); - Molecule line2 (line1); + Stencil line1 = Lookup::round_filled_box (b, blotdiameter); + Stencil line2 (line1); line2.translate_axis (0.5 * staff_space, X_AXIS); - line1.add_molecule (line2); + line1.add_stencil (line2); return line1.smobbed_copy (); } diff --git a/lily/chord-name.cc b/lily/chord-name.cc index 50c5c43a76..1077e3ec6f 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -7,7 +7,7 @@ */ #include "chord-name.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "font-interface.hh" #include "grob.hh" diff --git a/lily/clef.cc b/lily/clef.cc index 9a493ddeef..d385520114 100644 --- a/lily/clef.cc +++ b/lily/clef.cc @@ -8,7 +8,7 @@ #include "clef.hh" #include "string.hh" -#include "molecule.hh" +#include "stencil.hh" #include "item.hh" #include "font-interface.hh" @@ -58,7 +58,7 @@ Clef::print (SCM smob) String glyph = String (ly_scm2string (glyph_scm)); Font_metric *fm = Font_interface::get_default_font (me); - Molecule out = fm->find_by_name (glyph); + Stencil out = fm->find_by_name (glyph); if (out.is_empty ()) { me->warning (_f ("clef `%s' not found", glyph.to_str0 ())); diff --git a/lily/cluster.cc b/lily/cluster.cc index dda873e6c1..fedaaf4d79 100644 --- a/lily/cluster.cc +++ b/lily/cluster.cc @@ -27,7 +27,7 @@ TODO: Add support for cubic spline segments. */ -Molecule +Stencil brew_cluster_piece (Grob *me, Array bottom_points, Array top_points) { Real blotdiameter = Staff_symbol_referencer::staff_space (me)/2; @@ -49,11 +49,11 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi { programming_error ("#'style should be symbol."); me->suicide(); - return Molecule(); + return Stencil(); } - Molecule out = Molecule (); + Stencil out = Stencil (); Array points; points.clear (); int size = bottom_points.size (); @@ -65,7 +65,7 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi box.add_point (bottom_points[i] - hvpadding); box.add_point (Offset(top_points[i + 1][X_AXIS], top_points[i][Y_AXIS]) + hvpadding); - out.add_molecule (Lookup::round_filled_box (box, blotdiameter)); + out.add_stencil (Lookup::round_filled_box (box, blotdiameter)); } } else if (String::compare (shape, "rightsided-stairs") == 0) @@ -76,7 +76,7 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi box.add_point (Offset(bottom_points[i][X_AXIS], bottom_points[i + 1][Y_AXIS]) - hvpadding); box.add_point (top_points[i + 1] + hvpadding); - out.add_molecule (Lookup::round_filled_box (box, blotdiameter)); + out.add_stencil (Lookup::round_filled_box (box, blotdiameter)); } } else if (String::compare (shape, "centered-stairs") == 0) @@ -91,7 +91,7 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi hvpadding); box.add_point (Offset (right_xmid, top_points[i][Y_AXIS]) + hvpadding); - out.add_molecule (Lookup::round_filled_box (box, blotdiameter)); + out.add_stencil (Lookup::round_filled_box (box, blotdiameter)); left_xmid = right_xmid; } Real right_xmid = bottom_points[size - 1][X_AXIS]; @@ -100,7 +100,7 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi hvpadding); box.add_point (Offset (right_xmid, top_points[size - 1][Y_AXIS]) + hvpadding); - out.add_molecule (Lookup::round_filled_box (box, blotdiameter)); + out.add_stencil (Lookup::round_filled_box (box, blotdiameter)); } else if (String::compare (shape, "ramp") == 0) { @@ -116,7 +116,7 @@ brew_cluster_piece (Grob *me, Array bottom_points, Array top_poi points.push (top_points[i] + vpadding); } points.push (top_points[0] + vpadding + hpadding); - out.add_molecule (Lookup::round_filled_polygon (points, blotdiameter)); + out.add_stencil (Lookup::round_filled_polygon (points, blotdiameter)); } else { @@ -213,7 +213,7 @@ Cluster::print (SCM smob) bottom_points.reverse (); top_points.reverse (); - Molecule out = brew_cluster_piece (me, bottom_points, top_points); + Stencil out = brew_cluster_piece (me, bottom_points, top_points); return out.smobbed_copy (); } diff --git a/lily/context-def.cc b/lily/context-def.cc new file mode 100644 index 0000000000..f48e78d3aa --- /dev/null +++ b/lily/context-def.cc @@ -0,0 +1,319 @@ +/* + translator-def.cc -- implement Context_def + + source file of the GNU LilyPond music typesetter + + (c) 2000--2004 Han-Wen Nienhuys + + */ + +#include "lily-proto.hh" +#include "context-def.hh" +#include "translator-group.hh" +#include "warn.hh" +#include "music-output-def.hh" +#include "ly-smobs.icc" + +int +Context_def::print_smob (SCM smob, SCM port, scm_print_state*) +{ + Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob); + + scm_puts ("#context_name_, port); + scm_puts (">", port); + return 1; +} + + +SCM +Context_def::mark_smob (SCM smob) +{ + Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob); + + scm_gc_mark (me->description_); + scm_gc_mark (me->context_aliases_); + scm_gc_mark (me->accept_mods_); + scm_gc_mark (me->translator_mods_); + scm_gc_mark (me->property_ops_); + scm_gc_mark (me->translator_group_type_); + return me->context_name_; +} + + +Context_def::Context_def () +{ + context_aliases_ = SCM_EOL; + translator_group_type_ = SCM_EOL; + accept_mods_ = SCM_EOL; + translator_mods_ = SCM_EOL; + property_ops_ = SCM_EOL; + context_name_ = SCM_EOL; + description_ = SCM_EOL; + + smobify_self(); +} + +Context_def::~Context_def () +{ +} + +Context_def::Context_def (Context_def const & s) + : Input (s) +{ + context_aliases_ = SCM_EOL; + translator_group_type_ = SCM_EOL; + accept_mods_ = SCM_EOL; + translator_mods_ = SCM_EOL; + property_ops_ = SCM_EOL; + context_name_ = SCM_EOL; + description_ = SCM_EOL; + + smobify_self(); + description_ = s.description_; + + accept_mods_ = s.accept_mods_; + property_ops_ = s.property_ops_; + translator_mods_ = s.translator_mods_; + context_aliases_ = s.context_aliases_; + translator_group_type_ = s.translator_group_type_; + context_name_ = s.context_name_; +} + + +void +Context_def::add_context_mod (SCM mod) +{ + SCM tag = gh_car (mod); + if (ly_symbol2scm ("description") == tag) + { + description_ = gh_cadr (mod); + return ; + } + + SCM sym = gh_cadr (mod); + if (gh_string_p (sym)) + sym = scm_string_to_symbol (sym); + + if (ly_symbol2scm ("consists") == tag + || ly_symbol2scm ("consists-end") == tag + || ly_symbol2scm ("remove") == tag) + { + if (!get_translator (sym)) + error (_f ("Program has no such type: `%s'", ly_symbol2string (sym).to_str0 ())); + else + translator_mods_ = gh_cons (scm_list_2 (tag, sym), translator_mods_ ); + } + else if (ly_symbol2scm ("accepts") == tag + || ly_symbol2scm ("denies") == tag) + { + accept_mods_ = gh_cons (scm_list_2 (tag, sym), accept_mods_); + } + else if (ly_symbol2scm ("poppush") == tag + || ly_symbol2scm ("pop") == tag + || ly_symbol2scm ("push") == tag + || ly_symbol2scm ("assign") == tag + || ly_symbol2scm ("unset") == tag) + { + property_ops_ = gh_cons (mod, property_ops_); + } + else if (ly_symbol2scm ("alias") == tag) + { + context_aliases_ = gh_cons (sym, context_aliases_); + } + else if (ly_symbol2scm ("translator-type") == tag) + { + translator_group_type_ = sym; + } + else if (ly_symbol2scm ("context-name") == tag) + { + context_name_ = sym; + } + else + { + programming_error ("Unknown context mod tag."); + } +} + + + +SCM +Context_def::get_context_name () const +{ + return context_name_; +} + +SCM +Context_def::get_accepted (SCM user_mod) const +{ + SCM mods = scm_reverse_x (scm_list_copy (accept_mods_), + user_mod); + SCM acc = SCM_EOL; + for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s)) + { + SCM tag = gh_caar (s); + SCM sym = gh_cadar (s); + if (tag == ly_symbol2scm ("accepts")) + acc = gh_cons (sym, acc); + else if (tag == ly_symbol2scm ("denies")) + acc = scm_delete_x (sym, acc); + } + return acc; +} + + +Link_array +Context_def::path_to_acceptable_translator (SCM type_sym, Music_output_def* odef) const +{ + assert (gh_symbol_p (type_sym)); + + SCM accepted = get_accepted (SCM_EOL); + + Link_array accepteds; + for (SCM s = accepted; gh_pair_p (s); s = ly_cdr (s)) + { + Context_def *t = unsmob_context_def (odef->find_translator (ly_car (s))); + if (!t) + continue; + accepteds.push (t); + } + + Link_array best_result; + for (int i=0; i < accepteds.size (); i++) + { + /* + don't check aliases, because \context Staff should not create RhythmicStaff. + */ + if (gh_equal_p (accepteds[i]->get_context_name (), type_sym)) + { + best_result.push (accepteds[i]); + return best_result; + } + } + + int best_depth= INT_MAX; + for (int i=0; i < accepteds.size (); i++) + { + Context_def * g = accepteds[i]; + + Link_array result + = g->path_to_acceptable_translator (type_sym, odef); + if (result.size () && result.size () < best_depth) + { + result.insert (g,0); + best_result = result; + + /* + this following line was added in 1.9.3, but hsould've been + there all along... Let's hope it doesn't cause nightmares. + */ + best_depth = result.size(); + } + } + + return best_result; +} + +IMPLEMENT_SMOBS (Context_def); +IMPLEMENT_DEFAULT_EQUAL_P (Context_def); + + + + +SCM +Context_def::get_translator_names (SCM user_mod) const +{ + SCM l1 = SCM_EOL; + SCM l2 = SCM_EOL; + + SCM mods = scm_reverse_x (scm_list_copy (translator_mods_), + user_mod); + + for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s)) + { + SCM tag = gh_caar (s); + SCM arg = gh_cadar (s); + + if (gh_string_p (arg)) + arg = scm_string_to_symbol (arg); + + if (ly_symbol2scm ("consists") == tag) + l1 = gh_cons (arg, l1); + else if (ly_symbol2scm ("consists-end") == tag) + l2 = gh_cons (arg, l2); + else if (ly_symbol2scm ("remove") == tag) + { + l1 = scm_delete_x (arg, l1); + l2 = scm_delete_x (arg, l2); + } + } + + return scm_append_x (scm_list_2 (l1, l2)); +} + + +Translator_group * +Context_def::instantiate (SCM ops) +{ + Translator * g = get_translator (translator_group_type_); + g = g->clone (); + + Translator_group *tg = dynamic_cast (g); + tg->definition_ = self_scm (); + + SCM trans_names = get_translator_names (ops); + tg->simple_trans_list_ = names_to_translators (trans_names, tg); + tg->accepts_list_ = get_accepted (ops); + return tg; +} + + +SCM +Context_def::clone_scm () const +{ + Context_def * t = new Context_def (*this); + scm_gc_unprotect_object (t->self_scm()); + return t->self_scm(); +} + +SCM +Context_def::make_scm () +{ + Context_def* t = new Context_def; + scm_gc_unprotect_object (t->self_scm()); + return t->self_scm(); +} + +void +Context_def::apply_default_property_operations (Translator_group *tg) +{ + apply_property_operations (tg , property_ops_); +} + +SCM +Context_def::to_alist () const +{ + SCM l = SCM_EOL; + + l = gh_cons (gh_cons (ly_symbol2scm ("consists"), + get_translator_names (SCM_EOL)), l); + l = gh_cons (gh_cons (ly_symbol2scm ("description"), description_), l); + l = gh_cons (gh_cons (ly_symbol2scm ("aliases"), context_aliases_), l); + l = gh_cons (gh_cons (ly_symbol2scm ("accepts"), get_accepted (SCM_EOL)), l); + l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"), property_ops_), l); + l = gh_cons (gh_cons (ly_symbol2scm ("context-name"), context_name_), l); + l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l); + + return l; +} + +bool +Context_def::is_alias (SCM sym) const +{ + bool b = sym == context_name_; + + for (SCM a = context_aliases_; !b && gh_pair_p (a); a = ly_cdr (a)) + b = b || sym == ly_car (a); + + return b; +} diff --git a/lily/context.cc b/lily/context.cc index cf5b161679..bbf12d4b18 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -22,7 +22,8 @@ Translator_group::find_existing_translator (SCM n, String id) { Translator * t = unsmob_translator (ly_car (p)); - r = dynamic_cast (t)->find_existing_translator (n, id); } + r = dynamic_cast (t)->find_existing_translator (n, id); + } return r; } @@ -35,6 +36,12 @@ Translator_group::find_create_translator (SCM n, String id, SCM operations) if (existing) return existing; + if (n == ly_symbol2scm ("Bottom")) + { + Translator_group* tg = get_default_interpreter (); + tg->id_string_ = id; + return tg; + } /* TODO: use accepts_list_. @@ -153,6 +160,15 @@ Translator_group::internal_get_property (SCM sym) const return val; } +bool +Translator_group::is_alias (SCM sym) const +{ + if (sym == ly_symbol2scm ("Bottom") + && !gh_pair_p (accepts_list_)) + return true; + return unsmob_context_def (definition_)->is_alias (sym); +} + void Translator_group::internal_set_property (SCM sym, SCM val) { diff --git a/lily/custos.cc b/lily/custos.cc index 8024fa9465..7b2300ca7e 100644 --- a/lily/custos.cc +++ b/lily/custos.cc @@ -19,7 +19,7 @@ #include "direction.hh" #include "staff-symbol-referencer.hh" #include "custos.hh" -#include "molecule.hh" +#include "stencil.hh" #include "warn.hh" #include "note-head.hh" #include "item.hh" @@ -85,9 +85,9 @@ Custos::print (SCM smob) font_char += "2"; } - Molecule molecule + Stencil stencil = Font_interface::get_default_font (me)->find_by_name (font_char); - if (molecule.is_empty ()) + if (stencil.is_empty ()) { me->warning (_f ("custos `%s' not found", font_char)); return SCM_EOL; @@ -99,12 +99,12 @@ Custos::print (SCM smob) int interspaces = Staff_symbol_referencer::line_count (me)-1; if (abs (pos) - interspaces > 1) { - Molecule ledger_lines = + Stencil ledger_lines = Note_head::brew_ledger_lines (me, pos, interspaces, - molecule.extent (X_AXIS), 0, true); - molecule.add_molecule (ledger_lines); + stencil.extent (X_AXIS), 0, true); + stencil.add_stencil (ledger_lines); } - return molecule.smobbed_copy (); + return stencil.smobbed_copy (); } } diff --git a/lily/dots.cc b/lily/dots.cc index 2bb9dfdf7a..f87c719e3b 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -8,7 +8,7 @@ #include "dots.hh" #include "item.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "font-interface.hh" #include "lookup.hh" @@ -20,13 +20,13 @@ SCM Dots::print (SCM d) { Grob *sc = unsmob_grob (d); - Molecule mol; + Stencil mol; SCM c = sc->get_grob_property ("dot-count"); if (gh_number_p (c)) { - Molecule d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot")); + Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot")); Real dw = d.extent (X_AXIS).length (); diff --git a/lily/font-metric.cc b/lily/font-metric.cc index b7345b86e1..1d0428b278 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -13,7 +13,7 @@ #include "virtual-methods.hh" #include "warn.hh" -#include "molecule.hh" +#include "stencil.hh" #include "ly-smobs.icc" #include "font-metric.hh" #include "string.hh" @@ -155,16 +155,16 @@ IMPLEMENT_SMOBS (Font_metric); IMPLEMENT_DEFAULT_EQUAL_P (Font_metric); IMPLEMENT_TYPE_P (Font_metric, "ly:font-metric?"); -Molecule +Stencil Font_metric::find_by_name (String) const { - Molecule m ; + Stencil m ; return m; } LY_DEFINE(ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0, (SCM font, SCM name), - "This function retrieves a Molecule for the glyph named @var{name} in " + "This function retrieves a Stencil for the glyph named @var{name} in " "@var{font}. The font must be available as an AFM file. If the glyph " "is not found, #f is returned. ") { @@ -172,7 +172,7 @@ LY_DEFINE(ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0, SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); SCM_ASSERT_TYPE(gh_string_p (name), name, SCM_ARG2, __FUNCTION__, "string"); - Molecule m = fm->find_by_name (ly_scm2string (name)); + Stencil m = fm->find_by_name (ly_scm2string (name)); /* TODO: make optional argument for default if not found. @@ -183,14 +183,14 @@ LY_DEFINE(ly_find_glyph_by_name, "ly:find-glyph-by-name", 2 , 0, 0, LY_DEFINE(ly_get_glyph, "ly:get-glyph", 2 , 0, 0, (SCM font, SCM index), - "This function retrieves a Molecule for the glyph numbered @var{index} in " + "This function retrieves a Stencil for the glyph numbered @var{index} in " "@var{font}. ") { Font_metric *fm = unsmob_metrics (font); SCM_ASSERT_TYPE(fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); SCM_ASSERT_TYPE(gh_number_p (index), index, SCM_ARG2, __FUNCTION__, "number"); - return fm->get_ascii_char_molecule (gh_scm2int (index)).smobbed_copy (); + return fm->get_ascii_char_stencil (gh_scm2int (index)).smobbed_copy (); } LY_DEFINE(ly_text_dimension,"ly:text-dimension", 2 , 0, 0, @@ -209,22 +209,22 @@ LY_DEFINE(ly_text_dimension,"ly:text-dimension", 2 , 0, 0, return gh_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm(b[Y_AXIS])); } -Molecule -Font_metric::get_ascii_char_molecule (int code) const +Stencil +Font_metric::get_ascii_char_stencil (int code) const { SCM at = scm_list_n (ly_symbol2scm ("char"), gh_int2scm (code), SCM_UNDEFINED); at = fontify_atom (this, at); Box b = get_ascii_char (code); - return Molecule (b, at); + return Stencil (b, at); } -Molecule -Font_metric::get_indexed_char_molecule (int code) const +Stencil +Font_metric::get_indexed_char_stencil (int code) const { SCM at = scm_list_n (ly_symbol2scm ("char"), gh_int2scm (code), SCM_UNDEFINED); at = fontify_atom (this, at); Box b = get_indexed_char (code); - return Molecule (b, at); + return Stencil (b, at); } diff --git a/lily/grob.cc b/lily/grob.cc index f2998d0b64..d44f3ce7c5 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -16,13 +16,13 @@ #include "group-interface.hh" #include "misc.hh" #include "paper-score.hh" -#include "molecule.hh" +#include "stencil.hh" #include "grob.hh" #include "warn.hh" #include "spanner.hh" #include "system.hh" #include "item.hh" -#include "molecule.hh" +#include "stencil.hh" #include "misc.hh" #include "music.hh" #include "item.hh" @@ -114,7 +114,7 @@ Grob::Grob (SCM basicprops) else if (cb != SCM_BOOL_F && !gh_procedure_p (cb) && !gh_pair_p (cb) && gh_procedure_p (get_grob_property ("print-function"))) - cb = molecule_extent_proc; + cb = stencil_extent_proc; dim_cache_[a].dimension_ = cb; } @@ -152,14 +152,14 @@ Grob::~Grob () } -MAKE_SCHEME_CALLBACK (Grob,molecule_extent,2); +MAKE_SCHEME_CALLBACK (Grob,stencil_extent,2); SCM -Grob::molecule_extent (SCM element_smob, SCM scm_axis) +Grob::stencil_extent (SCM element_smob, SCM scm_axis) { Grob *s = unsmob_grob (element_smob); Axis a = (Axis) gh_scm2int (scm_axis); - Molecule *m = s->get_molecule (); + Stencil *m = s->get_stencil (); Interval e ; if (m) e = m->extent (a); @@ -201,31 +201,31 @@ Grob::calculate_dependencies (int final, int busy, SCM funcname) status_= final; } -Molecule * -Grob::get_molecule () const +Stencil * +Grob::get_stencil () const { if (!live()) { return 0; } - SCM mol = get_grob_property ("molecule"); - if (unsmob_molecule (mol)) - return unsmob_molecule (mol); + SCM mol = get_grob_property ("stencil"); + if (unsmob_stencil (mol)) + return unsmob_stencil (mol); - mol = get_uncached_molecule (); + mol = get_uncached_stencil (); if (live ()) { Grob *me = (Grob*)this; - me->set_grob_property ("molecule", mol); + me->set_grob_property ("stencil", mol); } - return unsmob_molecule (mol); + return unsmob_stencil (mol); } SCM -Grob::get_uncached_molecule ()const +Grob::get_uncached_stencil ()const { SCM proc = get_grob_property ("print-function"); @@ -233,9 +233,9 @@ Grob::get_uncached_molecule ()const if (gh_procedure_p (proc)) mol = gh_apply (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED)); - Molecule *m = unsmob_molecule (mol); + Stencil *m = unsmob_stencil (mol); - if (unsmob_molecule (mol)) + if (unsmob_stencil (mol)) { SCM origin = ly_symbol2scm ("no-origin"); @@ -252,18 +252,18 @@ Grob::get_uncached_molecule ()const // ugr. - mol = Molecule (m->extent_box (), + mol = Stencil (m->extent_box (), scm_list_n (origin, m->get_expr (), SCM_UNDEFINED) ). smobbed_copy (); - m = unsmob_molecule (mol); + m = unsmob_stencil (mol); } /* transparent retains dimensions of element. */ if (m && to_boolean (get_grob_property ("transparent"))) - mol = Molecule (m->extent_box (), SCM_EOL).smobbed_copy (); + mol = Stencil (m->extent_box (), SCM_EOL).smobbed_copy (); return mol; } @@ -805,7 +805,7 @@ ADD_INTERFACE (Grob, "grob-interface", "other grobs (i.e. pointers). This big graph of grobs specifies the\n" "notation problem. The solution of this problem is a description of the\n" "printout in closed form, i.e. a list of values. These values are\n" -"Molecules.\n" +"Stencils.\n" "\n" "All grobs have an X and Y-position on the page. These X and Y positions\n" "are stored in a relative format, so they can easily be combined by\n" @@ -824,7 +824,7 @@ ADD_INTERFACE (Grob, "grob-interface", "is also an abstract grob: it only moves around chords, but doesn't print\n" "anything.\n" , - "X-offset-callbacks Y-offset-callbacks X-extent-callback molecule cause " + "X-offset-callbacks Y-offset-callbacks X-extent-callback stencil cause " "Y-extent-callback print-function extra-offset spacing-procedure " "staff-symbol interfaces dependencies X-extent Y-extent extra-X-extent " "meta layer before-line-breaking-callback " diff --git a/lily/hairpin.cc b/lily/hairpin.cc index 5e96a3854f..fcb3c621da 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -7,7 +7,7 @@ */ #include "staff-symbol-referencer.hh" -#include "molecule.hh" +#include "stencil.hh" #include "line-interface.hh" #include "hairpin.hh" #include "spanner.hh" @@ -120,9 +120,9 @@ Hairpin::print (SCM smob) should do relative to staff-symbol staff-space? */ - Molecule mol; + Stencil mol; mol = Line_interface::line (me, Offset (0, starth), Offset (width, endh)); - mol.add_molecule (Line_interface::line (me, + mol.add_stencil (Line_interface::line (me, Offset (0, -starth), Offset (width, -endh))); diff --git a/lily/horizontal-bracket.cc b/lily/horizontal-bracket.cc index 5c5039a5d1..8d74224bfa 100644 --- a/lily/horizontal-bracket.cc +++ b/lily/horizontal-bracket.cc @@ -56,7 +56,7 @@ Horizontal_bracket::print (SCM smob) Real thickness = Staff_symbol_referencer::line_thickness (me); thickness *= robust_scm2double (me->get_grob_property ("thickness"), 1.0); - Molecule b = Lookup::bracket (X_AXIS, ext, thickness, - d* 1.0, thickness/2); + Stencil b = Lookup::bracket (X_AXIS, ext, thickness, - d* 1.0, thickness/2); b.translate_axis ( - sp->get_bound (LEFT)->relative_coordinate (cx, X_AXIS), X_AXIS); diff --git a/lily/include/afm.hh b/lily/include/afm.hh index 1e9cf55509..14ab748e93 100644 --- a/lily/include/afm.hh +++ b/lily/include/afm.hh @@ -41,7 +41,7 @@ protected: Array ascii_to_metric_idx_; std::map name_to_metric_dict_; - virtual Molecule find_by_name (String) const; + virtual Stencil find_by_name (String) const; Adobe_font_metric (AFM_Font_info*); }; diff --git a/lily/include/bar-line.hh b/lily/include/bar-line.hh index 60dcb51cd0..945109c4d9 100644 --- a/lily/include/bar-line.hh +++ b/lily/include/bar-line.hh @@ -18,8 +18,8 @@ class Bar_line public: static bool has_interface (Grob*); - static Molecule compound_barline (Grob*, String, Real height) ; - static Molecule simple_barline (Grob*, Real wid, Real height) ; + static Stencil compound_barline (Grob*, String, Real height) ; + static Stencil simple_barline (Grob*, Real wid, Real height) ; DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM )); DECLARE_SCHEME_CALLBACK (print, (SCM )); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); diff --git a/lily/include/bar.hh b/lily/include/bar.hh index 641ae51d1b..e87836a75c 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -18,8 +18,8 @@ class Bar public: static bool has_interface (Grob*); - static Molecule compound_barline (Grob*, String, Real height) ; - static Molecule simple_barline (Grob*, Real wid, Real height) ; + static Stencil compound_barline (Grob*, String, Real height) ; + static Stencil simple_barline (Grob*, Real wid, Real height) ; DECLARE_SCHEME_CALLBACK (get_staff_bar_size, (SCM )); DECLARE_SCHEME_CALLBACK (print, (SCM )); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); diff --git a/lily/include/chord-name.hh b/lily/include/chord-name.hh index b06a861daa..a775a2b79a 100644 --- a/lily/include/chord-name.hh +++ b/lily/include/chord-name.hh @@ -10,7 +10,7 @@ #define CHORD_NAME_HH #include "lily-guile.hh" -#include "molecule.hh" +#include "stencil.hh" class Chord_name diff --git a/lily/include/cluster.hh b/lily/include/cluster.hh index dd3639e95b..490863be63 100644 --- a/lily/include/cluster.hh +++ b/lily/include/cluster.hh @@ -10,7 +10,7 @@ #define CLUSTER_HH #include "lily-guile.hh" -#include "molecule.hh" +#include "stencil.hh" class Cluster { diff --git a/lily/include/custos.hh b/lily/include/custos.hh index fb5e52e86b..0d6401130b 100644 --- a/lily/include/custos.hh +++ b/lily/include/custos.hh @@ -17,8 +17,8 @@ struct Custos static bool has_interface (Grob*); private: - static void add_streepjes (Grob* me, int pos, int interspaces, Molecule* custos_); - static Molecule create_ledger_line (Interval x_extent, Grob *me) ; + static void add_streepjes (Grob* me, int pos, int interspaces, Stencil* custos_); + static Stencil create_ledger_line (Interval x_extent, Grob *me) ; }; diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index cb9206efdc..4f8079f963 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -29,9 +29,9 @@ public: virtual Box text_dimension (String) const; virtual int name_to_index (String) const; - virtual Molecule find_by_name (String) const; - virtual Molecule get_indexed_char_molecule (int k) const; - virtual Molecule get_ascii_char_molecule (int k) const; + virtual Stencil find_by_name (String) const; + virtual Stencil get_indexed_char_stencil (int k) const; + virtual Stencil get_ascii_char_stencil (int k) const; DECLARE_SMOBS (Font_metric,); private: diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 49c5556c13..4a111b233d 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -111,14 +111,14 @@ public: virtual void discretionary_processing (); virtual SCM do_derived_mark () const; - Molecule * get_molecule () const; - SCM get_uncached_molecule () const; + Stencil * get_stencil () const; + SCM get_uncached_stencil () const; SCM get_property_alist_chain (SCM) const; void suicide (); bool live () const; - DECLARE_SCHEME_CALLBACK (molecule_extent, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (stencil_extent, (SCM smob, SCM axis)); static SCM ly_set_grob_property (SCM, SCM,SCM); static SCM ly_get_grob_property (SCM, SCM); diff --git a/lily/include/ligature-engraver.hh b/lily/include/ligature-engraver.hh index aa09d02297..a63920598f 100644 --- a/lily/include/ligature-engraver.hh +++ b/lily/include/ligature-engraver.hh @@ -45,8 +45,8 @@ private: Grob *last_bound_; - void override_molecule_callback (); - void revert_molecule_callback (); + void override_stencil_callback (); + void revert_stencil_callback (); }; #endif // LIGATURE_ENGRAVER_HH diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index b085da12d1..659a6b606b 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -94,7 +94,7 @@ class Midi_tempo; class Midi_text; class Midi_time_signature; class Midi_track; -class Molecule; +class Stencil; class Moment; class Music; class Music_iterator; diff --git a/lily/include/line-interface.hh b/lily/include/line-interface.hh index 0bf56707a0..576fcce7fc 100644 --- a/lily/include/line-interface.hh +++ b/lily/include/line-interface.hh @@ -14,10 +14,10 @@ source file of the GNU LilyPond music typesetter struct Line_interface { - static Molecule line (Grob *me, Offset from, Offset to); + static Stencil line (Grob *me, Offset from, Offset to); static bool has_interface (Grob*); - static Molecule make_dashed_line (Real th, Offset from, Offset to, Real, Real); - static Molecule make_line (Real th, Offset from, Offset to); + static Stencil make_dashed_line (Real th, Offset from, Offset to, Real, Real); + static Stencil make_line (Real th, Offset from, Offset to); }; #endif /* LINE_INTERFACE_HH */ diff --git a/lily/include/line-spanner.hh b/lily/include/line-spanner.hh index 4dda796de4..79a08e2c81 100644 --- a/lily/include/line-spanner.hh +++ b/lily/include/line-spanner.hh @@ -17,7 +17,7 @@ class Line_spanner public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK(after_line_breaking, (SCM)); - static Molecule line_molecule (Grob* me, Offset f, Offset t); + static Stencil line_stencil (Grob* me, Offset f, Offset t); static bool has_interface (Grob*); private: diff --git a/lily/include/lookup.hh b/lily/include/lookup.hh index a86be78852..b84097ee2e 100644 --- a/lily/include/lookup.hh +++ b/lily/include/lookup.hh @@ -11,28 +11,28 @@ #define LOOKUP_HH #include "string.hh" -#include "molecule.hh" +#include "stencil.hh" #include "flower-proto.hh" #include "direction.hh" #include "box.hh" struct Lookup { - static Molecule dot (Offset p, Real radius); - static Molecule bracket (Axis a, Interval iv, Real thick, Real protude, Real blot); - static Molecule accordion (SCM arg, Real interline_f, Font_metric*fm); - static Molecule round_filled_polygon (Array points, Real blotdiameter); - static Molecule frame (Box b, Real thick, Real blot); - static Molecule slur (Bezier controls, Real cthick, Real thick); - static Molecule bezier_sandwich (Bezier top_curve, Bezier bottom_curve); - static Molecule beam (Real slope, Real width, Real thick, Real blot); - static Molecule dashed_slur (Bezier, Real thick, Real dash); - static Molecule blank (Box b); - static Molecule filled_box (Box b); - static Molecule round_filled_box (Box b, Real blotdiameter); - static Molecule repeat_slash (Real w, Real slope, Real th); - static Molecule horizontal_line (Interval w, Real th); - static Molecule triangle (Interval, Real, Real); + static Stencil dot (Offset p, Real radius); + static Stencil bracket (Axis a, Interval iv, Real thick, Real protude, Real blot); + static Stencil accordion (SCM arg, Real interline_f, Font_metric*fm); + static Stencil round_filled_polygon (Array points, Real blotdiameter); + static Stencil frame (Box b, Real thick, Real blot); + static Stencil slur (Bezier controls, Real cthick, Real thick); + static Stencil bezier_sandwich (Bezier top_curve, Bezier bottom_curve); + static Stencil beam (Real slope, Real width, Real thick, Real blot); + static Stencil dashed_slur (Bezier, Real thick, Real dash); + static Stencil blank (Box b); + static Stencil filled_box (Box b); + static Stencil round_filled_box (Box b, Real blotdiameter); + static Stencil repeat_slash (Real w, Real slope, Real th); + static Stencil horizontal_line (Interval w, Real th); + static Stencil triangle (Interval, Real, Real); }; #endif // LOOKUP_HH diff --git a/lily/include/molecule.hh b/lily/include/molecule.hh deleted file mode 100644 index 78aace7bd3..0000000000 --- a/lily/include/molecule.hh +++ /dev/null @@ -1,90 +0,0 @@ -/* - molecule.hh -- declare Molecule - - source file of the GNU LilyPond music typesetter - - (c) 1997--2004 Han-Wen Nienhuys -*/ -#ifndef MOLECULE_HH -#define MOLECULE_HH - -#include // size_t -#include "lily-proto.hh" -#include "box.hh" -#include "axes.hh" -#include "direction.hh" -#include "lily-guile.hh" -#include "smobs.hh" - -/** a group of individually translated symbols. You can add molecules - to the top, to the right, etc. - - It is implemented as a "tree" of scheme expressions, as in - - Expr = combine Expr Expr - | translate Offset Expr - | SCHEME - ; - - SCHEME is a Scheme expression that --when eval'd-- produces the - desired output. - - - Because of the way that Molecule is implemented, it is the most - efficient to add "fresh" molecules to what you're going to build. - - Dimension behavior: - - Empty molecules have empty dimensions. If add_at_edge is used to - init the molecule, we assume that - DIMENSIONS = (Interval (0,0),Interval (0,0) -*/ -class Molecule -{ - friend SCM ly_molecule_set_extent_x (SCM, SCM, SCM); - - Box dim_; - SCM expr_; - - DECLARE_SIMPLE_SMOBS (Molecule,); -public: - Molecule (Box, SCM s); - Molecule (); - - - SCM smobbed_copy () const; - SCM get_expr () const; - - /** - Set dimensions to empty, or to (Interval (0,0),Interval (0,0) */ - void set_empty (bool); - void add_at_edge (Axis a, Direction d, const Molecule &m, Real padding, - Real minimum); - void add_molecule (Molecule const &m); - void translate (Offset); - void align_to (Axis a, Real x); - void translate_axis (Real,Axis); - - Interval extent (Axis) const; - Box extent_box () const; - /** - codify THIS into a Scheme expression. - */ - SCM create_scheme () const; - bool is_empty () const; - - - static SCM ly_get_molecule_extent (SCM mol, SCM axis); - static SCM ly_set_molecule_extent_x (SCM,SCM,SCM); - static SCM ly_molecule_combined_at_edge (SCM,SCM,SCM,SCM,SCM); -}; - - -DECLARE_UNSMOB(Molecule,molecule); -SCM fontify_atom (Font_metric const*, SCM atom); - -Molecule create_molecule (SCM print); - - - -#endif diff --git a/lily/include/multi-measure-rest.hh b/lily/include/multi-measure-rest.hh index c3f6c75142..c863940ec1 100644 --- a/lily/include/multi-measure-rest.hh +++ b/lily/include/multi-measure-rest.hh @@ -22,11 +22,11 @@ public: DECLARE_SCHEME_CALLBACK (percent, (SCM)); static void add_column (Grob*,Item*); DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM )); - DECLARE_SCHEME_CALLBACK (centered_molecule, (SCM )); + DECLARE_SCHEME_CALLBACK (centered_stencil, (SCM )); - static Molecule big_rest (Grob*,Real); - static Molecule symbol_molecule (Grob*,Real); - static Molecule church_rest (Grob*, Font_metric*, int,Real); + static Stencil big_rest (Grob*,Real); + static Stencil symbol_stencil (Grob*,Real); + static Stencil church_rest (Grob*, Font_metric*, int,Real); }; #endif /* MULTI_MEASURE_REST_HH */ diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 7c41206e52..194f7c2c24 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -8,7 +8,7 @@ #define NOTEHEAD_HH #include "lily-guile.hh" -#include "molecule.hh" +#include "stencil.hh" /** ball at the end of the stem. Also takes care of ledger lines. @@ -22,9 +22,9 @@ class Note_head public: DECLARE_SCHEME_CALLBACK (print, (SCM )); static Interval head_extent (Grob*, Axis); - static Molecule brew_ledger_lines (Grob *me, int pos, int interspaces, + static Stencil brew_ledger_lines (Grob *me, int pos, int interspaces, Interval x_extent, Real, bool); - DECLARE_SCHEME_CALLBACK (brew_ez_molecule, (SCM)); + DECLARE_SCHEME_CALLBACK (brew_ez_stencil, (SCM)); DECLARE_SCHEME_CALLBACK (extent, (SCM,SCM)); static bool has_interface (Grob*); static Real stem_attachment_coordinate (Grob *, Axis a); diff --git a/lily/include/percent-repeat-item.hh b/lily/include/percent-repeat-item.hh index 2db9741ae2..f810b48677 100644 --- a/lily/include/percent-repeat-item.hh +++ b/lily/include/percent-repeat-item.hh @@ -18,8 +18,8 @@ public: static bool has_interface (Grob*); DECLARE_SCHEME_CALLBACK (beat_slash, (SCM )); DECLARE_SCHEME_CALLBACK (double_percent, (SCM )); - static Molecule x_percent (Grob*,int,Real,Real ); - static Molecule brew_slash (Grob*); + static Stencil x_percent (Grob*,int,Real,Real ); + static Stencil brew_slash (Grob*); }; #endif /* PERCENT_REPEAT_ITEM_HH */ diff --git a/lily/include/rest.hh b/lily/include/rest.hh index 3df7a120bd..88e9a74eed 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -18,7 +18,7 @@ public: DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); static bool has_interface (Grob*); static String glyph_name (Grob*, int, String); - static SCM brew_internal_molecule (SCM); + static SCM brew_internal_stencil (SCM); DECLARE_SCHEME_CALLBACK (extent_callback, (SCM,SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM )); }; diff --git a/lily/include/scaled-font-metric.hh b/lily/include/scaled-font-metric.hh index 2b27d71b4d..71c8276250 100644 --- a/lily/include/scaled-font-metric.hh +++ b/lily/include/scaled-font-metric.hh @@ -18,7 +18,7 @@ struct Scaled_font_metric : public Font_metric { virtual Box text_dimension (String) const; - virtual Molecule find_by_name (String) const; + virtual Stencil find_by_name (String) const; static SCM make_scaled_font_metric (Font_metric*, Real); virtual int count () const; virtual Offset get_indexed_wxwy (int) const; diff --git a/lily/include/script.hh b/lily/include/script.hh index 494e897788..4417e9f233 100644 --- a/lily/include/script.hh +++ b/lily/include/script.hh @@ -21,7 +21,7 @@ class Script_interface { public: - static Molecule get_molecule (Grob*,Direction d); + static Stencil get_stencil (Grob*,Direction d); static bool has_interface (Grob*); DECLARE_SCHEME_CALLBACK (print, (SCM )); diff --git a/lily/include/stem-tremolo.hh b/lily/include/stem-tremolo.hh index a0aa600f50..8cddd8f18a 100644 --- a/lily/include/stem-tremolo.hh +++ b/lily/include/stem-tremolo.hh @@ -22,7 +22,7 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM )); DECLARE_SCHEME_CALLBACK (height, (SCM,SCM)); static void set_stem (Grob*me, Grob *st); - static Molecule raw_molecule (Grob*); + static Stencil raw_stencil (Grob*); }; #endif /* ABBREV_HH */ diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 02466710d8..65c23a2f7f 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -37,7 +37,7 @@ public: static Real get_default_stem_end_position (Grob*me); static void position_noteheads (Grob *); static Real stem_end_position (Grob *); - static Molecule flag (Grob *); + static Stencil flag (Grob *); static bool has_interface (Grob *); static void set_spacing_hints (Grob *); diff --git a/lily/include/stencil.hh b/lily/include/stencil.hh new file mode 100644 index 0000000000..9d81bdc13a --- /dev/null +++ b/lily/include/stencil.hh @@ -0,0 +1,90 @@ +/* + stencil.hh -- declare Stencil + + source file of the GNU LilyPond music typesetter + + (c) 1997--2004 Han-Wen Nienhuys +*/ +#ifndef STENCIL_HH +#define STENCIL_HH + +#include // size_t +#include "lily-proto.hh" +#include "box.hh" +#include "axes.hh" +#include "direction.hh" +#include "lily-guile.hh" +#include "smobs.hh" + +/** a group of individually translated symbols. You can add stencils + to the top, to the right, etc. + + It is implemented as a "tree" of scheme expressions, as in + + Expr = combine Expr Expr + | translate Offset Expr + | SCHEME + ; + + SCHEME is a Scheme expression that --when eval'd-- produces the + desired output. + + + Because of the way that Stencil is implemented, it is the most + efficient to add "fresh" stencils to what you're going to build. + + Dimension behavior: + + Empty stencils have empty dimensions. If add_at_edge is used to + init the stencil, we assume that + DIMENSIONS = (Interval (0,0),Interval (0,0) +*/ +class Stencil +{ + friend SCM ly_stencil_set_extent_x (SCM, SCM, SCM); + + Box dim_; + SCM expr_; + + DECLARE_SIMPLE_SMOBS (Stencil,); +public: + Stencil (Box, SCM s); + Stencil (); + + + SCM smobbed_copy () const; + SCM get_expr () const; + + /** + Set dimensions to empty, or to (Interval (0,0),Interval (0,0) */ + void set_empty (bool); + void add_at_edge (Axis a, Direction d, const Stencil &m, Real padding, + Real minimum); + void add_stencil (Stencil const &m); + void translate (Offset); + void align_to (Axis a, Real x); + void translate_axis (Real,Axis); + + Interval extent (Axis) const; + Box extent_box () const; + /** + codify THIS into a Scheme expression. + */ + SCM create_scheme () const; + bool is_empty () const; + + + static SCM ly_get_stencil_extent (SCM mol, SCM axis); + static SCM ly_set_stencil_extent_x (SCM,SCM,SCM); + static SCM ly_stencil_combined_at_edge (SCM,SCM,SCM,SCM,SCM); +}; + + +DECLARE_UNSMOB(Stencil,stencil); +SCM fontify_atom (Font_metric const*, SCM atom); + +Stencil create_stencil (SCM print); + + + +#endif diff --git a/lily/include/system-start-delimiter.hh b/lily/include/system-start-delimiter.hh index 59e87f29e3..828a11da7c 100644 --- a/lily/include/system-start-delimiter.hh +++ b/lily/include/system-start-delimiter.hh @@ -25,9 +25,9 @@ public: static bool has_interface (Grob*); DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); static void try_collapse (Grob*); - static Molecule staff_bracket (Grob*,Real) ; - static Molecule staff_brace (Grob*,Real) ; - static Molecule simple_bar (Grob*,Real) ; + static Stencil staff_bracket (Grob*,Real) ; + static Stencil staff_brace (Grob*,Real) ; + static Stencil simple_bar (Grob*,Real) ; }; #endif /* SYSTEM_START_DELIMITER_HH */ diff --git a/lily/include/system.hh b/lily/include/system.hh index 1f77cac75a..df209eb5fe 100644 --- a/lily/include/system.hh +++ b/lily/include/system.hh @@ -41,7 +41,7 @@ public: void add_column (Paper_column*); void typeset_grob (Grob*); - void output_molecule (SCM, Offset); + void output_stencil (SCM, Offset); void output_scheme (SCM); void pre_processing (); protected: diff --git a/lily/include/text-item.hh b/lily/include/text-item.hh index e272303e4b..1ef5255c5d 100644 --- a/lily/include/text-item.hh +++ b/lily/include/text-item.hh @@ -13,7 +13,7 @@ #include "lily-proto.hh" #include "lily-guile.hh" -#include "molecule.hh" +#include "stencil.hh" class Text_item { diff --git a/lily/include/time-signature.hh b/lily/include/time-signature.hh index 2488c75660..ac25f89c86 100644 --- a/lily/include/time-signature.hh +++ b/lily/include/time-signature.hh @@ -20,8 +20,8 @@ struct Time_signature { static bool has_interface (Grob*); - static Molecule special_time_signature (Grob*,SCM,int,int) ; - static Molecule numbered_time_signature (Grob*,int, int); + static Stencil special_time_signature (Grob*,SCM,int,int) ; + static Stencil numbered_time_signature (Grob*,int, int); DECLARE_SCHEME_CALLBACK (print, (SCM )); }; #endif // METER_HH diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 6bf46324bf..36ac26cf2f 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -53,7 +53,7 @@ public: Translator_group (Translator_group const &); Translator_group (); - + bool is_alias (SCM) const; void add_fresh_group_translator (Translator *trans); void add_used_group_translator (Translator *trans); bool is_bottom_context () const; diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 00ffc86d94..fe4d51aaa5 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -38,7 +38,6 @@ class Translator public: Music_output_def * output_def_; - bool is_alias (SCM) const; Translator (Translator const &); diff --git a/lily/include/tuplet-bracket.hh b/lily/include/tuplet-bracket.hh index 0b37235201..b875a2f2cb 100644 --- a/lily/include/tuplet-bracket.hh +++ b/lily/include/tuplet-bracket.hh @@ -31,7 +31,7 @@ public: DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM )); DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM )); - static Molecule make_bracket (Grob *me, Axis protusion_axis, + static Stencil make_bracket (Grob *me, Axis protusion_axis, Offset dz, Drul_array height, Real gap, Drul_array widen, Drul_array shorten); diff --git a/lily/include/vaticana-ligature.hh b/lily/include/vaticana-ligature.hh index 333a64992e..ee68e69649 100644 --- a/lily/include/vaticana-ligature.hh +++ b/lily/include/vaticana-ligature.hh @@ -10,7 +10,7 @@ #define VATICANA_LIGATURE_HH #include "lily-guile.hh" -#include "molecule.hh" +#include "stencil.hh" struct Vaticana_ligature { diff --git a/lily/include/virtual-font-metric.hh b/lily/include/virtual-font-metric.hh index 0946ac8eba..a3859954df 100644 --- a/lily/include/virtual-font-metric.hh +++ b/lily/include/virtual-font-metric.hh @@ -22,11 +22,11 @@ public: virtual int count () const; virtual Box get_indexed_char (int ascii) const; virtual Box get_ascii_char (int ascii) const; - virtual Molecule get_indexed_char_molecule (int ascii) const; - virtual Molecule get_ascii_char_molecule (int ascii) const; + virtual Stencil get_indexed_char_stencil (int ascii) const; + virtual Stencil get_ascii_char_stencil (int ascii) const; virtual Offset get_indexed_wxwy (int) const; virtual int name_to_index (String)const; - virtual Molecule find_by_name (String) const; + virtual Stencil find_by_name (String) const; protected: virtual void derived_mark () const; diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 123a6da6c5..eb936456ff 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -10,7 +10,7 @@ #include "item.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "font-interface.hh" #include "staff-symbol-referencer.hh" @@ -114,7 +114,7 @@ Key_signature_interface::print (SCM smob) } SCM newas = me->get_grob_property ("new-accidentals"); - Molecule mol; + Stencil mol; SCM c0s = me->get_grob_property ("c0-position"); int c0p = 0; @@ -132,7 +132,7 @@ Key_signature_interface::print (SCM smob) int alteration = gh_scm2int (ly_cdar (s)); String font_char = Accidental_interface::get_fontcharname (style, alteration); - Molecule acc (fm->find_by_name ("accidentals-" + font_char)); + Stencil acc (fm->find_by_name ("accidentals-" + font_char)); if (acc.is_empty ()) { @@ -162,7 +162,7 @@ Key_signature_interface::print (SCM smob) mol.add_at_edge (X_AXIS, LEFT, Lookup::blank (Box (x,y)), 0, 0); - Molecule natural; + Stencil natural; if (gh_pair_p (old)) natural=Font_interface::get_default_font (me)-> find_by_name (String ("accidentals-") + style + String ("0")); @@ -177,7 +177,7 @@ Key_signature_interface::print (SCM smob) int alteration = 0; int pos = alteration_pos (what, alteration, c0p); - Molecule m = natural; + Stencil m = natural; m.translate_axis (pos* inter, Y_AXIS); /* diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index 49b4cfa209..a026118b98 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -110,7 +110,7 @@ Ligature_engraver::create_ligature_spanner () * nests \[ and \]. */ void -Ligature_engraver::override_molecule_callback () +Ligature_engraver::override_stencil_callback () { SCM target_callback = ly_symbol2scm ("print-function"); SCM source_callback = ly_symbol2scm ("ligature-primitive-callback"); @@ -134,7 +134,7 @@ Ligature_engraver::override_molecule_callback () * nests \[ and \]. */ void -Ligature_engraver::revert_molecule_callback () +Ligature_engraver::revert_stencil_callback () { SCM symbol = ly_symbol2scm ("NoteHead"); SCM key = ly_symbol2scm ("print-function"); @@ -166,7 +166,7 @@ Ligature_engraver::process_music () finished_ligature_ = ligature_; primitives_.clear (); ligature_ = 0; - revert_molecule_callback (); + revert_stencil_callback (); } last_bound_ = unsmob_grob (get_property ("currentMusicalColumn")); @@ -206,7 +206,7 @@ Ligature_engraver::process_music () ligature_start_mom_ = now_mom (); announce_grob(ligature_, reqs_drul_[START]->self_scm()); - override_molecule_callback (); + override_stencil_callback (); } } diff --git a/lily/line-interface.cc b/lily/line-interface.cc index a4adb8e357..091eac7cf1 100644 --- a/lily/line-interface.cc +++ b/lily/line-interface.cc @@ -8,14 +8,14 @@ source file of the GNU LilyPond music typesetter */ #include "line-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "grob.hh" #include "staff-symbol-referencer.hh" #include "lookup.hh" #include "paper-def.hh" -Molecule +Stencil Line_interface::make_dashed_line (Real thick, Offset from, Offset to, Real dash_period, Real dash_fraction) { @@ -38,12 +38,12 @@ Line_interface::make_dashed_line (Real thick, Offset from, Offset to, box[X_AXIS].widen (thick/2); box[Y_AXIS].widen (thick/2); - Molecule m = Molecule (box, at); + Stencil m = Stencil (box, at); m.translate (from); return m; } -Molecule +Stencil Line_interface::make_line (Real th, Offset from, Offset to) { SCM at = scm_list_n (ly_symbol2scm ("draw-line"), @@ -61,10 +61,10 @@ Line_interface::make_line (Real th, Offset from, Offset to) box[X_AXIS].widen (th/2); box[Y_AXIS].widen (th/2); - return Molecule (box, at); + return Stencil (box, at); } -Molecule +Stencil Line_interface::line (Grob *me, Offset from, Offset to) { Real thick = Staff_symbol_referencer::line_thickness (me) @@ -86,7 +86,7 @@ Line_interface::line (Grob *me, Offset from, Offset to) * robust_scm2double (me->get_grob_property ("dash-period"), 1.0); if (period < 0) - return Molecule (); + return Stencil (); return make_dashed_line (thick, from, to, period, fraction); } diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index e7e59d5259..2f91fd7aa5 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -8,7 +8,7 @@ #include -#include "molecule.hh" +#include "stencil.hh" #include "item.hh" #include "spanner.hh" #include "line-spanner.hh" @@ -21,8 +21,8 @@ #include "lookup.hh" #include "line-interface.hh" -Molecule -zigzag_molecule (Grob *me, +Stencil +zigzag_stencil (Grob *me, Offset from, Offset to) { @@ -53,7 +53,7 @@ zigzag_molecule (Grob *me, b[X_AXIS].widen (thick/2); b[Y_AXIS].widen (thick/2); - return Molecule (b, list); + return Stencil (b, list); } MAKE_SCHEME_CALLBACK(Line_spanner, after_line_breaking, 1); @@ -91,8 +91,8 @@ Line_spanner::after_line_breaking (SCM g) } -Molecule -Line_spanner::line_molecule (Grob *me, +Stencil +Line_spanner::line_stencil (Grob *me, Offset from, Offset to) { @@ -106,7 +106,7 @@ Line_spanner::line_molecule (Grob *me, || (type == ly_symbol2scm ("trill") && dz[Y_AXIS] != 0))) { return (type == ly_symbol2scm ("zigzag")) - ? zigzag_molecule (me, from, to) + ? zigzag_stencil (me, from, to) : Line_interface::line (me, from, to); } else if (gh_symbol_p (type) @@ -120,8 +120,8 @@ Line_spanner::line_molecule (Grob *me, Font_metric *fm = select_font (me->get_paper (), gh_cons (style_alist, alist_chain)); - Molecule m = fm->find_by_name ("scripts-trill-element"); - Molecule mol; + Stencil m = fm->find_by_name ("scripts-trill-element"); + Stencil mol; do mol.add_at_edge (X_AXIS, RIGHT, m, 0,0); @@ -139,7 +139,7 @@ Line_spanner::line_molecule (Grob *me, mol.translate (from); return mol; } - return Molecule(); + return Stencil(); } /* @@ -166,7 +166,7 @@ line_spanner_common_parent (Grob *me) Warning: this thing is a cross-staff object, so it should have empty Y-dimensions. (If not, you risk that this is called from the staff-alignment - routine, via molecule_extent. At this point, the staves aren't + routine, via stencil_extent. At this point, the staves aren't separated yet, so it doesn't work cross-staff. */ @@ -245,7 +245,7 @@ Line_spanner::print (SCM smob) dz = (dz.length () - 2*gap) *dir; - Molecule l (line_molecule (me, Offset(0, 0), dz)); + Stencil l (line_stencil (me, Offset(0, 0), dz)); l.translate (dir * gap + p1 - Offset (me->relative_coordinate (commonx, X_AXIS), @@ -280,7 +280,7 @@ Line_spanner::print (SCM smob) ofxy = dxy * (off/dxy.length ()); dxy -= 2*ofxy; - Molecule line = line_molecule (me, Offset (0,0),dxy); + Stencil line = line_stencil (me, Offset (0,0),dxy); line.translate_axis (bound[LEFT]->extent (bound[LEFT], X_AXIS).length ()/2, X_AXIS); line.translate (ofxy - my_off + his_off); diff --git a/lily/lookup.cc b/lily/lookup.cc index 0d950735b0..667aef9431 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -18,12 +18,12 @@ #include "file-path.hh" #include "main.hh" #include "lily-guile.hh" -#include "molecule.hh" +#include "stencil.hh" #include "lookup.hh" #include "font-metric.hh" #include "interval.hh" -Molecule +Stencil Lookup::dot (Offset p, Real radius) { SCM at = (scm_list_n (ly_symbol2scm ("dot"), @@ -34,7 +34,7 @@ Lookup::dot (Offset p, Real radius) Box box; box.add_point (p - Offset (radius, radius)); box.add_point (p + Offset (radius, radius)); - return Molecule (box, at); + return Stencil (box, at); } @@ -56,7 +56,7 @@ Lookup::dot (Offset p, Real radius) * <-----> * width */ -Molecule +Stencil Lookup::beam (Real slope, Real width, Real thick, Real blot) { Real height = slope * width; @@ -72,10 +72,10 @@ Lookup::beam (Real slope, Real width, Real thick, Real blot) gh_double2scm (thick), gh_double2scm (blot), SCM_UNDEFINED); - return Molecule (b, at); + return Stencil (b, at); } -Molecule +Stencil Lookup::dashed_slur (Bezier b, Real thick, Real dash) { SCM l = SCM_EOL; @@ -92,12 +92,12 @@ Lookup::dashed_slur (Bezier b, Real thick, Real dash) SCM_UNDEFINED)); Box box (Interval (0,0),Interval (0,0)); - return Molecule (box, at); + return Stencil (box, at); } -Molecule +Stencil Lookup::horizontal_line (Interval w, Real th) { SCM at = scm_list_n (ly_symbol2scm ("horizontal-line"), @@ -111,17 +111,17 @@ Lookup::horizontal_line (Interval w, Real th) box[X_AXIS] = w; box[Y_AXIS] = Interval (-th/2,th/2); - return Molecule (box, at); + return Stencil (box, at); } -Molecule +Stencil Lookup::blank (Box b) { - return Molecule (b, scm_makfrom0str ("")); + return Stencil (b, scm_makfrom0str ("")); } -Molecule +Stencil Lookup::filled_box (Box b) { SCM at = (scm_list_n (ly_symbol2scm ("filledbox"), @@ -131,7 +131,7 @@ Lookup::filled_box (Box b) gh_double2scm (b[Y_AXIS][UP]), SCM_UNDEFINED)); - return Molecule (b,at); + return Stencil (b,at); } /* @@ -161,7 +161,7 @@ Lookup::filled_box (Box b) * |<-------------------------->| * Box extent(X_AXIS) */ -Molecule +Stencil Lookup::round_filled_box (Box b, Real blotdiameter) { if (b.x ().length () < blotdiameter) @@ -183,13 +183,13 @@ Lookup::round_filled_box (Box b, Real blotdiameter) gh_double2scm (blotdiameter), SCM_UNDEFINED)); - return Molecule (b,at); + return Stencil (b,at); } /* - * Create Molecule that represents a filled polygon with round edges. + * Create Stencil that represents a filled polygon with round edges. * * LIMITATIONS: * @@ -228,7 +228,7 @@ Lookup::round_filled_box (Box b, Real blotdiameter) * postscript routine in the backend effectively does, but on the * shrinked polygon). --jr */ -Molecule +Stencil Lookup::round_filled_polygon (Array points, Real blotdiameter) { /* TODO: Maybe print a warning if one of the above limitations @@ -249,7 +249,7 @@ Lookup::round_filled_polygon (Array points, Real blotdiameter) /* special cases: degenerated polygons */ if (points.size () == 0) - return Molecule (); + return Stencil (); if (points.size () == 1) return dot (points[0], 0.5 * blotdiameter); if (points.size () == 2) @@ -316,7 +316,7 @@ Lookup::round_filled_polygon (Array points, Real blotdiameter) gh_double2scm (blotdiameter), SCM_UNDEFINED); - Molecule polygon = Molecule (box, polygon_scm); + Stencil polygon = Stencil (box, polygon_scm); shrinked_points.clear (); return polygon; } @@ -325,10 +325,10 @@ Lookup::round_filled_polygon (Array points, Real blotdiameter) /* TODO: deprecate? */ -Molecule +Stencil Lookup::frame (Box b, Real thick, Real blot) { - Molecule m; + Stencil m; Direction d = LEFT; for (Axis a = X_AXIS; a < NO_AXES; a = Axis (a + 1)) { @@ -340,7 +340,7 @@ Lookup::frame (Box b, Real thick, Real blot) edges[o][DOWN] = b[o][DOWN] - thick/2; edges[o][UP] = b[o][UP] + thick/2; - m.add_molecule (round_filled_box (edges, blot)); + m.add_stencil (round_filled_box (edges, blot)); } while (flip (&d) != LEFT); } @@ -350,7 +350,7 @@ Lookup::frame (Box b, Real thick, Real blot) /* Make a smooth curve along the points */ -Molecule +Stencil Lookup::slur (Bezier curve, Real curvethick, Real linethick) { Real alpha = (curve.control_[3] - curve.control_[0]).arg (); @@ -391,7 +391,7 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) b[X_AXIS].unite (back.extent (X_AXIS)); b[Y_AXIS].unite (back.extent (Y_AXIS)); - return Molecule (b, at); + return Stencil (b, at); } /* @@ -417,7 +417,7 @@ Lookup::slur (Bezier curve, Real curvethick, Real linethick) * | * */ -Molecule +Stencil Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve) { /* @@ -444,28 +444,28 @@ Lookup::bezier_sandwich (Bezier top_curve, Bezier bottom_curve) y_extent.unite (bottom_curve.extent (Y_AXIS)); Box b (x_extent, y_extent); - return Molecule (b, horizontal_bend); + return Stencil (b, horizontal_bend); } /* TODO: junk me. */ -Molecule +Stencil Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) { - Molecule m; + Stencil m; String sym = ly_scm2string (ly_car (s)); String reg = ly_scm2string (ly_car (ly_cdr (s))); if (sym == "Discant") { - Molecule r = fm->find_by_name ("accordion-accDiscant"); - m.add_molecule (r); + Stencil r = fm->find_by_name ("accordion-accDiscant"); + m.add_stencil (r); if (reg.left_string (1) == "F") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 2.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } int eflag = 0x00; @@ -491,135 +491,135 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) } if (eflag & 0x02) { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 1.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); } if (eflag & 0x04) { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 1.5 PT, Y_AXIS); d.translate_axis (0.8 * staff_space PT, X_AXIS); - m.add_molecule (d); + m.add_stencil (d); } if (eflag & 0x01) { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 1.5 PT, Y_AXIS); d.translate_axis (-0.8 * staff_space PT, X_AXIS); - m.add_molecule (d); + m.add_stencil (d); } if (reg.left_string (2) == "SS") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (0.5 * staff_space PT, Y_AXIS); d.translate_axis (0.4 * staff_space PT, X_AXIS); - m.add_molecule (d); + m.add_stencil (d); d.translate_axis (-0.8 * staff_space PT, X_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-2); } if (reg.left_string (1) == "S") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (0.5 * staff_space PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } } else if (sym == "Freebase") { - Molecule r = fm->find_by_name ("accordion-accFreebase"); - m.add_molecule (r); + Stencil r = fm->find_by_name ("accordion-accFreebase"); + m.add_stencil (r); if (reg.left_string (1) == "F") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 1.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } if (reg == "E") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 0.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); } } else if (sym == "Bayanbase") { - Molecule r = fm->find_by_name ("accordion-accBayanbase"); - m.add_molecule (r); + Stencil r = fm->find_by_name ("accordion-accBayanbase"); + m.add_stencil (r); if (reg.left_string (1) == "T") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 2.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } /* include 4' reed just for completeness. You don't want to use this. */ if (reg.left_string (1) == "F") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 1.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } if (reg.left_string (2) == "EE") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 0.5 PT, Y_AXIS); d.translate_axis (0.4 * staff_space PT, X_AXIS); - m.add_molecule (d); + m.add_stencil (d); d.translate_axis (-0.8 * staff_space PT, X_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-2); } if (reg.left_string (1) == "E") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 0.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } } else if (sym == "Stdbase") { - Molecule r = fm->find_by_name ("accordion-accStdbase"); - m.add_molecule (r); + Stencil r = fm->find_by_name ("accordion-accStdbase"); + m.add_stencil (r); if (reg.left_string (1) == "T") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 3.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } if (reg.left_string (1) == "F") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 2.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } if (reg.left_string (1) == "M") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 2 PT, Y_AXIS); d.translate_axis (staff_space PT, X_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } if (reg.left_string (1) == "E") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 1.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } if (reg.left_string (1) == "S") { - Molecule d = fm->find_by_name ("accordion-accDot"); + Stencil d = fm->find_by_name ("accordion-accDot"); d.translate_axis (staff_space * 0.5 PT, Y_AXIS); - m.add_molecule (d); + m.add_stencil (d); reg = reg.right_string (reg.length ()-1); } } @@ -627,28 +627,28 @@ Lookup::accordion (SCM s, Real staff_space, Font_metric *fm) for the rectangle */ else if (sym == "SB") { - Molecule r = fm->find_by_name ("accordion-accSB"); - m.add_molecule (r); + Stencil r = fm->find_by_name ("accordion-accSB"); + m.add_stencil (r); } else if (sym == "BB") { - Molecule r = fm->find_by_name ("accordion-accBB"); - m.add_molecule (r); + Stencil r = fm->find_by_name ("accordion-accBB"); + m.add_stencil (r); } else if (sym == "OldEE") { - Molecule r = fm->find_by_name ("accordion-accOldEE"); - m.add_molecule (r); + Stencil r = fm->find_by_name ("accordion-accOldEE"); + m.add_stencil (r); } else if (sym == "OldEES") { - Molecule r = fm->find_by_name ("accordion-accOldEES"); - m.add_molecule (r); + Stencil r = fm->find_by_name ("accordion-accOldEES"); + m.add_stencil (r); } return m; } -Molecule +Stencil Lookup::repeat_slash (Real w, Real s, Real t) { SCM wid = gh_double2scm (w); @@ -660,11 +660,11 @@ Lookup::repeat_slash (Real w, Real s, Real t) Box b (Interval (0, w + sqrt (sqr(t/s) + sqr (t))), Interval (0, w * s)); - return Molecule (b, slashnodot); // http://slashnodot.org + return Stencil (b, slashnodot); // http://slashnodot.org } -Molecule +Stencil Lookup::bracket (Axis a, Interval iv, Real thick, Real protude, Real blot) { Box b; @@ -672,20 +672,20 @@ Lookup::bracket (Axis a, Interval iv, Real thick, Real protude, Real blot) b[a] = iv; b[other] = Interval(-1, 1) * thick * 0.5; - Molecule m = round_filled_box (b, blot); + Stencil m = round_filled_box (b, blot); b[a] = Interval (iv[UP] - thick, iv[UP]); Interval oi = Interval (-thick/2, thick/2 + fabs (protude)) ; oi *= sign (protude); b[other] = oi; - m.add_molecule (round_filled_box (b, blot)); + m.add_stencil (round_filled_box (b, blot)); b[a] = Interval (iv[DOWN], iv[DOWN] +thick); - m.add_molecule (round_filled_box (b,blot)); + m.add_stencil (round_filled_box (b,blot)); return m; } -Molecule +Stencil Lookup::triangle (Interval iv, Real thick, Real protude) { Box b ; @@ -697,7 +697,7 @@ Lookup::triangle (Interval iv, Real thick, Real protude) gh_double2scm (iv.length()), gh_double2scm (protude), SCM_UNDEFINED); - return Molecule (b, s); + return Stencil (b, s); } diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 40ee4b391c..05e90ba421 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -11,7 +11,7 @@ #include "box.hh" #include "warn.hh" #include "lookup.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-column.hh" #include "paper-def.hh" #include "lyric-extender.hh" @@ -106,7 +106,7 @@ Lyric_extender::print (SCM smob) if (w < 1.5 * h) return SCM_EOL; - Molecule mol (Lookup::round_filled_box (Box (Interval (0,w), Interval (0,h)), + Stencil mol (Lookup::round_filled_box (Box (Interval (0,w), Interval (0,h)), 0.8 * h)); mol.translate_axis (left_point - me->relative_coordinate (common, X_AXIS), X_AXIS); return mol.smobbed_copy (); diff --git a/lily/lyric-hyphen.cc b/lily/lyric-hyphen.cc index f608ddc77f..3691dedc62 100644 --- a/lily/lyric-hyphen.cc +++ b/lily/lyric-hyphen.cc @@ -10,7 +10,7 @@ #include "box.hh" #include "lookup.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "paper-column.hh" #include "spanner.hh" @@ -74,14 +74,14 @@ Hyphen_spanner::print (SCM smob) space_left = space_left >? 0.0; Box b (Interval (0, dl), Interval (h,h+th)); - Molecule dash_mol (Lookup::round_filled_box (b, 0.8 * lt)); + Stencil dash_mol (Lookup::round_filled_box (b, 0.8 * lt)); - Molecule total; + Stencil total; for (int i = 0; i < n; i++) { - Molecule m (dash_mol); + Stencil m (dash_mol); m.translate_axis (span_points[LEFT] + i * dp + space_left / 2, X_AXIS); - total.add_molecule (m); + total.add_stencil (m); } total.translate_axis ( -me->relative_coordinate (common, X_AXIS), X_AXIS); diff --git a/lily/measure-grouping-spanner.cc b/lily/measure-grouping-spanner.cc index 780e77547b..2896a3d8e8 100644 --- a/lily/measure-grouping-spanner.cc +++ b/lily/measure-grouping-spanner.cc @@ -40,7 +40,7 @@ Measure_grouping::print (SCM grob) Interval iv (0,w); - Molecule m; + Stencil m; /* TODO: use line interface diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index 9d09027e14..0866707bd1 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -10,7 +10,7 @@ #include "item.hh" #include "mensural-ligature.hh" #include "font-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "lookup.hh" #include "staff-symbol-referencer.hh" #include "note-head.hh" @@ -22,7 +22,7 @@ * * TODO: move this function to class Lookup? */ -Molecule +Stencil brew_flexa (Grob *me, Real interval, bool solid, @@ -33,7 +33,7 @@ brew_flexa (Grob *me, { Real staff_space = Staff_symbol_referencer::staff_space (me); Real height = 0.6 * staff_space; - Molecule molecule = Molecule (); + Stencil stencil = Stencil (); if (add_cauda) { @@ -57,9 +57,9 @@ brew_flexa (Grob *me, -0.5*height - cauda_box_y.length(); Box cauda_box (cauda_box_x, cauda_box_y); - Molecule cauda = Lookup::filled_box (cauda_box); + Stencil cauda = Lookup::filled_box (cauda_box); cauda.translate_axis (y_correction, Y_AXIS); - molecule.add_molecule (cauda); + stencil.add_stencil (cauda); } Real slope = (interval / 2.0 * staff_space) / width; @@ -72,38 +72,38 @@ brew_flexa (Grob *me, if (solid) { - Molecule solid_head = + Stencil solid_head = Lookup::beam (corrected_slope, width, height, 0.0); - molecule.add_molecule (solid_head); + stencil.add_stencil (solid_head); } else // outline { - Molecule left_edge = + Stencil left_edge = Lookup::beam (corrected_slope, thickness, height, 0.0); - molecule.add_molecule(left_edge); + stencil.add_stencil(left_edge); - Molecule right_edge = + Stencil right_edge = Lookup::beam (corrected_slope, thickness, height, 0.0); right_edge.translate_axis (width-thickness, X_AXIS); right_edge.translate_axis (corrected_slope * (width-thickness), Y_AXIS); - molecule.add_molecule(right_edge); + stencil.add_stencil(right_edge); - Molecule bottom_edge = + Stencil bottom_edge = Lookup::beam (corrected_slope, width, thickness, 0.0); bottom_edge.translate_axis (-0.5*height, Y_AXIS); - molecule.add_molecule (bottom_edge); + stencil.add_stencil (bottom_edge); - Molecule top_edge = + Stencil top_edge = Lookup::beam (corrected_slope, width, thickness, 0.0); top_edge.translate_axis (+0.5*height, Y_AXIS); - molecule.add_molecule (top_edge); + stencil.add_stencil (top_edge); } - molecule.translate_axis (ypos_correction, Y_AXIS); - return molecule; + stencil.translate_axis (ypos_correction, Y_AXIS); + return stencil; } void -add_ledger_lines (Grob *me, Molecule *out, int pos, Real offs, +add_ledger_lines (Grob *me, Stencil *out, int pos, Real offs, bool ledger_take_space) { int interspaces = Staff_symbol_referencer::line_count (me)-1; @@ -115,16 +115,16 @@ add_ledger_lines (Grob *me, Molecule *out, int pos, Real offs, Interval l_extents = Interval (hd[LEFT] - left_ledger_protusion, hd[RIGHT] + right_ledger_protusion); - Molecule ledger_lines = + Stencil ledger_lines = Note_head::brew_ledger_lines (me, pos, interspaces, l_extents,0, ledger_take_space); ledger_lines.translate_axis (offs, Y_AXIS); - out->add_molecule (ledger_lines); + out->add_stencil (ledger_lines); } } -Molecule +Stencil internal_brew_primitive (Grob *me, bool ledger_take_space) { SCM primitive_scm = me->get_grob_property ("primitive"); @@ -132,10 +132,10 @@ internal_brew_primitive (Grob *me, bool ledger_take_space) { programming_error ("Mensural_ligature:" "undefined primitive -> ignoring grob"); - return Molecule (); + return Stencil (); } - Molecule out; + Stencil out; int primitive = gh_scm2int (primitive_scm); int delta_pitch = 0; Real thickness = 0.0; @@ -157,7 +157,7 @@ internal_brew_primitive (Grob *me, bool ledger_take_space) switch (primitive) { case MLP_NONE: - return Molecule(); + return Stencil(); case MLP_BB: out = brew_flexa (me, delta_pitch, false, flexa_width, thickness, true, DOWN); @@ -182,7 +182,7 @@ internal_brew_primitive (Grob *me, bool ledger_take_space) default: programming_error (_f ("Mensural_ligature:" "unexpected case fall-through")); - return Molecule (); + return Stencil (); } SCM join_left_scm = me->get_grob_property ("join-left-amount"); @@ -198,8 +198,8 @@ internal_brew_primitive (Grob *me, bool ledger_take_space) Interval (0, -join_left * 0.5 * staff_space); Box join_box (x_extent, y_extent); - Molecule join = Lookup::round_filled_box (join_box, blotdiameter); - out.add_molecule (join); + Stencil join = Lookup::round_filled_box (join_box, blotdiameter); + out.add_stencil (join); } int pos = (int)rint (Staff_symbol_referencer::get_position (me)); diff --git a/lily/molecule-scheme.cc b/lily/molecule-scheme.cc deleted file mode 100644 index 3ac21c095a..0000000000 --- a/lily/molecule-scheme.cc +++ /dev/null @@ -1,227 +0,0 @@ -/* - molecule-scheme.cc -- implement Molecule - - source file of the GNU LilyPond music typesetter - - (c) 1997--2004 Han-Wen Nienhuys -*/ - -#include "molecule.hh" -#include "font-metric.hh" - -LY_DEFINE(ly_molecule_set_extent_x,"ly:molecule-set-extent!", 3 , 0, 0, - (SCM mol, SCM axis, SCM np), - "Set the extent (@var{extent} must be a pair of numbers) of @var{mol} in \n" -"@var{axis} direction (0 or 1 for x- and y-axis respectively).\n" -"\n" -"Note that an extent @code{(A . B)} is an interval and hence @code{A} is\n" -"smaller than @code{B}, and is often negative.\n" -) -{ - Molecule* m = unsmob_molecule (mol); - SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule"); - SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); - SCM_ASSERT_TYPE (is_number_pair (np), np, SCM_ARG3, __FUNCTION__, "number pair"); - - Interval iv = ly_scm2interval (np); - m->dim_[Axis (gh_scm2int (axis))] = iv; - - return SCM_UNDEFINED; -} - - -LY_DEFINE(ly_translate_molecule_axis,"ly:molecule-translate-axis", 3, 0, 0, - (SCM mol, SCM amount, SCM axis), - "Return a @var{mol}, but translated by @var{amount} in @var{axis} direction") -{ - Molecule* m = unsmob_molecule (mol); - SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule"); - SCM_ASSERT_TYPE (gh_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair"); - SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); - - - Molecule q (*m); - q.translate_axis (gh_scm2double (amount), Axis (gh_scm2int (axis))); - - return q.smobbed_copy(); -} - -LY_DEFINE(ly_translate_molecule,"ly:molecule-translate", 2, 0, 0, - (SCM mol, SCM offset), - "Return a @var{mol}, but translated by @var{offset} (a pair of numbers).") -{ - Molecule* m = unsmob_molecule (mol); - SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule"); - SCM_ASSERT_TYPE (is_number_pair (offset), offset, SCM_ARG2, __FUNCTION__, "number pair"); - Offset o = ly_scm2offset (offset); - - Molecule q (*m); - q.translate (o); - return q.smobbed_copy(); -} - -LY_DEFINE(ly_molecule_get_extent, - "ly:molecule-get-extent", 2 , 0, 0, (SCM mol, SCM axis), - "Return a pair of numbers signifying the extent of @var{mol} in " -"@var{axis} direction (0 or 1 for x and y axis respectively)." -) -{ - Molecule *m = unsmob_molecule (mol); - SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "molecule"); - SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); - - return ly_interval2scm (m->extent (Axis (gh_scm2int (axis)))); -} - - -LY_DEFINE(ly_molecule_combined_at_edge, - "ly:molecule-combine-at-edge", - 4, 2, 0, (SCM first, SCM axis, SCM direction, - SCM second, - SCM padding, - SCM minimum), - "Construct a molecule by putting @var{second} next to " -"@var{first}. @var{axis} can be 0 (x-axis) or 1 (y-axis), @var{direction} can be " -"-1 (left or down) or 1 (right or up). " -"The molecules are juxtaposed with @var{padding} as extra space. If " -"this puts the reference points closer than @var{minimum}, they are moved " -"by the latter amount.") - -{ - Molecule * m1 = unsmob_molecule (first); - Molecule * m2 = unsmob_molecule (second); - Molecule result; - - - SCM_ASSERT_TYPE(is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); - SCM_ASSERT_TYPE(is_direction (direction), direction, SCM_ARG4, __FUNCTION__, "dir"); - - Real p = 0.0; - if (padding != SCM_UNDEFINED) - { - SCM_ASSERT_TYPE(gh_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number"); - p = gh_scm2double (padding); - } - Real m =0.0; - if (minimum != SCM_UNDEFINED) - { - SCM_ASSERT_TYPE(gh_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); - m = gh_scm2double (minimum); - } - - if (m1) - result = *m1; - if (m2) - result.add_at_edge (Axis (gh_scm2int (axis)), Direction (gh_scm2int (direction)), - *m2, p, m); - - return result.smobbed_copy (); -} - -/* - FIXME: support variable number of arguments. - - */ -LY_DEFINE(ly_molecule_add , - "ly:molecule-add", 0, 0, 1, (SCM args), - "Combine molecules. Takes any number of arguments." - ) -{ -#define FUNC_NAME __FUNCTION__ - SCM_VALIDATE_REST_ARGUMENT (args); - - Molecule result; - - while (!SCM_NULLP (args)) - { - Molecule * m = unsmob_molecule (gh_car (args)); - - if (!m) - SCM_ASSERT_TYPE(m, gh_car (args), SCM_ARGn, __FUNCTION__, - "Molecule"); - - result.add_molecule (*m); - - args = gh_cdr (args); - } - - return result.smobbed_copy (); -} - -LY_DEFINE(ly_make_molecule, - "ly:make-molecule", 3, 0, 0, (SCM expr, SCM xext, SCM yext), - " \n" -"The objective of any typesetting system is to put ink on paper in the \n" -"right places. For LilyPond, this final stage is left to the @TeX{} and \n" -"the printer subsystem. For lily, the last stage in processing a score is \n" -"outputting a description of what to put where. This description roughly \n" -"looks like \n" -"@example \n" -" PUT glyph AT (x,y) \n" -" PUT glyph AT (x,y) \n" -" PUT glyph AT (x,y) \n" -"@end example \n" -"you merely have to look at the tex output of lily to see this. \n" -"Internally these instructions are encoded in Molecules.@footnote{At some \n" -"point LilyPond also contained Atom-objects, but they have been replaced \n" -"by Scheme expressions, making the name outdated.} A molecule is \n" -"what-to-print-where information that also contains dimension information \n" -"(how large is this glyph?). \n" -" \n" -"Conceptually, Molecules can be constructed from Scheme code, by \n" -"translating a Molecule and by combining two molecules. In BNF \n" -"notation: \n" -" \n" -"@example \n" -"Molecule :: COMBINE Molecule Molecule \n" -" | TRANSLATE Offset Molecule \n" -" | GLYPH-DESCRIPTION \n" -" ; \n" -"@end example \n" -" \n" -"If you are interested in seeing how this information is stored, you \n" -"can run with the @code{-f scm} option. The scheme expressions are then \n" -"dumped in the output file.") -{ - SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG2, __FUNCTION__, "number pair"); - SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG3, __FUNCTION__, "number pair"); - - Box b (ly_scm2interval (xext), ly_scm2interval(yext)); - Molecule m (b, expr); - return m.smobbed_copy (); -} - - -SCM -fontify_atom (Font_metric const * met, SCM f) -{ - if (f == SCM_EOL) - return f; - else - return scm_list_n (ly_symbol2scm ("fontify"), - ly_quote_scm (met->description_), f, SCM_UNDEFINED); -} - -LY_DEFINE(ly_fontify_atom,"ly:fontify-atom", 2, 0, 0, - (SCM met, SCM f), - "Add a font selection command for the font metric @var{met} to @var{f}.") -{ - SCM_ASSERT_TYPE(unsmob_metrics (met), met, SCM_ARG1, __FUNCTION__, "font metric"); - - return fontify_atom (unsmob_metrics (met), f); -} -LY_DEFINE(ly_align_to_x,"ly:molecule-align-to!", 3, 0, 0, (SCM mol, SCM axis, SCM dir), - - "Align @var{mol} using its own extents. @var{dir} is a number -1, 1 are " - " left and right respectively. Other values are interpolated (so 0 means " - " the center. ") -{ - SCM_ASSERT_TYPE(unsmob_molecule (mol), mol, SCM_ARG1, __FUNCTION__, "molecule"); - SCM_ASSERT_TYPE(is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); - SCM_ASSERT_TYPE(gh_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number"); - - unsmob_molecule (mol)->align_to ((Axis)gh_scm2int (axis), - gh_scm2double (dir)); - - return SCM_UNDEFINED; -} diff --git a/lily/molecule.cc b/lily/molecule.cc deleted file mode 100644 index 552e88675c..0000000000 --- a/lily/molecule.cc +++ /dev/null @@ -1,192 +0,0 @@ -/* - molecule.cc -- implement Molecule - - source file of the GNU LilyPond music typesetter - - (c) 1997--2004 Han-Wen Nienhuys -*/ - -#include -#include // isinf - -#include "font-metric.hh" -#include "dimensions.hh" -#include "interval.hh" -#include "string.hh" -#include "molecule.hh" -#include "warn.hh" - - -#include "ly-smobs.icc" - - -SCM -Molecule::smobbed_copy () const -{ - Molecule * m = new Molecule (*this); - - return m->smobbed_self (); -} - -Interval -Molecule::extent (Axis a) const -{ - return dim_[a]; -} - -Molecule::Molecule (Box b, SCM func) -{ - expr_ = func; - dim_ = b; -} - -Molecule::Molecule () -{ - expr_ = SCM_EOL; - set_empty (true); -} - -void -Molecule::translate (Offset o) -{ - Axis a = X_AXIS; - while (a < NO_AXES) - { - if (abs (o[a]) > 100 CM - || isinf (o[a]) || isnan (o[a])) - { - programming_error ("Improbable offset for translation: setting to zero"); - o[a] = 0.0; - } - incr (a); - } - - expr_ = scm_list_n (ly_symbol2scm ("translate-molecule"), - ly_offset2scm (o), - expr_, SCM_UNDEFINED); - if (!is_empty ()) - dim_.translate (o); -} - - -void -Molecule::translate_axis (Real x,Axis a) -{ - Offset o (0,0); - o[a] = x; - translate (o); -} - - - -void -Molecule::add_molecule (Molecule const &m) -{ - expr_ = scm_list_n (ly_symbol2scm ("combine-molecule"), - m.expr_, - expr_, SCM_UNDEFINED); - dim_.unite (m.dim_); -} - -void -Molecule::set_empty (bool e) -{ - if (e) - { - dim_[X_AXIS].set_empty (); - dim_[Y_AXIS].set_empty (); - } - else - { - dim_[X_AXIS] = Interval (0,0); - dim_[Y_AXIS] = Interval (0,0); - } -} - - -void -Molecule::align_to (Axis a, Real x) -{ - if (is_empty ()) - return ; - - Interval i (extent (a)); - translate_axis (-i.linear_combination (x), a); -} - -/* - See scheme Function. - */ -void -Molecule::add_at_edge (Axis a, Direction d, Molecule const &m, Real padding, - Real minimum) -{ - Real my_extent= is_empty () ? 0.0 : dim_[a][d]; - Interval i (m.extent (a)); - Real his_extent; - if (i.is_empty ()) - { - programming_error ("Molecule::add_at_edge: adding empty molecule."); - his_extent = 0.0; - } - else - his_extent = i[-d]; - - Real offset = (my_extent - his_extent) + d*padding; - if (minimum > 0 && fabs (offset) < minimum) - offset = sign (offset) * minimum; - - Molecule toadd (m); - toadd.translate_axis (offset, a); - add_molecule (toadd); -} - - - -/* - Hmm... maybe this is not such a good idea ; stuff can be empty, - while expr_ == '() - */ -bool -Molecule::is_empty () const -{ - return expr_ == SCM_EOL; -} - -SCM -Molecule::get_expr () const -{ - return expr_; -} - - - -Box -Molecule::extent_box () const -{ - return dim_; -} -IMPLEMENT_SIMPLE_SMOBS (Molecule); - - -int -Molecule::print_smob (SCM , SCM port, scm_print_state *) -{ - scm_puts ("#", port); - - return 1; -} - - -SCM -Molecule::mark_smob (SCM s) -{ - Molecule *r = (Molecule *) ly_cdr (s); - - return r->expr_; -} - -IMPLEMENT_TYPE_P (Molecule, "ly:molecule?"); -IMPLEMENT_DEFAULT_EQUAL_P (Molecule); - diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 36dbd24241..ad45fbc197 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -13,7 +13,7 @@ #include "paper-column.hh" // urg #include "font-interface.hh" #include "rest.hh" -#include "molecule.hh" +#include "stencil.hh" #include "misc.hh" #include "spanner.hh" #include "staff-symbol-referencer.hh" @@ -29,7 +29,7 @@ Multi_measure_rest::percent (SCM smob) Grob *me = unsmob_grob (smob); Spanner *sp = dynamic_cast (me); - Molecule r = Percent_repeat_item_interface::x_percent (me, 1, 0.75, 1.6); + Stencil r = Percent_repeat_item_interface::x_percent (me, 1, 0.75, 1.6); // ugh copy & paste. @@ -97,8 +97,8 @@ Multi_measure_rest::print (SCM smob) Real x_off = (sp_iv[LEFT] - rx) >? 0; - Molecule mol; - mol.add_molecule (symbol_molecule (me, space)); + Stencil mol; + mol.add_stencil (symbol_stencil (me, space)); int measures = 0; SCM m (me->get_grob_property ("measure-count")); @@ -113,8 +113,8 @@ Multi_measure_rest::print (SCM smob) -Molecule -Multi_measure_rest::symbol_molecule (Grob *me, Real space) +Stencil +Multi_measure_rest::symbol_stencil (Grob *me, Real space) { int measures = 0; SCM m (me->get_grob_property ("measure-count")); @@ -123,14 +123,14 @@ Multi_measure_rest::symbol_molecule (Grob *me, Real space) measures = gh_scm2int (m); } if (measures <= 0) - return Molecule(); + return Stencil(); SCM limit = me->get_grob_property ("expand-limit"); if (measures > gh_scm2int (limit)) { Real padding = 0.15; - Molecule s = big_rest (me, (1.0 - 2*padding) * space); + Stencil s = big_rest (me, (1.0 - 2*padding) * space); s.translate_axis (padding * space, X_AXIS); return s; } @@ -146,7 +146,7 @@ Multi_measure_rest::symbol_molecule (Grob *me, Real space) { if (sml == SCM_BOOL_T) { - Molecule s = musfont->find_by_name (Rest::glyph_name (me, -1, "")); + Stencil s = musfont->find_by_name (Rest::glyph_name (me, -1, "")); s.translate_axis ((space - s.extent (X_AXIS).length ())/2, X_AXIS); @@ -154,7 +154,7 @@ Multi_measure_rest::symbol_molecule (Grob *me, Real space) } else { - Molecule s = musfont->find_by_name (Rest::glyph_name (me, 0, "")); + Stencil s = musfont->find_by_name (Rest::glyph_name (me, 0, "")); /* ugh. @@ -177,7 +177,7 @@ Multi_measure_rest::symbol_molecule (Grob *me, Real space) /* WIDTH can also be 0 to determine the minimum size of the object. */ -Molecule +Stencil Multi_measure_rest::big_rest (Grob *me, Real width) { Real thick_thick =robust_scm2double (me->get_grob_property ("thick-thickness"), 1.0); @@ -192,8 +192,8 @@ Multi_measure_rest::big_rest (Grob *me, Real width) Real blot = width ? (.8 * (y find_by_name ("rests-" + to_string (k))); + Stencil r (musfont->find_by_name ("rests-" + to_string (k))); symbols_width += r.extent (X_AXIS).length (); mols = gh_cons (r.smobbed_copy (), mols); } @@ -260,7 +260,7 @@ Multi_measure_rest::church_rest (Grob*me, Font_metric *musfont, int measures, l --; } - Molecule r (musfont->find_by_name ("rests-" + to_string (k))); + Stencil r (musfont->find_by_name ("rests-" + to_string (k))); if (k == 0) { Real staff_space = Staff_symbol_referencer::staff_space (me); @@ -281,10 +281,10 @@ Multi_measure_rest::church_rest (Grob*me, Font_metric *musfont, int measures, inner_padding = 1.0; } - Molecule mol; + Stencil mol; for (SCM s = mols; gh_pair_p (s); s = gh_cdr(s)) { - mol.add_at_edge (X_AXIS, LEFT, *unsmob_molecule (gh_car (s)), inner_padding, 0); + mol.add_at_edge (X_AXIS, LEFT, *unsmob_stencil (gh_car (s)), inner_padding, 0); } mol.align_to (X_AXIS, LEFT); mol.translate_axis (outer_padding_factor * inner_padding, X_AXIS); @@ -319,7 +319,7 @@ Multi_measure_rest::set_spacing_rods (SCM smob) Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}}; - Real sym_width = symbol_molecule (me, 0.0).extent (X_AXIS).length (); + Real sym_width = symbol_stencil (me, 0.0).extent (X_AXIS).length (); for (int i=0; i < 4; i++) { diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 06a91a352b..f412d4d2ba 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -67,7 +67,6 @@ static Keyword_ent the_key_tab[]={ {"paper", PAPER}, {"partcombine", PARTCOMBINE}, {"partial", PARTIAL}, - {"property", PROPERTY}, {"relative", RELATIVE}, {"remove", REMOVE}, {"repeat", REPEAT}, diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 9683378af8..4d1992e9cb 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -204,7 +204,7 @@ check_meshing_chords (Grob *me, if (wipe_ball->live ()) { wipe_ball->set_grob_property ("transparent", SCM_BOOL_T); - wipe_ball->set_grob_property ("molecule", SCM_EOL); + wipe_ball->set_grob_property ("stencil", SCM_EOL); if (Grob *d = unsmob_grob (wipe_ball->get_grob_property ("dot"))) d->suicide (); diff --git a/lily/note-head.cc b/lily/note-head.cc index e620fdf7a4..af32eeb209 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -14,7 +14,7 @@ #include "note-head.hh" #include "warn.hh" #include "font-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "event.hh" #include "rhythmic-head.hh" #include "staff-symbol-referencer.hh" @@ -62,7 +62,7 @@ TODO: ledger lines are also a property of the staff. Maybe move them to there? */ -Molecule +Stencil Note_head::brew_ledger_lines (Grob *me, int pos, int interspaces, @@ -75,7 +75,7 @@ Note_head::brew_ledger_lines (Grob *me, int line_count = (abs (pos) < interspaces) ? 0 : (abs (pos) - interspaces) / 2; - Molecule molecule = Molecule(); + Stencil stencil = Stencil(); if (line_count) @@ -86,11 +86,11 @@ Note_head::brew_ledger_lines (Grob *me, Interval y_extent = Interval (-0.5*(ledgerlinethickness), +0.5*(ledgerlinethickness)); - Molecule proto_ledger_line = + Stencil proto_ledger_line = Lookup::round_filled_box (Box (x_extent, y_extent), blotdiameter); x_extent[LEFT] += left_shorten; - Molecule proto_first_line = + Stencil proto_first_line = Lookup::round_filled_box (Box (x_extent, y_extent), blotdiameter); if (!take_space) @@ -106,25 +106,25 @@ Note_head::brew_ledger_lines (Grob *me, for (int i = 0; i < line_count; i++) { - Molecule ledger_line ((i == 0) + Stencil ledger_line ((i == 0) ? proto_first_line : proto_ledger_line ); ledger_line.translate_axis (-dir * inter_f * i * 2 + offs, Y_AXIS); - molecule.add_molecule (ledger_line); + stencil.add_stencil (ledger_line); } } - return molecule; + return stencil; } -Molecule +Stencil internal_print (Grob *me, bool with_ledgers) { SCM style = me->get_grob_property ("style"); if (!gh_symbol_p (style)) { - return Molecule (); + return Stencil (); } SCM log = gh_int2scm (Note_head::get_balltype (me)); @@ -133,7 +133,7 @@ internal_print (Grob *me, bool with_ledgers) String font_char = "noteheads-" + ly_scm2string (scm_font_char); Font_metric * fm = Font_interface::get_default_font (me); - Molecule out = fm->find_by_name (font_char); + Stencil out = fm->find_by_name (font_char); if (out.is_empty ()) { me->warning (_f ("note head `%s' not found", font_char.to_str0 ())); @@ -170,7 +170,7 @@ internal_print (Grob *me, bool with_ledgers) */ } - out.add_molecule (Note_head::brew_ledger_lines (me, pos, interspaces, + out.add_stencil (Note_head::brew_ledger_lines (me, pos, interspaces, ledger_size, left_shorten, false)); @@ -203,14 +203,14 @@ Note_head::head_extent (Grob *me, Axis a) SCM brewer = me->get_grob_property ("print-function"); if (brewer == Note_head::print_proc) { - Molecule mol = internal_print (me, false); + Stencil mol = internal_print (me, false); if (!mol.is_empty ()) return mol.extent (a); } else { - Molecule * mol = me->get_molecule (); + Stencil * mol = me->get_stencil (); if (mol) return mol->extent (a) ; } @@ -220,7 +220,7 @@ Note_head::head_extent (Grob *me, Axis a) /* This is necessary to prevent a cyclic dependency: the appearance of - the ledgers depends on positioning, so the Grob::get_molecule() can + the ledgers depends on positioning, so the Grob::get_stencil() can not be used for determining the note head extent. */ @@ -233,9 +233,9 @@ Note_head::extent (SCM smob, SCM axis) return ly_interval2scm (head_extent (me, (Axis) gh_scm2int (axis))); } -MAKE_SCHEME_CALLBACK (Note_head,brew_ez_molecule,1); +MAKE_SCHEME_CALLBACK (Note_head,brew_ez_stencil,1); SCM -Note_head::brew_ez_molecule (SCM smob) +Note_head::brew_ez_stencil (SCM smob) { Grob *me = unsmob_grob (smob); int l = Note_head::get_balltype (me); @@ -258,7 +258,7 @@ Note_head::brew_ez_molecule (SCM smob) gh_int2scm (1-b), SCM_UNDEFINED); Box bx (Interval (0, 1.0), Interval (-0.5, 0.5)); - Molecule m (bx, at); + Stencil m (bx, at); int pos = (int)rint (Staff_symbol_referencer::get_position (me)); int interspaces = Staff_symbol_referencer::line_count (me)-1; @@ -266,7 +266,7 @@ Note_head::brew_ez_molecule (SCM smob) { Interval hd = m.extent (X_AXIS); hd.widen ( hd.length ()/4); - m.add_molecule (brew_ledger_lines (me, pos, interspaces, hd, 0, false)); + m.add_stencil (brew_ledger_lines (me, pos, interspaces, hd, 0, false)); } return m.smobbed_copy (); diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 9adaded43c..7e72c8c937 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -7,7 +7,7 @@ */ -#include "molecule.hh" +#include "stencil.hh" #include "text-item.hh" #include "text-spanner.hh" #include "line-spanner.hh" @@ -68,9 +68,9 @@ Ottava_bracket::print (SCM smob) SCM properties = Font_interface::font_alist_chain (me); SCM markup = me->get_grob_property ("text"); - Molecule text; + Stencil text; if (Text_item::markup_p (markup)) - text = *unsmob_molecule (Text_item::interpret_markup (paper->self_scm (), properties, markup)); + text = *unsmob_stencil (Text_item::interpret_markup (paper->self_scm (), properties, markup)); Drul_array shorten = robust_scm2interval (me->get_grob_property ("shorten-pair"), @@ -130,7 +130,7 @@ Ottava_bracket::print (SCM smob) if (broken[RIGHT]) edge_height[RIGHT] = 0.0; - Molecule b; + Stencil b; if (!bracket_span_points.is_empty () && bracket_span_points.length () > 0.001) b = Tuplet_bracket::make_bracket (me, Y_AXIS, Offset (bracket_span_points.length (), 0), @@ -153,14 +153,14 @@ Ottava_bracket::print (SCM smob) */ - b = Molecule (Box (b.extent (X_AXIS), + b = Stencil (Box (b.extent (X_AXIS), Interval (0.1,0.1)), b.get_expr ()); b.translate_axis (bracket_span_points[LEFT], X_AXIS); text.translate_axis (span_points[LEFT], X_AXIS); text.align_to (Y_AXIS, CENTER); - b.add_molecule (text); + b.add_stencil (text); b.translate_axis (- me->relative_coordinate (common, X_AXIS), X_AXIS); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index f6f081f54b..af24691999 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -12,7 +12,7 @@ #include "warn.hh" #include "axis-group-interface.hh" #include "spaceable-grob.hh" -#include "molecule.hh" +#include "stencil.hh" #include "text-item.hh" #include "lookup.hh" #include "font-interface.hh" @@ -122,14 +122,14 @@ Paper_column::print (SCM p) SCM scm_mol = Text_item::interpret_markup (me->get_paper ()->self_scm (), properties, scm_makfrom0str (r.to_str0 ())); - Molecule t = *unsmob_molecule (scm_mol); + Stencil t = *unsmob_stencil (scm_mol); t.align_to (X_AXIS, CENTER); t.align_to (Y_AXIS, DOWN); - Molecule l = Lookup::filled_box (Box (Interval (-0.01, 0.01), + Stencil l = Lookup::filled_box (Box (Interval (-0.01, 0.01), Interval (-2, -1))); - t.add_molecule (l); + t.add_stencil (l); return t.smobbed_copy (); } diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index e31c61b4a9..bda8c562fb 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -13,7 +13,7 @@ #include "dimensions.hh" #include "virtual-methods.hh" #include "paper-outputter.hh" -#include "molecule.hh" +#include "stencil.hh" #include "array.hh" #include "string-convert.hh" #include "warn.hh" diff --git a/lily/parser.yy b/lily/parser.yy index dfbe3dfc32..7cd980afc5 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -283,7 +283,6 @@ yylex (YYSTYPE *s, void * v) %token PAPER %token PARTCOMBINE %token PARTIAL -%token PROPERTY %token RELATIVE %token REMOVE %token REPEAT @@ -381,8 +380,9 @@ yylex (YYSTYPE *s, void * v) %type embedded_scm scalar %type Music Sequential_music Simultaneous_music %type relative_music re_rhythmed_music -%type music_property_def context_change -%type Music_list +%type music_property_def context_change +%type context_prop_spec +%type Music_list %type property_operation context_mod translator_mod optional_context_mod %type music_output_def_body music_output_def_head %type post_event tagged_post_event @@ -1168,27 +1168,52 @@ context_mod: } ; -music_property_def: - PROPERTY STRING '.' property_operation { - Music * t = property_op_to_music ($4); - Music *csm = MY_MAKE_MUSIC("ContextSpeccedMusic"); - - csm->set_mus_property ("element", t->self_scm ()); - scm_gc_unprotect_object (t->self_scm ()); - - $$ = csm; - $$->set_spot (THIS->here_input ()); +context_prop_spec: + STRING { + $$ = scm_list_n (ly_symbol2scm ("Bottom"), scm_string_to_symbol ($1), SCM_UNDEFINED); + } + | STRING '.' STRING { + $$ = scm_list_n (scm_string_to_symbol ($1), scm_string_to_symbol ($3), SCM_UNDEFINED); + } + ; - csm-> set_mus_property ("context-type", scm_string_to_symbol ($2)); +music_property_def: + OVERRIDE context_prop_spec embedded_scm '=' scalar { + $$ = property_op_to_music (scm_list_n ( + ly_symbol2scm ("poppush"), + gh_cadr ($2), + $3, $5, SCM_UNDEFINED)); + $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL); + } + | SET context_prop_spec '=' scalar { + $$ = property_op_to_music (scm_list_n ( + ly_symbol2scm ("assign"), + gh_cadr ($2), + $4, SCM_UNDEFINED)); + $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL); + } + | REVERT context_prop_spec embedded_scm { + $$ = property_op_to_music (scm_list_n ( + ly_symbol2scm ("pop"), + gh_cadr ($2), + $3, SCM_UNDEFINED)); + + $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL); + } + | UNSET context_prop_spec { + $$ = property_op_to_music (scm_list_n ( + ly_symbol2scm ("unset"), + gh_cadr ($2))); + $$= context_spec_music (gh_car ($2), SCM_UNDEFINED, $$, SCM_EOL); } | ONCE music_property_def { $$ = $2; - SCM e = $2->get_mus_property ("element"); - unsmob_music (e)->set_mus_property ("once", SCM_BOOL_T); + $$->set_mus_property ("once", SCM_BOOL_T); } ; + scalar: string { $$ = $1; } | bare_int { $$ = gh_int2scm ($1); } @@ -2448,7 +2473,8 @@ context_spec_music (SCM type, SCM id, Music * m, SCM ops) csm->set_mus_property ("element", m->self_scm ()); scm_gc_unprotect_object (m->self_scm ()); - csm->set_mus_property ("context-type", scm_string_to_symbol (type)); + csm->set_mus_property ("context-type", + gh_symbol_p (type) ? type : scm_string_to_symbol (type)); csm->set_mus_property ("property-operations", ops); if (gh_string_p (id)) diff --git a/lily/percent-repeat-item.cc b/lily/percent-repeat-item.cc index 5688ce5fa5..480acb826c 100644 --- a/lily/percent-repeat-item.cc +++ b/lily/percent-repeat-item.cc @@ -10,13 +10,13 @@ #include "grob.hh" #include "lookup.hh" -#include "molecule.hh" +#include "stencil.hh" #include "font-interface.hh" #include "font-metric.hh" #include "percent-repeat-item.hh" -Molecule +Stencil Percent_repeat_item_interface::brew_slash ( Grob *me) { Real slope = robust_scm2double (me->get_grob_property ("slope"), 1); @@ -26,7 +26,7 @@ Percent_repeat_item_interface::brew_slash ( Grob *me) todo: check out if in staff-rule thickness normally. */ Real thick = robust_scm2double (me->get_grob_property ("thickness"), 1); - Molecule m = Lookup::repeat_slash (wid, slope, thick); + Stencil m = Lookup::repeat_slash (wid, slope, thick); m.translate_axis (-m.extent (Y_AXIS).center (), Y_AXIS); return m; } @@ -34,20 +34,20 @@ Percent_repeat_item_interface::brew_slash ( Grob *me) /* todo: use grob props for dot_neg_kern, slash_neg_kern? */ -Molecule +Stencil Percent_repeat_item_interface::x_percent (Grob *me, int count, Real dot_neg_kern, Real slash_neg_kern) { - Molecule m ; - Molecule s = brew_slash (me); + Stencil m ; + Stencil s = brew_slash (me); for (int i = count; i--;) { m.add_at_edge (X_AXIS, RIGHT, s, -slash_neg_kern,0); } - Molecule d1 = Font_interface::get_default_font (me)->find_by_name ("dots-dot"); - Molecule d2 = d1; + Stencil d1 = Font_interface::get_default_font (me)->find_by_name ("dots-dot"); + Stencil d2 = d1; d1.translate_axis (0.5, Y_AXIS ); d2.translate_axis (-0.5, Y_AXIS); @@ -62,7 +62,7 @@ SCM Percent_repeat_item_interface::double_percent (SCM grob) { Grob *me = unsmob_grob (grob); - Molecule m = x_percent (me, 2, 0.75, 1.6); + Stencil m = x_percent (me, 2, 0.75, 1.6); m.translate_axis (- m.extent (X_AXIS).center (), X_AXIS); return m.smobbed_copy (); } @@ -72,7 +72,7 @@ SCM Percent_repeat_item_interface::beat_slash (SCM grob) { Grob *me = unsmob_grob (grob); - Molecule m = brew_slash (me); + Stencil m = brew_slash (me); return m.smobbed_copy (); } diff --git a/lily/piano-pedal-bracket.cc b/lily/piano-pedal-bracket.cc index 957a795274..fb9a2ac4f6 100644 --- a/lily/piano-pedal-bracket.cc +++ b/lily/piano-pedal-bracket.cc @@ -7,7 +7,7 @@ source file of the GNU LilyPond music typesetter */ -#include "molecule.hh" +#include "stencil.hh" #include "spanner.hh" #include "item.hh" #include "tuplet-bracket.hh" @@ -69,7 +69,7 @@ Piano_pedal_bracket::print (SCM smob) } - Molecule m ; + Stencil m ; if (!span_points.is_empty () && span_points.length () > 0.001) { diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index b9068bea0c..77283f3bce 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -340,7 +340,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed) p->bracket_->set_bound (RIGHT, cmc); /* - Set properties so that the molecule-creating function will + Set properties so that the stencil-creating function will know whether the right edge should be flared ___/ */ @@ -364,7 +364,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed) p->bracket_ = make_spanner ("PianoPedalBracket"); /* - Set properties so that the molecule-creating function will + Set properties so that the stencil-creating function will know whether the left edge should be flared \___ */ @@ -376,7 +376,7 @@ Piano_pedal_engraver::create_bracket_grobs (Pedal_info *p, bool mixed) /* Set this property for 'mixed style' pedals, Ped._______/\ , - so the molecule function will shorten the ____ line by the length of the Ped. text. + so the stencil function will shorten the ____ line by the length of the Ped. text. */ if (mixed) diff --git a/lily/rest.cc b/lily/rest.cc index 210e756814..0d01e41155 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -6,7 +6,7 @@ (c) 1997--2004 Han-Wen Nienhuys */ -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "font-interface.hh" #include "rest.hh" @@ -114,13 +114,13 @@ Rest::glyph_name (Grob *me, int balltype, String style) MAKE_SCHEME_CALLBACK (Rest,print,1); SCM -Rest::brew_internal_molecule (SCM smob) +Rest::brew_internal_stencil (SCM smob) { Grob* me = unsmob_grob (smob); SCM balltype_scm = me->get_grob_property ("duration-log"); if (!gh_number_p (balltype_scm)) - return Molecule ().smobbed_copy (); + return Stencil ().smobbed_copy (); int balltype = gh_scm2int (balltype_scm); @@ -133,7 +133,7 @@ Rest::brew_internal_molecule (SCM smob) Font_metric *fm = Font_interface::get_default_font (me); String font_char = glyph_name (me, balltype, style); - Molecule out = fm->find_by_name (font_char); + Stencil out = fm->find_by_name (font_char); if (out.is_empty ()) { me->warning (_f ("rest `%s' not found, ", font_char.to_str0 ())); @@ -145,18 +145,18 @@ Rest::brew_internal_molecule (SCM smob) SCM Rest::print (SCM smob) { - return brew_internal_molecule (smob); + return brew_internal_stencil (smob); } MAKE_SCHEME_CALLBACK (Rest,extent_callback,2); /* - We need the callback. The real molecule has ledgers depending on + We need the callback. The real stencil has ledgers depending on Y-position. The Y-position is known only after line breaking. */ SCM Rest::extent_callback (SCM smob, SCM ax) { Axis a = (Axis) gh_scm2int (ax); - SCM m = brew_internal_molecule (smob); - return ly_interval2scm (unsmob_molecule (m)->extent (a)); + SCM m = brew_internal_stencil (smob); + return ly_interval2scm (unsmob_stencil (m)->extent (a)); } diff --git a/lily/scaled-font-metric.cc b/lily/scaled-font-metric.cc index ca0039386d..b3a07b3270 100644 --- a/lily/scaled-font-metric.cc +++ b/lily/scaled-font-metric.cc @@ -9,7 +9,7 @@ #include "scaled-font-metric.hh" #include "string.hh" -#include "molecule.hh" +#include "stencil.hh" Scaled_font_metric::Scaled_font_metric (Font_metric* m, Real magn) @@ -31,13 +31,13 @@ Scaled_font_metric::make_scaled_font_metric (Font_metric*m, Real s) return sfm->self_scm (); } -Molecule +Stencil Scaled_font_metric::find_by_name (String s) const { - Molecule m = orig_->find_by_name (s); + Stencil m = orig_->find_by_name (s); Box b = m.extent_box (); b.scale (magnification_); - Molecule q (b,fontify_atom ((Font_metric*) this, m.get_expr ())); + Stencil q (b,fontify_atom ((Font_metric*) this, m.get_expr ())); return q ; } diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 03826157bf..e313e0a0e0 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -103,7 +103,7 @@ void make_script_from_event (Grob *p, *descr = art; - copy_property (p, ly_symbol2scm ("script-molecule"), art); + copy_property (p, ly_symbol2scm ("script-stencil"), art); copy_property (p, ly_symbol2scm ("direction"), art); copy_property (p, ly_symbol2scm ("side-relative-direction"), art); diff --git a/lily/script.cc b/lily/script.cc index 3e8a8148b7..619f4e420b 100644 --- a/lily/script.cc +++ b/lily/script.cc @@ -14,15 +14,15 @@ #include "side-position-interface.hh" #include "paper-def.hh" #include "item.hh" -#include "molecule.hh" +#include "stencil.hh" #include "lookup.hh" #include "stem.hh" #include "note-column.hh" -Molecule -Script_interface::get_molecule (Grob * me, Direction d) +Stencil +Script_interface::get_stencil (Grob * me, Direction d) { - SCM s = me->get_grob_property ("script-molecule"); + SCM s = me->get_grob_property ("script-stencil"); assert (gh_pair_p (s)); SCM key = ly_car (s); @@ -41,7 +41,7 @@ Script_interface::get_molecule (Grob * me, Direction d) else assert (false); - return Molecule (); + return Stencil (); } MAKE_SCHEME_CALLBACK (Script_interface,before_line_breaking,1); @@ -86,11 +86,11 @@ Script_interface::print (SCM smob) Direction dir = Side_position_interface::get_direction (me); if (!dir) { - programming_error ("Script direction not known, but molecule wanted."); + programming_error ("Script direction not known, but stencil wanted."); dir= DOWN; } - return get_molecule (me, dir).smobbed_copy (); + return get_stencil (me, dir).smobbed_copy (); } @@ -111,5 +111,5 @@ ADD_INTERFACE (Text_script,"text-script-interface", ADD_INTERFACE (Script_interface, "script-interface", "", - "script-priority script-molecule"); + "script-priority script-stencil"); diff --git a/lily/slur.cc b/lily/slur.cc index 5777cdcf20..9868d30b9c 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -29,7 +29,7 @@ #include "note-column.hh" #include "stem.hh" #include "paper-column.hh" -#include "molecule.hh" +#include "stencil.hh" #include "warn.hh" #include "slur-bezier-bow.hh" #include "main.hh" @@ -528,9 +528,9 @@ Slur::height (SCM smob, SCM ax) Grob * me = unsmob_grob (smob); assert (a == Y_AXIS); - SCM mol = me->get_uncached_molecule (); + SCM mol = me->get_uncached_stencil (); Interval ext; - if (Molecule * m = unsmob_molecule (mol)) + if (Stencil * m = unsmob_stencil (mol)) ext = m->extent (a); return ly_interval2scm (ext); } @@ -559,7 +559,7 @@ Slur::print (SCM smob) if (!scm_ilength (me->get_grob_property ("note-columns"))) return SCM_EOL; - Molecule a; + Stencil a; SCM d = me->get_grob_property ("dashed"); if (gh_number_p (d)) a = Lookup::dashed_slur (one, thick, thick * robust_scm2double (d, 0)); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 46c39c6798..a8b1862337 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -10,7 +10,7 @@ #include "font-interface.hh" #include "dimensions.hh" #include "paper-def.hh" -#include "molecule.hh" +#include "stencil.hh" #include "warn.hh" #include "axis-group-interface.hh" #include "group-interface.hh" @@ -71,7 +71,7 @@ Span_bar::print (SCM smobbed_me) String glyph_string = ly_scm2string (glyph); /* compose span_bar_mol */ - Molecule span_bar_mol; + Stencil span_bar_mol; Interval prev_extent; for (SCM elts = first_elt; gh_pair_p (elts); elts = ly_cdr (elts)) @@ -93,11 +93,11 @@ Span_bar::print (SCM smobbed_me) } else { - Molecule interbar = Bar_line::compound_barline (staff_bar, + Stencil interbar = Bar_line::compound_barline (staff_bar, glyph_string, l.length ()); interbar.translate_axis (l.center (), Y_AXIS); - span_bar_mol.add_molecule (interbar); + span_bar_mol.add_stencil (interbar); } } prev_extent = ext; @@ -121,7 +121,7 @@ Span_bar::width_callback (SCM element_smob, SCM scm_axis) /* urg. */ - Molecule m = Bar_line::compound_barline (se, gl, 40 PT); + Stencil m = Bar_line::compound_barline (se, gl, 40 PT); return ly_interval2scm (m.extent (X_AXIS)); } diff --git a/lily/spanner.cc b/lily/spanner.cc index fdc34380a4..0a4a585d03 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -13,7 +13,7 @@ #include "spanner.hh" #include "paper-column.hh" #include "paper-score.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-outputter.hh" #include "paper-column.hh" #include "system.hh" diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index a8ef6c0d1b..ab0c72b0d5 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -9,7 +9,7 @@ #include "lookup.hh" #include "dimensions.hh" #include "paper-def.hh" -#include "molecule.hh" +#include "stencil.hh" #include "warn.hh" #include "item.hh" #include "staff-symbol.hh" @@ -68,14 +68,14 @@ Staff_symbol::print (SCM smob) int l = Staff_symbol::line_count (me); Real height = (l-1) * staff_space (me) /2; - Molecule m; + Stencil m; for (int i=0; i < l; i++) { - Molecule a = + Stencil a = Lookup::horizontal_line (Interval (0,width), t); a.translate_axis (height - i * staff_space (me), Y_AXIS); - m.add_molecule (a); + m.add_stencil (a); } return m.smobbed_copy (); diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index c3a8b54c52..327433bbdb 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -46,17 +46,17 @@ Stem_tremolo::height (SCM smob, SCM ax) Grob * me = unsmob_grob (smob); assert (a == Y_AXIS); - SCM mol = me->get_uncached_molecule (); + SCM mol = me->get_uncached_stencil (); - if (Molecule *m = unsmob_molecule (mol)) + if (Stencil *m = unsmob_stencil (mol)) return ly_interval2scm (m->extent (a)); else return ly_interval2scm (Interval()); } -Molecule -Stem_tremolo::raw_molecule (Grob *me) +Stencil +Stem_tremolo::raw_stencil (Grob *me) { Grob *stem = unsmob_grob (me->get_grob_property ("stem")); Grob *beam = Stem::get_beam (stem); @@ -87,7 +87,7 @@ Stem_tremolo::raw_molecule (Grob *me) width *= ss; thick *= ss; - Molecule a (Lookup::beam (dydx, width, thick, blot)); + Stencil a (Lookup::beam (dydx, width, thick, blot)); a.translate (Offset (-width/2, width / 2 * dydx)); int tremolo_flags = 0; @@ -100,7 +100,7 @@ Stem_tremolo::raw_molecule (Grob *me) programming_error ("No tremolo flags?"); me->suicide(); - return Molecule (); + return Stencil (); } /* @@ -110,12 +110,12 @@ Stem_tremolo::raw_molecule (Grob *me) */ Real beam_translation = beam ? Beam::get_beam_translation (beam) : 0.81; - Molecule mol; + Stencil mol; for (int i = 0; i < tremolo_flags; i++) { - Molecule b (a); + Stencil b (a); b.translate_axis (beam_translation * i, Y_AXIS); - mol.add_molecule (b); + mol.add_stencil (b); } return mol; } @@ -134,7 +134,7 @@ Stem_tremolo::print (SCM grob) ? Beam::get_beam_translation (beam) : 0.81; - Molecule mol = raw_molecule (me); + Stencil mol = raw_stencil (me); Interval mol_ext = mol.extent (Y_AXIS); Real ss = Staff_symbol_referencer::staff_space (me); diff --git a/lily/stem.cc b/lily/stem.cc index a5d0c00e73..c0af303c0c 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -23,7 +23,7 @@ #include "paper-def.hh" #include "rhythmic-head.hh" #include "font-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-column.hh" #include "misc.hh" #include "beam.hh" @@ -345,13 +345,13 @@ Stem::get_default_stem_end_position (Grob*me) Crude hack: add extra space if tremolo flag is there. We can't do this for the beam, since we get into a loop - (Stem_tremolo::raw_molecule() looks at the beam.) + (Stem_tremolo::raw_stencil() looks at the beam.) --hwn */ Real minlen = - 1.0 + 2 * Stem_tremolo::raw_molecule (trem).extent (Y_AXIS).length () / ss; + 1.0 + 2 * Stem_tremolo::raw_stencil (trem).extent (Y_AXIS).length () / ss; if (durlog >= 3) { @@ -559,10 +559,10 @@ Stem::height (SCM smob, SCM ax) Grob * me = unsmob_grob (smob); assert (a == Y_AXIS); - SCM mol = me->get_uncached_molecule (); + SCM mol = me->get_uncached_stencil (); Interval iv; if (mol != SCM_EOL) - iv = unsmob_molecule (mol)->extent (a); + iv = unsmob_stencil (mol)->extent (a); if (Grob *b =get_beam (me)) { Direction d = get_direction (me); @@ -573,7 +573,7 @@ Stem::height (SCM smob, SCM ax) } -Molecule +Stencil Stem::flag (Grob*me) { /* TODO: maybe property stroke-style should take different values, @@ -589,7 +589,7 @@ Stem::flag (Grob*me) if (flag_style == "no-flag") { - return Molecule (); + return Stencil (); } bool adjust = to_boolean (me->get_grob_property ("adjust-if-on-staffline")); @@ -648,7 +648,7 @@ Stem::flag (Grob*me) String font_char = flag_style + to_string (dir) + staffline_offs + to_string (duration_log (me)); Font_metric *fm = Font_interface::get_default_font (me); - Molecule flag = fm->find_by_name ("flags-" + font_char); + Stencil flag = fm->find_by_name ("flags-" + font_char); if (flag.is_empty ()) { me->warning (_f ("flag `%s' not found", font_char)); @@ -661,14 +661,14 @@ Stem::flag (Grob*me) if (!stroke_style.is_empty ()) { String font_char = to_string (dir) + stroke_style; - Molecule stroke = fm->find_by_name ("flags-" + font_char); + Stencil stroke = fm->find_by_name ("flags-" + font_char); if (stroke.is_empty ()) { me->warning (_f ("flag stroke `%s' not found", font_char)); } else { - flag.add_molecule (stroke); + flag.add_stencil (stroke); } } } @@ -707,7 +707,7 @@ SCM Stem::print (SCM smob) { Grob*me = unsmob_grob (smob); - Molecule mol; + Stencil mol; Direction d = get_direction (me); /* @@ -754,15 +754,15 @@ Stem::print (SCM smob) Box b = Box (Interval (-stem_width/2, stem_width/2), Interval (stem_y[DOWN]*dy, stem_y[UP]*dy)); - Molecule ss = Lookup::round_filled_box (b, blot); - mol.add_molecule (ss); + Stencil ss = Lookup::round_filled_box (b, blot); + mol.add_stencil (ss); if (!get_beam (me) && abs (duration_log (me)) > 2) { - Molecule fl = flag (me); + Stencil fl = flag (me); fl.translate_axis (stem_y[d]*dy - d * blot/2, Y_AXIS); fl.translate_axis (stem_width/2, X_AXIS); - mol.add_molecule (fl); + mol.add_stencil (fl); } return mol.smobbed_copy (); diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc new file mode 100644 index 0000000000..9f2f06567c --- /dev/null +++ b/lily/stencil-scheme.cc @@ -0,0 +1,227 @@ +/* + stencil-scheme.cc -- implement Stencil + + source file of the GNU LilyPond music typesetter + + (c) 1997--2004 Han-Wen Nienhuys +*/ + +#include "stencil.hh" +#include "font-metric.hh" + +LY_DEFINE(ly_stencil_set_extent_x,"ly:stencil-set-extent!", 3 , 0, 0, + (SCM mol, SCM axis, SCM np), + "Set the extent (@var{extent} must be a pair of numbers) of @var{mol} in \n" +"@var{axis} direction (0 or 1 for x- and y-axis respectively).\n" +"\n" +"Note that an extent @code{(A . B)} is an interval and hence @code{A} is\n" +"smaller than @code{B}, and is often negative.\n" +) +{ + Stencil* m = unsmob_stencil (mol); + SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "stencil"); + SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); + SCM_ASSERT_TYPE (is_number_pair (np), np, SCM_ARG3, __FUNCTION__, "number pair"); + + Interval iv = ly_scm2interval (np); + m->dim_[Axis (gh_scm2int (axis))] = iv; + + return SCM_UNDEFINED; +} + + +LY_DEFINE(ly_translate_stencil_axis,"ly:stencil-translate-axis", 3, 0, 0, + (SCM mol, SCM amount, SCM axis), + "Return a @var{mol}, but translated by @var{amount} in @var{axis} direction") +{ + Stencil* m = unsmob_stencil (mol); + SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "stencil"); + SCM_ASSERT_TYPE (gh_number_p (amount), amount, SCM_ARG2, __FUNCTION__, "number pair"); + SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); + + + Stencil q (*m); + q.translate_axis (gh_scm2double (amount), Axis (gh_scm2int (axis))); + + return q.smobbed_copy(); +} + +LY_DEFINE(ly_translate_stencil,"ly:stencil-translate", 2, 0, 0, + (SCM mol, SCM offset), + "Return a @var{mol}, but translated by @var{offset} (a pair of numbers).") +{ + Stencil* m = unsmob_stencil (mol); + SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "stencil"); + SCM_ASSERT_TYPE (is_number_pair (offset), offset, SCM_ARG2, __FUNCTION__, "number pair"); + Offset o = ly_scm2offset (offset); + + Stencil q (*m); + q.translate (o); + return q.smobbed_copy(); +} + +LY_DEFINE(ly_stencil_get_extent, + "ly:stencil-get-extent", 2 , 0, 0, (SCM mol, SCM axis), + "Return a pair of numbers signifying the extent of @var{mol} in " +"@var{axis} direction (0 or 1 for x and y axis respectively)." +) +{ + Stencil *m = unsmob_stencil (mol); + SCM_ASSERT_TYPE (m, mol, SCM_ARG1, __FUNCTION__, "stencil"); + SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); + + return ly_interval2scm (m->extent (Axis (gh_scm2int (axis)))); +} + + +LY_DEFINE(ly_stencil_combined_at_edge, + "ly:stencil-combine-at-edge", + 4, 2, 0, (SCM first, SCM axis, SCM direction, + SCM second, + SCM padding, + SCM minimum), + "Construct a stencil by putting @var{second} next to " +"@var{first}. @var{axis} can be 0 (x-axis) or 1 (y-axis), @var{direction} can be " +"-1 (left or down) or 1 (right or up). " +"The stencils are juxtaposed with @var{padding} as extra space. If " +"this puts the reference points closer than @var{minimum}, they are moved " +"by the latter amount.") + +{ + Stencil * m1 = unsmob_stencil (first); + Stencil * m2 = unsmob_stencil (second); + Stencil result; + + + SCM_ASSERT_TYPE(is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis"); + SCM_ASSERT_TYPE(is_direction (direction), direction, SCM_ARG4, __FUNCTION__, "dir"); + + Real p = 0.0; + if (padding != SCM_UNDEFINED) + { + SCM_ASSERT_TYPE(gh_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number"); + p = gh_scm2double (padding); + } + Real m =0.0; + if (minimum != SCM_UNDEFINED) + { + SCM_ASSERT_TYPE(gh_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number"); + m = gh_scm2double (minimum); + } + + if (m1) + result = *m1; + if (m2) + result.add_at_edge (Axis (gh_scm2int (axis)), Direction (gh_scm2int (direction)), + *m2, p, m); + + return result.smobbed_copy (); +} + +/* + FIXME: support variable number of arguments. + + */ +LY_DEFINE(ly_stencil_add , + "ly:stencil-add", 0, 0, 1, (SCM args), + "Combine stencils. Takes any number of arguments." + ) +{ +#define FUNC_NAME __FUNCTION__ + SCM_VALIDATE_REST_ARGUMENT (args); + + Stencil result; + + while (!SCM_NULLP (args)) + { + Stencil * m = unsmob_stencil (gh_car (args)); + + if (!m) + SCM_ASSERT_TYPE(m, gh_car (args), SCM_ARGn, __FUNCTION__, + "Stencil"); + + result.add_stencil (*m); + + args = gh_cdr (args); + } + + return result.smobbed_copy (); +} + +LY_DEFINE(ly_make_stencil, + "ly:make-stencil", 3, 0, 0, (SCM expr, SCM xext, SCM yext), + " \n" +"The objective of any typesetting system is to put ink on paper in the \n" +"right places. For LilyPond, this final stage is left to the @TeX{} and \n" +"the printer subsystem. For lily, the last stage in processing a score is \n" +"outputting a description of what to put where. This description roughly \n" +"looks like \n" +"@example \n" +" PUT glyph AT (x,y) \n" +" PUT glyph AT (x,y) \n" +" PUT glyph AT (x,y) \n" +"@end example \n" +"you merely have to look at the tex output of lily to see this. \n" +"Internally these instructions are encoded in Stencils.@footnote{At some \n" +"point LilyPond also contained Atom-objects, but they have been replaced \n" +"by Scheme expressions, making the name outdated.} A stencil is \n" +"what-to-print-where information that also contains dimension information \n" +"(how large is this glyph?). \n" +" \n" +"Conceptually, Stencils can be constructed from Scheme code, by \n" +"translating a Stencil and by combining two stencils. In BNF \n" +"notation: \n" +" \n" +"@example \n" +"Stencil :: COMBINE Stencil Stencil \n" +" | TRANSLATE Offset Stencil \n" +" | GLYPH-DESCRIPTION \n" +" ; \n" +"@end example \n" +" \n" +"If you are interested in seeing how this information is stored, you \n" +"can run with the @code{-f scm} option. The scheme expressions are then \n" +"dumped in the output file.") +{ + SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG2, __FUNCTION__, "number pair"); + SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG3, __FUNCTION__, "number pair"); + + Box b (ly_scm2interval (xext), ly_scm2interval(yext)); + Stencil m (b, expr); + return m.smobbed_copy (); +} + + +SCM +fontify_atom (Font_metric const * met, SCM f) +{ + if (f == SCM_EOL) + return f; + else + return scm_list_n (ly_symbol2scm ("fontify"), + ly_quote_scm (met->description_), f, SCM_UNDEFINED); +} + +LY_DEFINE(ly_fontify_atom,"ly:fontify-atom", 2, 0, 0, + (SCM met, SCM f), + "Add a font selection command for the font metric @var{met} to @var{f}.") +{ + SCM_ASSERT_TYPE(unsmob_metrics (met), met, SCM_ARG1, __FUNCTION__, "font metric"); + + return fontify_atom (unsmob_metrics (met), f); +} +LY_DEFINE(ly_align_to_x,"ly:stencil-align-to!", 3, 0, 0, (SCM mol, SCM axis, SCM dir), + + "Align @var{mol} using its own extents. @var{dir} is a number -1, 1 are " + " left and right respectively. Other values are interpolated (so 0 means " + " the center. ") +{ + SCM_ASSERT_TYPE(unsmob_stencil (mol), mol, SCM_ARG1, __FUNCTION__, "stencil"); + SCM_ASSERT_TYPE(is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis"); + SCM_ASSERT_TYPE(gh_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number"); + + unsmob_stencil (mol)->align_to ((Axis)gh_scm2int (axis), + gh_scm2double (dir)); + + return SCM_UNDEFINED; +} diff --git a/lily/stencil.cc b/lily/stencil.cc new file mode 100644 index 0000000000..ba2d24e6d8 --- /dev/null +++ b/lily/stencil.cc @@ -0,0 +1,192 @@ +/* + stencil.cc -- implement Stencil + + source file of the GNU LilyPond music typesetter + + (c) 1997--2004 Han-Wen Nienhuys +*/ + +#include +#include // isinf + +#include "font-metric.hh" +#include "dimensions.hh" +#include "interval.hh" +#include "string.hh" +#include "stencil.hh" +#include "warn.hh" + + +#include "ly-smobs.icc" + + +SCM +Stencil::smobbed_copy () const +{ + Stencil * m = new Stencil (*this); + + return m->smobbed_self (); +} + +Interval +Stencil::extent (Axis a) const +{ + return dim_[a]; +} + +Stencil::Stencil (Box b, SCM func) +{ + expr_ = func; + dim_ = b; +} + +Stencil::Stencil () +{ + expr_ = SCM_EOL; + set_empty (true); +} + +void +Stencil::translate (Offset o) +{ + Axis a = X_AXIS; + while (a < NO_AXES) + { + if (abs (o[a]) > 100 CM + || isinf (o[a]) || isnan (o[a])) + { + programming_error ("Improbable offset for translation: setting to zero"); + o[a] = 0.0; + } + incr (a); + } + + expr_ = scm_list_n (ly_symbol2scm ("translate-stencil"), + ly_offset2scm (o), + expr_, SCM_UNDEFINED); + if (!is_empty ()) + dim_.translate (o); +} + + +void +Stencil::translate_axis (Real x,Axis a) +{ + Offset o (0,0); + o[a] = x; + translate (o); +} + + + +void +Stencil::add_stencil (Stencil const &m) +{ + expr_ = scm_list_n (ly_symbol2scm ("combine-stencil"), + m.expr_, + expr_, SCM_UNDEFINED); + dim_.unite (m.dim_); +} + +void +Stencil::set_empty (bool e) +{ + if (e) + { + dim_[X_AXIS].set_empty (); + dim_[Y_AXIS].set_empty (); + } + else + { + dim_[X_AXIS] = Interval (0,0); + dim_[Y_AXIS] = Interval (0,0); + } +} + + +void +Stencil::align_to (Axis a, Real x) +{ + if (is_empty ()) + return ; + + Interval i (extent (a)); + translate_axis (-i.linear_combination (x), a); +} + +/* + See scheme Function. + */ +void +Stencil::add_at_edge (Axis a, Direction d, Stencil const &m, Real padding, + Real minimum) +{ + Real my_extent= is_empty () ? 0.0 : dim_[a][d]; + Interval i (m.extent (a)); + Real his_extent; + if (i.is_empty ()) + { + programming_error ("Stencil::add_at_edge: adding empty stencil."); + his_extent = 0.0; + } + else + his_extent = i[-d]; + + Real offset = (my_extent - his_extent) + d*padding; + if (minimum > 0 && fabs (offset) < minimum) + offset = sign (offset) * minimum; + + Stencil toadd (m); + toadd.translate_axis (offset, a); + add_stencil (toadd); +} + + + +/* + Hmm... maybe this is not such a good idea ; stuff can be empty, + while expr_ == '() + */ +bool +Stencil::is_empty () const +{ + return expr_ == SCM_EOL; +} + +SCM +Stencil::get_expr () const +{ + return expr_; +} + + + +Box +Stencil::extent_box () const +{ + return dim_; +} +IMPLEMENT_SIMPLE_SMOBS (Stencil); + + +int +Stencil::print_smob (SCM , SCM port, scm_print_state *) +{ + scm_puts ("#", port); + + return 1; +} + + +SCM +Stencil::mark_smob (SCM s) +{ + Stencil *r = (Stencil *) ly_cdr (s); + + return r->expr_; +} + +IMPLEMENT_TYPE_P (Stencil, "ly:stencil?"); +IMPLEMENT_DEFAULT_EQUAL_P (Stencil); + diff --git a/lily/sustain-pedal.cc b/lily/sustain-pedal.cc index 30658d7bf3..c2cad1be29 100644 --- a/lily/sustain-pedal.cc +++ b/lily/sustain-pedal.cc @@ -7,7 +7,7 @@ */ #include "grob.hh" -#include "molecule.hh" +#include "stencil.hh" #include "font-interface.hh" #include "string.hh" @@ -40,7 +40,7 @@ Sustain_pedal::print (SCM smob) { Grob * e = unsmob_grob (smob); - Molecule mol; + Stencil mol; SCM glyph = e->get_grob_property ("text"); if (!gh_string_p (glyph)) return mol.smobbed_copy (); @@ -57,7 +57,7 @@ Sustain_pedal::print (SCM smob) } else idx += String (&text.to_bytes ()[i], 1); - Molecule m = Font_interface::get_default_font (e)->find_by_name (idx); + Stencil m = Font_interface::get_default_font (e)->find_by_name (idx); if (!m.is_empty ()) mol.add_at_edge (X_AXIS, RIGHT, m, 0, 0); } diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index d4784aa3c1..e39b897cfc 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -11,14 +11,14 @@ #include "axis-group-interface.hh" #include "system-start-delimiter.hh" #include "paper-def.hh" -#include "molecule.hh" +#include "stencil.hh" #include "font-interface.hh" #include "all-font-metrics.hh" #include "grob.hh" #include "staff-symbol-referencer.hh" #include "lookup.hh" -Molecule +Stencil System_start_delimiter::staff_bracket (Grob*me,Real height) { Real arc_height = gh_scm2double (me->get_grob_property ("arch-height")) ; @@ -52,14 +52,14 @@ Will not fix it since I'm not sure. Real h = height + 2 * arc_height; Box b (Interval (0, 1.5), Interval (-h/2, h/2)); - Molecule mol (b, at); + Stencil mol (b, at); mol.align_to (X_AXIS, CENTER); return mol; } -Molecule +Stencil System_start_delimiter::simple_bar (Grob*me,Real h) { Real lt =me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")) ; @@ -125,7 +125,7 @@ System_start_delimiter::print (SCM smob) return SCM_EOL; } - Molecule m; + Stencil m; if (gsym== ly_symbol2scm ("bracket")) m = staff_bracket (me,l); @@ -138,7 +138,7 @@ System_start_delimiter::print (SCM smob) return m.smobbed_copy (); } -Molecule +Stencil System_start_delimiter::staff_brace (Grob*me, Real y) { Font_metric *fm = 0; @@ -172,11 +172,11 @@ System_start_delimiter::staff_brace (Grob*me, Real y) } while (hi - lo > 1); - Molecule m (fm->get_indexed_char_molecule (lo)); // ugh. ascii? + Stencil m (fm->get_indexed_char_stencil (lo)); // ugh. ascii? b=m.extent_box(); b[X_AXIS] = Interval (0,0); - return Molecule (b, m.get_expr()); + return Stencil (b, m.get_expr()); } diff --git a/lily/system.cc b/lily/system.cc index 3a0f2dbaa3..5fce3e2299 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -18,7 +18,7 @@ #include "string.hh" #include "warn.hh" #include "dimensions.hh" -#include "molecule.hh" +#include "stencil.hh" #include "all-font-metrics.hh" #include "spacing-interface.hh" #include "staff-symbol-referencer.hh" @@ -336,7 +336,7 @@ System::break_into_pieces (Array const &breaking) } void -System::output_molecule (SCM expr, Offset o) +System::output_stencil (SCM expr, Offset o) { while (1) { @@ -360,14 +360,14 @@ System::output_molecule (SCM expr, Offset o) pscore_->outputter_->output_scheme (scm_list_n (head, SCM_UNDEFINED)); expr = ly_cadr (expr); } - else if (head == ly_symbol2scm ("translate-molecule")) + else if (head == ly_symbol2scm ("translate-stencil")) { o += ly_scm2offset (ly_cadr (expr)); expr = ly_caddr (expr); } - else if (head == ly_symbol2scm ("combine-molecule")) + else if (head == ly_symbol2scm ("combine-stencil")) { - output_molecule (ly_cadr (expr), o); + output_stencil (ly_cadr (expr), o); expr = ly_caddr (expr); } else @@ -465,7 +465,7 @@ System::post_processing (bool last_line) } /* - generate all molecules to trigger all font loads. + generate all stencils to trigger all font loads. (ugh. This is not very memory efficient.) */ @@ -475,14 +475,14 @@ System::post_processing (bool last_line) /* triger font loads first. - This might seem inefficient, but Molecules are cached per grob + This might seem inefficient, but Stencils are cached per grob anyway. */ - this->get_molecule(); + this->get_stencil(); for (SCM s = all; gh_pair_p (s); s = ly_cdr (s)) { Grob * g = unsmob_grob (ly_car (s)); - g->get_molecule (); + g->get_stencil (); } /* @@ -507,9 +507,9 @@ System::post_processing (bool last_line) /* Output elements in three layers, 0, 1, 2. The default layer is 1. */ { - Molecule *m = this->get_molecule(); + Stencil *m = this->get_stencil(); if (m) - output_molecule (m->get_expr (), Offset(0,0)); + output_stencil (m->get_expr (), Offset(0,0)); } for (int i = 0; i < 3; i++) @@ -517,7 +517,7 @@ System::post_processing (bool last_line) s = ly_cdr (s)) { Grob *sc = unsmob_grob (ly_car (s)); - Molecule *m = sc->get_molecule (); + Stencil *m = sc->get_stencil (); if (!m) continue; @@ -538,7 +538,7 @@ System::post_processing (bool last_line) o += z; } - output_molecule (m->get_expr (), o); + output_stencil (m->get_expr (), o); } diff --git a/lily/text-item.cc b/lily/text-item.cc index 33a3632a4d..f45b66e068 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -37,7 +37,7 @@ Text_item::interpret_markup (SCM paper, SCM props, SCM markup) list = fontify_atom (fm, list); Box b = fm->text_dimension (ly_scm2string (markup)); - return Molecule (b, list).smobbed_copy(); + return Stencil (b, list).smobbed_copy(); } else if (gh_pair_p (markup)) { diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index f88df10985..a6f54f22ac 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -8,7 +8,7 @@ Revised over good by Han-Wen. */ -#include "molecule.hh" +#include "stencil.hh" #include "text-item.hh" #include "text-spanner.hh" #include "line-spanner.hh" @@ -79,7 +79,7 @@ Text_spanner::print (SCM smob) SCM properties = Font_interface::font_alist_chain (me); SCM edge_text = me->get_grob_property ("edge-text"); - Drul_array edge; + Drul_array edge; if (gh_pair_p (edge_text)) { Direction d = LEFT; @@ -92,7 +92,7 @@ Text_spanner::print (SCM smob) SCM text = index_get_cell (edge_text, d); if (Text_item::markup_p (text)) - edge[d] = *unsmob_molecule (Text_item::interpret_markup (paper->self_scm (), properties, text)); + edge[d] = *unsmob_stencil (Text_item::interpret_markup (paper->self_scm (), properties, text)); if (!edge[d].is_empty ()) edge[d].align_to (Y_AXIS, CENTER); @@ -102,7 +102,7 @@ Text_spanner::print (SCM smob) Drul_array edge_height = robust_scm2interval (me->get_grob_property ("edge-height"), Interval (0.0, 0.0)); - Drul_array edge_line; + Drul_array edge_line; { Direction d = LEFT; int dir = to_dir (me->get_grob_property ("direction")); @@ -117,19 +117,19 @@ Text_spanner::print (SCM smob) Real dy = - dir * edge_height[d] ; if (dy) - edge_line[d] = Line_spanner::line_molecule (me, Offset(0,0), Offset (dx, dy)); + edge_line[d] = Line_spanner::line_stencil (me, Offset(0,0), Offset (dx, dy)); } while (flip (&d) != LEFT); } - Molecule m; + Stencil m; do { Interval ext = edge[d].extent (X_AXIS); if (!ext.is_empty ()) { edge[d].translate_axis (span_points[d], X_AXIS); - m.add_molecule (edge[d]); + m.add_stencil (edge[d]); span_points[d] += -d * ext[-d]; } } @@ -139,16 +139,16 @@ Text_spanner::print (SCM smob) if (d* span_points[d] > d * edge[-d].extent(X_AXIS)[d]) { edge_line[d].translate_axis (span_points[d], X_AXIS); - m.add_molecule (edge_line[d]); + m.add_stencil (edge_line[d]); } } while (flip (&d) != LEFT); if (!span_points.is_empty ()) { - Molecule l =Line_spanner::line_molecule (me, Offset (span_points[LEFT], 0), + Stencil l =Line_spanner::line_stencil (me, Offset (span_points[LEFT], 0), Offset (span_points[RIGHT], 0)); - m.add_molecule (l); + m.add_stencil (l); } m.translate_axis (- me->relative_coordinate (common, X_AXIS), X_AXIS); return m.smobbed_copy (); diff --git a/lily/tie.cc b/lily/tie.cc index 3440fd9aeb..afdfd0240a 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -18,7 +18,7 @@ #include "warn.hh" #include "staff-symbol-referencer.hh" #include "directional-element-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "bezier-bow.hh" #include "stem.hh" #include "note-head.hh" @@ -333,7 +333,7 @@ Tie::print (SCM smob) } if (!gh_pair_p (cp)) - return Molecule ().smobbed_copy (); + return Stencil ().smobbed_copy (); Real thick = Staff_symbol_referencer::line_thickness (me) @@ -347,7 +347,7 @@ Tie::print (SCM smob) i++; } - Molecule a = Lookup::slur (b, get_grob_direction (me) * thick, thick); + Stencil a = Lookup::slur (b, get_grob_direction (me) * thick, thick); return a.smobbed_copy (); } diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 2a4d380db3..f122d256e5 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -8,7 +8,7 @@ */ -#include "molecule.hh" +#include "stencil.hh" #include "text-item.hh" #include "time-signature.hh" #include "paper-def.hh" @@ -40,7 +40,7 @@ Time_signature::print (SCM smob) d = gh_scm2int (ly_cdr (frac)); } - Molecule m; + Stencil m; if (gh_symbol_p (st)) { String style (ly_scm2string (scm_symbol_to_string (st))); @@ -62,7 +62,7 @@ Time_signature::print (SCM smob) return m.smobbed_copy (); } -Molecule +Stencil Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d) { String style = ly_scm2string (scm_symbol_to_string (scm_style)); @@ -85,7 +85,7 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d) String char_name = style + to_string (n) + "/" + to_string (d); me->set_grob_property ("font-family", ly_symbol2scm ("music")); - Molecule out = Font_interface::get_default_font (me) + Stencil out = Font_interface::get_default_font (me) ->find_by_name ("timesig-" + char_name); if (!out.is_empty ()) return out; @@ -97,7 +97,7 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d) return numbered_time_signature (me, n, d); } -Molecule +Stencil Time_signature::numbered_time_signature (Grob*me,int num, int den) { SCM chain = Font_interface::font_alist_chain (me); @@ -110,12 +110,12 @@ SCM sd = Text_item::interpret_markup (me->get_paper ()->self_scm(), chain, scm_makfrom0str (to_string (den).to_str0 ())); - Molecule n = *unsmob_molecule (sn); - Molecule d = *unsmob_molecule (sd); + Stencil n = *unsmob_stencil (sn); + Stencil d = *unsmob_stencil (sd); n.align_to (X_AXIS, CENTER); d.align_to (X_AXIS, CENTER); - Molecule m; + Stencil m; if (den) { m.add_at_edge (Y_AXIS, UP, n, 0.0, 0); diff --git a/lily/translator-def.cc b/lily/translator-def.cc deleted file mode 100644 index f48e78d3aa..0000000000 --- a/lily/translator-def.cc +++ /dev/null @@ -1,319 +0,0 @@ -/* - translator-def.cc -- implement Context_def - - source file of the GNU LilyPond music typesetter - - (c) 2000--2004 Han-Wen Nienhuys - - */ - -#include "lily-proto.hh" -#include "context-def.hh" -#include "translator-group.hh" -#include "warn.hh" -#include "music-output-def.hh" -#include "ly-smobs.icc" - -int -Context_def::print_smob (SCM smob, SCM port, scm_print_state*) -{ - Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob); - - scm_puts ("#context_name_, port); - scm_puts (">", port); - return 1; -} - - -SCM -Context_def::mark_smob (SCM smob) -{ - Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob); - - scm_gc_mark (me->description_); - scm_gc_mark (me->context_aliases_); - scm_gc_mark (me->accept_mods_); - scm_gc_mark (me->translator_mods_); - scm_gc_mark (me->property_ops_); - scm_gc_mark (me->translator_group_type_); - return me->context_name_; -} - - -Context_def::Context_def () -{ - context_aliases_ = SCM_EOL; - translator_group_type_ = SCM_EOL; - accept_mods_ = SCM_EOL; - translator_mods_ = SCM_EOL; - property_ops_ = SCM_EOL; - context_name_ = SCM_EOL; - description_ = SCM_EOL; - - smobify_self(); -} - -Context_def::~Context_def () -{ -} - -Context_def::Context_def (Context_def const & s) - : Input (s) -{ - context_aliases_ = SCM_EOL; - translator_group_type_ = SCM_EOL; - accept_mods_ = SCM_EOL; - translator_mods_ = SCM_EOL; - property_ops_ = SCM_EOL; - context_name_ = SCM_EOL; - description_ = SCM_EOL; - - smobify_self(); - description_ = s.description_; - - accept_mods_ = s.accept_mods_; - property_ops_ = s.property_ops_; - translator_mods_ = s.translator_mods_; - context_aliases_ = s.context_aliases_; - translator_group_type_ = s.translator_group_type_; - context_name_ = s.context_name_; -} - - -void -Context_def::add_context_mod (SCM mod) -{ - SCM tag = gh_car (mod); - if (ly_symbol2scm ("description") == tag) - { - description_ = gh_cadr (mod); - return ; - } - - SCM sym = gh_cadr (mod); - if (gh_string_p (sym)) - sym = scm_string_to_symbol (sym); - - if (ly_symbol2scm ("consists") == tag - || ly_symbol2scm ("consists-end") == tag - || ly_symbol2scm ("remove") == tag) - { - if (!get_translator (sym)) - error (_f ("Program has no such type: `%s'", ly_symbol2string (sym).to_str0 ())); - else - translator_mods_ = gh_cons (scm_list_2 (tag, sym), translator_mods_ ); - } - else if (ly_symbol2scm ("accepts") == tag - || ly_symbol2scm ("denies") == tag) - { - accept_mods_ = gh_cons (scm_list_2 (tag, sym), accept_mods_); - } - else if (ly_symbol2scm ("poppush") == tag - || ly_symbol2scm ("pop") == tag - || ly_symbol2scm ("push") == tag - || ly_symbol2scm ("assign") == tag - || ly_symbol2scm ("unset") == tag) - { - property_ops_ = gh_cons (mod, property_ops_); - } - else if (ly_symbol2scm ("alias") == tag) - { - context_aliases_ = gh_cons (sym, context_aliases_); - } - else if (ly_symbol2scm ("translator-type") == tag) - { - translator_group_type_ = sym; - } - else if (ly_symbol2scm ("context-name") == tag) - { - context_name_ = sym; - } - else - { - programming_error ("Unknown context mod tag."); - } -} - - - -SCM -Context_def::get_context_name () const -{ - return context_name_; -} - -SCM -Context_def::get_accepted (SCM user_mod) const -{ - SCM mods = scm_reverse_x (scm_list_copy (accept_mods_), - user_mod); - SCM acc = SCM_EOL; - for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s)) - { - SCM tag = gh_caar (s); - SCM sym = gh_cadar (s); - if (tag == ly_symbol2scm ("accepts")) - acc = gh_cons (sym, acc); - else if (tag == ly_symbol2scm ("denies")) - acc = scm_delete_x (sym, acc); - } - return acc; -} - - -Link_array -Context_def::path_to_acceptable_translator (SCM type_sym, Music_output_def* odef) const -{ - assert (gh_symbol_p (type_sym)); - - SCM accepted = get_accepted (SCM_EOL); - - Link_array accepteds; - for (SCM s = accepted; gh_pair_p (s); s = ly_cdr (s)) - { - Context_def *t = unsmob_context_def (odef->find_translator (ly_car (s))); - if (!t) - continue; - accepteds.push (t); - } - - Link_array best_result; - for (int i=0; i < accepteds.size (); i++) - { - /* - don't check aliases, because \context Staff should not create RhythmicStaff. - */ - if (gh_equal_p (accepteds[i]->get_context_name (), type_sym)) - { - best_result.push (accepteds[i]); - return best_result; - } - } - - int best_depth= INT_MAX; - for (int i=0; i < accepteds.size (); i++) - { - Context_def * g = accepteds[i]; - - Link_array result - = g->path_to_acceptable_translator (type_sym, odef); - if (result.size () && result.size () < best_depth) - { - result.insert (g,0); - best_result = result; - - /* - this following line was added in 1.9.3, but hsould've been - there all along... Let's hope it doesn't cause nightmares. - */ - best_depth = result.size(); - } - } - - return best_result; -} - -IMPLEMENT_SMOBS (Context_def); -IMPLEMENT_DEFAULT_EQUAL_P (Context_def); - - - - -SCM -Context_def::get_translator_names (SCM user_mod) const -{ - SCM l1 = SCM_EOL; - SCM l2 = SCM_EOL; - - SCM mods = scm_reverse_x (scm_list_copy (translator_mods_), - user_mod); - - for (SCM s = mods; gh_pair_p (s); s = gh_cdr (s)) - { - SCM tag = gh_caar (s); - SCM arg = gh_cadar (s); - - if (gh_string_p (arg)) - arg = scm_string_to_symbol (arg); - - if (ly_symbol2scm ("consists") == tag) - l1 = gh_cons (arg, l1); - else if (ly_symbol2scm ("consists-end") == tag) - l2 = gh_cons (arg, l2); - else if (ly_symbol2scm ("remove") == tag) - { - l1 = scm_delete_x (arg, l1); - l2 = scm_delete_x (arg, l2); - } - } - - return scm_append_x (scm_list_2 (l1, l2)); -} - - -Translator_group * -Context_def::instantiate (SCM ops) -{ - Translator * g = get_translator (translator_group_type_); - g = g->clone (); - - Translator_group *tg = dynamic_cast (g); - tg->definition_ = self_scm (); - - SCM trans_names = get_translator_names (ops); - tg->simple_trans_list_ = names_to_translators (trans_names, tg); - tg->accepts_list_ = get_accepted (ops); - return tg; -} - - -SCM -Context_def::clone_scm () const -{ - Context_def * t = new Context_def (*this); - scm_gc_unprotect_object (t->self_scm()); - return t->self_scm(); -} - -SCM -Context_def::make_scm () -{ - Context_def* t = new Context_def; - scm_gc_unprotect_object (t->self_scm()); - return t->self_scm(); -} - -void -Context_def::apply_default_property_operations (Translator_group *tg) -{ - apply_property_operations (tg , property_ops_); -} - -SCM -Context_def::to_alist () const -{ - SCM l = SCM_EOL; - - l = gh_cons (gh_cons (ly_symbol2scm ("consists"), - get_translator_names (SCM_EOL)), l); - l = gh_cons (gh_cons (ly_symbol2scm ("description"), description_), l); - l = gh_cons (gh_cons (ly_symbol2scm ("aliases"), context_aliases_), l); - l = gh_cons (gh_cons (ly_symbol2scm ("accepts"), get_accepted (SCM_EOL)), l); - l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"), property_ops_), l); - l = gh_cons (gh_cons (ly_symbol2scm ("context-name"), context_name_), l); - l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l); - - return l; -} - -bool -Context_def::is_alias (SCM sym) const -{ - bool b = sym == context_name_; - - for (SCM a = context_aliases_; !b && gh_pair_p (a); a = ly_cdr (a)) - b = b || sym == ly_car (a); - - return b; -} diff --git a/lily/translator.cc b/lily/translator.cc index c8a99998c5..c4ab9083ab 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -48,11 +48,6 @@ Translator::Translator (Translator const &s) smobify_self (); } -bool -Translator::is_alias (SCM sym) const -{ - return unsmob_context_def (definition_)->is_alias (sym); -} bool Translator::try_music (Music *) diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 5bc83b5e12..31914723bd 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -30,7 +30,7 @@ #include "box.hh" #include "warn.hh" #include "font-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" #include "text-item.hh" #include "tuplet-bracket.hh" @@ -101,7 +101,7 @@ SCM Tuplet_bracket::print (SCM smob) { Grob *me= unsmob_grob (smob); - Molecule mol; + Stencil mol; Link_array columns= Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns"); @@ -173,14 +173,14 @@ Tuplet_bracket::print (SCM smob) { SCM properties = Font_interface::font_alist_chain (me); SCM snum = Text_item::interpret_markup (pap->self_scm (), properties, number); - Molecule num = *unsmob_molecule (snum); + Stencil num = *unsmob_stencil (snum); num.align_to (X_AXIS, CENTER); num.translate_axis (w/2, X_AXIS); num.align_to (Y_AXIS, CENTER); num.translate_axis ((ry-ly)/2, Y_AXIS); - mol.add_molecule (num); + mol.add_stencil (num); } @@ -218,11 +218,11 @@ Tuplet_bracket::print (SCM smob) } while (flip (&d) != LEFT); - Molecule brack = make_bracket (me, Y_AXIS, + Stencil brack = make_bracket (me, Y_AXIS, Offset (w, ry - ly), height, gap, flare, shorten); - mol.add_molecule (brack); + mol.add_stencil (brack); } mol.translate_axis (ly, Y_AXIS); @@ -236,7 +236,7 @@ Tuplet_bracket::print (SCM smob) TODO: this will fail for very short (shorter than the flare) brackets. */ -Molecule +Stencil Tuplet_bracket::make_bracket (Grob *me, // for line properties. Axis protusion_axis, Offset dz, @@ -277,12 +277,12 @@ Tuplet_bracket::make_bracket (Grob *me, // for line properties. straight_corners[d][bracket_axis] += - d * flare[d]; } while (flip (&d) != LEFT); - Molecule m; + Stencil m; do { - m.add_molecule (Line_interface::line (me, straight_corners[d], + m.add_stencil (Line_interface::line (me, straight_corners[d], gap_corners[d])); - m.add_molecule (Line_interface::line (me, straight_corners[d], + m.add_stencil (Line_interface::line (me, straight_corners[d], flare_corners[d])); } while (flip (&d) != LEFT); diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index ba3626d90f..d683aec1cf 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -10,7 +10,7 @@ #include "item.hh" #include "vaticana-ligature.hh" #include "font-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "lookup.hh" #include "staff-symbol-referencer.hh" #include "note-head.hh" @@ -18,7 +18,7 @@ #include "bezier.hh" #include "warn.hh" -Molecule +Stencil vaticana_brew_cauda (Grob *me, int pos, int delta_pitch, @@ -65,13 +65,13 @@ vaticana_brew_cauda (Grob *me, /* * TODO: move this function to class Lookup? */ -Molecule +Stencil vaticana_brew_flexa (Grob *me, bool solid, Real line_thickness) { Real staff_space = Staff_symbol_referencer::staff_space (me); - Molecule molecule = Molecule (); + Stencil stencil = Stencil (); Real right_height = 0.6 * staff_space; Real interval; @@ -129,23 +129,23 @@ vaticana_brew_flexa (Grob *me, if (solid) { - Molecule solid_head = + Stencil solid_head = Lookup::bezier_sandwich (top_curve, bottom_curve); - molecule.add_molecule (solid_head); + stencil.add_stencil (solid_head); } else // outline { Bezier inner_top_curve = top_curve; inner_top_curve.translate (Offset (0.0, -line_thickness)); - Molecule top_edge = + Stencil top_edge = Lookup::bezier_sandwich (top_curve, inner_top_curve); - molecule.add_molecule(top_edge); + stencil.add_stencil(top_edge); Bezier inner_bottom_curve = bottom_curve; inner_bottom_curve.translate (Offset (0.0, +line_thickness)); - Molecule bottom_edge = + Stencil bottom_edge = Lookup::bezier_sandwich (bottom_curve, inner_bottom_curve); - molecule.add_molecule(bottom_edge); + stencil.add_stencil(bottom_edge); /* * TODO: Use horizontal slope with proper slope value rather @@ -157,21 +157,21 @@ vaticana_brew_flexa (Grob *me, */ Box left_edge_box (Interval (0, line_thickness), Interval (-0.5*left_height, +0.5*left_height)); - Molecule left_edge = Lookup::filled_box (left_edge_box); - molecule.add_molecule(left_edge); + Stencil left_edge = Lookup::filled_box (left_edge_box); + stencil.add_stencil(left_edge); Box right_edge_box (Interval (-line_thickness, 0), Interval (-0.5*right_height, +0.5*right_height)); - Molecule right_edge = Lookup::filled_box (right_edge_box); + Stencil right_edge = Lookup::filled_box (right_edge_box); right_edge.translate_axis (width, X_AXIS); right_edge.translate_axis (corrected_interval / 2.0, Y_AXIS); - molecule.add_molecule(right_edge); + stencil.add_stencil(right_edge); } - molecule.translate_axis (ypos_correction, Y_AXIS); - return molecule; + stencil.translate_axis (ypos_correction, Y_AXIS); + return stencil; } -Molecule +Stencil vaticana_brew_join (Grob *me, int delta_pitch, Real join_thickness, Real blotdiameter) { @@ -180,7 +180,7 @@ vaticana_brew_join (Grob *me, int delta_pitch, { me->programming_error (_f ("Vaticana_ligature: " "zero join (delta_pitch == 0)")); - return Molecule (); + return Stencil (); } Interval x_extent = Interval (0, join_thickness); Interval y_extent = (delta_pitch > 0) ? @@ -191,7 +191,7 @@ vaticana_brew_join (Grob *me, int delta_pitch, } void -vaticana_add_ledger_lines (Grob *me, Molecule *out, int pos, Real offs, +vaticana_add_ledger_lines (Grob *me, Stencil *out, int pos, Real offs, bool ledger_take_space) { int interspaces = Staff_symbol_referencer::line_count (me)-1; @@ -203,16 +203,16 @@ vaticana_add_ledger_lines (Grob *me, Molecule *out, int pos, Real offs, Interval l_extents = Interval (hd[LEFT] - left_ledger_protusion, hd[RIGHT] + right_ledger_protusion); - Molecule ledger_lines = + Stencil ledger_lines = Note_head::brew_ledger_lines (me, pos, interspaces, l_extents, 0, ledger_take_space); ledger_lines.translate_axis (offs, Y_AXIS); - out->add_molecule (ledger_lines); + out->add_stencil (ledger_lines); } } -Molecule +Stencil vaticana_brew_primitive (Grob *me, bool ledger_take_space) { SCM glyph_name_scm = me->get_grob_property ("glyph-name"); @@ -220,12 +220,12 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space) { me->programming_error ("Vaticana_ligature: " "undefined glyph-name -> ignoring grob"); - return Molecule (); + return Stencil (); } String glyph_name = ly_scm2string (glyph_name_scm); - Molecule out; + Stencil out; int flexa_height = 0; Real thickness = robust_scm2double ( me->get_grob_property ("thickness"), 1); @@ -279,27 +279,27 @@ vaticana_brew_primitive (Grob *me, bool ledger_take_space) if (add_cauda) { - Molecule cauda = + Stencil cauda = vaticana_brew_cauda (me, pos, delta_pitch, line_thickness, blotdiameter); - out.add_molecule (cauda); + out.add_stencil (cauda); } if (add_stem) { - Molecule stem = + Stencil stem = vaticana_brew_cauda (me, pos, -1, line_thickness, blotdiameter); stem.translate_axis (head_width - line_thickness, X_AXIS); - out.add_molecule (stem); + out.add_stencil (stem); } if (add_join) { - Molecule join = + Stencil join = vaticana_brew_join (me, delta_pitch, line_thickness, blotdiameter); join.translate_axis (head_width - line_thickness, X_AXIS); - out.add_molecule (join); + out.add_stencil (join); } vaticana_add_ledger_lines(me, &out, pos, 0, ledger_take_space); diff --git a/lily/virtual-font-metric.cc b/lily/virtual-font-metric.cc index 24d7bcdd6a..744da20afd 100644 --- a/lily/virtual-font-metric.cc +++ b/lily/virtual-font-metric.cc @@ -10,7 +10,7 @@ source file of the GNU LilyPond music typesetter #include "warn.hh" #include "virtual-font-metric.hh" #include "all-font-metrics.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-def.hh" @@ -50,10 +50,10 @@ Virtual_font_metric::count () const return k; } -Molecule +Stencil Virtual_font_metric::find_by_name (String glyph) const { - Molecule m; + Stencil m; for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s)) { m = unsmob_metrics (gh_car (s))->find_by_name (glyph); @@ -71,11 +71,11 @@ Virtual_font_metric::get_ascii_char (int) const return Box(); } -Molecule -Virtual_font_metric::get_ascii_char_molecule (int ) const +Stencil +Virtual_font_metric::get_ascii_char_stencil (int ) const { programming_error ("Virtual font metric cannot be indexed by ASCII."); - return Molecule(); + return Stencil(); } @@ -119,7 +119,7 @@ Virtual_font_metric::get_indexed_char (int code) const int Virtual_font_metric::name_to_index (String glyph) const { - Molecule m; + Stencil m; int total = 0; for (SCM s = font_list_; m.is_empty () && gh_pair_p (s); s = gh_cdr (s)) { @@ -135,10 +135,10 @@ Virtual_font_metric::name_to_index (String glyph) const } -Molecule -Virtual_font_metric::get_indexed_char_molecule (int code) const +Stencil +Virtual_font_metric::get_indexed_char_stencil (int code) const { - Molecule m ; + Stencil m ; int total = 0; for (SCM s = font_list_; gh_pair_p (s); s = gh_cdr (s)) @@ -146,7 +146,7 @@ Virtual_font_metric::get_indexed_char_molecule (int code) const Font_metric* fm = unsmob_metrics (gh_car (s)); if (code < total + fm->count()) { - m = fm->get_indexed_char_molecule (code - total); // ugh. + m = fm->get_indexed_char_stencil (code - total); // ugh. break; } total += fm->count (); diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 813bc1162f..92184e301c 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -12,7 +12,7 @@ #include "warn.hh" #include "font-interface.hh" #include "line-interface.hh" -#include "molecule.hh" +#include "stencil.hh" #include "paper-column.hh" #include "paper-def.hh" #include "text-item.hh" @@ -91,23 +91,23 @@ Volta_bracket_interface::print (SCM smob) Real w = dynamic_cast (me)->spanner_length () - left - half_space; Real h = robust_scm2double (me->get_grob_property ("height"), 1); - Molecule start,end ; + Stencil start,end ; if (!no_vertical_start) start = Line_interface::line (me, Offset (0,0), Offset (0, h)); if (!no_vertical_end) end = Line_interface::line (me, Offset (w, 0), Offset (w,h)); - Molecule mol = Line_interface::line (me, Offset (0, h), Offset (w,h)); - mol.add_molecule (start); - mol.add_molecule (end); + Stencil mol = Line_interface::line (me, Offset (0, h), Offset (w,h)); + mol.add_stencil (start); + mol.add_stencil (end); if (!orig_span || broken_first_bracket) { SCM text = me->get_grob_property ("text"); SCM properties = me->get_property_alist_chain (SCM_EOL); SCM snum = Text_item::interpret_markup (paper->self_scm (), properties, text); - Molecule num = *unsmob_molecule (snum); + Stencil num = *unsmob_stencil (snum); mol.add_at_edge (X_AXIS, LEFT, num, - num.extent (X_AXIS).length () - 1.0, 0); diff --git a/ly/a3-init.ly b/ly/a3-init.ly index de751af0df..1444f5d788 100644 --- a/ly/a3-init.ly +++ b/ly/a3-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % a3-init.ly hsize = 296.9 \mm diff --git a/ly/a4-init.ly b/ly/a4-init.ly index 1cbf7111ca..f58c6acbeb 100644 --- a/ly/a4-init.ly +++ b/ly/a4-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % a4.ly hsize = 210.0 \mm diff --git a/ly/accordion-defs-init.ly b/ly/accordion-defs-init.ly index 32de5a4d0f..e4c493214f 100644 --- a/ly/accordion-defs-init.ly +++ b/ly/accordion-defs-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % Symbols needed to print accordion music % % 2' = T diff --git a/ly/book-init-init.ly b/ly/book-init-init.ly index 7ebb27bbe6..574e66871c 100644 --- a/ly/book-init-init.ly +++ b/ly/book-init-init.ly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "2.1.13" +\version "2.1.22" \include "declarations-init.ly" diff --git a/ly/catalan.ly b/ly/catalan.ly index cc93ae08f0..684a48f65c 100644 --- a/ly/catalan.ly +++ b/ly/catalan.ly @@ -73,4 +73,4 @@ pitchnamesCatalan = #`( pitchnames = \pitchnamesCatalan -\version "2.1.19" +\version "2.1.22" diff --git a/ly/center-init.ly b/ly/center-init.ly index ca066e96b4..822c878dd9 100644 --- a/ly/center-init.ly +++ b/ly/center-init.ly @@ -1,6 +1,6 @@ % Toplevel initialisation file. -\version "2.1.13" +\version "2.1.22" \include "declarations-init.ly" diff --git a/ly/chord-modifiers-init.ly b/ly/chord-modifiers-init.ly index a74dfb5b49..0978d5c938 100644 --- a/ly/chord-modifiers-init.ly +++ b/ly/chord-modifiers-init.ly @@ -1,4 +1,4 @@ -\version "2.1.19" +\version "2.1.22" chordmodifiers = #default-chord-modifier-list diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index a9247573c0..5805fdb7de 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -1,6 +1,6 @@ #(ly:set-option 'old-relative) -\version "2.1.19" +\version "2.1.22" breve = #(ly:make-duration -1 0) longa = #(ly:make-duration -2 0 ) maxima = #(ly:make-duration -3 0) @@ -32,8 +32,8 @@ noBreak = #(make-event-chord (list (make-penalty-music 10001))) \include "scale-definitions-init.ly" -melisma = \property Staff.melismaBusy = ##t -melismaEnd = \property Staff.melismaBusy = ##f +melisma = \set Staff.melismaBusy = ##t +melismaEnd = \set Staff.melismaBusy = ##f \include "grace-init.ly" diff --git a/ly/deutsch.ly b/ly/deutsch.ly index b4dec3933a..d9ab259f5d 100644 --- a/ly/deutsch.ly +++ b/ly/deutsch.ly @@ -49,4 +49,4 @@ pitchnamesDeutsch = #`( pitchnames = \pitchnamesDeutsch -\version "2.1.19" +\version "2.1.22" diff --git a/ly/dynamic-scripts-init.ly b/ly/dynamic-scripts-init.ly index 004ef5823b..37481bd59e 100644 --- a/ly/dynamic-scripts-init.ly +++ b/ly/dynamic-scripts-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % % declare the standard dynamic identifiers. diff --git a/ly/english.ly b/ly/english.ly index 68dd5d07c4..236877765e 100644 --- a/ly/english.ly +++ b/ly/english.ly @@ -87,5 +87,5 @@ pitchnamesEnglish = #`( pitchnames = \pitchnamesEnglish -\version "2.1.19" +\version "2.1.22" diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index d15e164e6b..04c85316b3 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -1,4 +1,4 @@ -\version "2.1.21" +\version "2.1.22" % @@ -565,7 +565,7 @@ OrchestralScoreContext = \translator { EasyNotation = \translator { \ScoreContext - NoteHead \override #'print-function = #Note_head::brew_ez_molecule + NoteHead \override #'print-function = #Note_head::brew_ez_stencil NoteHead \override #'Y-extent-callback = #'() NoteHead \override #'X-extent-callback = #'() } diff --git a/ly/espanol.ly b/ly/espanol.ly index 595af54c4f..bcaee43026 100644 --- a/ly/espanol.ly +++ b/ly/espanol.ly @@ -58,4 +58,4 @@ pitchnamesEspanol = #`( pitchnames = \pitchnamesEspanol -\version "2.1.19" +\version "2.1.22" diff --git a/ly/generate-documentation.ly b/ly/generate-documentation.ly index 8f752ed0e6..f96b5f9bef 100644 --- a/ly/generate-documentation.ly +++ b/ly/generate-documentation.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % % Running LilyPond on this file generates the documentation diff --git a/ly/generate-interface-doc-init.ly b/ly/generate-interface-doc-init.ly index b902e70cf9..d74ac7a021 100644 --- a/ly/generate-interface-doc-init.ly +++ b/ly/generate-interface-doc-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % % Running LilyPond on this file generates the short interface doc diff --git a/ly/grace-init.ly b/ly/grace-init.ly index 4b1dc9b94b..6976b092d5 100644 --- a/ly/grace-init.ly +++ b/ly/grace-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" startGraceMusic = \notes { @@ -23,11 +23,11 @@ stopAppoggiaturaMusic = \notes { startAcciaccaturaMusic = \notes { \context Voice \applycontext #set-start-grace-properties s1*0( - \property Voice.Stem \override #'stroke-style = #"grace" + \override Stem #'stroke-style = #"grace" } stopAcciaccaturaMusic = \notes { - \property Voice.Stem \revert #'stroke-style + \revert Stem #'stroke-style \context Voice \applycontext #set-stop-grace-properties s1*0) } diff --git a/ly/gregorian-init.ly b/ly/gregorian-init.ly index 850392a80f..e94b69e1e7 100644 --- a/ly/gregorian-init.ly +++ b/ly/gregorian-init.ly @@ -1,4 +1,4 @@ -\version "2.1.21" +\version "2.1.22" %%%%%%%% %%%%%%%% shortcuts common for all styles of gregorian chant notation @@ -8,85 +8,85 @@ % declare head prefix shortcuts % virga = - \once \property Voice.NoteHead \override #'virga = ##t + \once \override NoteHead #'virga = ##t stropha = - \once \property Voice.NoteHead \override #'stropha = ##t + \once \override NoteHead #'stropha = ##t inclinatum = - \once \property Voice.NoteHead \override #'inclinatum = ##t + \once \override NoteHead #'inclinatum = ##t auctum = - \once \property Voice.NoteHead \override #'auctum = ##t + \once \override NoteHead #'auctum = ##t descendens = - \once \property Voice.NoteHead \override #'descendens = ##t + \once \override NoteHead #'descendens = ##t ascendens = - \once \property Voice.NoteHead \override #'ascendens = ##t + \once \override NoteHead #'ascendens = ##t pes = - \once \property Voice.NoteHead \override #'pes-or-flexa = ##t + \once \override NoteHead #'pes-or-flexa = ##t flexa = - \once \property Voice.NoteHead \override #'pes-or-flexa = ##t + \once \override NoteHead #'pes-or-flexa = ##t oriscus = - \once \property Voice.NoteHead \override #'oriscus = ##t + \once \override NoteHead #'oriscus = ##t quilisma = - \once \property Voice.NoteHead \override #'quilisma = ##t + \once \override NoteHead #'quilisma = ##t deminutum = - \once \property Voice.NoteHead \override #'deminutum = ##t + \once \override NoteHead #'deminutum = ##t linea = - \once \property Voice.NoteHead \override #'linea = ##t + \once \override NoteHead #'linea = ##t cavum = - \once \property Voice.NoteHead \override #'cavum = ##t + \once \override NoteHead #'cavum = ##t % % declare divisiones shortcuts % virgula = { - \once \property Voice.BreathingSign \override #'text = #(make-musicglyph-markup "scripts-rcomma") - \once \property Voice.BreathingSign \override #'font-size = #-2 + \once \override BreathingSign #'text = #(make-musicglyph-markup "scripts-rcomma") + \once \override BreathingSign #'font-size = #-2 % Workaround: add padding. Correct fix would be spacing engine handle this. - \once \property Voice.BreathingSign \override #'extra-X-extent = #'(-1.0 . 0) + \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) \breathe } caesura = { - \once \property Voice.BreathingSign \override #'text = #(make-musicglyph-markup "scripts-rvarcomma") - \once \property Voice.BreathingSign \override #'font-size = #-2 + \once \override BreathingSign #'text = #(make-musicglyph-markup "scripts-rvarcomma") + \once \override BreathingSign #'font-size = #-2 % Workaround: add padding. Correct fix would be spacing engine handle this. - \once \property Voice.BreathingSign \override #'extra-X-extent = #'(-1.0 . 0) + \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) \breathe } divisioMinima = { - \once \property Voice.BreathingSign \override #'print-function = #Breathing_sign::divisio_minima + \once \override BreathingSign #'print-function = #Breathing_sign::divisio_minima % Workaround: add padding. Correct fix would be spacing engine handle this. - \once \property Voice.BreathingSign \override #'extra-X-extent = #'(-1.0 . 0) + \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) \breathe } divisioMaior = { - \once \property Voice.BreathingSign \override #'print-function = #Breathing_sign::divisio_maior - \once \property Voice.BreathingSign \override #'Y-offset-callbacks = #'() + \once \override BreathingSign #'print-function = #Breathing_sign::divisio_maior + \once \override BreathingSign #'Y-offset-callbacks = #'() % Workaround: add padding. Correct fix would be spacing engine handle this. - \once \property Voice.BreathingSign \override #'extra-X-extent = #'(-1.0 . 0) + \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) \breathe } divisioMaxima = { - \once \property Voice.BreathingSign \override #'print-function = #Breathing_sign::divisio_maxima - \once \property Voice.BreathingSign \override #'Y-offset-callbacks = #'() + \once \override BreathingSign #'print-function = #Breathing_sign::divisio_maxima + \once \override BreathingSign #'Y-offset-callbacks = #'() % Workaround: add padding. Correct fix would be spacing engine handle this. - \once \property Voice.BreathingSign \override #'extra-X-extent = #'(-1.0 . 0) + \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) \breathe } finalis = { - \once \property Voice.BreathingSign \override #'print-function = #Breathing_sign::finalis - \once \property Voice.BreathingSign \override #'Y-offset-callbacks = #'() + \once \override BreathingSign #'print-function = #Breathing_sign::finalis + \once \override BreathingSign #'Y-offset-callbacks = #'() % Workaround: add padding. Correct fix would be spacing engine handle this. - \once \property Voice.BreathingSign \override #'extra-X-extent = #'(-1.0 . 0) + \once \override BreathingSign #'extra-X-extent = #'(-1.0 . 0) \breathe } diff --git a/ly/init.ly b/ly/init.ly index f0d780b267..bf9fc9f2e2 100644 --- a/ly/init.ly +++ b/ly/init.ly @@ -4,7 +4,7 @@ #(define-public midi-debug #f) -\version "1.9.8" +\version "2.1.22" \include "declarations-init.ly" diff --git a/ly/italiano.ly b/ly/italiano.ly index 418b9491f3..2284d26c27 100644 --- a/ly/italiano.ly +++ b/ly/italiano.ly @@ -86,4 +86,4 @@ pitchnamesItaliano = #`( pitchnames = \pitchnamesItaliano -\version "2.1.19" +\version "2.1.22" diff --git a/ly/legal-init.ly b/ly/legal-init.ly index ee113f7cdd..5333671442 100644 --- a/ly/legal-init.ly +++ b/ly/legal-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % legal-init.ly hsize = 8.5 \in diff --git a/ly/letter-init.ly b/ly/letter-init.ly index 6b2d704997..7e5186fee3 100644 --- a/ly/letter-init.ly +++ b/ly/letter-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % letter-init.ly hsize = 8.5 \in diff --git a/ly/midi-init.ly b/ly/midi-init.ly index 31857ef63b..205b56c579 100644 --- a/ly/midi-init.ly +++ b/ly/midi-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" \midi { \tempo 4=60 \include "performer-init.ly" diff --git a/ly/nederlands.ly b/ly/nederlands.ly index f0e1ad12be..65c2f91aee 100644 --- a/ly/nederlands.ly +++ b/ly/nederlands.ly @@ -1,4 +1,4 @@ -\version "2.1.19" +\version "2.1.22" %{ common dutch names for notes. es means flat, is means sharp %} diff --git a/ly/norsk.ly b/ly/norsk.ly index 1f1ec4fdc4..4ede332e65 100644 --- a/ly/norsk.ly +++ b/ly/norsk.ly @@ -105,4 +105,4 @@ pitchnamesNorsk = #`( pitchnames =\pitchnamesNorsk -\version "2.1.19" +\version "2.1.22" diff --git a/ly/params-init.ly b/ly/params-init.ly index d8dd41d556..e053fe5065 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -1,2 +1,2 @@ -\version "2.1.1" +\version "2.1.22" diff --git a/ly/part-paper-init.ly b/ly/part-paper-init.ly index 0ecdebdfe5..c27098bfc0 100644 --- a/ly/part-paper-init.ly +++ b/ly/part-paper-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % JUNKME %part-paper-init.ly diff --git a/ly/performer-init.ly b/ly/performer-init.ly index 279f1e0861..5a024a7d23 100644 --- a/ly/performer-init.ly +++ b/ly/performer-init.ly @@ -1,4 +1,4 @@ -\version "2.1.21" +\version "2.1.22" % % setup for Request->Element conversion. Guru-only diff --git a/ly/property-init.ly b/ly/property-init.ly index 51fbb8bc44..449ba70073 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -1,75 +1,75 @@ % property-init.ly -\version "2.1.21" +\version "2.1.22" -stemUp = \property Voice.Stem \set #'direction = #1 -stemDown = \property Voice.Stem \set #'direction = #-1 -stemBoth= \property Voice.Stem \revert #'direction +stemUp = \override Stem #'direction = #1 +stemDown = \override Stem #'direction = #-1 +stemBoth= \revert Stem #'direction -slurUp = \property Voice.Slur \set #'direction = #1 -slurDown = \property Voice.Slur \set #'direction = #-1 -slurBoth = \property Voice.Slur \revert #'direction +slurUp = \override Slur #'direction = #1 +slurDown = \override Slur #'direction = #-1 +slurBoth = \revert Slur #'direction % There's also dash, but setting dash period/length should be fixed. -slurDotted = \property Voice.Slur \set #'dashed = #1 -slurSolid = \property Voice.Slur \revert #'dashed +slurDotted = \override Slur #'dashed = #1 +slurSolid = \revert Slur #'dashed -phrasingSlurUp = \property Voice.PhrasingSlur \set #'direction = #1 -phrasingSlurDown = \property Voice.PhrasingSlur \set #'direction = #-1 -phrasingSlurBoth = \property Voice.PhrasingSlur \revert #'direction +phrasingSlurUp = \override PhrasingSlur #'direction = #1 +phrasingSlurDown = \override PhrasingSlur #'direction = #-1 +phrasingSlurBoth = \revert PhrasingSlur #'direction -shiftOn = \property Voice.NoteColumn \set #'horizontal-shift = #1 -shiftOnn = \property Voice.NoteColumn \set #'horizontal-shift = #2 -shiftOnnn = \property Voice.NoteColumn \set #'horizontal-shift = #3 -shiftOff = \property Voice.NoteColumn \revert #'horizontal-shift +shiftOn = \override NoteColumn #'horizontal-shift = #1 +shiftOnn = \override NoteColumn #'horizontal-shift = #2 +shiftOnnn = \override NoteColumn #'horizontal-shift = #3 +shiftOff = \revert NoteColumn #'horizontal-shift -tieUp = \property Voice.Tie \set #'direction = #1 -tieDown = \property Voice.Tie \set #'direction = #-1 -tieBoth = \property Voice.Tie \revert #'direction +tieUp = \override Tie #'direction = #1 +tieDown = \override Tie #'direction = #-1 +tieBoth = \revert Tie #'direction -tieDotted = \property Voice.Tie \set #'dashed = #1 -tieSolid = \property Voice.Tie \revert #'dashed +tieDotted = \override Tie #'dashed = #1 +tieSolid = \revert Tie #'dashed dynamicUp = { - \property Voice.DynamicText \set #'direction = #1 - \property Voice.DynamicLineSpanner \set #'direction = #1 + \override DynamicText #'direction = #1 + \override DynamicLineSpanner #'direction = #1 } dynamicDown = { - \property Voice.DynamicText \set #'direction = #-1 - \property Voice.DynamicLineSpanner \set #'direction = #-1 + \override DynamicText #'direction = #-1 + \override DynamicLineSpanner #'direction = #-1 } dynamicBoth = { - \property Voice.DynamicText \revert #'direction - \property Voice.DynamicLineSpanner \revert #'direction + \revert DynamicText #'direction + \revert DynamicLineSpanner #'direction } scriptUp = { - \property Voice.TextScript \set #'direction = #1 - \property Voice.Script \set #'direction = #1 + \override TextScript #'direction = #1 + \override Script #'direction = #1 } scriptDown = { - \property Voice.TextScript \set #'direction = #-1 - \property Voice.Script \set #'direction = #-1 + \override TextScript #'direction = #-1 + \override Script #'direction = #-1 } scriptBoth = { - \property Voice.TextScript \revert #'direction - \property Voice.Script \revert #'direction + \revert TextScript #'direction + \revert Script #'direction } -dotsUp = \property Voice.Dots \set #'direction = #1 -dotsDown = \property Voice.Dots \set #'direction = #-1 -dotsBoth = \property Voice.Dots \revert #'direction +dotsUp = \override Dots #'direction = #1 +dotsDown = \override Dots #'direction = #-1 +dotsBoth = \revert Dots #'direction -tupletUp = \property Voice.TupletBracket \set #'direction = #1 -tupletDown = \property Voice.TupletBracket \set #'direction = #-1 -tupletBoth = \property Voice.TupletBracket \revert #'direction +tupletUp = \override TupletBracket #'direction = #1 +tupletDown = \override TupletBracket #'direction = #-1 +tupletBoth = \revert TupletBracket #'direction -cadenzaOn = \property Timing.timing = ##f +cadenzaOn = \set Timing.timing = ##f cadenzaOff = { - \property Timing.timing = ##t - \property Timing.measurePosition = #(ly:make-moment 0 1) + \set Timing.timing = ##t + \set Timing.measurePosition = #(ly:make-moment 0 1) } newpage = \notes @@ -90,46 +90,46 @@ voiceFour = #(context-spec-music (make-voice-props-set 3) 'Voice) tiny = - \property Voice.fontSize= #-2 + \set fontSize = #-2 small = - \property Voice.fontSize= #-1 + \set fontSize = #-1 normalsize = { - \property Voice.fontSize= #0 + \set fontSize = #0 } % End the incipit and print a ``normal line start''. endincipit = \notes \context Staff { \partial 16 s16 % Hack to handle e.g. \bar ".|" \endincipit - \once \property Staff.Clef \set #'full-size-change = ##t - \once \property Staff.Clef \set #'non-default = ##t + \once \override Staff.Clef #'full-size-change = ##t + \once \override Staff.Clef #'non-default = ##t \bar "" } -autoBeamOff = \property Voice.autoBeaming = ##f -autoBeamOn = \property Voice.autoBeaming = ##t +autoBeamOff = \set autoBeaming = ##f +autoBeamOn = \set autoBeaming = ##t -fatText = \property Voice.TextScript \set #'no-spacing-rods = ##f -emptyText = \property Voice.TextScript \set #'no-spacing-rods = ##t +fatText = \override TextScript #'no-spacing-rods = ##f +emptyText = \override TextScript #'no-spacing-rods = ##t -showStaffSwitch = \property Voice.followVoice = ##t -hideStaffSwitch = \property Voice.followVoice = ##f +showStaffSwitch = \set followVoice = ##t +hideStaffSwitch = \set followVoice = ##f % accidentals as they were common in the 18th century. defaultAccidentals = { - \property Current.extraNatural = ##t - \property Current.autoAccidentals = #'(Staff (same-octave . 0)) - \property Current.autoCautionaries = #'() + \set Current.extraNatural = ##t + \set Current.autoAccidentals = #'(Staff (same-octave . 0)) + \set Current.autoCautionaries = #'() } % accidentals in voices instead of staves. % Notice that accidentals from one voice do NOT get cancelled in other voices voiceAccidentals = { - \property Current.extraNatural = ##t - \property Current.autoAccidentals = #'(Voice (same-octave . 0)) - \property Current.autoCautionaries = #'() + \set Current.extraNatural = ##t + \set Current.autoAccidentals = #'(Voice (same-octave . 0)) + \set Current.autoCautionaries = #'() } @@ -137,38 +137,38 @@ voiceAccidentals = { % This includes all the default accidentals, but accidentals also needs cancelling % in other octaves and in the next measure. modernAccidentals = { - \property Current.extraNatural = ##f - \property Current.autoAccidentals = #'(Staff (same-octave . 0) (any-octave . 0) (same-octave . 1)) - \property Current.autoCautionaries = #'() + \set Current.extraNatural = ##f + \set Current.autoAccidentals = #'(Staff (same-octave . 0) (any-octave . 0) (same-octave . 1)) + \set Current.autoCautionaries = #'() } % the accidentals that Stone adds to the old standard as cautionaries modernCautionaries = { - \property Current.extraNatural = ##f - \property Current.autoAccidentals = #'(Staff (same-octave . 0)) - \property Current.autoCautionaries = #'(Staff (any-octave . 0) (same-octave . 1)) + \set Current.extraNatural = ##f + \set Current.autoAccidentals = #'(Staff (same-octave . 0)) + \set Current.autoCautionaries = #'(Staff (any-octave . 0) (same-octave . 1)) } % Multivoice accidentals to be read both by musicians playing one voice % and musicians playing all voices. % Accidentals are typeset for each voice, but they ARE cancelled across voices. modernVoiceAccidentals = { - \property Current.extraNatural = ##f - \property Current.autoAccidentals = #'( + \set Current.extraNatural = ##f + \set Current.autoAccidentals = #'( Voice (same-octave . 0) (any-octave . 0) (same-octave . 1) Staff (same-octave . 0) (any-octave . 0) (same-octave . 1) ) - \property Current.autoCautionaries = #'() + \set Current.autoCautionaries = #'() } % same as modernVoiceAccidental eccept that all special accidentals are typeset % as cautionaries modernVoiceCautionaries = { - \property Current.extraNatural = ##f - \property Current.autoAccidentals = #'( + \set Current.extraNatural = ##f + \set Current.autoAccidentals = #'( Voice (same-octave . 0) ) - \property Current.autoCautionaries = #'( + \set Current.autoCautionaries = #'( Voice (any-octave . 0) (same-octave . 1) Staff (same-octave . 0) (any-octave . 0) (same-octave . 1) ) @@ -177,18 +177,18 @@ modernVoiceCautionaries = { % stone's suggestions for accidentals on grand staff. % Accidentals are cancelled across the staves in the same grand staff as well pianoAccidentals = { - \property Current.autoAccidentals = #'( + \set Current.autoAccidentals = #'( Staff (same-octave . 0) (any-octave . 0) (same-octave . 1) GrandStaff (any-octave . 0) (same-octave . 1) ) - \property Current.autoCautionaries = #'() + \set Current.autoCautionaries = #'() } pianoCautionaries = { - \property Current.autoAccidentals = #'( + \set Current.autoAccidentals = #'( Staff (same-octave . 0) ) - \property Current.autoCautionaries = #'( + \set Current.autoCautionaries = #'( Staff (any-octave . 0) (same-octave . 1) GrandStaff (any-octave . 0) (same-octave . 1) ) @@ -199,8 +199,8 @@ pianoCautionaries = { % printed only once and are in effect until overridden, possibly many % measures later. noResetKey = { - \property Current.autoAccidentals = #'(Staff (same-octave . #t)) - \property Current.autoCautionaries = #'() + \set Current.autoAccidentals = #'(Staff (same-octave . #t)) + \set Current.autoCautionaries = #'() } % do not set localKeySignature when a note alterated differently from @@ -209,13 +209,13 @@ noResetKey = { % remembered for the duration of a measure. % accidentals not being remembered, causing accidentals always to be typeset relative to the time signature forgetAccidentals = { - \property Current.autoAccidentals = #'(Staff (same-octave . -1)) - \property Current.autoCautionaries = #'() + \set Current.autoAccidentals = #'(Staff (same-octave . -1)) + \set Current.autoCautionaries = #'() } % To remove a Volta bracket or some other graphical object, -% set it to turnOff. Example: \property Staff.VoltaBracket = \turnOff +% set it to turnOff. Example: \set Staff.VoltaBracket = \turnOff %% %% DO NOT USE THIS. IT CAN LEAD TO CRASHES. @@ -233,33 +233,33 @@ glissando = #(make-music-by-name 'GlissandoEvent) fermataMarkup = \markup { \musicglyph #"scripts-ufermata" } setMmRestFermata = - \once \property Voice.MultiMeasureRestNumber \override #'text = + \once \override MultiMeasureRestNumber #'text = #fermataMarkup hideNotes =\sequential { % hide notes, accidentals, etc. - \property Voice.Dots \override #'transparent = ##t - \property Voice.NoteHead \override #'transparent = ##t - \property Voice.Stem \override #'transparent = ##t - \property Voice.Beam \override #'transparent = ##t - \property Staff.Accidental \override #'transparent = ##t + \override Dots #'transparent = ##t + \override NoteHead #'transparent = ##t + \override Stem #'transparent = ##t + \override Beam #'transparent = ##t + \override Staff.Accidental #'transparent = ##t } unHideNotes = \sequential { - \property Staff.Accidental \revert #'transparent - \property Voice.Beam \revert #'transparent - \property Voice.Stem \revert #'transparent - \property Voice.NoteHead \revert #'transparent - \property Voice.Dots \revert #'transparent + \revert Staff.Accidental #'transparent + \revert Beam #'transparent + \revert Stem #'transparent + \revert NoteHead #'transparent + \revert Dots #'transparent } germanChords = { - \property ChordNames. chordRootNamer = #(chord-name->german-markup #t) - \property ChordNames. chordNoteNamer = #note-name->german-markup + \set chordRootNamer = #(chord-name->german-markup #t) + \set chordNoteNamer = #note-name->german-markup } semiGermanChords = { - \property ChordNames. chordRootNamer = #(chord-name->german-markup #f) - \property ChordNames. chordNoteNamer = #note-name->german-markup + \set chordRootNamer = #(chord-name->german-markup #f) + \set chordNoteNamer = #note-name->german-markup } diff --git a/ly/scale-definitions-init.ly b/ly/scale-definitions-init.ly index c32b0e2db1..4d0d42e483 100644 --- a/ly/scale-definitions-init.ly +++ b/ly/scale-definitions-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" major = #`( diff --git a/ly/script-init.ly b/ly/script-init.ly index 35fd6e86ee..051071a760 100644 --- a/ly/script-init.ly +++ b/ly/script-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" dashHat= "marcato" diff --git a/ly/spanners-init.ly b/ly/spanners-init.ly index 5d655b730c..464a54689c 100644 --- a/ly/spanners-init.ly +++ b/ly/spanners-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" startGroup = #(make-span-event 'NoteGroupingEvent START) stopGroup = #(make-span-event 'NoteGroupingEvent STOP) @@ -18,29 +18,29 @@ stopTextSpan = #(make-span-event 'TextSpanEvent STOP) cresc = \notes { #(ly:export (make-event-chord (list cr))) - \property Voice.crescendoText = \markup { \italic "cresc." } - \property Voice.crescendoSpanner = #'dashed-line + \set crescendoText = \markup { \italic "cresc." } + \set crescendoSpanner = #'dashed-line } % ah, this is handy: maybe drop resetting of properties in % dynamic-engraver ? endcresc = \notes { #(ly:export (make-event-chord (list rc))) - \property Voice.crescendoText \unset - \property Voice.crescendoSpanner \unset + \unset crescendoText + \unset crescendoSpanner } dim = \notes { #(ly:export (make-event-chord (list decr))) - \property Voice.decrescendoText = \markup { \italic "dim." } - \property Voice.decrescendoSpanner = #'dashed-line + \set decrescendoText = \markup { \italic "dim." } + \set decrescendoSpanner = #'dashed-line } enddim = \notes { #(ly:export (make-event-chord (list rced))) - \property Voice.decrescendoText \unset - \property Voice.decrescendoSpanner \unset + \unset decrescendoText + \unset decrescendoSpanner } %{ @@ -60,6 +60,6 @@ treCorde = #(make-span-event 'UnaCordaEvent STOP) sostenutoDown = #(make-span-event 'SostenutoEvent START) sostenutoUp = #(make-span-event 'SostenutoEvent STOP) -%crescpoco = \property Voice.crescendoText = "cresc. poco a poco" -%decresc = \property Voice.crescendoText = "decr." -%dim = \property Voice.crescendoText = "dim." +%crescpoco = \set crescendoText = "cresc. poco a poco" +%decresc = \set crescendoText = "decr." +%dim = \set crescendoText = "dim." diff --git a/ly/suomi.ly b/ly/suomi.ly index 1a82687171..7e0d10f3be 100644 --- a/ly/suomi.ly +++ b/ly/suomi.ly @@ -48,4 +48,4 @@ pitchnamesSuomi = #`( pitchnames = \pitchnamesSuomi -\version "2.1.19" +\version "2.1.22" diff --git a/ly/svenska.ly b/ly/svenska.ly index d81d7f1467..b9df19ba0d 100644 --- a/ly/svenska.ly +++ b/ly/svenska.ly @@ -42,4 +42,4 @@ pitchnamesSvenska = #`( ) pitchnames = \pitchnamesSvenska -\version "2.1.19" +\version "2.1.22" diff --git a/ly/tabloid-init.ly b/ly/tabloid-init.ly index 41f0e88bc3..1bc151b795 100644 --- a/ly/tabloid-init.ly +++ b/ly/tabloid-init.ly @@ -1,4 +1,4 @@ -\version "1.9.8" +\version "2.1.22" % tabloid-init.ly diff --git a/make/ly-rules.make b/make/ly-rules.make index 174dee86eb..1aed0614e2 100644 --- a/make/ly-rules.make +++ b/make/ly-rules.make @@ -51,7 +51,7 @@ $(outdir)/%-book.ps: $(outdir)/%.ps pstops '2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)' $<.tmp $@ $(outdir)/%.pdf: $(outdir)/%.dvi - dvips -u +lilypond.map -o $@.pdfps -t $(DVIPS_PAPERSIZE) -Ppdf $< + dvips $(DVIPS_FLAGS) -o $@.pdfps -t $(DVIPS_PAPERSIZE) $< ps2pdf -sPAPERSIZE=$(DVIPS_PAPERSIZE) $@.pdfps $@ diff --git a/make/ly-vars.make b/make/ly-vars.make index 3a844e20bb..08d608dfb2 100644 --- a/make/ly-vars.make +++ b/make/ly-vars.make @@ -16,3 +16,4 @@ TEXINFO_SOURCES += $(TELY_FILES) $(ITELY_FILES) $(ITEXI_FILES) EXTRA_DIST_FILES += $(TELY_FILES) $(LY_FILES) $(ITEXI_FILES) $(ITELY_FILES) $(LYINC_FILES) +DVIPS_FLAGS= -u +lilypond.map -Ppdf diff --git a/make/mutopia-rules.make b/make/mutopia-rules.make index 03cba6f2e9..af73902b97 100644 --- a/make/mutopia-rules.make +++ b/make/mutopia-rules.make @@ -31,7 +31,7 @@ $(outdir)/%.dvi: %.ly $(outdir)/%.pdf: $(outdir)/%.dvi - dvips -u +lilypond.map -t $(DVIPS_PAPERSIZE) -o $@.pdfps -Ppdf $< + dvips $(DVIPS_FLAGS) -t $(DVIPS_PAPERSIZE) -o $@.pdfps $< ps2pdf -sPAPERSIZE=$(DVIPS_PAPERSIZE) $@.pdfps $@ $(outdir)-$(PAPERSIZE)/%.dvi: %.ly diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 322ac184d0..2b520fb25d 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -76,7 +76,7 @@ for balloon text.") "Where to put text relative to balloon.") (balloon-padding ,ly:dimension? "Text to add to help balloon") (balloon-original-callback ,procedure? "The -original molecule drawer to draw the balloon around.") +original stencil drawer to draw the balloon around.") (bar-size ,ly:dimension? "size of a bar line.") @@ -319,7 +319,7 @@ Also works as a scaling parameter for the length of hyphen. .") (print-function ,procedure? "Function taking grob as argument, returning a Molecule object.") - (molecule ,ly:molecule? "Cached output of the print-function.") + (stencil ,ly:stencil? "Cached output of the print-function.") (new-accidentals ,list? "list of (pitch, accidental) pairs.") (no-spacing-rods ,boolean? "read from grobs: boolean that makes Separation_item ignore this item (MOVE ME TO ITEM).") @@ -549,7 +549,7 @@ columns. did it's job. This ensures that a positioning is only done once.") - (script-molecule ,pair? "Index code for script -- internal, see script.cc.") + (script-stencil ,pair? "Index code for script -- internal, see script.cc.") (flag-count ,number? "") diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 10ecd85d9a..7a51b8af51 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -32,13 +32,13 @@ "Put @var{args} in a horizontal line. The property @code{word-space} determines the space between each markup in @var{args}. " - (stack-molecule-line + (stack-stencil-line (cdr (chain-assoc 'word-space props)) (map (lambda (m) (interpret-markup paper props m)) args))) (def-markup-command (combine paper props m1 m2) (markup? markup?) "Print two markups on top of each other." - (ly:molecule-add + (ly:stencil-add (interpret-markup paper props m1) (interpret-markup paper props m2))) @@ -172,17 +172,17 @@ of the #'direction layout property." (def-markup-command (center paper props args) (markup-list?) (let* ((mols (map (lambda (x) (interpret-markup paper props x)) args)) - (cmols (map (lambda (x) (ly:molecule-align-to! x X CENTER)) mols))) + (cmols (map (lambda (x) (ly:stencil-align-to! x X CENTER)) mols))) (stack-lines -1 0.0 (cdr (chain-assoc 'baseline-skip props)) mols))) (def-markup-command (right-align paper props arg) (markup?) (let* ((m (interpret-markup paper props arg))) - (ly:molecule-align-to! m X RIGHT) + (ly:stencil-align-to! m X RIGHT) m)) (def-markup-command (left-align paper props arg) (markup?) (let* ((m (interpret-markup paper props arg))) - (ly:molecule-align-to! m X LEFT) + (ly:stencil-align-to! m X LEFT) m)) (def-markup-command (halign paper props dir arg) (number? markup?) @@ -191,7 +191,7 @@ right, values in between vary alignment accordingly." (let* ((m (interpret-markup paper props arg))) - (ly:molecule-align-to! m X dir) + (ly:stencil-align-to! m X dir) m)) (def-markup-command (musicglyph paper props glyph-name) (string?) @@ -237,7 +237,7 @@ positions it next to the staff cancels any shift made with and/or @code{extra-offset} properties. " - (ly:molecule-translate-axis (interpret-markup paper props arg) + (ly:stencil-translate-axis (interpret-markup paper props arg) amount Y)) (def-markup-command (fraction paper props arg1 arg2) (markup? markup?) @@ -246,18 +246,18 @@ and/or @code{extra-offset} properties. " Syntax: \\fraction MARKUP1 MARKUP2." (let* ((m1 (interpret-markup paper props arg1)) (m2 (interpret-markup paper props arg2))) - (ly:molecule-align-to! m1 X CENTER) - (ly:molecule-align-to! m2 X CENTER) - (let* ((x1 (ly:molecule-get-extent m1 X)) - (x2 (ly:molecule-get-extent m2 X)) + (ly:stencil-align-to! m1 X CENTER) + (ly:stencil-align-to! m2 X CENTER) + (let* ((x1 (ly:stencil-get-extent m1 X)) + (x2 (ly:stencil-get-extent m2 X)) (line (ly:round-filled-box (interval-union x1 x2) '(-0.05 . 0.05) 0.0)) ;; should stack mols separately, to maintain LINE on baseline (stack (stack-lines -1 0.2 0.6 (list m1 line m2)))) - (ly:molecule-align-to! stack Y CENTER) - (ly:molecule-align-to! stack X LEFT) + (ly:stencil-align-to! stack Y CENTER) + (ly:stencil-align-to! stack X LEFT) ;; should have EX dimension ;; empirical anyway - (ly:molecule-translate-axis stack 0.75 Y)))) + (ly:stencil-translate-axis stack 0.75 Y)))) ;; TODO: better syntax. @@ -273,7 +273,7 @@ for DIR, you can obtain longer or shorter stems." (stemth 0.13) (stemy (* dir stemlen)) (attachx (if (> dir 0) - (- (cdr (ly:molecule-get-extent headgl X)) stemth) + (- (cdr (ly:stencil-get-extent headgl X)) stemth) 0)) (attachy (* dir 0.28)) (stemgl (and (> log 0) @@ -283,34 +283,34 @@ for DIR, you can obtain longer or shorter stems." (max stemy attachy)) (/ stemth 3)))) (dot (ly:find-glyph-by-name font "dots-dot")) - (dotwid (interval-length (ly:molecule-get-extent dot X))) + (dotwid (interval-length (ly:stencil-get-extent dot X))) (dots (and (> dot-count 0) - (apply ly:molecule-add + (apply ly:stencil-add (map (lambda (x) - (ly:molecule-translate-axis + (ly:stencil-translate-axis dot (* (+ 1 (* 2 x)) dotwid) X) ) (iota dot-count 1))))) (flaggl (and (> log 2) - (ly:molecule-translate + (ly:stencil-translate (ly:find-glyph-by-name font (string-append "flags-" (if (> dir 0) "u" "d") (number->string log))) (cons (+ attachx (/ stemth 2)) stemy))))) (if flaggl - (set! stemgl (ly:molecule-add flaggl stemgl))) - (if (ly:molecule? stemgl) - (set! stemgl (ly:molecule-add stemgl headgl)) + (set! stemgl (ly:stencil-add flaggl stemgl))) + (if (ly:stencil? stemgl) + (set! stemgl (ly:stencil-add stemgl headgl)) (set! stemgl headgl)) - (if (ly:molecule? dots) + (if (ly:stencil? dots) (set! stemgl - (ly:molecule-add - (ly:molecule-translate-axis dots + (ly:stencil-add + (ly:stencil-translate-axis dots (+ (if (and (> dir 0) (> log 2)) (* 1.5 dotwid) 0) ;; huh ? why not necessary? - ;;(cdr (ly:molecule-get-extent headgl X)) + ;;(cdr (ly:stencil-get-extent headgl X)) dotwid) X) stemgl))) @@ -346,7 +346,7 @@ a shortened down stem." (def-markup-command (normal-size-super paper props arg) (markup?) "A superscript which does not use a smaller font." - (ly:molecule-translate-axis (interpret-markup + (ly:stencil-translate-axis (interpret-markup paper props arg) (* 0.5 (cdr (chain-assoc 'baseline-skip props))) @@ -371,7 +371,7 @@ Raising and lowering texts can be done with @code{\\super} and " - (ly:molecule-translate-axis + (ly:stencil-translate-axis (interpret-markup paper (cons `((font-size . ,(- (chain-assoc-get 'font-size props 0) 3))) props) @@ -390,12 +390,12 @@ vertically, for the same reason that @code{\\raise} cannot be used for that. . " - (ly:molecule-translate (interpret-markup paper props arg) + (ly:stencil-translate (interpret-markup paper props arg) offset)) (def-markup-command (sub paper props arg) (markup?) "Syntax: \\sub MARKUP." - (ly:molecule-translate-axis + (ly:stencil-translate-axis (interpret-markup paper (cons `((font-size . ,(- (chain-assoc-get 'font-size props 0) 3))) props) @@ -404,7 +404,7 @@ that. Y)) (def-markup-command (normal-size-sub paper props arg) (markup?) - (ly:molecule-translate-axis + (ly:stencil-translate-axis (interpret-markup paper props arg) (* -0.5 (cdr (chain-assoc 'baseline-skip props))) Y)) @@ -413,13 +413,13 @@ that. "Horizontal brackets around @var{arg}." (let ((th 0.1) ;; todo: take from GROB. (m (interpret-markup paper props arg))) - (bracketify-molecule m X th (* 2.5 th) th))) + (bracketify-stencil m X th (* 2.5 th) th))) (def-markup-command (bracket paper props arg) (markup?) "Vertical brackets around @var{arg}." (let ((th 0.1) ;; todo: take from GROB. (m (interpret-markup paper props arg))) - (bracketify-molecule m Y th (* 2.5 th) th))) + (bracketify-stencil m Y th (* 2.5 th) th))) ;; todo: fix negative space (def-markup-command (hspace paper props amount) (number?) @@ -431,8 +431,8 @@ will put extra space between A and B, on top of the space that is normally inserted before elements on a line. " (if (> amount 0) - (ly:make-molecule "" (cons 0 amount) '(-1 . 1) ) - (ly:make-molecule "" (cons amount amount) '(-1 . 1)))) + (ly:make-stencil "" (cons 0 amount) '(-1 . 1) ) + (ly:make-stencil "" (cons amount amount) '(-1 . 1)))) (def-markup-command (override paper props new-prop arg) (pair? markup?) "Add the first argument in to the property list. Properties may be @@ -468,7 +468,7 @@ any sort of property supported by @internalsref{font-interface} and (let ((th 0.1) (pad 0.2) (m (interpret-markup paper props arg))) - (box-molecule m th pad))) + (box-stencil m th pad))) (def-markup-command (strut paper props) () @@ -478,7 +478,7 @@ FIXME: is this working? " (let ((m (Text_item::interpret_markup paper props " "))) - (ly:molecule-set-extent! m X '(1000 . -1000)) + (ly:stencil-set-extent! m X '(1000 . -1000)) m)) (define number->mark-letter-vector (make-vector 25 #\A)) diff --git a/scm/lily.scm b/scm/lily.scm index 31a24cd074..bd268611b3 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -373,7 +373,7 @@ L1 is copied, L2 not. `( ("tex" . ("TeX output. The default output form." ,tex-output-expression)) ("ps" . ("Direct postscript. Requires setting GS_LIB and GS_FONTPATH" ,ps-output-expression)) - ("scm" . ("Scheme dump: debug scheme molecule expressions" ,write)) + ("scm" . ("Scheme dump: debug scheme stencil expressions" ,write)) ("sketch" . ("Bare bones Sketch output." ,sketch-output-expression)) ("sodipodi" . ("Bare bones Sodipodi output." ,sodipodi-output-expression)) ("pdftex" . ("PDFTeX output. Was last seen nonfunctioning." ,pdftex-output-expression)) @@ -407,7 +407,7 @@ L1 is copied, L2 not. "chord-ignatzek-names.scm" "chord-entry.scm" "chord-generic-names.scm" - "molecule.scm" + "stencil.scm" "new-markup.scm" "bass-figure.scm" "music-functions.scm" diff --git a/scm/molecule.scm b/scm/molecule.scm deleted file mode 100644 index 443f6e5c83..0000000000 --- a/scm/molecule.scm +++ /dev/null @@ -1,84 +0,0 @@ - -(define-public (stack-molecules axis dir padding mols) - "Stack molecules MOLS in direction AXIS,DIR, using PADDING." - (if (null? mols) - '() - (if (pair? mols) - (ly:molecule-combine-at-edge (car mols) axis dir - (stack-molecules axis dir padding (cdr mols)) - padding - ) - ) - )) - - -(define-public (stack-lines dir padding baseline mols) - "Stack vertically with a baseline-skip." - (if (null? mols) - '() - (if (null? (cdr mols)) - (car mols) - (ly:molecule-combine-at-edge (car mols) Y dir - (stack-lines dir padding baseline (cdr mols)) - padding baseline - ) - ))) - -(define-public (fontify-text font-metric text) - "Set TEXT with font FONT-METRIC, returning a molecule." - (let* ((b (ly:text-dimension font-metric text))) - (ly:make-molecule - (ly:fontify-atom font-metric `(text ,text)) (car b) (cdr b)) - )) - -(define-public (bracketify-molecule mol axis thick protusion padding) - "Add brackets around MOL, producing a new molecule." - - (let* ((ext (ly:molecule-get-extent mol axis)) - (lb (ly:bracket axis ext thick (- protusion))) - (rb (ly:bracket axis ext thick protusion))) - (set! mol (ly:molecule-combine-at-edge mol (other-axis axis) 1 lb padding)) - (set! mol (ly:molecule-combine-at-edge mol (other-axis axis) -1 rb padding)) - mol - )) - -(define-public (make-filled-box-molecule xext yext) - "Make a filled box." - - (ly:make-molecule - (list 'filledbox (- (car xext)) (cdr xext) - (- (car yext)) (cdr yext)) - xext yext) -) - - -(define-public (box-grob-molecule grob) - "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)) - (thick 0.1)) - - (ly:molecule-add (make-filled-box-molecule xext (cons (- (car yext) thick) (car yext) )) - (make-filled-box-molecule xext (cons (cdr yext) (+ (cdr yext) thick) )) - (make-filled-box-molecule (cons (cdr xext) (+ (cdr xext) thick)) yext) - (make-filled-box-molecule (cons (- (car xext) thick) (car xext)) yext)))) - - -;; TODO merge this and prev function. -(define-public (box-molecule mol thick padding) - "Add a box around MOL, producing a new molecule." - (let* ( - (x-ext (interval-widen (ly:molecule-get-extent mol 0) padding)) - (y-ext (interval-widen (ly:molecule-get-extent mol 1) padding)) - (y-rule (make-filled-box-molecule (cons 0 thick) y-ext)) - (x-rule (make-filled-box-molecule (interval-widen x-ext thick) - (cons 0 thick))) - ) - (set! mol (ly:molecule-combine-at-edge mol X 1 y-rule padding)) - (set! mol (ly:molecule-combine-at-edge mol X -1 y-rule padding)) - (set! mol (ly:molecule-combine-at-edge mol Y 1 x-rule 0.0)) - (set! mol (ly:molecule-combine-at-edge mol Y -1 x-rule 0.0)) - - mol)) diff --git a/scm/new-markup.scm b/scm/new-markup.scm index e7a5d22ce3..43f493d79e 100644 --- a/scm/new-markup.scm +++ b/scm/new-markup.scm @@ -10,7 +10,7 @@ When the markup is formatted, then FUNCTION is called as follows GROB is the current grob, PROPS is a list of alists, and ARG1.. are the rest of the arguments. -The function should return a molecule (i.e. a formatted, ready to +The function should return a stencil (i.e. a formatted, ready to print object). @@ -360,7 +360,7 @@ Also set markup-signature and markup-keyword object properties." (make-line-markup (list-insert-separator markups sep)) empty-markup)) -(define-public brew-new-markup-molecule Text_item::print) +(define-public brew-new-markup-stencil Text_item::print) (define-public interpret-markup Text_item::interpret_markup) (define-public (prepend-alist-chain key val chain) (cons (acons key val (car chain)) (cdr chain))) @@ -368,15 +368,15 @@ Also set markup-signature and markup-keyword object properties." -(define-public (stack-molecule-line space molecules) - (if (pair? molecules) - (if (pair? (cdr molecules)) - (let* ((tail (stack-molecule-line space (cdr molecules))) - (head (car molecules)) - (xoff (+ space (cdr (ly:molecule-get-extent head X))))) - (ly:molecule-add head - (ly:molecule-translate-axis tail xoff X))) - (car molecules)) +(define-public (stack-stencil-line space stencils) + (if (pair? stencils) + (if (pair? (cdr stencils)) + (let* ((tail (stack-stencil-line space (cdr stencils))) + (head (car stencils)) + (xoff (+ space (cdr (ly:stencil-get-extent head X))))) + (ly:stencil-add head + (ly:stencil-translate-axis tail xoff X))) + (car stencils)) '())) diff --git a/scm/output-lib.scm b/scm/output-lib.scm index 2809f56707..bd839657de 100644 --- a/scm/output-lib.scm +++ b/scm/output-lib.scm @@ -11,14 +11,14 @@ (define (tablature-stem-attachment-function style duration) (cons 0.0 0.5)) -; The TabNoteHead molecule callback. -; Create a text molecule +; The TabNoteHead stencil callback. +; Create a text stencil (define-public (tablature-print-function grob) - (let ((molecule (fontify-text + (let ((stencil (fontify-text (ly:get-default-font grob) (ly:get-grob-property grob 'text) ))) - molecule ; return the molecule. + stencil ; return the stencil. )) ; The TabNoteHead tablatureFormat callback. @@ -50,16 +50,16 @@ (let ((slur (Slur::print grob)) (text (fontify-text (ly:get-default-font grob) letter))) - (let ((x (/ (- (cdr (ly:molecule-get-extent slur 0)) - (/ (cdr (ly:molecule-get-extent text 0)) 2.0) + (let ((x (/ (- (cdr (ly:stencil-get-extent slur 0)) + (/ (cdr (ly:stencil-get-extent text 0)) 2.0) ) -2.0))) - (ly:molecule-set-extent! text 0 (cons x x)) - (ly:molecule-align-to! text 0 1) + (ly:stencil-set-extent! text 0 (cons x x)) + (ly:stencil-align-to! text 0 1) ) - (ly:molecule-combine-at-edge slur 1 1 text -0.6) + (ly:stencil-combine-at-edge slur 1 1 text -0.6) ) ) ) @@ -69,27 +69,27 @@ ; end of tablature functions -(define-public (make-molecule-boxer line-thick x-padding y-padding callback) +(define-public (make-stencil-boxer line-thick x-padding y-padding callback) "Makes a routine that adds a box around the grob parsed as argument" - (define (molecule-boxer grob) + (define (stencil-boxer grob) (let* ( (mol (callback grob)) - (x-ext (interval-widen (ly:molecule-get-extent mol 0) x-padding)) - (y-ext (interval-widen (ly:molecule-get-extent mol 1) y-padding)) - (x-rule (make-filled-box-molecule (interval-widen x-ext line-thick) + (x-ext (interval-widen (ly:stencil-get-extent mol 0) x-padding)) + (y-ext (interval-widen (ly:stencil-get-extent mol 1) y-padding)) + (x-rule (make-filled-box-stencil (interval-widen x-ext line-thick) (cons 0 line-thick))) - (y-rule (make-filled-box-molecule (cons 0 line-thick) y-ext)) + (y-rule (make-filled-box-stencil (cons 0 line-thick) y-ext)) ) - (set! mol (ly:molecule-combine-at-edge mol 0 1 y-rule x-padding)) - (set! mol (ly:molecule-combine-at-edge mol 0 -1 y-rule x-padding)) - (set! mol (ly:molecule-combine-at-edge mol 1 1 x-rule 0)) - (set! mol (ly:molecule-combine-at-edge mol 1 -1 x-rule 0)) + (set! mol (ly:stencil-combine-at-edge mol 0 1 y-rule x-padding)) + (set! mol (ly:stencil-combine-at-edge mol 0 -1 y-rule x-padding)) + (set! mol (ly:stencil-combine-at-edge mol 1 1 x-rule 0)) + (set! mol (ly:stencil-combine-at-edge mol 1 -1 x-rule 0)) mol )) - molecule-boxer + stencil-boxer ) (define-public (arg->string arg) diff --git a/scm/script.scm b/scm/script.scm index d8f1be5e35..d125b6c95a 100644 --- a/scm/script.scm +++ b/scm/script.scm @@ -3,162 +3,162 @@ (append '(("thumb" . ( - (script-molecule . (feta . ("thumb" . "thumb"))) + (script-stencil . (feta . ("thumb" . "thumb"))) (direction . 1))) ("accent" . ( - (script-molecule . (feta . ("sforzato" . "sforzato"))) + (script-stencil . (feta . ("sforzato" . "sforzato"))) (side-relative-direction . -1)) ) ("marcato" . ( - (script-molecule . (feta . ("dmarcato" . "umarcato"))) + (script-stencil . (feta . ("dmarcato" . "umarcato"))) (side-relative-direction . -1))) ("staccatissimo" . ( - (script-molecule . (feta . ("dstaccatissimo" . "ustaccatissimo"))) + (script-stencil . (feta . ("dstaccatissimo" . "ustaccatissimo"))) (side-relative-direction . -1))) ("portato" . - ((script-molecule . (feta . ("dportato" . "uportato"))) + ((script-stencil . (feta . ("dportato" . "uportato"))) (side-relative-direction . -1))) ("accentus" . - ((script-molecule . (feta . ("uaccentus" . "uaccentus"))) + ((script-stencil . (feta . ("uaccentus" . "uaccentus"))) (side-relative-direction . -1) (follow-into-staff . #t) (priority . -100) (direction . 1))) ("ictus" . - ((script-molecule . (feta . ("ictus" . "ictus"))) + ((script-stencil . (feta . ("ictus" . "ictus"))) (side-relative-direction . -1) (follow-into-staff . #t) (priority . -100) (direction . -1))) ("semicirculus" . - ((script-molecule . (feta . ("dsemicirculus" . "dsemicirculus"))) + ((script-stencil . (feta . ("dsemicirculus" . "dsemicirculus"))) (side-relative-direction . -1) (follow-into-staff . #t) (priority . -100) (direction . 1))) ("circulus" . - ((script-molecule . (feta . ("circulus" . "circulus"))) + ((script-stencil . (feta . ("circulus" . "circulus"))) (side-relative-direction . -1) (follow-into-staff . #t) (priority . -100) (direction . 1))) ("signumcongruentiae" . - ((script-molecule . (feta . ("dsignumcongruentiae" . "usignumcongruentiae"))) + ((script-stencil . (feta . ("dsignumcongruentiae" . "usignumcongruentiae"))) (direction . 1))) ("fermata" . - ((script-molecule . (feta . ("dfermata" . "ufermata"))) + ((script-stencil . (feta . ("dfermata" . "ufermata"))) (direction . 1))) ("shortfermata" . - ((script-molecule . (feta . ("dshortfermata" . "ushortfermata"))) + ((script-stencil . (feta . ("dshortfermata" . "ushortfermata"))) (direction . 1))) ("longfermata" . - ((script-molecule . (feta . ("dlongfermata" . "ulongfermata"))) + ((script-stencil . (feta . ("dlongfermata" . "ulongfermata"))) (direction . 1))) ("verylongfermata" . - ((script-molecule . (feta . ("dverylongfermata" . "uverylongfermata"))) + ((script-stencil . (feta . ("dverylongfermata" . "uverylongfermata"))) (direction . 1))) ("stopped" . - ((script-molecule . (feta . ("stopped" . "stopped"))) + ((script-stencil . (feta . ("stopped" . "stopped"))) (direction . 1) )) ("staccato" . - ((script-molecule . (feta . ("staccato" . "staccato"))) + ((script-stencil . (feta . ("staccato" . "staccato"))) (side-relative-direction . -1) (follow-into-staff . #t) (priority . -100))) ("tenuto" . - ((script-molecule . (feta . ("tenuto" . "tenuto"))) + ((script-stencil . (feta . ("tenuto" . "tenuto"))) (follow-into-staff . #t) (side-relative-direction . -1))) ("comma" . - ((script-molecule . (feta . ("lcomma" . "rcomma"))) + ((script-stencil . (feta . ("lcomma" . "rcomma"))) (follow-into-staff . #t) (direction . 1))) ("varcomma" . - ((script-molecule . (feta . ("lvarcomma" . "rvarcomma"))) + ((script-stencil . (feta . ("lvarcomma" . "rvarcomma"))) (follow-into-staff . #t) (direction . 1))) ("upbow" . - ((script-molecule . (feta . ("upbow" . "upbow"))) + ((script-stencil . (feta . ("upbow" . "upbow"))) (direction . 1) )) ("downbow" . - ((script-molecule . (feta . ("downbow" . "downbow"))) + ((script-stencil . (feta . ("downbow" . "downbow"))) (direction . 1) )) ("lheel" . - ((script-molecule . (feta . ("upedalheel" . "upedalheel"))) + ((script-stencil . (feta . ("upedalheel" . "upedalheel"))) (direction . -1)) ) ("rheel" . - ((script-molecule . (feta . ("dpedalheel" . "dpedalheel"))) + ((script-stencil . (feta . ("dpedalheel" . "dpedalheel"))) (direction . 1) )) ("ltoe" . - ((script-molecule . (feta . ("upedaltoe" . "upedaltoe"))) + ((script-stencil . (feta . ("upedaltoe" . "upedaltoe"))) (direction . -1) )) ("rtoe" . - ((script-molecule . (feta . ("dpedaltoe" . "dpedaltoe"))) + ((script-stencil . (feta . ("dpedaltoe" . "dpedaltoe"))) (direction . 1) )) ("turn" . - ((script-molecule . (feta . ("turn" . "turn"))) + ((script-stencil . (feta . ("turn" . "turn"))) (direction . 1) )) ("open" . - ((script-molecule . (feta . ("open" . "open"))) + ((script-stencil . (feta . ("open" . "open"))) (direction . 1) )) ("flageolet" . - ((script-molecule . (feta . ("flageolet" . "flageolet"))) + ((script-stencil . (feta . ("flageolet" . "flageolet"))) (direction . 1) )) ("reverseturn" . - ((script-molecule . (feta . ("reverseturn" . "reverseturn"))) + ((script-stencil . (feta . ("reverseturn" . "reverseturn"))) (direction . 1) )) ("trill" . - ((script-molecule . (feta . ("trill" . "trill"))) + ((script-stencil . (feta . ("trill" . "trill"))) (direction . 1) (priority . 2000))) ("prall" . - ((script-molecule . (feta . ("prall" . "prall"))) + ((script-stencil . (feta . ("prall" . "prall"))) (direction . 1) )) ("mordent" . - ((script-molecule . (feta . ("mordent" . "mordent"))) + ((script-stencil . (feta . ("mordent" . "mordent"))) (direction . 1) )) ("prallprall" . - ((script-molecule . (feta . ("prallprall" . "prallprall"))) + ((script-stencil . (feta . ("prallprall" . "prallprall"))) (direction . 1) )) ("prallmordent" . - ((script-molecule . (feta . ("prallmordent" . "prallmordent"))) + ((script-stencil . (feta . ("prallmordent" . "prallmordent"))) (direction . 1) )) ("upprall" . - ((script-molecule . (feta . ("upprall" . "upprall"))) + ((script-stencil . (feta . ("upprall" . "upprall"))) (direction . 1) )) ("downprall" . - ((script-molecule . (feta . ("downprall" . "downprall"))) + ((script-stencil . (feta . ("downprall" . "downprall"))) (direction . 1) )) ("upmordent" . - ((script-molecule . (feta . ("upmordent" . "upmordent"))) + ((script-stencil . (feta . ("upmordent" . "upmordent"))) (direction . 1) )) ("downmordent" . - ((script-molecule . (feta . ("downmordent" . "downmordent"))) + ((script-stencil . (feta . ("downmordent" . "downmordent"))) (direction . 1) )) ("lineprall" . - ((script-molecule . (feta . ("lineprall" . "lineprall"))) + ((script-stencil . (feta . ("lineprall" . "lineprall"))) (direction . 1) )) ("pralldown" . - ((script-molecule . (feta . ("pralldown" . "pralldown"))) + ((script-stencil . (feta . ("pralldown" . "pralldown"))) (direction . 1) )) ("prallup" . - ((script-molecule . (feta . ("prallup" . "prallup"))) + ((script-stencil . (feta . ("prallup" . "prallup"))) (direction . 1) )) ("segno" . - ((script-molecule . (feta . ("segno" . "segno"))) + ((script-stencil . (feta . ("segno" . "segno"))) (direction . 1) )) ("coda" . - ((script-molecule . (feta . ("coda" . "coda"))) + ((script-stencil . (feta . ("coda" . "coda"))) (direction . 1) )) ("varcoda" . - ((script-molecule . (feta . ("varcoda" . "varcoda"))) + ((script-stencil . (feta . ("varcoda" . "varcoda"))) (direction . 1) ))) default-script-alist) ) diff --git a/scm/stencil.scm b/scm/stencil.scm new file mode 100644 index 0000000000..81869ae7f2 --- /dev/null +++ b/scm/stencil.scm @@ -0,0 +1,84 @@ + +(define-public (stack-stencils axis dir padding mols) + "Stack stencils MOLS in direction AXIS,DIR, using PADDING." + (if (null? mols) + '() + (if (pair? mols) + (ly:stencil-combine-at-edge (car mols) axis dir + (stack-stencils axis dir padding (cdr mols)) + padding + ) + ) + )) + + +(define-public (stack-lines dir padding baseline mols) + "Stack vertically with a baseline-skip." + (if (null? mols) + '() + (if (null? (cdr mols)) + (car mols) + (ly:stencil-combine-at-edge (car mols) Y dir + (stack-lines dir padding baseline (cdr mols)) + padding baseline + ) + ))) + +(define-public (fontify-text font-metric text) + "Set TEXT with font FONT-METRIC, returning a stencil." + (let* ((b (ly:text-dimension font-metric text))) + (ly:make-stencil + (ly:fontify-atom font-metric `(text ,text)) (car b) (cdr b)) + )) + +(define-public (bracketify-stencil mol axis thick protusion padding) + "Add brackets around MOL, producing a new stencil." + + (let* ((ext (ly:stencil-get-extent mol axis)) + (lb (ly:bracket axis ext thick (- protusion))) + (rb (ly:bracket axis ext thick protusion))) + (set! mol (ly:stencil-combine-at-edge mol (other-axis axis) 1 lb padding)) + (set! mol (ly:stencil-combine-at-edge mol (other-axis axis) -1 rb padding)) + mol + )) + +(define-public (make-filled-box-stencil xext yext) + "Make a filled box." + + (ly:make-stencil + (list 'filledbox (- (car xext)) (cdr xext) + (- (car yext)) (cdr yext)) + xext yext) +) + + +(define-public (box-grob-stencil grob) + "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)) + (thick 0.1)) + + (ly:stencil-add (make-filled-box-stencil xext (cons (- (car yext) thick) (car yext) )) + (make-filled-box-stencil xext (cons (cdr yext) (+ (cdr yext) thick) )) + (make-filled-box-stencil (cons (cdr xext) (+ (cdr xext) thick)) yext) + (make-filled-box-stencil (cons (- (car xext) thick) (car xext)) yext)))) + + +;; TODO merge this and prev function. +(define-public (box-stencil mol thick padding) + "Add a box around MOL, producing a new stencil." + (let* ( + (x-ext (interval-widen (ly:stencil-get-extent mol 0) padding)) + (y-ext (interval-widen (ly:stencil-get-extent mol 1) padding)) + (y-rule (make-filled-box-stencil (cons 0 thick) y-ext)) + (x-rule (make-filled-box-stencil (interval-widen x-ext thick) + (cons 0 thick))) + ) + (set! mol (ly:stencil-combine-at-edge mol X 1 y-rule padding)) + (set! mol (ly:stencil-combine-at-edge mol X -1 y-rule padding)) + (set! mol (ly:stencil-combine-at-edge mol Y 1 x-rule 0.0)) + (set! mol (ly:stencil-combine-at-edge mol Y -1 x-rule 0.0)) + + mol)) diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 712f463132..07f0a387b3 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1845,6 +1845,33 @@ Grob::preset_extent removed. """ )) +def conv (str): + str = re.sub (r'\\property\s+([^.]+)\s*\.\s*([^\\=]+)\s*\\(set|override)', + r"\\overrid@ \1.\2 ", str) + str = re.sub (r'\\property\s+([^. ]+)\s*\.\s*([^\\= ]+)\s*=', + r'\\s@t \1.\2 = ', str) + str = re.sub (r'\\property\s+([^. ]+)\s*\.\s*([^\\= ]+)\s*\\unset', + r'\\uns@t \1.\2 ', str) + str = re.sub (r'\\property\s+([^. ]+)\s*\.\s*([^\\= ]+)\s*\\revert' + + r"\s*#'([-a-z0-9_]+)", + r"\\rev@rt \1.\2 #'\3", str) + str = re.sub (r'Voice\.', '', str) + str = re.sub (r'Lyrics\.', '', str) + str = re.sub (r'ChordNames\.', '', str) + + str = re.sub ('rev@rt', 'revert',str) + str = re.sub ('s@t', 'set',str) + str = re.sub ('overrid@', 'override',str) + + str = re.sub ('molecule', 'stencil', str) + str = re.sub ('Molecule', 'Stencil', str) + return str + +conversions.append (((2,1,22), conv, """new syntax for property settings: + \set A.B = #C , \unset A.B + \override A.B #C = #D, \revert A.B #C + +""")) ################################ diff --git a/stepmake/stepmake/tex-rules.make b/stepmake/stepmake/tex-rules.make index 482957c558..e4fa7b301e 100644 --- a/stepmake/stepmake/tex-rules.make +++ b/stepmake/stepmake/tex-rules.make @@ -15,8 +15,8 @@ $(outdir)/%.dvi: $(outdir)/%.latex $(outdir)/%.ps: $(outdir)/%.dvi - cd $(outdir) && dvips -t $(DVIPS_PAPERSIZE) -o $(@F) $(