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
+2004-02-13 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * 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 <hanwen@xs4all.nl>
+
+ * 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 <hjunes@cc.hut.fi>
* Documentation/user/refman.itely: add dots after seealso refs.
* Documentation/user/music-glossary.itely: add Finnish author.
+2004-02-12 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * VERSION (PACKAGE_NAME): release 2.1.21
+
2004-02-12 Jan Nieuwenhuizen <janneke@gnu.org>
* Documentation/topdocs/NEWS.texi: Substitute Lyrics/LyricsVoice.
@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.
+\version "2.1.22"
@node Reference manual details
@appendix Reference manual details
+\version "2.1.22"
@c -*-texinfo-*-
@node Cheat sheet
@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
@tab augmentation dots
@tab
@lilypond[relative=1,notime]
-\property Staff.Clef = \turnOff
+\set Staff.Clef = \turnOff
c4. c4..
@end lilypond
@tab time signature
@tab
@lilypond
-\property Staff.Clef \set #'transparent = ##t
+\override Staff.Clef #'transparent = ##t
\time 3/4
s4_" "
\time 4/4
@tab rest
@tab
@lilypond[relative=1,notime]
-\property Staff.Clef = \turnOff
+\set Staff.Clef = \turnOff
r4 r8
@end lilypond
@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
@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
@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
@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
@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
@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
@tab articulations
@tab
@lilypond[fragment,relative=1]
-\property Staff.TimeSignature = \turnOff
+\set Staff.TimeSignature = \turnOff
c-> c-.
@end lilypond
@tab dynamics
@tab
@lilypond[fragment,relative=1]
-\property Staff.TimeSignature = \turnOff
+\set Staff.TimeSignature = \turnOff
c\mf c\sfz
@end lilypond
@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
@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
+\version "2.1.22"
@c -*-texinfo-*-
@node Converting from other formats
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
+\version "2.1.22"
@quotation
We would like to dedicate this program to all the friends that we
+\version "2.1.22"
@c -*-texinfo-*-
@c Note:
@c
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
@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
@cindex properties, context
@example
-\property @var{contextname}.@var{propname} = @var{value}
+\set @var{contextname}.@var{propname} = @var{value}
@end example
@noindent
@code{\property}-command. Hence the expressions
@example
-\property @var{contextname}.@var{propname} = @var{value}
+\set @var{contextname}.@var{propname} = @var{value}
@end example
@noindent
@example
\context @var{contextname}
-\property Current.@var{propname} = @var{value}
+\set Current.@var{propname} = @var{value}
@end example
@noindent
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
@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.
@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
@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
@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
+\version "2.1.22"
@c -*-texinfo-*-
@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|
@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 }
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
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
}
@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
+\version "2.1.22"
@c -*-texinfo-*-
@ignore
+\version "2.1.22"
\input texinfo @c -*-texinfo-*-
@setfilename lilypond.info
@settitle GNU LilyPond
@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
+\version "2.1.22"
@node Literature list
@chapter Literature list
+\version "2.1.22"
\input texinfo @c -*-texinfo-*-
@settitle Music Glossary
@setfilename music-glosssary.info
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
N: ?.
@lilypond[notime]
-\property Score.automaticBars = ##f
+\set Score.automaticBars = ##f
\notes\relative c'' {
a1 b c d e f g a }
@end lilypond
\key d \major
\time 4/4
-%\property Score.TextScript \set #'font-style = #'large
+%\override Score.TextScript #'font-style = #'large
<d a fis>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 }
\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 "||"
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
@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
in pre-1650 music.
@lilypond[notime]
-\property Score.automaticBars = ##f
+\set Score.automaticBars = ##f
\notes\relative c'' { g\breve }
@end lilypond
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
\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
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'' {
<g b d>1 s s
<g b d f a> 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 "
}
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
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
@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
}
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
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 {
@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 {
@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 {
@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 {
@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
@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 {
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 {
@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 {
@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 {
@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
}
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 <des g,!> s s <cis g!> 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
@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
f1
}
\context Lyrics \lyrics {
- \property Lyrics . LyricText \set #'self-alignment-X = #-1
+ \override Lyrics .LyricText #'self-alignment-X = #-1
"baritone "
"bass "
"sub-bass "
@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
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'' {
<g e c >1 < a f d > < b g e >
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
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 "
\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
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'' {
<g g>1_"unisone " s
<g b>_"third " s
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'' {
<g a>1_"second " s s
<g f'>_"seventh " s s
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
@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
@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
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 "||"
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
(d) @aref{staccato}.
@lilypond[notime]
-\property Score.automaticBars = ##f
+\set Score.automaticBars = ##f
\addlyrics
\context Staff \notes\relative c'' {
c4-( d e-) \bar "||"
c4-. d-. e-. \bar "||"
}
\context Lyrics \lyrics {
-% \property Lyrics . LyricText \set #'font-style = #'large
+% \override Lyrics .LyricText #'font-style = #'large
a
b "" ""
c
@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
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
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
@lilypond
\notes\relative c'' {
a1
- \property Score.skipBars=##t R1*3
+ \set Score.skipBars = ##t R1*3
a1
}
@end lilypond
@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
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 "||"
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 "||"
@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 "||"
@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 "||"
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
@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 "||"
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
@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
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
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" } >>
}
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
(@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
+\version "2.1.22"
@comment @c -*-texinfo-*-
+\version "2.1.22"
@c Note: -*-texinfo-*-
@c This file is part of lilypond.tely
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
@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
@example
#(set-octavation 1)
- \property Staff.ottavation = #"8"
+ \set Staff.ottavation = #"8"
@end example
@seealso
@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
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
@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] }
@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
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}
@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
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
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
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
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
@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
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
input file:
@lilypond[raggedright,fragment,verbatim]
-\property Staff.autoAccidentals = #'( Staff (any-octave . 0) )
+\set Staff.autoAccidentals = #'( Staff (any-octave . 0) )
cis'4 <c'' c'> r2 | cis'4 <c' c''> r2
| <cis' c''> r | <c'' cis'> r |
@end lilypond
@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
@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
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
@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
to note heads:
@lilypond[verbatim,raggedright,fragment,relative=1]
- \property Voice.fingeringOrientations = #'(left down)
+ \set fingeringOrientations = #'(left down)
<c-1 es-2 g-4 bes-5 > 4
- \property Voice.fingeringOrientations = #'(up right down)
+ \set fingeringOrientations = #'(up right down)
<c-1 es-2 g-4 bes-5 > 4
@end lilypond
@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
}
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
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
@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
`@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': |
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 }
>>
@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
@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
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
@lilypond[fragment,relative,verbatim]
\context PianoStaff <<
- \property PianoStaff.connectArpeggios = ##t
+ \set PianoStaff.connectArpeggios = ##t
\new Staff { <c' e g c>\arpeggio }
\new Staff { \clef bass <c,, e g>\arpeggio }
>>
@lilypond[fragment,relative,verbatim]
\context Voice {
- \property Voice.Arpeggio \set #'arpeggio-direction = #1
+ \override Arpeggio #'arpeggio-direction = #1
<c e g c>\arpeggio
- \property Voice.Arpeggio \set #'arpeggio-direction = #-1
+ \override Arpeggio #'arpeggio-direction = #-1
<c e g c>\arpeggio
}
@end lilypond
@code{\arpeggio} statements within the chords as before:
@lilypond[fragment,relative,verbatim]
- \property PianoStaff.Arpeggio \override
+ \override PianoStaff.Arpeggio
#'print-function = \arpeggioBracket
<c' e g c>\arpeggio
@end lilypond
@lilypond[fragment,relative,verbatim]
\context PianoStaff <<
- \property PianoStaff.followVoice = ##t
+ \set PianoStaff.followVoice = ##t
\context Staff \context Voice {
c1
\change Staff=two
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{_}
<< \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. }
>> >>
}
@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
@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 {
@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'
\score {
\notes <<
\context ChordNames {
- \property ChordNames.chordChanges = ##t
+ \set chordChanges = ##t
\scheme }
\context Staff \transpose c c' \scheme
>>
@lilypond[fragment,verbatim]
\context ChordNames \chords {
c:7sus4
- \property ChordNames.chordNameSeparator
- = \markup { \typewriter "|" }
+ \set chordNameSeparator
+ = \markup { \typewriter "|" }
c:7sus4 }
@end lilypond
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
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
@quotation
@lilypond[verbatim,raggedright]
- \property Staff.instrument = "ploink " { c''4 }
+ \set Staff.instrument = "ploink " { c''4 }
@end lilypond
@end quotation
@quotation
@lilypond[fragment,verbatim,raggedright]
\notes {
- \property Staff.instrument = \markup {
+ \set Staff.instrument = \markup {
\column < "Clarinetti"
{ "in B"
\smaller \musicglyph #"accidentals--1"
@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
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
@lilypond[verbatim,raggedright,fragment]
\new Staff <<
- \property Staff.soloADue = ##f
+ \set Staff.soloADue = ##f
\partcombine
{
g a( b) r
\tag #'part <<
R1 \\
@{
- \property Voice.fontSize = #-1
+ \set fontSize = #-1
c4_"cue" f2 g4 @}
>>
\tag #'score R1
@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
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
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
@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
@tab
@lilypond[relative,notime]
-\property Staff.TimeSignature \set #'transparent = ##t
+\override Staff.TimeSignature #'transparent = ##t
\clef "petrucci_c2" c
@end lilypond
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
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
@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
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
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
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
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
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
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
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
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
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
@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''.
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
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
@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
\score {
\notes {
a'1
- \property Staff.Custos \set #'style = #'mensural
+ \override Staff.Custos #'style = #'mensural
\break
g'
}
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
@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
@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
\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
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
@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.
@lilypond[verbatim,fragment,relative=1]
c4
- \once \property Voice.Stem \set #'thickness = #4
+ \once \override Stem #'thickness = #4
c4
c4
@end lilypond
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
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
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
@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,
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
@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
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
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
@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}
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
\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|
+\version "2.1.22"
@c -*-texinfo-*-
@c This file is part of lilypond.tely
@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
@end example
@lilypond[notime]
-\property Score.timing = ##f
+\set Score.timing = ##f
\transpose c c' { a a a2 a s16_" " }
@end lilypond
@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
@end example
@lilypond[notime]
-\property Score.timing = ##f
+\set Score.timing = ##f
\transpose c c' { a2. a4 a8. a16 s16_" " }
@end lilypond
@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
@end example
@lilypond[notime]
-\property Score.timing = ##f
+\set Score.timing = ##f
\clef violin
s4_" "
\clef bass
@end example
@lilypond[notime]
-\property Score.timing = ##f
+\set Score.timing = ##f
\transpose c c' { cis1 ees fisis aeses s16_" " }
@end lilypond
@end example
@lilypond[fragment]
-\property Staff.TimeSignature = \turnOff
+\set Staff.TimeSignature = \turnOff
\key d \major
g'1
\key c \minor
For example, in this example:
@lilypond[fragment]
-\property Staff.TimeSignature = \turnOff
+\set Staff.TimeSignature = \turnOff
\key d \major
d' cis' fis'
@end lilypond
of A-flat, it gets an accidental:
@lilypond[fragment]
-\property Staff.TimeSignature =\turnOff
+\set Staff.TimeSignature = \turnOff
\key as \major
d'
@end lilypond
@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
@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
}
@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,
}
@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'
@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
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
@c
@lilypond[relative=1,fragment,verbatim]
c8 c c c
- \property Staff.autoBeaming = ##f
+ \set Staff.autoBeaming = ##f
c8 c c c
@end lilypond
@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
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
@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
@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
@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
@lilypond[fragment,relative=1,verbatim]
c4 << {
- \once \property Voice.Stem \set #'transparent = ##t
+ \once \override Stem #'transparent = ##t
b8~ b8
} \\ {
b[ g8]
@lilypond[relative=1,verbatim]
c2\fermata
- \property Voice.Script \set #'padding = #3
+ \override Script #'padding = #3
b2\fermata
@end lilypond
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
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=1
-PATCH_LEVEL=21
+PATCH_LEVEL=22
MY_PATCH_LEVEL=
-\version "2.1.7"
+\version "2.1.22"
% A simple scale in LilyPond
%
-\version "2.1.7"
+\version "2.1.22"
% Some beamed and slurred notes of different taste in LilyPond
%
% Type:
#(ly:set-option 'old-relative)
-\version "2.1.7"
+\version "2.1.22"
one = \notes\relative c{
c'' d e f
#(ly:set-option 'old-relative)
-\version "2.1.7"
+\version "2.1.22"
\header {
composer = "ARTHUR GRAY"
\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." }
<fis fis,>8 <e! e,!>
\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)
% the small grace in lower staff comes after us
s32
- \property Voice.Stem \revert #'stroke-style
+ \revert Stem #'stroke-style
}
r8 <a' a,>8(\mf <gis gis,> <fis fis,>
% \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
<gis gis,> <fis fis,> e)-1-4-5 r
| %6
\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
\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
<cis cis,>4
\change Staff=treble
\stemDown
- \property Voice.Slur \override #'attachment = #'(stem . stem) %tweak
+ \override Slur #'attachment = #'(stem . stem) %tweak
<a'' eis cis>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( <fis fis,>8 <gis gis,>
| %3
- \property Voice.Stem \set #'length = #5 %tweak
+ \override Stem #'length = #5 %tweak
<a a,>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
<a' fis cis>)\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
<b,, b,>4
\clef treble
>>
\grace {
- \property Voice.Stem \override #'stroke-style = #"grace"
+ \override Stem #'stroke-style = #"grace"
s8
s16 s s
\clef bass
<e,,, e,>32(
- \property Voice.Stem \revert #'stroke-style
+ \revert Stem #'stroke-style
}
<gis' e>2)
\slurUp
% \fingerDown
- \property Voice.Fingering \set #'direction = #-1
+ \override Fingering #'direction = #-1
%%a,8 e'[-5(<a-2 cis-3>])
a,8 e'[-5(<a cis>])-2-3
%%r b,-5 <e-3 gis-5 d'>4
r b,-5 <e gis d'>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'[(<a cis>)] r b, <e gis d'>4
}
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\!
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
%
% 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
}
-\version "2.1.7"
+\version "2.1.22"
\header {
title = "Title"
subtitle = "Subtitle"
-\version "2.1.21"
+\version "2.1.22"
\header {
title = "Puer natus est nobis (excerptum)"
subtitle = "Antiphona ad introitum VII"
-\version "2.1.7"
+\version "2.1.22"
\header {
title = "Screech and boink"
subtitle = "Random complex notation"
<< {
- \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
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 } \\
\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 <as b>
<g cis>
} \\
{
- \property Staff.Arpeggio \set #'arpeggio-direction =#-1
+ \override Staff.Arpeggio #'arpeggio-direction =#-1
<cis, e, gis, b, cis>4\arpeggio }
>>
}
#(ly:set-option 'old-relative)
-\version "2.1.21"
+\version "2.1.22"
\header{
filename = "twinkle-pop.ly"
xtitle = "Ah, vous dirais-je, maman "
}
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
*/
#include "font-interface.hh"
#include "item.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "accidental-interface.hh"
#include "paper-def.hh"
#include "pitch.hh"
*/
-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;
}
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 ())
{
#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)
}
/*
- 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);
Why don't we return empty?
*/
- Molecule m;
+ Stencil m;
m.set_empty (false);
return m;
}
// at= fontify_atom ((Font_metric*)this, at);
Box b = afm_bbox_to_box (cm->charBBox);
- return Molecule (b, at);
+ return Stencil (b, at);
}
#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"
}
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 ())));
}
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")));
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;
}
// 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);
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
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");
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",
(c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "molecule.hh"
+#include "stencil.hh"
#include "paper-def.hh"
#include "arpeggio.hh"
#include "grob.hh"
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));
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();
}
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);
}
/*
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);
}
#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"
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");
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;
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);
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;
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 ();
}
#include "grob.hh"
#include "bar-line.hh"
#include "string.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "paper-def.hh"
#include "font-interface.hh"
}
-Molecule
+Stencil
Bar_line::compound_barline (Grob*me, String str, Real h)
{
Real kern = robust_scm2double (me->get_grob_property ("kern"), 1);
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 == "")
{
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"));
#include <math.h> // tanh.
-#include "molecule.hh"
+#include "stencil.hh"
#include "directional-element-interface.hh"
#include "beaming.hh"
#include "beam.hh"
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++)
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")))
int k = 0;
for (int j = full_beams.size (); j--;)
{
- Molecule b (whole);
+ Stencil b (whole);
if (k++ < gap_count)
{
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);
}
Real w = (i>0 && st) ? (xposn - last_xposn) : break_overshoot;
w = w/2 <? nw_f;
- Molecule half = Lookup::beam (dydx, w, thick, blot);
+ Stencil half = Lookup::beam (dydx, w, thick, blot);
for (int j = lfliebertjes.size(); j--;)
{
- Molecule b (half);
+ Stencil b (half);
b.translate_axis (last_xposn - x0, X_AXIS);
b.translate_axis (dydx * (last_xposn-x0) + bdy * lfliebertjes[j], Y_AXIS);
- the_beam.add_molecule (b);
+ the_beam.add_stencil (b);
}
for (int j = rfliebertjes.size(); j--;)
{
- Molecule b (half);
+ Stencil b (half);
b.translate_axis (xposn - x0 - w , X_AXIS);
b.translate_axis (dydx * (xposn-x0 -w) + bdy * rfliebertjes[j], Y_AXIS);
- the_beam.add_molecule (b);
+ the_beam.add_stencil (b);
}
}
String str;
SCM properties = Font_interface::font_alist_chain (me);
- Molecule tm = *unsmob_molecule (Text_item::interpret_markup
+ Stencil tm = *unsmob_stencil (Text_item::interpret_markup
(me->get_paper ()->self_scm (), properties, quant_score));
the_beam.add_at_edge (Y_AXIS, UP, tm, 5.0, 0);
}
#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"
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 ();
}
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 ();
}
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 ();
}
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 ();
}
*/
#include "chord-name.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "paper-def.hh"
#include "font-interface.hh"
#include "grob.hh"
#include "clef.hh"
#include "string.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "item.hh"
#include "font-interface.hh"
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 ()));
TODO: Add support for cubic spline segments.
*/
-Molecule
+Stencil
brew_cluster_piece (Grob *me, Array<Offset> bottom_points, Array<Offset> top_points)
{
Real blotdiameter = Staff_symbol_referencer::staff_space (me)/2;
{
programming_error ("#'style should be symbol.");
me->suicide();
- return Molecule();
+ return Stencil();
}
- Molecule out = Molecule ();
+ Stencil out = Stencil ();
Array<Offset> points;
points.clear ();
int size = bottom_points.size ();
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)
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)
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];
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)
{
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
{
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 ();
}
--- /dev/null
+/*
+ translator-def.cc -- implement Context_def
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ */
+
+#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_def ", port);
+ scm_display (me->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>
+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<Context_def> 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<Context_def> 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<Context_def> 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<Translator_group*> (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;
+}
{
Translator * t = unsmob_translator (ly_car (p));
- r = dynamic_cast<Translator_group*> (t)->find_existing_translator (n, id); }
+ r = dynamic_cast<Translator_group*> (t)->find_existing_translator (n, id);
+ }
return r;
}
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_.
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)
{
#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"
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;
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 ();
}
}
#include "dots.hh"
#include "item.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "paper-def.hh"
#include "font-interface.hh"
#include "lookup.hh"
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 ();
#include "virtual-methods.hh"
#include "warn.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "ly-smobs.icc"
#include "font-metric.hh"
#include "string.hh"
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. ")
{
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.
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,
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);
}
#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"
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;
}
}
-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);
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");
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");
// 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;
}
"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"
"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 "
*/
#include "staff-symbol-referencer.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "line-interface.hh"
#include "hairpin.hh"
#include "spanner.hh"
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)));
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);
Array<int> ascii_to_metric_idx_;
std::map<String,int> name_to_metric_dict_;
- virtual Molecule find_by_name (String) const;
+ virtual Stencil find_by_name (String) const;
Adobe_font_metric (AFM_Font_info*);
};
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 ));
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 ));
#define CHORD_NAME_HH
#include "lily-guile.hh"
-#include "molecule.hh"
+#include "stencil.hh"
class Chord_name
#define CLUSTER_HH
#include "lily-guile.hh"
-#include "molecule.hh"
+#include "stencil.hh"
class Cluster
{
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) ;
};
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:
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);
Grob *last_bound_;
- void override_molecule_callback ();
- void revert_molecule_callback ();
+ void override_stencil_callback ();
+ void revert_stencil_callback ();
};
#endif // LIGATURE_ENGRAVER_HH
class Midi_text;
class Midi_time_signature;
class Midi_track;
-class Molecule;
+class Stencil;
class Moment;
class Music;
class Music_iterator;
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 */
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:
#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<Offset> 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<Offset> 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
+++ /dev/null
-/*
- molecule.hh -- declare Molecule
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-#ifndef MOLECULE_HH
-#define MOLECULE_HH
-
-#include <stdlib.h> // 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
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 */
#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.
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);
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 */
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 ));
};
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;
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 ));
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 */
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 *);
--- /dev/null
+/*
+ stencil.hh -- declare Stencil
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+#ifndef STENCIL_HH
+#define STENCIL_HH
+
+#include <stdlib.h> // 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
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 */
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:
#include "lily-proto.hh"
#include "lily-guile.hh"
-#include "molecule.hh"
+#include "stencil.hh"
class Text_item
{
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
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;
public:
Music_output_def * output_def_;
- bool is_alias (SCM) const;
Translator (Translator const &);
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<Real> height,
Real gap, Drul_array<Real> widen,
Drul_array<Real> shorten);
#define VATICANA_LIGATURE_HH
#include "lily-guile.hh"
-#include "molecule.hh"
+#include "stencil.hh"
struct Vaticana_ligature
{
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;
#include "item.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "paper-def.hh"
#include "font-interface.hh"
#include "staff-symbol-referencer.hh"
}
SCM newas = me->get_grob_property ("new-accidentals");
- Molecule mol;
+ Stencil mol;
SCM c0s = me->get_grob_property ("c0-position");
int c0p = 0;
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 ())
{
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"));
int alteration = 0;
int pos = alteration_pos (what, alteration, c0p);
- Molecule m = natural;
+ Stencil m = natural;
m.translate_axis (pos* inter, Y_AXIS);
/*
* 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");
* nests \[ and \].
*/
void
-Ligature_engraver::revert_molecule_callback ()
+Ligature_engraver::revert_stencil_callback ()
{
SCM symbol = ly_symbol2scm ("NoteHead");
SCM key = ly_symbol2scm ("print-function");
finished_ligature_ = ligature_;
primitives_.clear ();
ligature_ = 0;
- revert_molecule_callback ();
+ revert_stencil_callback ();
}
last_bound_ = unsmob_grob (get_property ("currentMusicalColumn"));
ligature_start_mom_ = now_mom ();
announce_grob(ligature_, reqs_drul_[START]->self_scm());
- override_molecule_callback ();
+ override_stencil_callback ();
}
}
*/
#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)
{
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"),
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)
* 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);
}
#include <math.h>
-#include "molecule.hh"
+#include "stencil.hh"
#include "item.hh"
#include "spanner.hh"
#include "line-spanner.hh"
#include "lookup.hh"
#include "line-interface.hh"
-Molecule
-zigzag_molecule (Grob *me,
+Stencil
+zigzag_stencil (Grob *me,
Offset from,
Offset to)
{
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);
}
-Molecule
-Line_spanner::line_molecule (Grob *me,
+Stencil
+Line_spanner::line_stencil (Grob *me,
Offset from,
Offset to)
{
|| (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)
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);
mol.translate (from);
return mol;
}
- return Molecule();
+ return Stencil();
}
/*
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.
*/
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),
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);
#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"),
Box box;
box.add_point (p - Offset (radius, radius));
box.add_point (p + Offset (radius, radius));
- return Molecule (box, at);
+ return Stencil (box, at);
}
* <----->
* width
*/
-Molecule
+Stencil
Lookup::beam (Real slope, Real width, Real thick, Real blot)
{
Real height = slope * width;
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;
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"),
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"),
gh_double2scm (b[Y_AXIS][UP]),
SCM_UNDEFINED));
- return Molecule (b,at);
+ return Stencil (b,at);
}
/*
* |<-------------------------->|
* Box extent(X_AXIS)
*/
-Molecule
+Stencil
Lookup::round_filled_box (Box b, Real blotdiameter)
{
if (b.x ().length () < 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:
*
* postscript routine in the backend effectively does, but on the
* shrinked polygon). --jr
*/
-Molecule
+Stencil
Lookup::round_filled_polygon (Array<Offset> points, Real blotdiameter)
{
/* TODO: Maybe print a warning if one of the above limitations
/* 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)
gh_double2scm (blotdiameter),
SCM_UNDEFINED);
- Molecule polygon = Molecule (box, polygon_scm);
+ Stencil polygon = Stencil (box, polygon_scm);
shrinked_points.clear ();
return polygon;
}
/*
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))
{
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);
}
/*
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 ();
b[X_AXIS].unite (back.extent (X_AXIS));
b[Y_AXIS].unite (back.extent (Y_AXIS));
- return Molecule (b, at);
+ return Stencil (b, at);
}
/*
* |
*
*/
-Molecule
+Stencil
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;
}
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);
}
}
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);
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;
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 ;
gh_double2scm (iv.length()),
gh_double2scm (protude), SCM_UNDEFINED);
- return Molecule (b, s);
+ return Stencil (b, s);
}
#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"
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 ();
#include "box.hh"
#include "lookup.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "paper-def.hh"
#include "paper-column.hh"
#include "spanner.hh"
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);
Interval iv (0,w);
- Molecule m;
+ Stencil m;
/*
TODO: use line interface
#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"
*
* TODO: move this function to class Lookup?
*/
-Molecule
+Stencil
brew_flexa (Grob *me,
Real interval,
bool solid,
{
Real staff_space = Staff_symbol_referencer::staff_space (me);
Real height = 0.6 * staff_space;
- Molecule molecule = Molecule ();
+ Stencil stencil = Stencil ();
if (add_cauda)
{
-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;
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;
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");
{
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;
switch (primitive)
{
case MLP_NONE:
- return Molecule();
+ return Stencil();
case MLP_BB:
out = brew_flexa (me, delta_pitch, false,
flexa_width, thickness, true, DOWN);
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");
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));
+++ /dev/null
-/*
- molecule-scheme.cc -- implement Molecule
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#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;
-}
+++ /dev/null
-/*
- molecule.cc -- implement Molecule
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-*/
-
-#include <math.h>
-#include <libc-extension.hh> // 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 ("#<Molecule ", port);
- 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);
-
#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"
Grob *me = unsmob_grob (smob);
Spanner *sp = dynamic_cast<Spanner*> (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.
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"));
-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"));
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;
}
{
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);
}
else
{
- Molecule s = musfont->find_by_name (Rest::glyph_name (me, 0, ""));
+ Stencil s = musfont->find_by_name (Rest::glyph_name (me, 0, ""));
/*
ugh.
/*
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);
Real blot = width ? (.8 * (y <? ythick)) : 0.0;
- Molecule m = Lookup::round_filled_box (b, blot);
- Molecule yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5)* ythick, Interval (-ss, ss)), blot);
+ Stencil m = Lookup::round_filled_box (b, blot);
+ Stencil yb = Lookup::round_filled_box (Box (Interval (-0.5, 0.5)* ythick, Interval (-ss, ss)), blot);
m.add_at_edge (X_AXIS, RIGHT, yb, 0, 0);
m.add_at_edge (X_AXIS, LEFT, yb, 0, 0);
/*
Kirchenpause (?)
*/
-Molecule
+Stencil
Multi_measure_rest::church_rest (Grob*me, Font_metric *musfont, int measures,
Real space)
{
k = -1;
}
- Molecule r (musfont->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);
}
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);
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);
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++)
{
{"paper", PAPER},
{"partcombine", PARTCOMBINE},
{"partial", PARTIAL},
- {"property", PROPERTY},
{"relative", RELATIVE},
{"remove", REMOVE},
{"repeat", REPEAT},
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 ();
#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"
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,
int line_count = (abs (pos) < interspaces)
? 0
: (abs (pos) - interspaces) / 2;
- Molecule molecule = Molecule();
+ Stencil stencil = Stencil();
if (line_count)
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)
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));
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 ()));
*/
}
- 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));
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) ;
}
/*
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.
*/
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);
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;
{
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 ();
*/
-#include "molecule.hh"
+#include "stencil.hh"
#include "text-item.hh"
#include "text-spanner.hh"
#include "line-spanner.hh"
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<Real> shorten = robust_scm2interval (me->get_grob_property ("shorten-pair"),
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),
*/
- 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);
#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"
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 ();
}
#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"
%token PAPER
%token PARTCOMBINE
%token PARTIAL
-%token PROPERTY
%token RELATIVE
%token REMOVE
%token REPEAT
%type <scm> embedded_scm scalar
%type <music> Music Sequential_music Simultaneous_music
%type <music> relative_music re_rhythmed_music
-%type <music> music_property_def context_change
-%type <scm> Music_list
+%type <music> music_property_def context_change
+%type <scm> context_prop_spec
+%type <scm> Music_list
%type <scm> property_operation context_mod translator_mod optional_context_mod
%type <outputdef> music_output_def_body music_output_def_head
%type <music> post_event tagged_post_event
}
;
-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); }
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))
#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);
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;
}
/*
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);
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 ();
}
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 ();
}
*/
-#include "molecule.hh"
+#include "stencil.hh"
#include "spanner.hh"
#include "item.hh"
#include "tuplet-bracket.hh"
}
- Molecule m ;
+ Stencil m ;
if (!span_points.is_empty () &&
span_points.length () > 0.001)
{
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 ___/
*/
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 \___
*/
/* 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)
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "molecule.hh"
+#include "stencil.hh"
#include "paper-def.hh"
#include "font-interface.hh"
#include "rest.hh"
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);
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 ()));
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));
}
#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)
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 ;
}
*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);
#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);
else
assert (false);
- return Molecule ();
+ return Stencil ();
}
MAKE_SCHEME_CALLBACK (Script_interface,before_line_breaking,1);
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 ();
}
ADD_INTERFACE (Script_interface, "script-interface",
"",
- "script-priority script-molecule");
+ "script-priority script-stencil");
#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"
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);
}
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));
#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"
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))
}
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;
/*
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));
}
#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"
#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"
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 ();
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);
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;
programming_error ("No tremolo flags?");
me->suicide();
- return Molecule ();
+ return Stencil ();
}
/*
*/
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;
}
? 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);
#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"
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)
{
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);
}
-Molecule
+Stencil
Stem::flag (Grob*me)
{
/* TODO: maybe property stroke-style should take different values,
if (flag_style == "no-flag")
{
- return Molecule ();
+ return Stencil ();
}
bool adjust = to_boolean (me->get_grob_property ("adjust-if-on-staffline"));
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));
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);
}
}
}
Stem::print (SCM smob)
{
Grob*me = unsmob_grob (smob);
- Molecule mol;
+ Stencil mol;
Direction d = get_direction (me);
/*
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 ();
--- /dev/null
+/*
+ stencil-scheme.cc -- implement Stencil
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#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;
+}
--- /dev/null
+/*
+ stencil.cc -- implement Stencil
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#include <math.h>
+#include <libc-extension.hh> // 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 ("#<Stencil ", port);
+ 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);
+
*/
#include "grob.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "font-interface.hh"
#include "string.hh"
{
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 ();
}
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);
}
#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")) ;
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")) ;
return SCM_EOL;
}
- Molecule m;
+ Stencil m;
if (gsym== ly_symbol2scm ("bracket"))
m = staff_bracket (me,l);
return m.smobbed_copy ();
}
-Molecule
+Stencil
System_start_delimiter::staff_brace (Grob*me, Real y)
{
Font_metric *fm = 0;
}
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());
}
#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"
}
void
-System::output_molecule (SCM expr, Offset o)
+System::output_stencil (SCM expr, Offset o)
{
while (1)
{
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
}
/*
- generate all molecules to trigger all font loads.
+ generate all stencils to trigger all font loads.
(ugh. This is not very memory efficient.) */
/*
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 ();
}
/*
/* 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++)
s = ly_cdr (s))
{
Grob *sc = unsmob_grob (ly_car (s));
- Molecule *m = sc->get_molecule ();
+ Stencil *m = sc->get_stencil ();
if (!m)
continue;
o += z;
}
- output_molecule (m->get_expr (), o);
+ output_stencil (m->get_expr (), o);
}
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))
{
Revised over good by Han-Wen.
*/
-#include "molecule.hh"
+#include "stencil.hh"
#include "text-item.hh"
#include "text-spanner.hh"
#include "line-spanner.hh"
SCM properties = Font_interface::font_alist_chain (me);
SCM edge_text = me->get_grob_property ("edge-text");
- Drul_array<Molecule> edge;
+ Drul_array<Stencil> edge;
if (gh_pair_p (edge_text))
{
Direction d = LEFT;
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);
Drul_array<Real> edge_height = robust_scm2interval (me->get_grob_property ("edge-height"),
Interval (0.0, 0.0));
- Drul_array<Molecule> edge_line;
+ Drul_array<Stencil> edge_line;
{
Direction d = LEFT;
int dir = to_dir (me->get_grob_property ("direction"));
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];
}
}
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 ();
#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"
}
if (!gh_pair_p (cp))
- return Molecule ().smobbed_copy ();
+ return Stencil ().smobbed_copy ();
Real thick
= Staff_symbol_referencer::line_thickness (me)
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 ();
}
*/
-#include "molecule.hh"
+#include "stencil.hh"
#include "text-item.hh"
#include "time-signature.hh"
#include "paper-def.hh"
d = gh_scm2int (ly_cdr (frac));
}
- Molecule m;
+ Stencil m;
if (gh_symbol_p (st))
{
String style (ly_scm2string (scm_symbol_to_string (st)));
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));
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;
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);
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);
+++ /dev/null
-/*
- translator-def.cc -- implement Context_def
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#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_def ", port);
- scm_display (me->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>
-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<Context_def> 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<Context_def> 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<Context_def> 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<Translator_group*> (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;
-}
smobify_self ();
}
-bool
-Translator::is_alias (SCM sym) const
-{
- return unsmob_context_def (definition_)->is_alias (sym);
-}
bool
Translator::try_music (Music *)
#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"
Tuplet_bracket::print (SCM smob)
{
Grob *me= unsmob_grob (smob);
- Molecule mol;
+ Stencil mol;
Link_array<Grob> columns=
Pointer_group_interface__extract_grobs (me, (Grob*)0, "note-columns");
{
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);
}
}
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);
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,
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);
#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"
#include "bezier.hh"
#include "warn.hh"
-Molecule
+Stencil
vaticana_brew_cauda (Grob *me,
int pos,
int delta_pitch,
/*
* 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;
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
*/
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)
{
{
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) ?
}
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;
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");
{
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);
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);
#include "warn.hh"
#include "virtual-font-metric.hh"
#include "all-font-metrics.hh"
-#include "molecule.hh"
+#include "stencil.hh"
#include "paper-def.hh"
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);
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();
}
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))
{
}
-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))
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 ();
#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"
Real w = dynamic_cast<Spanner*> (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);
-\version "1.9.8"
+\version "2.1.22"
% a3-init.ly
hsize = 296.9 \mm
-\version "1.9.8"
+\version "2.1.22"
% a4.ly
hsize = 210.0 \mm
-\version "1.9.8"
+\version "2.1.22"
% Symbols needed to print accordion music
%
% 2' = T
% Toplevel initialisation file.
-\version "2.1.13"
+\version "2.1.22"
\include "declarations-init.ly"
pitchnames = \pitchnamesCatalan
-\version "2.1.19"
+\version "2.1.22"
% Toplevel initialisation file.
-\version "2.1.13"
+\version "2.1.22"
\include "declarations-init.ly"
-\version "2.1.19"
+\version "2.1.22"
chordmodifiers = #default-chord-modifier-list
#(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)
\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"
pitchnames = \pitchnamesDeutsch
-\version "2.1.19"
+\version "2.1.22"
-\version "1.9.8"
+\version "2.1.22"
%
% declare the standard dynamic identifiers.
pitchnames = \pitchnamesEnglish
-\version "2.1.19"
+\version "2.1.22"
-\version "2.1.21"
+\version "2.1.22"
%
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 = #'()
}
pitchnames = \pitchnamesEspanol
-\version "2.1.19"
+\version "2.1.22"
-\version "1.9.8"
+\version "2.1.22"
%
% Running LilyPond on this file generates the documentation
-\version "1.9.8"
+\version "2.1.22"
%
% Running LilyPond on this file generates the short interface doc
-\version "1.9.8"
+\version "2.1.22"
startGraceMusic = \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)
}
-\version "2.1.21"
+\version "2.1.22"
%%%%%%%%
%%%%%%%% shortcuts common for all styles of gregorian chant notation
% 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
}
#(define-public midi-debug #f)
-\version "1.9.8"
+\version "2.1.22"
\include "declarations-init.ly"
pitchnames = \pitchnamesItaliano
-\version "2.1.19"
+\version "2.1.22"
-\version "1.9.8"
+\version "2.1.22"
% legal-init.ly
hsize = 8.5 \in
-\version "1.9.8"
+\version "2.1.22"
% letter-init.ly
hsize = 8.5 \in
-\version "1.9.8"
+\version "2.1.22"
\midi {
\tempo 4=60
\include "performer-init.ly"
-\version "2.1.19"
+\version "2.1.22"
%{
common dutch names for notes. es means flat, is means sharp
%}
pitchnames =\pitchnamesNorsk
-\version "2.1.19"
+\version "2.1.22"
-\version "2.1.1"
+\version "2.1.22"
-\version "1.9.8"
+\version "2.1.22"
% JUNKME
%part-paper-init.ly
-\version "2.1.21"
+\version "2.1.22"
%
% setup for Request->Element conversion. Guru-only
% 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
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 = #'()
}
% 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)
)
% 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)
)
% 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
% 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.
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
}
-\version "1.9.8"
+\version "2.1.22"
major = #`(
-\version "1.9.8"
+\version "2.1.22"
dashHat= "marcato"
-\version "1.9.8"
+\version "2.1.22"
startGroup = #(make-span-event 'NoteGroupingEvent START)
stopGroup = #(make-span-event 'NoteGroupingEvent 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
}
%{
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."
pitchnames = \pitchnamesSuomi
-\version "2.1.19"
+\version "2.1.22"
)
pitchnames = \pitchnamesSvenska
-\version "2.1.19"
+\version "2.1.22"
-\version "1.9.8"
+\version "2.1.22"
% tabloid-init.ly
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 $@
EXTRA_DIST_FILES += $(TELY_FILES) $(LY_FILES) $(ITEXI_FILES) $(ITELY_FILES) $(LYINC_FILES)
+DVIPS_FLAGS= -u +lilypond.map -Ppdf
$(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
"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.")
(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).")
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? "")
"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)))
(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?)
(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?)
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?)
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.
(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)
(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)))
(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)))
"
- (ly:molecule-translate-axis
+ (ly:stencil-translate-axis
(interpret-markup
paper
(cons `((font-size . ,(- (chain-assoc-get 'font-size props 0) 3))) props)
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)
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))
"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?)
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
(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) ()
"
(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))
`(
("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))
"chord-ignatzek-names.scm"
"chord-entry.scm"
"chord-generic-names.scm"
- "molecule.scm"
+ "stencil.scm"
"new-markup.scm"
"bass-figure.scm"
"music-functions.scm"
+++ /dev/null
-
-(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))
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).
(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)))
-(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))
'()))
(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.
(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)
) ) )
; 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)
(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)
)
--- /dev/null
+
+(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))
""" ))
+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
+
+"""))
################################
$(outdir)/%.ps: $(outdir)/%.dvi
- cd $(outdir) && dvips -t $(DVIPS_PAPERSIZE) -o $(@F) $(<F)
+ cd $(outdir) && dvips $(DVIPS_FLAGS) -t $(DVIPS_PAPERSIZE) -o $(@F) $(<F)
$(outdir)-$(PAPERSIZE)/%.ps: $(outdir)-$(PAPERSIZE)/%.dvi
- cd $(outdir)-$(PAPERSIZE) && dvips -t$(PAPERSIZE) -o $(@F) $(<F)
+ cd $(outdir)-$(PAPERSIZE) && dvips $(DVIPS_FLAGS) -t$(PAPERSIZE) -o $(@F) $(<F)