gis a
\override NoteHead #'color = #(x11-color "LimeGreen")
gis a
-
% this is deliberate nonsense; note that the stems remain black
\override Stem #'color = #(x11-color 'Boggle)
b2 cis
@cindex parentheses
Objects may be parenthesized by prefixing @code{\parenthesize} to
-the music event,
+the music event. This only functions inside chords; to
+parenthesize a single note it must be enclosed with @code{<>} as
+if it is a chord.
@lilypond[relative=2,fragment,verbatim,ragged-right]
-<
- c
- \parenthesize d
- g
->2-\parenthesize -.
-d g
-<
- c,
- \parenthesize fis
->
+c2 < \parenthesize d>
+<\parenthesize e> d
@end lilypond
-This only functions inside chords, to parenthesize a single note it
-must be enclosed with @code{<>} as if it is a chord.
-
-@example
-< \parenthesize NOTE>
-@end example
+Non-note objects may be parenthesized as well.
@lilypond[relative=2,fragment,verbatim,ragged-right]
-c4
-<\parenthesize d>
-g
-<\parenthesize d>
+< c \parenthesize d g >2-\parenthesize -. d
+g < c, \parenthesize fis >
@end lilypond
@seealso
\layout {
\context {
\Staff
- \consists "Grid_point_engraver" %% sets of grid
+ \consists "Grid_point_engraver"
+ % sets up grids
gridInterval = #(ly:make-moment 1 4)
+ % this sets the grid interval to 1 quarternote (crotchet)
}
}
\new Score \with {
\consists "Grid_line_span_engraver"
- %% centers grid lines horizontally below note heads
+ %% centers grid lines horizontally below note heads by default
+ %the grid lines are aligned with the left side of the notehead
\override NoteColumn #'X-offset = #-0.5
+ % this moves them to the right half a staff space
}
\new ChoirStaff <<
}
}
\new Staff {
- %% centers grid lines vertically
\override Score.GridLine #'extra-offset = #'( 0.0 . 1.0 )
+ % by default the grid lines join the middle line of each staff,
+ % this moves them up one staff space
\stemDown
\clef bass
\relative c {
FIXME: don't complain about anything in this chapter. It's still
under heavy development.
+FIXME: add comments
+@verbatim
+% %{
+@end verbatim
+to 3.1.
+
@menu
* Input files::
* Common syntax issues TODO name?::
@ifnottex
@node Top
@top GNU LilyPond --- learning manual
-@c HJJ: Info needs `@top', which is a synonym for `@unnumbered' in TeX.
This is the learning manual for GNU LilyPond version @version{}.
@node Note heads
@subsection Note heads
+This section suggests ways of altering note heads.
+
@menu
* Special note heads::
* Easy notation note heads::
@cindex triplets
@funindex \times
-Tuplets are made out of a music expression by multiplying all
+Tuplets are made from a music expression by multiplying all the
durations with a fraction:
@example
The duration of @var{musicexpr} will be multiplied by the
fraction. The fraction's denominator will be printed over or
under the notes, optionally with a bracket. The most common
-tuplet is the triplet in which 3 notes have the length of 2, so
+tuplet is the triplet in which 3 notes have the duration of 2, so
the notes are 2/3 of their written length.
@lilypond[quote,ragged-right,fragment,verbatim,relative=2]
Tuplets may be nested:
-@lilypond[fragment,ragged-right,verbatim,relative=2]
-\relative c'' {
- \autoBeamOff
- c4 \times 4/5 { f8 e f \times 2/3 {e[ f g] } } f4 |
-}
+@lilypond[quote,fragment,ragged-right,verbatim,relative=2]
+\autoBeamOff
+c4 \times 4/5 { f8 e f \times 2/3 {e[ f g] } } f4 |
@end lilypond
Modifying nested tuplets which begin at the same musical moment
@lilypondfile [verbatim,lilyquote,ragged-right,texidoc]
{entering-several-tuplets-using-only-one--times-command.ly}
-@ignore
-@c TODO Remove when snippet works ok
-@c Sent to Snippet 5 Feb 08
-The property @code{tupletSpannerDuration} specifies how long each
-bracket should last. With this, you can make lots of tuplets
-while typing @code{\times} only once, thus saving lots of typing.
-In the next example, there are two triplets shown, while
-@code{\times} was only used once.
-
-@lilypond[quote,fragment,relative=2,ragged-right,verbatim]
-\set tupletSpannerDuration = #(ly:make-moment 1 4)
-\times 2/3 { c8 c c c c c }
-@end lilypond
-@end ignore
-
@noindent
For more information about @code{make-moment}, see
@ref{Time administration}.
@code{\compressMusic} works similarly to \times, but does not
create a tuplet bracket. One application is in polymetric
-notation, as shown in the following example. See
-@ref{Polymetric notation}.
+notation, see @ref{Polymetric notation}.
@lilypondfile [verbatim,lilyquote,ragged-right,texidoc]
{printing-music-with-different-time-signatures.ly}
+
at first, so we can be sure the command is working. We get:
@example
- \override Slur #'thickness = #5.0
+\override Slur #'thickness = #5.0
@end example
Don't forget the @code{#'} preceding the
in italics should be
@example
- \override LyricText #'font-shape = #'italic
+\override LyricText #'font-shape = #'italic
@end example
@noindent
the interpreter cannot recognise them. So the command should be:
@example
- \override Lyrics . LyricText #'font-shape = #'italic
+\override Lyrics . LyricText #'font-shape = #'italic
@end example
@warning{In lyrics always leave whitespace between the final
by placing the overrides in a Score @code{\with} block, rather than
in-line in music, as follows:
-@verbatim
-\new Score \with {
+@example
+\new Score \with @{
% Makes sure text scripts and lyrics are within the paper margins
\override PaperColumn #'keep-inside-line = ##t
\override NonMusicalPaperColumn #'keep-inside-line = ##t
-} {
+@} @{
..
-}
-@end verbatim
+@}
+@end example
@node Advanced tweaks with Scheme
@subsection Advanced tweaks with Scheme
#(define (color-notehead grob)
"Color the notehead according to its position on the staff."
(let ((mod-position (modulo (ly:grob-property grob 'staff-position) 7)))
- (case mod-position ; Set rainbow colors
- ((1) (ly:grob-set-property! grob 'color (x11-color 'red)))
- ((2) (ly:grob-set-property! grob 'color (x11-color 'orange)))
- ((3) (ly:grob-set-property! grob 'color (x11-color 'yellow)))
- ((4) (ly:grob-set-property! grob 'color (x11-color 'green)))
- ((5) (ly:grob-set-property! grob 'color (x11-color 'blue)))
- ((6) (ly:grob-set-property! grob 'color (x11-color 'purple)))
- ((0) (ly:grob-set-property! grob 'color (x11-color 'violet)))
- )
+ (case mod-position
+ ;; Return rainbow colors
+ ((1) (x11-color 'red )) ; for C
+ ((2) (x11-color 'orange )) ; for D
+ ((3) (x11-color 'yellow )) ; for E
+ ((4) (x11-color 'green )) ; for F
+ ((5) (x11-color 'blue )) ; for G
+ ((6) (x11-color 'purple )) ; for A
+ ((0) (x11-color 'violet )) ; for B
+ )
)
)
-rainbow = {
- % Override color so it is obtained from color-notehead Scheme function
- \override NoteHead #'color = #color-notehead
-}
-
\relative c' {
- \rainbow {
- c2 c' |
- b4 g8 a b4 c |
- c,2 a' |
- g1 |
- }
+ % Arrange to obtain color from color-notehead procedure
+ \override NoteHead #'color = #color-notehead
+ c2 c' |
+ b4 g8 a b4 c |
+ c,2 a' |
+ g1 |
}
\addlyrics {
- Some -- where o -- ver the Rain -- bow, way up high,
+ Some -- where o -- ver the Rain -- bow way up high,
}
@end lilypond
d'8-2 \staccato
|
c'4-3
- r8
- r16.
- c'32-3 \pp
- |
- c'8-2
- r16.
- c'32
- c'8
- r16.
- c'32
- |
- c'8
+ r4
}
% LH Staff
d8-2 \staccato
|
c4-3
- r8
- r16.
- c32-3
- |
- c8-2
- r16.
- c32
- c8
- r16.
- c32
- |
- c8
+ r4
}
>>
<part id="P1">
<measure number="1">
<attributes>
- <divisions>32</divisions>
+ <divisions>64</divisions>
<key>
<fifths>0</fifths>
<mode>major</mode>
</key>
- <time symbol="common">
- <beats>4</beats>
+ <time>
+ <beats>16</beats>
<beat-type>4</beat-type>
</time>
<clef>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>128</duration>
- <tie type="start"/>
+ <duration>1024</duration>
<voice>1</voice>
- <type>whole</type>
- <notations>
- <tied type="start"/>
- </notations>
+ <type>longa</type>
</note>
</measure>
<!--=======================================================-->
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>128</duration>
- <tie type="stop"/>
+ <duration>512</duration>
<voice>1</voice>
- <type>whole</type>
- <notations>
- <tied type="stop"/>
- </notations>
+ <type>breve</type>
</note>
- </measure>
- <!--=======================================================-->
- <measure number="3">
<note>
<pitch>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>128</duration>
+ <duration>256</duration>
<voice>1</voice>
<type>whole</type>
</note>
- </measure>
- <!--=======================================================-->
- <measure number="4">
<note>
<pitch>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>64</duration>
+ <duration>128</duration>
<voice>1</voice>
<type>half</type>
<stem>down</stem>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>32</duration>
+ <duration>64</duration>
<voice>1</voice>
<type>quarter</type>
<stem>down</stem>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>16</duration>
+ <duration>32</duration>
<voice>1</voice>
<type>eighth</type>
<stem>down</stem>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>8</duration>
+ <duration>16</duration>
<voice>1</voice>
<type>16th</type>
<stem>down</stem>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>4</duration>
+ <duration>8</duration>
<voice>1</voice>
<type>32nd</type>
<stem>down</stem>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>2</duration>
+ <duration>4</duration>
<voice>1</voice>
<type>64th</type>
<stem>down</stem>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>1</duration>
+ <duration>2</duration>
<voice>1</voice>
<type>128th</type>
<stem>down</stem>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>1</duration>
+ <duration>2</duration>
<voice>1</voice>
<type>128th</type>
<stem>down</stem>
</note>
</measure>
<!--=======================================================-->
+ <measure number="4">
+ <attributes>
+ <time>
+ <beats>24</beats>
+ <beat-type>4</beat-type>
+ </time>
+ </attributes>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>1536</duration>
+ <voice>1</voice>
+ <type>longa</type>
+ <dot/>
+ </note>
+ </measure>
+ <!--=======================================================-->
<measure number="5">
<note>
<pitch>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>96</duration>
+ <duration>768</duration>
<voice>1</voice>
- <type>half</type>
+ <type>breve</type>
<dot/>
- <stem>down</stem>
</note>
<note>
<pitch>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>32</duration>
+ <duration>384</duration>
<voice>1</voice>
- <type>quarter</type>
- <stem>down</stem>
+ <type>whole</type>
+ <dot/>
</note>
- </measure>
- <!--=======================================================-->
- <measure number="6">
<note>
<pitch>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>48</duration>
+ <duration>192</duration>
+ <voice>1</voice>
+ <type>half</type>
+ <dot/>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>96</duration>
<voice>1</voice>
<type>quarter</type>
<dot/>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>24</duration>
+ <duration>48</duration>
<voice>1</voice>
<type>eighth</type>
<dot/>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>12</duration>
+ <duration>24</duration>
<voice>1</voice>
<type>16th</type>
<dot/>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>6</duration>
+ <duration>12</duration>
<voice>1</voice>
<type>32nd</type>
<dot/>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>3</duration>
+ <duration>6</duration>
<voice>1</voice>
<type>64th</type>
<dot/>
- <stem>down</stem>
<beam number="1">continue</beam>
<beam number="2">continue</beam>
<beam number="3">continue</beam>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>2</duration>
+ <duration>3</duration>
<voice>1</voice>
<type>128th</type>
<dot/>
- <stem>down</stem>
<beam number="1">continue</beam>
<beam number="2">continue</beam>
<beam number="3">continue</beam>
<step>C</step>
<octave>5</octave>
</pitch>
- <duration>2</duration>
+ <duration>3</duration>
<voice>1</voice>
<type>128th</type>
<dot/>
- <stem>down</stem>
<beam number="1">end</beam>
<beam number="2">end</beam>
<beam number="3">end</beam>
<beam number="4">end</beam>
<beam number="5">end</beam>
</note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="6">
+ <attributes>
+ <time>
+ <beats>28</beats>
+ <beat-type>4</beat-type>
+ </time>
+ </attributes>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>1792</duration>
+ <voice>1</voice>
+ <type>longa</type>
+ <dot/>
+ <dot/>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="7">
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>896</duration>
+ <voice>1</voice>
+ <type>breve</type>
+ <dot/>
+ <dot/>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>448</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ <dot/>
+ <dot/>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>224</duration>
+ <voice>1</voice>
+ <type>half</type>
+ <dot/>
+ <dot/>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>112</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ <dot/>
+ <dot/>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>56</duration>
+ <voice>1</voice>
+ <type>eighth</type>
+ <dot/>
+ <dot/>
+ <beam number="1">begin</beam>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>28</duration>
+ <voice>1</voice>
+ <type>16th</type>
+ <dot/>
+ <dot/>
+ <beam number="1">continue</beam>
+ <beam number="2">begin</beam>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>14</duration>
+ <voice>1</voice>
+ <type>32nd</type>
+ <dot/>
+ <dot/>
+ <beam number="1">continue</beam>
+ <beam number="2">continue</beam>
+ <beam number="3">begin</beam>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>7</duration>
+ <voice>1</voice>
+ <type>64th</type>
+ <dot/>
+ <dot/>
+ <beam number="1">continue</beam>
+ <beam number="2">continue</beam>
+ <beam number="3">continue</beam>
+ <beam number="4">begin</beam>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>7</duration>
+ <voice>1</voice>
+ <type>64th</type>
+ <dot/>
+ <dot/>
+ <beam number="1">end</beam>
+ <beam number="2">end</beam>
+ <beam number="3">end</beam>
+ <beam number="4">end</beam>
+ </note>
<barline location="right">
<bar-style>light-heavy</bar-style>
</barline>
}
details = scm_acons (ly_symbol2scm ("X"),
- scm_from_double (bound_grob->extent (commonx, X_AXIS)
+ scm_from_double (robust_relative_extent (bound_grob, commonx, X_AXIS)
.linear_combination (attach)),
details);
}
line.translate (Offset (-me->relative_coordinate (commonx, X_AXIS),
-me->relative_coordinate (my_common_y, Y_AXIS)));
-
+
return line.smobbed_copy ();
}
/*
- If a variable in changed in SRC, we DEST doesn't see the
+ If a variable is changed in SRC, then DEST doesn't see the
definitions.
*/
"@code{force-hshift} and @code{horizontal-shift}.",
/* properties */
- "ignore-collision "
"merge-differently-dotted "
"merge-differently-headed "
"positioning-done ");
"arpeggio "
"force-hshift "
"horizontal-shift "
+ "ignore-collision "
"note-heads "
"rest "
"rest-collision "
import sys
import string
import re
-import lilylib
+import lilylib as ly
-_ = lilylib._
+_ = ly._
from rational import Rational
def ly_expression (self, factor = None):
if not factor:
factor = self.factor
-
- str = '%d%s' % (1 << self.duration_log, '.'*self.dots)
+
+ if self.duration_log < 0:
+ str = {-1: "\\breve", -2: "\\longa"}.get (self.duration_log, "1")
+ else:
+ str = '%d' % (1 << self.duration_log)
+ str += '.'*self.dots
if factor <> Rational (1,1):
if factor.denominator () <> 1:
import re
import sys
import copy
-import lilylib
+import lilylib as ly
-_ = lilylib._
+_ = ly._
def error (str):
ly.stderr_write ((_ ("error: %s") % str) + "\n")
return ''.join ([c.get_text () for c in self._children])
def message (self, msg):
- lilylib.stderr_write (msg+'\n')
+ ly.stderr_write (msg+'\n')
p = self
while p:
'half': 1,
'whole': 0,
'breve': -1,
- 'long': -2}.get (log, 0)
+ 'longa': -2}.get (log, 0)
elif self.get_maybe_exist_named_child (u'grace'):
# FIXME: is it ok to default to eight note for grace notes?
return 3
if instrument_name:
return instrument_name
else:
- lilylib.stderr_write (_ ("Unable to find find instrument for ID=%s\n") % id)
+ ly.stderr_write (_ ("Unable to find find instrument for ID=%s\n") % id)
return "Grand Piano"
class Part_group (Music_xml_node):
else:
duration_factor = Rational (diff.numerator ())
else:
+ # for skips of a whole or more, simply use s1*factor
duration_log = 0
duration_factor = diff
skip.duration.duration_log = duration_log
OUTTXT_FILES += $(addprefix $(outdir)/,$(TEXI_FILES:.texi=.txt))
+TEXI2PDF_FLAGS += --command '@set version $(TOPLEVEL_VERSION)'
GENERATE_OMF = $(PYTHON) $(buildscript-dir)/texi2omf.py --format $(1) --location $(webdir)/$(tree-dir)/out-www/$(notdir $(basename $@)) --version $(TOPLEVEL_VERSION) $< > $@
TEXI2PDF_FLAGS += --command '@set version $(TOPLEVEL_VERSION)'