<<
\context ChordNames {
\chordmode {
- f1 g
+ f1 g c
}
}
\context Staff {
(open 2)
(place-fret 1 3 3)
)
- }
+ < c e g c' e'> ^\markup
+ \fret-diagram-verbose #'(
+ (capo 3)
+ (mute 6)
+ (place-fret 4 5 1)
+ (place-fret 3 5 2)
+ (place-fret 2 5 3)
+ )
+ }
>>
@end lilypond
\storePredefinedDiagram \chordmode {c'}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'bes))
+ #(offset-fret 2 (chord-shape 'bes guitar-tuning))
mychords = \chordmode{
c1 c'
% add a new chord shape
-\addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;"
+\addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;"
% add some new chords based on the power chord shape
\storePredefinedDiagram \chordmode {f'}
#guitar-tuning
- #(chord-shape 'powerf)
+ #(chord-shape 'powerf guitar-tuning)
\storePredefinedDiagram \chordmode {g'}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'powerf))
+ #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
mychords = \chordmode{
f1 f' g g'
<<
\context ChordNames {
\chordmode {
- f1 g
+ f1 g c
}
}
\context Staff {
(open 2)
(place-fret 1 3 3)
)
- }
+ < c e g c' e'> ^\markup
+ \fret-diagram-verbose #'(
+ (capo 3)
+ (mute 6)
+ (place-fret 4 5 1)
+ (place-fret 3 5 2)
+ (place-fret 2 5 3)
+ )
+ }
>>
@end lilypond
\storePredefinedDiagram \chordmode {c'}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'bes))
+ #(offset-fret 2 (chord-shape 'bes guitar-tuning))
mychords = \chordmode{
c1 c'
% add a new chord shape
-\addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;"
+\addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;"
% add some new chords based on the power chord shape
\storePredefinedDiagram \chordmode {f'}
#guitar-tuning
- #(chord-shape 'powerf)
+ #(chord-shape 'powerf guitar-tuning)
\storePredefinedDiagram \chordmode {g'}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'powerf))
+ #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
mychords = \chordmode{
f1 f' g g'
@end ignore
+@item
+Straight flags (used in old scores of e.g. Bach, but also in different form in
+modern scores of e.g. Stockhausen) are now implemented:
+@lilypond
+\relative c'' {
+ \override Stem #'flag = #modern-straight-flag
+ c,16 \acciaccatura {c'8} d4 d32
+ \bar":"
+ \override Stem #'flag = #old-straight-flag
+ c,16 \acciaccatura {c'8} d4 d32
+}
+@end lilypond
+
@item
@code{\bookpart} blocks may be used to split a book into several parts,
separated by a page break, in order to ease the page breaking, or to use
@end lilypond
Fingering indications and barres can be included in a
-fret-diagram-verbose markup string.
+fret-diagram-verbose markup string. Unique to the
+fret-diagram-verbose interface is a capo indication that
+can be placed on the fret diagram. The capo indication is
+a thick bar that covers all strings. The fret with the
+capo will be the lowest fret in the fret diagram.
@c \override is necessary to make fingering visible
@lilypond[quote, verbatim]
<<
\context ChordNames {
\chordmode {
- f1 g
+ f1 g c
}
}
\context Staff {
(open 2)
(place-fret 1 3 3)
)
- }
+ < c e g c' e'> ^\markup
+ \fret-diagram-verbose #'(
+ (capo 3)
+ (mute 6)
+ (place-fret 4 5 1)
+ (place-fret 3 5 2)
+ (place-fret 2 5 3)
+ )
+ }
>>
@end lilypond
@cindex adding custom fret diagrams
Fret diagrams can be added to the fret diagram table. To add a diagram,
-you must specify the chord for the diagram, the tuning to be used, and the
-fret-diagram-terse definition string for the diagram.
+you must specify the chord for the diagram, the tuning to be used, and
+a definition for the diagram. The diagram definition can be either a
+fret-diagram-terse definition string or a fret-diagram-verbose
+marking list.
@lilypond[verbatim, ragged-right, quote]
\include "predefined-guitar-fretboards.ly"
\storePredefinedDiagram \chordmode {c'}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'bes))
+ #(offset-fret 2 (chord-shape 'bes guitar-tuning))
mychords = \chordmode{
c1 c'
shapes. The chord shapes are fret diagrams that can be shifted along
the neck to different posistions to provide different chords. Chord
shapes can be added to the internal list and then used to define
-predefined fret diagrams.
+predefined fret diagrams. Like fret diagrams, chord shapes can be
+entered as either fret-diagram-terse strings or fret-diagram-verbose
+marking lists.
@lilypond[verbatim, ragged-right, quote]
\include "predefined-guitar-fretboards.ly"
% add a new chord shape
-\addChordShape #'powerf #"1-1;3-3;3-4;x;x;x;"
+\addChordShape #'powerf #guitar-tuning #"1-1;3-3;3-4;x;x;x;"
% add some new chords based on the power chord shape
\storePredefinedDiagram \chordmode {f'}
#guitar-tuning
- #(chord-shape 'powerf)
+ #(chord-shape 'powerf guitar-tuning)
\storePredefinedDiagram \chordmode {g'}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'powerf))
+ #(offset-fret 2 (chord-shape 'powerf guitar-tuning))
mychords = \chordmode{
f1 f' g g'
@item Canceling the effects of the key signature or previous accidentals.
@end itemize
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-<<
- \context Staff \relative c'' {
- \set Staff.extraNatural = ##f
- gisis1 gis g! ges geses
+@lilypond[quote,notime]
+\score {
+ \new Staff {
+ \relative c'' {
+ \set Staff.extraNatural = ##f
+ gisis1 gis g! ges geses
+ }
}
- \lyrics {
- \override Lyrics .LyricText #'self-alignment-X = #-1
- "db. sharp" sharp natural flat "db. flat"
+ \addlyrics {
+ \markup {
+ \center-column { double sharp }
+ }
+ sharp
+ natural
+ flat
+ \markup {
+ \center-column { double flat }
+ }
}
->>
+ \layout {
+ \context {
+ \Score
+ \override SpacingSpanner
+ #'base-shortest-duration = #(ly:make-moment 1 32)
+ }
+ }
+}
@end lilypond
@notation{Al niente} is indicated by circling the tip of the hairpin:
-@lilypond[fragment,ragged-right]
-\relative c'' {
- \override Hairpin #'circled-tip = ##t
- c1\<
- c2\> c\<
- c1\!
-}
+@lilypond[quote,relative=2]
+\override Hairpin #'circled-tip = ##t
+c1\<
+c2\> c\<
+c1\!
@end lilypond
-or with the actual phrase @notation{al niente}. This may be easier with
-text markup, rather than as part of the @notation{decrescendo} text:
+or with the actual phrase @notation{al niente}:
-@lilypond[fragment,ragged-right]
-\relative c'' {
- \dimTextDecresc
- c1~\>
- c~
- c\!-\markup { \italic "al niente" }
-}
+@lilypond[quote,relative=2]
+\dimTextDecresc
+\override DynamicTextSpanner #'(bound-details right text) =
+ \markup { \italic { al niente } }
+c1\> ~
+c1 ~
+c1\!
@end lilypond
Since one does not crescendo @emph{to} nothing, it is not correct to use
FI: kohotahti.
An anacrusis (also known as pickup or upbeat) is an incomplete measure
-of music before a section of music. It also refers to the initial
+of music before a section of music. It also refers to the initial
note(s) of a melody occurring in that incomplete measure.
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=1]
\key f \major
\time 4/4
-\relative c' {
- \partial 4 f4 | bes4. a8 bes4 c |
- bes( a) g f | bes4. a8 bes4 c | f,2. \bar "||" }
+\partial 4 f4
+bes4. a8 bes4 c
+bes4( a) g f
+bes4. a8 bes4 c
+f,2. \bar "||"
@end lilypond
Also called @q{natural minor scale}.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\relative c'' {
- a1 b c d e f g a }
+@lilypond[quote,notime,relative=2]
+a1 b c d e f g a
@end lilypond
note regardless of the duration of the main note the duration of the
long appoggiatura is proportional to that of the main note.
-@lilypond[line-width=13.0\cm]
-\context Voice \relative c'' {
- \key d \major
- \time 4/4
-
-%\override Score.TextScript #'font-style = #'large
- <d a fis>4_"notation" r
- { \override Stem #'flag-style = #'()
- \grace g16
- \revert Stem #'flag-style
- }
- fis8 e16 fis
- { \override Stem #'flag-style = #'()
- \grace a16
- \revert Stem #'flag-style
- }
- g8 fis16 g |
- \cadenzaOn a4 \bar "||" \cadenzaOff
-
- <d, a fis>4_"performance" r g16 ( fis) e fis a ( g) fis g |
- \cadenzaOn a4 \bar "||" \cadenzaOff
-}
+@lilypond[quote,relative=2]
+\key d \major
+\time 4/4
+<d a fis>4_"notation" r
+\grace g16
+fis8 e16 fis
+\grace a16
+g8 fis16 g |
+a4 \bar "||"
+
+\set Score.measurePosition = #ZERO-MOMENT
+<d, a fis>4_"performance" r
+g16( fis) e fis
+a16 ( g) fis g |
+a4 \bar "||"
@end lilypond
An appoggiatura may have more notes preceding the main note.
-@lilypond[line-width=13.0\cm]
-\relative c'' {
- \key as \major
- \time 2/4
-% \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 "||"
- \grace { bes16 } as8_"performance" as16 bes as8 g |
- << \context Voice = va { \stemUp\tieUp as32 bes c8. as32 bes c8. }
- \context Voice = vb { \stemDown\tieDown as16 ~ as8. as16 ~ as8. } >>
- \bar "||"
-}
+@lilypond[quote,relative=2]
+\key as \major
+\time 2/4
+\grace bes16 as8-"notation" as16 bes as8 g |
+\grace { as16[( bes] } <c as>4)
+\grace { as16[( bes] } <c as>4) \bar "||"
+
+\grace bes16 as8-"performance" as16 bes as8 g |
+<<
+ {
+ \voiceOne
+ as32 bes c8. as32 bes c8.
+ }
+ \new Voice {
+ \voiceTwo
+ as16 ~ as8. as16 ~ as8.
+ }
+>>
@end lilypond
[Italian: @q{harp-like, played like a harp}.]
-@lilypond[fragment,line-width=13.0\cm]
- \context PianoStaff <<
- \context Staff = SA \relative c'' {
- \time 4/4
- \clef treble
- r8 g16 c e g, c e r8 g,16 c e g, c e |
- r8 a,16 d f a, d f r8 a,16 d f a, d f \bar "||" }
- \context Staff = SB \relative c' {
- \clef bass
- << \context Voice = va {
- \stemUp
- r16 e8. ( e4) r16 e8. ( e4) |
- r16 d8. ( d4) r16 d8. ( d4) }
- \context Voice = vb {
- \stemDown
- c2 c | c c } >>
+@lilypond[quote,line-width=13\cm]
+\new PianoStaff <<
+ \context Staff = "SA" {
+ \relative c'' {
+ \clef treble
+ \time 4/4
+ r8 g16 c e g, c e r8 g,16 c e g, c e
+ r8 a,16 d f a, d f r8 a,16 d f a, d f
+ \bar "||"
+ }
+ }
+ \context Staff = "SB" {
+ \relative c' {
+ \clef bass
+ <<
+ {
+ \voiceOne
+ r16 e8. ( e4) r16 e8. ( e4)
+ r16 d8. ( d4) r16 d8. ( d4)
+ }
+ \new Voice {
+ \voiceTwo
+ c2 c
+ c2 c
+ }
+ >>
+ }
}
>>
@end lilypond
Line connecting a series of notes (shorter than a quarter note). The
number of beams determines the note value of the connected notes.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override TextScript #'font-style = #'large
-\relative c'' {
- g8_"1/8"[ g g g] s16
- g16_"1/16"[ g g g] s16
- g32_"1/32"[ s32 g32 s32 g32 s32 g32] s16
- g64_"1/64"[ s32 g64 s32 g64 s32 g64] s32 }
+@lilypond[quote,notime,relative=2,line-width=13\cm]
+g8-"1/8"[ g g g] s16
+g16-"1/16"[ g g g] s
+g32-"1/32"[ s g s g s g] s16
+g64-"1/64"[ s32 g64 s32 g64 s32 g64] s32
@end lilypond
The base counting value and the number of them in each measure is indicated
at the start of the music by the @notation{time signature}.
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=2]
\key g \major
\time 4/4
-\relative c'' { g4 c b a | g1 \bar "||"}
+g4 c b a | g1 \bar "||"
\time 3/8
-\relative c'' { g8 d' c | b c a | g4. \bar "||"}
+g8 d' c | b c a | g4. \bar "||"
@end lilypond
the staves of like instruments in an orchestral score when written on different
staves (e.g. first and second flutes):
-@lilypond[fragment,ragged-right]
-\context GrandStaff <<
- \relative c''\context Staff = SA { \clef treble g4 e c2 }
- \relative c \context Staff = SB { \clef bass c1 \bar "|." } >>
+@lilypond[quote]
+\new GrandStaff <<
+ \context Staff = "SA" {
+ \relative c'' {
+ \clef treble
+ g4 e c2
+ }
+ }
+ \context Staff = "SB" {
+ \relative c {
+ \clef bass
+ c1
+ \bar "|."
+ }
+ }
+>>
@end lilypond
Angular brackets for connecting parts in an orchestral or choral score:
-@lilypond[fragment,ragged-right]
-\context StaffGroup <<
-% \set StaffGroup.minVerticalAlign = #12
- \relative c'' \context Staff = SA { \clef treble g4 e c2 }
- \relative c \context Staff = SB { \clef bass c1 \bar "|." } >>
+@lilypond[quote]
+\new StaffGroup <<
+ \context Staff = "SA" {
+ \relative c'' {
+ \clef treble
+ g4 e c2
+ }
+ }
+ \context Staff = "SB" {
+ \relative c {
+ \clef bass
+ c1
+ \bar "|."
+ }
+ }
+>>
@end lilypond
A family of blown musical instruments made of brass, all using a cup
formed mouth piece. The brass instruments commonly used in a symphony
-orchestra are trumpet, trombone, french horn, and tube.
+orchestra are trumpet, trombone, french horn, and tuba.
@seealso
The shortest note value generally used in white mensural notation, hence the
name, which originally meant @q{of short duration}.
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-\relative c'' { g\breve }
+@lilypond[quote,notime,relative=2]
+g\breve
@end lilypond
Clef symbol indicating the position of the middle C. Used on all note
lines.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\override Score.Clef #'full-size-change = ##t
-<<
- \context Staff \relative c' {
- \clef soprano c1
- \clef mezzosoprano c
- \clef alto c
- \clef tenor c
- \clef baritone c
- }
- \context Lyrics \lyrics {
- \override Lyrics .LyricText #'self-alignment-X = #-1
- "Soprano " "Mezzosoprano " "Alto " "Tenor " Baritone
- }
->>
+@lilypond[quote,notime,relative=1,line-width=13.0\cm]
+\new Staff {
+ \override Staff.Clef #'full-size-change = ##t
+ \clef soprano c1
+ \clef mezzosoprano c1
+ \clef alto c1
+ \clef tenor c1
+ \clef baritone c1
+}
+\addlyrics {
+ \override Lyrics . LyricText #'self-alignment-X = #LEFT
+ "Soprano " "Mezzosoprano " "Alto " "Tenor " Baritone
+}
@end lilypond
FI: sointu.
Three or more tones sounding simultaneously. In traditional European music
-the base chord is a @emph{triad} consisting of two thirds. @emph{Major}
+the base chord is a @emph{triad} consisting of two thirds. @emph{Major}
(major + minor third) as well as @emph{minor} (minor + major third) chords
-may be extended with more thirds. Four-tone @emph{seventh chords} and
+may be extended with more thirds. Four-tone @emph{seventh chords} and
five-tone @emph{ninth} major chords are most often used as dominants
(functional harmony). Chords having no third above the lower notes to
define their mood are a special case called @q{open chords}. The lack of
the middle third means their quality is ambivalent -- neither major nor
minor.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override TextScript #'font-style = #'large
+@lilypond[quote,notime,line-width=13.0\cm]
<<
-\context Staff \relative c'' {
- \set Staff.extraNatural = ##f
- <g b d>1
- <g bes d>
- <g bes des>
- <g b dis>
- <g b d f>
- <g b d f a>
-}
-\lyrics{
- "major "
- "minor "
- "diminished "
- "augmented "
- "seventh-chord "
- ninth-chord
-}
+ \new Staff {
+ \relative c'' {
+ \set Staff.extraNatural = ##f
+ <g b d>1
+ <g bes d>
+ <g bes des>
+ <g b dis>
+ <g b d f>
+ <g b d f a>
+ }
+ }
+ \lyrics {
+ "major "
+ "minor "
+ "diminished "
+ "augmented "
+ "seventh-chord "
+ ninth-chord
+ }
>>
@end lilypond
A scale consisting of all 12 semitones.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\relative c' { c1 cis d dis e f fis g gis a ais b c }
+@lilypond[quote,notime,relative=1,line-width=13.0\cm]
+c1 cis d dis e f fis g gis a ais b c
@end lilypond
geometrical shape of a cluster covers the area in which any single
pitch contained in the cluster would be notated as an ordinary note.
-@lilypond[fragment,relative=2,ragged-right]
-\makeClusters { <c e> <b f'> <b g'> <c g> <f e> }
+@lilypond[quote,relative=2]
+\makeClusters { <c e>4 <b f'> <b g'> <c g>8 <f e> }
@end lilypond
A time signature that additively combines two or more unequal meters, e.g.,
"3/8 + 2/8" instead of "5/8". Sometimes called additive time signatures.
-@lilypond[fragment,line-width=13.0\cm]
-#(define (compound-time grob one two three num)
+@end enumerate
+
+@lilypond[quote,line-width=13.0\cm]
+#(define ((compound-time one two three num) grob)
(grob-interpret-markup grob
(markup
#:override '(baseline-skip . 0)
\relative c' {
\key f \major
#(set-time-signature 8 8 '(3 2 3))
- \override Staff.TimeSignature #'stencil = #(lambda (grob)
- (compound-time grob "3" "2" "3" "8"))
+ \override Staff.TimeSignature #'stencil =
+ #(compound-time "3" "2" "3" "8")
#(override-auto-beam-setting '(end 1 8 8 8) 3 8)
#(override-auto-beam-setting '(end 1 8 8 8) 5 8)
}
@end lilypond
-@end enumerate
-
@seealso
@ref{compound meter}, @ref{meter}, @ref{polymetric time signature}.
@itemize
@item violin
@item viola
-@item violincello
+@item violoncello
@end itemize
@end multitable
@item piccolo (plays an octave higher)
@item celesta (plays an octave higher)
-@item double-bass (plays an octave lower)
+@item double bass (plays an octave lower)
@end itemize
Progressing melodically by intervals of a second, as contrasted with
@emph{disjunct movement}.
-@lilypond[fragment,line-width=13.0\cm]
-\key g \major \time 4/4
-\relative c'' { g4 g g a | b2 a | g4 b a a | g1 \bar "||" }
+@lilypond[quote,relative=2,line-width=13.0\cm]
+\key g \major
+\time 4/4
+g4 g g a | b2 a | g4 b a a | g1 \bar "||"
@end lilypond
distinct melodic significance. A frequently used polyphonic technique
is imitation, in its strictest form found in the canon needing only
one part to be written down while the other parts are performed with a
-given displacement. Imitation is also the contrapunctal technique
+given displacement. Imitation is also the contrapuntal technique
used in the @emph{fugue} which, since the music of the baroque era,
has been one of the most popular polyphonic composition methods.
-@lilypond[fragment,staffsize=12,line-width=13.0\cm]
-\set Score.implicitTimeSignatureVisibility = #all-invisible
-\override Score.TimeSignature #'break-visibility = #all-invisible
-\context PianoStaff <<
+@lilypond[quote,staffsize=12,line-width=13.0\cm]
+\new PianoStaff <<
\context Staff = SA \relative c' {
\key bes \major
\time 4/4
Increasing volume. Indicated by a rightwards opening horizontal wedge
(hairpin) or the abbreviation @notation{cresc.}.
-@lilypond[fragment,ragged-right]
-\key g \major \time 4/4
-\relative c'' { g4 \< a b c | d1\! \bar "|." }
+@lilypond[quote,relative=2]
+\key g \major
+\time 4/4
+g4\< a b c | d1\! \bar "|."
@end lilypond
they have survived only in special forms of musical notation such as the
@emph{Editio Vaticana}, dating from the beginning of the 20th century
-@lilypond
+@lilypond[quote,ragged-right]
\score {
- {
-% \override Staff.Custos #'neutral-position = #4
- \override Staff.Custos #'neutral-direction = #down
+ \new Staff {
+ \override Staff.Custos #'neutral-direction = #DOWN
\override Staff.Custos #'style = #'hufnagel
c'1 \break
<d' a' f''>1
}
-
\layout {
\context {
\Staff
- \consists Custos_engraver
+ \consists "Custos_engraver"
}
- ragged-right = ##t
}
}
@end lilypond
another place frequently near the beginning marked by a sign
(@notation{segno}):
-@lilypond[fragment,ragged-right]
-%\override TextScript #'font-style = #'large
-\override TextScript #'font-shape = #'italic
-\key g \major \time 4/4
-\relative c'' {
- d1 |
- g,4^\segno a b c |
- b a g2_\markup{
- \line { "D.S. " \tiny \raise #1 \musicglyph #"scripts.segno" } }
- \bar "|."
+@lilypond[quote,relative=2]
+\key g \major
+\time 4/4
+d1
+g,4^\segno a b c
+b4 a g2-\markup {
+ \italic "D.S. "
+ \tiny \raise #1
+ \musicglyph #"scripts.segno"
}
+\bar "|."
@end lilypond
Decreasing tone volume. Indicated by a leftwards opening horizontal
wedge (hairpin) or the abbreviation @notation{decresc.}.
-@lilypond[fragment,ragged-right]
-\relative c'' {
- \key g \major \time 4/4
- d4 \> c b a | g1 \! \bar "|."
-}
+@lilypond[quote,relative=2]
+\key g \major
+\time 4/4
+d4\> c b a | g1 \! \bar "|."
@end lilypond
S: diatonisk skala,
FI: diatoninen asteikko.
-A scale consisting of 5@w{ }whole tones and 2@w{ }semitones (S). Scales
+A scale consisting of 5@w{ }whole tones and 2@w{ }semitones (S). Scales
played on the white keys of a piano keybord are diatonic. These scales
are sometimes called, somewhat inaccurately, @q{church modes}).
These @emph{modes} are used in Gregorian chant and in pre-baroque early music
but also to some extent in newer jazz music.
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=1]
<<
- \context Staff \relative c' {
+ {
c1 d
- \override TextScript #'padding = #-4
e^"~~ S" f g a b^"~~ S" c
}
- \context Lyrics \lyrics {
+ \lyrics {
Ionian
}
>>
@end lilypond
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
<<
- \context Staff \relative c' {
+ {
d1
- \override TextScript #'padding = #-4
e^"~~ S" f g a b^"~~ S" c d
}
\lyrics {
>>
@end lilypond
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
<<
- \relative c' {
- \override TextScript #'padding = #-4
+ {
e1^"~~ S" f g a b^"~~ S" c d e
}
\lyrics {
>>
@end lilypond
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
<<
- \relative c' {
+ {
f1 g a
- \override TextScript #'padding = #-4
b^"~~ S" c d e^"~~ S" f
}
\lyrics {
>>
@end lilypond
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=2]
<<
- \relative c'' {
+ {
g1 a
- \override TextScript #'padding = #-4
- b^"~~ S" c d e^"~~ S" f g }
+ b^"~~ S" c d e^"~~ S" f g
+ }
\lyrics {
Mixolydian
}
>>
@end lilypond
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=2]
<<
- \relative c'' {
+ {
a1
- \override TextScript #'padding = #-4
b^"~~ S" c d e^"~~ S" f g a
}
\lyrics {
>>
@end lilypond
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=2]
<<
- \relative c'' {
- \override TextScript #'padding = #-4
+ {
b1^"~~ S" c d e^"~~ S" f g a b
}
\lyrics {
the harmonic minor scale type an augmented second (A) occurs between
the 6th and 7th tone.
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
<<
- \relative c' {
+ {
c1 d
- \override TextScript #'padding = #-4
e^"~~ S" f g a b^"~~ S" c
}
- \lyrics {
+ \lyrics {
Major
}
>>
@end lilypond
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=2]
<<
- \relative c'' {
+ {
a1
- \override TextScript #'padding = #-4
b^"~~ S" c d e^"~~ S" f g a
}
- \lyrics {
+ \lyrics {
"Ancient (or Natural) minor"
}
>>
@end lilypond
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=2]
<<
- \relative c'' {
+ {
a1
- \override TextScript #'padding = #-4
b^"~~ S" c d e^"~~ S" f!^"~~ A" gis^"~~ S" a
}
- \context Lyrics \lyrics {
+ \lyrics {
"Harmonic minor"
}
>>
@end lilypond
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=2]
<<
- \relative c'' {
+ {
a1
- \override TextScript #'padding = #-4
b^"~~ S" c d e fis gis^"~~ S" a
}
- \lyrics {
+ \lyrics {
"Melodic minor ascending"
}
>>
@end lilypond
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.LyricText #'font-style = #'large
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,notime,relative=3]
<<
- \relative c'' {
- a'1
- \override TextScript #'padding = #-4
- a g! f!^"~~ S" e d c^"~~ S" b a
+ {
+ a1
+ g! f!^"~~ S" e d c^"~~ S" b a
}
- \lyrics {
+ \lyrics {
"Melodic minor descending"
}
>>
Progressing melodically by intervals larger than a major second, as contrasted
with conjunct movement.
-@lilypond[fragment,ragged-right]
+@lilypond[quote,relative=1]
\key a \major
\time 4/4
-\relative c' {
- \partial 8 e8 |
- a4. gis8 b a e cis |
- fis2 d4. \bar "||" }
+\partial 8 e8 |
+a4. gis8 b a e cis |
+fis2 d4.
+\bar "||"
@end lilypond
Two notes, intervals, or scales are enharmonic if they have different
names but equal pitch.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
<<
-\context Staff \relative c'' {
- gis1 as <des g,!> <cis g!>
-}
-\context Lyrics \lyrics {
- \override Lyrics .LyricText #'self-alignment-X = #-1
- "g sharp " "a flat " "dim fifth " "augm fourth"
-}
+ \new Staff {
+ \relative c'' {
+ gis1 as <des g,!> <cis g!>
+ }
+ }
+ \lyrics {
+ "g sharp " "a flat " "dim fifth " "augm fourth"
+ }
>>
@end lilypond
the clef symbol indicates playing an octave lower (for example, on the
Double Bass).
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\override Staff.Clef #'full-size-change = ##t
+@lilypond[quote,notime,line-width=13.0\cm]
<<
-\relative c {
- \clef varbaritone
- f1
- \clef bass
- f1
- \clef subbass
- f1
- \clef "F^8"
- f1
- \clef "F_8"
- f1
-}
- \lyrics {
- "varbaritone "
- "bass "
- "sub-bass "
- "octave up "
- "octave down"
-}
+ \relative c {
+ \override Staff.Clef #'full-size-change = ##t
+ \clef varbaritone
+ f1
+ \clef bass
+ f1
+ \clef subbass
+ f1
+ \clef "F^8"
+ f1
+ \clef "F_8"
+ f1
+ }
+ \lyrics {
+ "varbaritone "
+ "bass "
+ "sub-bass "
+ "octave up "
+ "octave down"
+ }
>>
@end lilypond
Prolonged note or rest of indefinite duration.
-@lilypond[fragment,ragged-right]
+@lilypond[quote,relative=2]
\time 4/4
-\relative c'' {
- a4 b c2^\fermata \bar "|."
-}
+a4 b c2^\fermata
+\bar "|."
@end lilypond
together with figures designating the chief intervals and chords to be
played above the bass notes.
-TODO: Make the upper clef smaller, since it's usually "realized" in performance.
-
-@lilypond[fragment,line-width=13.0\cm]
-\context GrandStaff <<
- \context Staff = lh \relative c'' {
- \time 4/4
- \key es \major
+@lilypond[quote,line-width=13.0\cm]
+\new GrandStaff <<
+ \new Staff = "rh" \with {
+ fontSize = #-3
+ \override StaffSymbol #'staff-space = #(magstep -3)
+ } \relative c'' {
\clef treble
- << \context Voice = rha {
- \stemUp
- es4 d c bes | bes }
- \context Voice = rhb {
- \stemDown
- < bes g >8 as < as f > g < g es > f < d f > es | < g es >4 }
+ \key es \major
+ \time 4/4
+ <<
+ \context Voice = "rha" {
+ \voiceOne
+ es4 d c bes
+ bes4
+ }
+ \context Voice = "rhb" {
+ \voiceTwo
+ <bes g>8 as <as f> g <g es> f <d f> es
+ <g es>4
+ }
>>
}
- <<
- \context Staff = rh \relative c' {
+ \new Staff = "lh" \relative c' {
\clef bass
\key es \major
- es8 c d bes c as bes16 as g f | es4
- }
- \figures { s8 <6> s <4 2> s <6> s16 s <6> <4 2> }
- >>
+ es8 c d bes c as bes16 as g f
+ es4
+ }
+ \figures {
+ s8 <6> s <4 2> s <6> s16 s <6> <4 2>
+ }
>>
@end lilypond
Ornament at the end of the stem of a note used for notes with values less
than a quarter note. The number of flags determines the note value.
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c'' {
- g8_"8th" s8
- g16_"16th" s8
- g32_"32nd" s8
- g64_"64th" s8
-}
+@lilypond[quote,notime,relative=2]
+g8-"8th" s8
+g16-"16th" s8
+g32-"32nd" s8
+g64-"64th" s8
@end lilypond
TODO: what does the @q{p} mean in Sp, Dp, Tp?
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
<<
-\context Voice \relative c'' {
- <g e c >1 < a f d > < b g e >
- <c a f > < d b g > < e c a > < f d b > }
-\context Lyrics \lyrics {
- T Sp Dp S D Tp \markup{ D\translate #(cons -2 0) {"|"} } }
+ {
+ <g e c>1 <a f d> <b g e>
+ <c a f> <d b g> <e c a> <f d b>
+ }
+ \lyrics {
+ T Sp Dp S D Tp
+ \markup { D \translate #'(-2 . 0) | }
+ }
>>
@end lilypond
playing or singing an octave lower (used most frequently to notate the tenor
part in modern choral scores).
-@lilypond[fragment,notime,ragged-right]
-<<
- \set Score.automaticBars = ##f
+@lilypond[quote,notime]
+\relative c'' {
\override Staff.Clef #'full-size-change = ##t
-
- \relative c'' {
- \set Score.proportionalNotationDuration = #(ly:make-moment 1 8)
- \clef french
- g1
- \clef treble
- g
- \clef "G^8"
- g
- \clef "G_8"
- g
- }
- \context Lyrics \lyrics {
- \override Lyrics . LyricText #'X-offset = #-5
- "french violin clef"
- "violin clef"
- "octave up"
- "octave down"
- }
->>
+ \set Score.proportionalNotationDuration = #(ly:make-moment 1 8)
+ \clef french
+ g1
+ \clef treble
+ g1
+ \clef "G^8"
+ g1
+ \clef "G_8"
+ g1
+}
+\addlyrics {
+ "french violin clef"
+ "violin clef"
+ "octave up"
+ "octave down"
+}
@end lilypond
Graphical version of the @notation{crescendo} and @notation{decrescendo}
dynamic marks.
-@lilypond[fragment,ragged-right]
-\relative c'' {
- c1\<
- c2\> c\<
- c1\!
-}
+@lilypond[quote,relative=2]
+c1\<
+c2\> c\<
+c1\!
@end lilypond
A sequence of chords that terminates a musical phrase or section.
-@lilypond[fragment,ragged-right]
-\context PianoStaff <<
- \context Staff = SA \relative c'' {
- \time 4/4
+@lilypond[quote]
+\new PianoStaff <<
+ \context Staff = "SA" \relative c'' {
\clef treble
- \context Voice
- \partial 4 < c g e >4 |
- < c a f > < b g d > < c g e >2
+ \time 4/4
+ \partial 4 <c g e>4 |
+ <c a f> <b g d> <c g e>2
}
<<
- \context Staff = SB \relative c {
+ \context Staff = "SB" \relative c {
\clef bass
\partial 4 c4 | f, g c2
\bar "|."
}
>>
>>
-
@end lilypond
Consonances:
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\context Voice \relative c'' {
- <g g>1_"unison " s
- <g b>_"third " s
- <g c>_"fourth " s
- <g d'>_"fifth " s
- <g e'>_"sixth " s
- <g g'>_"octave " s
- <g b'>_"tenth" s s
-}
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
+<g g>1_"unison " s
+<g b>_"third " s
+<g c>_"fourth " s
+<g d'>_"fifth " s
+<g e'>_"sixth " s
+<g g'>_"octave " s
+<g b'>_"tenth" s s
@end lilypond
Dissonances:
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\context Voice \relative c'' {
- <g a>1_"second " s s
- <g f'>_"seventh " s s
- <g a'>_"ninth" s s
-}
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
+<g a>1_"second " s s
+<g f'>_"seventh " s s
+<g a'>_"ninth" s s
@end lilypond
For harmony that uses three or more notes, see @ref{chord}.
For example, this phrase in 6/4 time
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=1,line-width=13.0\cm]
\key c \major
\time 6/4
-\relative c' {
- c2. e | d2 c d | c1. \bar "||" }
+c2. e | d2 c d | c1. \bar "||"
@end lilypond
may be thought of having alternating time signatures
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=1,line-width=13.0\cm]
\key c \major
\time 6/4
-\relative c' {
- c2. e | \time 3/2 d2 c d | \time 6/4 c1. \bar "||" }
+c2. e
+\time 3/2
+d2 c d
+\time 6/4
+c1. \bar "||"
@end lilypond
and is therefore a polymeter (second definition) of considerable antiquity.
because they consist of three whole tones. The addition of such two
intervals forms an octave.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
<<
-\context Voice \relative c'' {
- < g g >1
- < g as >^"minor"
- < g a! >
- < g ais >^"augm"
- < gis bes >^"dimin"
- < g! bes >^"minor"
- < g b! >^"major"
- < g bis >^"augm"
-}
-\context Lyrics \lyrics {
- "unison " "second " "second " "second "
- "third " "third " "third " "third"
-}
+ \context Voice \relative c'' {
+ < g g >1
+ < g as >^"minor"
+ < g a! >
+ < g ais >^"augm"
+ < gis bes >^"dimin"
+ < g! bes >^"minor"
+ < g b! >^"major"
+ < g bis >^"augm"
+ }
+ \context Lyrics \lyrics {
+ "unison " "second " "second " "second "
+ "third " "third " "third " "third"
+ }
>>
@end lilypond
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
<<
-\context Staff \relative c'' {
- < g c >1^"perfect"
- < g cis >^"aug"
- < g d' >^"perfect"
- < g des' > ^"dim"
- < gis es' >^"dim"
- < g! es' >^"minor"
- < g e'! >^"major"
- < g eis' >^"aug"
-}
- \lyrics {
- "fourth " "fourth " "fifth " "fifth "
- "sixth " "sixth " "sixth " "sixth"
-}
+ \context Staff \relative c'' {
+ <g c >1^"perfect"
+ <g cis>^"aug"
+ <g d'>^"perfect"
+ <g des'> ^"dim"
+ <gis es'>^"dim"
+ <g! es'>^"minor"
+ <g e'!>^"major"
+ <g eis'>^"aug"
+ }
+ \lyrics {
+ "fourth " "fourth " "fifth " "fifth "
+ "sixth " "sixth " "sixth " "sixth"
+ }
>>
@end lilypond
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
<<
-\context Staff \relative c'' {
- < gis f'! >1^"dimin"
- < g! f'! >^"minor"
- < g fis' >^"major"
- < g g' >
- < g as' >^"minor"
- < g a'! >^"major"
- < g bes' >^"minor"
- < g b'! >^"major"
-}
-\context Lyrics \lyrics {
- "seventh " "seventh " "seventh " "octave "
- "ninth " "ninth " "tenth " "tenth"
-}
+ \context Staff \relative c'' {
+ <gis f'!>1^"dimin"
+ <g! f'!>^"minor"
+ <g fis'>^"major"
+ <g g'>
+ <g as'>^"minor"
+ <g a'!>^"major"
+ <g bes'>^"minor"
+ <g b'!>^"major"
+ }
+ \context Lyrics \lyrics {
+ "seventh " "seventh " "seventh " "octave "
+ "ninth " "ninth " "tenth " "tenth"
+ }
>>
@end lilypond
The difference between an interval and an octave.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\context Staff \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 "||"
- < g, c >_"fourth " s s < g' c, >_"fifth " s s \bar "||"
-}
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
+<g a>1_"second " s s <g' a,>_"seventh " s s \bar "||"
+<g, b>_"third " s s <g' b,>_"sixth " s s \bar "||"
+<g, c>_"fourth " s s <g' c,>_"fifth " s s \bar "||"
@end lilypond
A ledger line is an extension of the staff.
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-\relative c'' { a,1 s c'' }
+@lilypond[quote,notime,relative=2]
+a,1
+s1
+c''1
@end lilypond
notes, unlike (b) @notation{leggiero} or @notation{non-legato}, (c)
@notation{portato}, or (d) @notation{staccato}.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
<<
\context Staff \relative c'' {
c4-( d e-) \bar "||"
Note value: double length of @notation{breve}.
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-\relative c'' {
- \override NoteHead #'style = #'mensural
- g\longa g\breve
-}
+@lilypond[quote,notime,relative=2]
+\override NoteHead #'style = #'mensural
+g\longa g\breve
@end lilypond
Simple duple meter (F.J. Haydn, 1732-1809; or a Croatian folk tune):
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\relative c'' {
\time 2/4
\key g \major
Simple triple meter:
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\relative c'' {
\time 3/4
\key c \minor
Simple quadruple meter (French folk tune, @emph{Au clair de la lune}):
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\relative c'' {
\time 4/4
\key g \major
Simple quintuple meter (B. Marcello, 1686-1739):
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\relative c'' {
\time 5/4
\key c \major
Compound duple meter (unknown):
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\relative c' {
\time 6/8
\key f \major
Compound triple meter (J.S. Bach, 1685-1750):
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\relative c' {
\time 9/8
\key g \major
Compound quadruple meter (P. Yon, 1886-1943):
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\relative c' {
\time 12/8
\key e \major
First C below the 440 Hz A.
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,relative=1]
\override Staff.Clef #'full-size-change = ##t
-\relative c' {
- \clef bass c1 s
- \clef alto c s
- \clef treble c s
-}
+\clef bass c1 s
+\clef alto c s
+\clef treble c s
@end lilypond
The briefest intelligible and self-contained fragment of a musical
theme or subject.
-@lilypond[line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\score{
\relative c'' {
\set Score.implicitTimeSignatureVisibility = #all-invisible
FI: osa.
Greater musical works like @ref{symphony} and @ref{sonata} most often
-consist of several -- more or less -- independant pieces called
+consist of several -- more or less -- independent pieces called
movements.
measures) of the rest. The former style is called @q{Kirchenpausen} in
German, as a reminiscence of its use in Renaissance vocal polyphony.
-@lilypond[fragment,ragged-right]
-\relative c'' {
- a1
- \set Score.skipBars = ##t R1*3
- a1
- \set Score.skipBars = ##t R1*122
- a1
-}
+@lilypond[quote,relative=2]
+a1
+\set Score.skipBars = ##t
+R1*3
+a1
+\set Score.skipBars = ##t
+R1*122
+a1
@end lilypond
@c TODO -- add maxima to this example, in a way that doesn't break it.
-@lilypond[fragment,notime,line-width=13.0\cm]
-%\override Score.TextScript #'font-style = #'large
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
\relative c'' {
\override NoteHead #'style = #'mensural
a\longa_"longa" a\breve_"breve"
@c TODO -- add maxima rest to this example
-@lilypond[fragment,notime,line-width=13.0\cm]
-%\override Score.TextScript #'font-style = #'large
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
\relative c'' {
r\longa_"longa" r\breve_"breve"
r1_"1/1" r2_"1/2" r4_"1/4" s16 r8_"1/8" s16
An augmentation dot after a note multiplies the duration by one and a
half. Another dot adds yet a fourth of the duration.
-@lilypond[fragment,line-width=13.0\cm]
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,line-width=13.0\cm]
\relative c'' {
\time 4/4
g4._"pointed" g8 g2 | g4 ~ g8 g g2 \bar "||"
Subdivisions by@w{ }2 (@emph{duplets}) or@w{ }4 (@emph{quadruplets}) of
dotted notes are also frequently used.
-@lilypond[fragment,line-width=13.0\cm]
-%\override Score.TextScript #'font-style = #'large
+@lilypond[quote,line-width=13.0\cm]
\relative c'' {
\time 4/4
\times 2/3 {g8_"triplets" g g} g4 g8 g g4 \bar "||"
}
@end lilypond
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\relative c'' {
\time 3/4
\times 3/2 {g4_"duplets" g} |
note first while in the music from the preceding baroque and classic periods
the upper note is played first.
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
<<
\context Staff = sa {
-% \override Score.TextScript #'font-style = #'large
\relative c'' {
c2._"pre-1850" b4\trill | c1 \bar "||"
c2._"post-1850" b4\trill | c1 \bar "||"
the
@emph{prall} (inverted mordent).
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
<<
\context Staff = sa {
-% \override Score.TextScript #'font-style = #'large
\relative c'' {
a4_"turn" b\turn c2 \bar "||"
g4_"mordent" a b\mordent a \bar "||"
@end itemize
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=2,line-width=13.0\cm]
\time 4/4
-\relative c' {
- \repeat percent 4 { c4_"Beat (or slash) repeat" }
- \repeat percent 2 { c4 e g b_"Measure repeat" }
- \repeat percent 2 { c,2 es | f4 fis g c_"Multi-measure repeat" | }
-}
+\repeat percent 4 { c4_"Beat (or slash) repeat" }
+\repeat percent 2 { c4 e g b_"Measure repeat" }
+\repeat percent 2 { c,2 es | f4 fis g c_"Multi-measure repeat" | }
@end lilypond
Major and minor keys that have the same key signature.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c' {
- \key es \major
- es1_"e flat major" f g as bes c d es
- \bar "||"
-}
+@lilypond[quote,notime,relative=1,line-width=13.0\cm]
+\key es \major
+es1_"e flat major" f g as bes c d es
+\bar "||"
@end lilypond
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c' {
- \key c \minor
- c1_"c minor" d es f g a! b! c \bar "||"
-}
+@lilypond[quote,notime,relative=1,line-width=13.0\cm]
+\key c \minor
+c1_"c minor" d es f g a! b! c
+\bar "||"
@end lilypond
S: repris,
FI: toisto.
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,relative=2,line-width=13.0\cm]
\key g \major
\time 4/4
-\relative c'' {
- \repeat volta 2 {g4 g d' d | e e d2 | c4 c b b | a a g2 }
+\repeat volta 2 {
+ g4 g d' d
+ e4 e d2
+ c4 c b b
+ a a g2
}
@end lilypond
scale as roots of chords. The most important are degrees I = tonic
(T), IV = sub@-do@-mi@-nant (S) and V = dominant (D).
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
+@lilypond[quote,notime,line-width=13.0\cm]
<<
-\context Staff \relative c' {
+\new Staff \relative c' {
c1 d e f g a b c
}
\lyrics {
S: sekund,
FI: sekunti.
-The @ref{interval} between two neigbouring tones of a scale. A
+The @ref{interval} between two neighboring tones of a scale. A
@ref{diatonic scale} consists of alternating @ref{semitone}s and
-@ref{whole tone}s, hence the size of a se@-cond depends on the scale
+@ref{whole tone}s, hence the size of a second depends on the scale
degrees in question.
keyboard -- including black and white keys -- is a semitone. An octave may
be divided into 12@w{ }semitones.
-@lilypond[fragment,notime,line-width=13.0\cm]
-\set Score.automaticBars = ##f
-\relative c'' { g1 gis s a bes s b! c }
+@lilypond[quote,notime,relative=2,line-width=13.0\cm]
+g1 gis s a bes s b! c
@end lilypond
Playing the note(s) short. Staccato is indicated by a dot above or
below the note head.
-@lilypond[fragment,ragged-right]
+@lilypond[quote,relative=2]
\key d \major
\time 4/4
-\relative c'' {
- \partial 8 a8 |
- d4-\staccato cis-\staccato b-\staccato cis-\staccato |
- d2. \bar "||"
-}
+\partial 8 a8 |
+d4-\staccato cis-\staccato b-\staccato cis-\staccato |
+d2.
+\bar "||"
@end lilypond
@node staff
@section staff
+UK: stave,
ES: pentagrama,
I: pentagramma, rigo (musicale),
F: portée,
Vertical line above or below a @ref{note head} shorter than a
whole note.
-@ref{beam}.
-
-@lilypond[fragment,notime,line-width=13.0\cm]
+@lilypond[quote,notime,relative=2]
\set Score.autoBeaming = ##f
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c'' {
- g2_"1/2" g' s16
- g,4_"1/4" g' s16
- g,8_"1/8" g' s16
- g,16_"1/16" g' s16
-}
+g2_"1/2" g' s16
+g,4_"1/4" g' s16
+g,8_"1/8" g' s16
+g,16_"1/16" g' s16
@end lilypond
@seealso
-None yet.
+@ref{beam}.
@node stringendo
contradiction between the underlaying (normal) pulse and the actual
(abnormal) rhythm.
-@lilypond[fragment,ragged-right]
-\time 4/4
-\relative c' {
- \partial 4
- d8 dis |
- e c'4 e,8 c'4 e,8 c' ( | c2)
-}
+@lilypond[quote,relative=1]
+\time 2/4
+\partial 8 d16 dis
+e16 c'8 e,16 c'8 e,16 c' ~
+c4
@end lilypond
function of uniting them into a single sound (tone) equal to the
combined durations.
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-\relative c'' { g2 ~ g4. }
+@lilypond[quote,notime,relative=2]
+g2 ~ g4. r8
@end lilypond
Shifting a melody up or down in pitch, while keeping the same
relative pitches.
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\context Staff {
\time 3/4
\relative c'' {
}
@end lilypond
-@lilypond[fragment,line-width=13.0\cm]
+@lilypond[quote,line-width=13.0\cm]
\context Staff {
\time 3/4
\transpose c bes \relative c'' {
@end enumerate
-@lilypond[fragment,notime,ragged-right]
-\set Score.automaticBars = ##f
-%\override Score.TextScript #'font-style = #'large
-\relative c' {
- e2:32_"a"
- f:32 [ e8:16 f:16 g:16 a:16 ] s4
- \repeat tremolo 8 { e32_"b" g }
-}
+@lilypond[quote,notime,relative=1]
+e2:32_"a"
+f:32 [ e8:16 f:16 g:16 a:16 ] s4
+\repeat tremolo 8 { e32_"b" g }
@end lilypond
Override commands are often long and tedious to type, and they
have to be absolutely correct. If the same overrides are to be
used many times it may be worth defining variables to hold them.
+
Suppose we wish to emphasize certain words in lyrics by printing
them in bold italics. The @code{\italic} and @code{\bold}
-commands only work within lyrics if they are also embedded in
-@code{\markup}, which makes them tedious to enter, so as an
-alternative can we instead use the @code{\override} and
-@code{\revert} commands?
+commands only work within lyrics if they are embedded, together with
+the word or words to be modified, within a @code{\markup} block,
+which makes them tedious to enter. The need to embed the words
+themselves prevents their use in simple variables. As an
+alternative can we use @code{\override} and @code{\revert} commands?
@example
@code{\override Lyrics . LyricText #'font-shape = #'italic}
@end example
These would also be extremely tedious to enter if there were many
-words requiring emphasis. So instead we define these as two
-variables, and use them as follows, although normally we would
-perhaps choose shorter names for the variables to make them
-quicker to type:
+words requiring emphasis. But we @emph{can} define these as two
+variables and use those to bracket the words to be emphasized.
+Another advantage of using variables for these overrides is that
+the spaces around the dot are not necessary, since they are not
+being interpreted in @code{\lyricmode} directly. Here's an example
+of this, although in practice we would choose shorter names
+for the variables to make them quicker to type:
@cindex LyricText, example of overriding
@cindex font-shape property, example
@lilypond[quote,verbatim]
emphasize = {
- \override Lyrics . LyricText #'font-shape = #'italic
- \override Lyrics . LyricText #'font-series = #'bold
+ \override Lyrics.LyricText #'font-shape = #'italic
+ \override Lyrics.LyricText #'font-series = #'bold
}
normal = {
- \revert Lyrics . LyricText #'font-shape
- \revert Lyrics . LyricText #'font-series
+ \revert Lyrics.LyricText #'font-shape
+ \revert Lyrics.LyricText #'font-series
}
global = { \time 4/4 \partial 4 \key c \major}
\header {
lsrtags = "text"
+ texidoces = "
+Los textos independientes se pueden disponer en varias columnas
+utilizando instrucciones @code{\\markup}:
+
+"
+ doctitlees = "Elemento de marcado de texto independiente en dos columnas"
+
texidoc = "
Stand-alone text may be arranged in several columns using
@code{\\markup} commands:
-%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% Do not edit this file; it is auto-generated from input/new
%% This file is in the public domain.
-\version "2.11.64"
-
+\version "2.11.65"
\header {
lsrtags = "staff-notation"
-
texidoc = "
'Tick' bar lines are often used in music where the bar line is used
only for coordination and is not meant to imply any rhythmic stress.
-
-This snippet uses overrides for the @code{'bar-size} and
-@code{'extra-offset} properties of @code{BarLine} to determine,
-respectively, the tick size and its vertical placement.
-
"
doctitle = "Tick bar lines"
} % begin verbatim
-{
- % Use 'bar-size to control the height of the tick,
- % and 'extra-offset to determine its position.
- %
- % With 'extra-offset set to zero, the tick will be
- % centered around the middle line of the staff.
- %
- % Replace Staff.BarLine with Score.BarLine to
- % apply the method to the whole score.
-
- \override Staff.BarLine #'bar-size = #1
- \override Staff.BarLine #'extra-offset = #'(0 . 2)
-
- c'4 d' e' f'
- g'4 f' e' d'
- c'4 d' e' f'
- g'4 f' e' d'
-
- % Revert the overrides to get back a normal
- % bar line at the end.
-
- \revert Staff.BarLine #'bar-size
- \revert Staff.BarLine #'extra-offset
+\relative c' {
+ c4 d e f \bar "'"
+ g4 f e d \bar "'"
+ c4 d e f \bar "'"
+ g4 f e d
\bar "|."
}
--- /dev/null
+\version "2.11.65"
+\header {
+ lsrtags = "staff-notation"
+ texidoc = "
+'Tick' bar lines are often used in music where the bar line is used
+only for coordination and is not meant to imply any rhythmic stress.
+"
+ doctitle = "Tick bar lines"
+}
+\relative c' {
+ c4 d e f \bar "'"
+ g4 f e d \bar "'"
+ c4 d e f \bar "'"
+ g4 f e d
+ \bar "|."
+}
--- /dev/null
+
+\header { texidoc = "A ticked bar line is a short line of the same length as a
+ staff space, centered on the top-most barline." }
+
+\version "2.11.65"
+
+\paper { ragged-right = ##t }
+
+\relative \new StaffGroup <<
+ \new Staff {
+ c4 \bar "'" c }
+ \new Staff {
+ c c
+ }
+>>
+
--- /dev/null
+\version "2.11.49"
+
+stemLength = #(define-music-function (parser location length) (number?)
+ "Set the length of the next stem explicitly."
+ #{
+ \once \override Stem #'length-fraction = #$length
+ #}
+)
+
+{
+ \autoBeamOff
+ \time 3/8
+ \override Stem #'flag = #modern-straight-flag
+ \override Stem #'length-fraction = #'1.5
+ r8
+ \acciaccatura {
+ \stemDown
+ \slurUp
+ \stemLength #1
+ gis''8
+ \stemNeutral
+ } \stemLength #1.43 d'8 r16
+ \stemLength #0.95
+ \acciaccatura c''8
+ \stemLength #1.25
+ b'32 r
+ \bar"|.|"
+ \stemLength #1.25
+ <g! cis'>16 \stemLength #1.3 <f'! g''!>8
+}
\ No newline at end of file
--- /dev/null
+\version "2.11.57"
+
+\header {
+ texidoc = "Straight flag styles."
+}
+
+
+% test notes, which will be shown in different styles:
+testnotes = { \autoBeamOff c'8 d'16 c'32 d'64 \acciaccatura {c'8} d'64
+ c''8 d''16 c''32 d''64 \acciaccatura {\stemDown c''8 \stemNeutral} d''64 }
+
+{
+ \override Score.RehearsalMark #'self-alignment-X = #LEFT
+ \time 2/4
+ \mark "modern straight"
+ \override Stem #'flag = #modern-straight-flag
+ \testnotes
+
+ \mark "old straight (large angles)"
+ \override Stem #'flag = #old-straight-flag
+ \testnotes
+%
+% \mark "custom slant"
+% % Custom straight flag. The parameters are:
+% % flag thickness and spacing
+% % up-flag angle and length
+% % down-flag angle and length
+% \override Stem #'flag = #(straight-flag 0.35 0.8 -5 0.5 60 2.0)
+% \testnotes
+}
}
<<
- \chords {a2 a c c d}
+ \chords {a2 a c c c d}
\new Voice =mel {
\textLengthOn
(place-fret 2 5 4)
(place-fret 1 3 1)
(barre 5 1 3)) }}
- %% simple D chord
+
+
+ %% C major for guitar, with capo on third fret
+ % verbose style
+ c' ^\markup
+ \override #'(size . 1.1) { % 110% of default size
+ \override #'(fret-diagram-details . (
+ (dot-label-font-mag . 0.9)
+ (finger-code . in-dot)
+ (xo-font-magnification . 0.4)
+ (xo-padding . 0.3))) {
+ \fret-diagram-verbose #'((mute 6)
+ (capo 3)
+ (open 5)
+ (place-fret 4 5 1)
+ (place-fret 3 5 2)
+ (place-fret 2 5 3)
+ (open 1)) }}
+
+ %% simple D chord
d' ^\markup
\override #'(fret-diagram-details . (
% add a chord shape
-\version "2.11.56"
+\version "2.11.65"
-\addChordShape #'bes #"x;1-1-(;3-2;3-3;3-4;1-1-);"
+\addChordShape #'bes #guitar-tuning #"x;1-1-(;3-2;3-3;3-4;1-1-);"
% add chords
\storePredefinedDiagram \chordmode {bes}
#guitar-tuning
- #(chord-shape 'bes)
+ #(chord-shape 'bes guitar-tuning)
\storePredefinedDiagram \chordmode {c}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'bes))
+ #(offset-fret 2 (chord-shape 'bes guitar-tuning))
mychords = \chordmode {
bes
{
m = dashed_bar_line (me, h, hair);
}
+ else if (str == "'")
+ {
+ m = tick_bar_line (me, hair, h, rounded);
+ }
else if (str == ".")
{
m = dot;
Interval (-h / 2, h / 2)), blot);
}
+Stencil
+Bar_line::tick_bar_line (Grob *me, Real w, Real h, bool rounded)
+{
+ Real th = Staff_symbol_referencer::staff_space (me) / 2;
+ Real line_thick = Staff_symbol_referencer::line_thickness (me);
+
+ Real blot
+ = rounded
+ ? me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"))
+ : 0.0;
+
+ return Lookup::round_filled_box (Box (Interval (0, line_thick),
+ Interval (h / 2 - th, h / 2 + th)), blot);
+}
+
+
MAKE_SCHEME_CALLBACK (Bar_line, calc_bar_size, 1);
SCM
Bar_line::calc_bar_size (SCM smob)
DECLARE_GROB_INTERFACE();
static Stencil dashed_bar_line (Grob *me, Real h, Real thick);
+ static Stencil tick_bar_line (Grob *me, Real w, Real h, bool rounded);
static Stencil compound_barline (Grob *, string, Real height, bool rounded);
static Stencil simple_barline (Grob *, Real wid, Real height, bool rounded);
static Interval bar_y_extent (Grob *, Grob *);
protected:
void classic_output_aux (SCM output,
int *first_performance_number);
- void output_aux (SCM output_channel,
- bool is_last,
- int *first_page_number,
- int *first_performance_number);
+ int output_aux (SCM output_channel,
+ bool is_last,
+ int *first_page_number,
+ int *first_performance_number);
};
DECLARE_UNSMOB (Paper_book, paper_book)
static Moment when_mom (Grob *);
static bool is_used (Grob *);
static bool is_breakable (Grob *);
+ static bool is_extraneous_column_from_ligature (Grob *);
static Real minimum_distance (Grob *l, Grob *r);
static Interval break_align_width (Grob *me);
};
performances_ = scm_cons (s, performances_);
}
-void
+int
Paper_book::output_aux (SCM output_channel,
bool is_last,
int *first_page_number,
int *first_performance_number)
{
+ int page_nb = 0;
if (scm_is_pair (performances_))
{
SCM proc = ly_lily_module_constant ("write-performances-midis");
if (Paper_book *pbookpart = unsmob_paper_book (scm_car (p)))
{
bool is_last_part = (is_last && !scm_is_pair (scm_cdr (p)));
- pbookpart->output_aux (output_channel,
- is_last_part,
- first_page_number,
- first_performance_number);
+ page_nb += pbookpart->output_aux (output_channel,
+ is_last_part,
+ first_page_number,
+ first_performance_number);
}
}
else
{
if (scores_ == SCM_EOL)
- return;
+ return 0;
paper_->set_variable (ly_symbol2scm ("first-page-number"),
scm_long2num (*first_page_number));
paper_->set_variable (ly_symbol2scm ("is-last-bookpart"),
ly_bool2scm (is_last));
/* Generate all stencils to trigger font loads. */
- *first_page_number += scm_ilength (pages ());
+ page_nb = scm_ilength (pages ());
+ *first_page_number += page_nb;
}
+ return page_nb;
}
void
{
int first_page_number = robust_scm2int (paper_->c_variable ("first-page-number"), 1);
int first_performance_number = 0;
- output_aux (output_channel,
- true,
- &first_page_number,
- &first_performance_number);
-
+ if (!output_aux (output_channel,
+ true,
+ &first_page_number,
+ &first_performance_number))
+ return;
+
SCM scopes = SCM_EOL;
if (ly_is_module (header_))
scopes = scm_cons (header_, scopes);
if (Paper_book *pbookpart = unsmob_paper_book (scm_car (p)))
pages_ = scm_append_x (scm_list_2 (pages_, pbookpart->pages ()));
}
- else
+ else if (scm_is_pair (scores_))
{
SCM proc = paper_->c_variable ("page-breaking-wrapper");
pages_ = scm_apply_0 (proc, scm_list_1 (self_scm ()));
#include "output-def.hh"
#include "paper-score.hh"
#include "pointer-group-interface.hh"
+#include "rhythmic-head.hh"
#include "separation-item.hh"
#include "skyline-pair.hh"
#include "spaceable-grob.hh"
return SCM_UNSPECIFIED;
}
+/* FIXME: This is a hack that we use to identify columns that used to
+ contain note-heads but whose note-heads were moved by one of the ligature
+ engravers. Once the ligature engravers are fixed to behave nicely, this
+ function can be removed.
+*/
+bool
+Paper_column::is_extraneous_column_from_ligature (Grob *me)
+{
+ if (!is_musical (me))
+ return false;
+
+ // If all the note-heads that I think are my children actually belong
+ // to another column, then I am extraneous.
+ extract_grob_set (me, "elements", elts);
+ bool has_notehead = false;
+ for (vsize i = 0; i < elts.size (); i++)
+ {
+ if (Rhythmic_head::has_interface (elts[i]))
+ {
+ has_notehead = true;
+ if (dynamic_cast<Item*> (elts[i])->get_column () == me)
+ return false;
+ }
+ }
+ return has_notehead;
+}
+
ADD_INTERFACE (Paper_column,
"@code{Paper_column} objects form the top-most X@tie{}parents"
y[UP] += extra_height[UP];
if (!x.is_empty () && !y.is_empty ())
- out.push_back (Box (x, y));
+ out.push_back (Box (x, y));
}
return out;
Note that we don't actually pack things as tightly as possible:
we don't allow the next column to begin before this one ends.
*/
- spring.set_distance (max (left_col->extent (left_col, X_AXIS)[RIGHT],
- spring.min_distance ()));
+ /* FIXME: the else clause below is the "right" thing to do,
+ but we can't do it because of all the empty columns that the
+ ligature-engravers leave lying around. In that case, the extent of
+ the column is incorrect because it includes note-heads that aren't
+ there. We get around this by only including the column extent if
+ the left-hand column is "genuine". This is a dirty hack and it
+ should be fixed in the ligature-engravers. --jneem
+ */
+ if (Paper_column::is_extraneous_column_from_ligature (left_col))
+ spring.set_distance (spring.min_distance ());
+ else
+ spring.set_distance (max (left_col->extent (left_col, X_AXIS)[RIGHT],
+ spring.min_distance ()));
+
spring.set_inverse_stretch_strength (1.0);
}
type = "|.|";
else if (type == ":|.:")
type = "|.";
+ else if (type == "'")
+ type = "";
return ly_string2scm (type);
}
#(define fretboard-table (make-hash-table 100))
+#(define chord-shape-table (make-hash-table 100))
\include "scale-definitions-init.ly"
%%%%
%%%% (c) 2008 Carl D. Sorensen <c_sorensen@byu.edu>
-\version "2.11.56"
-
-%%%%% define storage structures
-
-% base-chord-shapes is an alist of chord shapes
-% in the form of fret-diagram-terse strings with
-% scheme symbols as keys. For convenience, the
-% symbols are LilyPond chordmode chord descriptions,
+\version "2.11.65"
+
+% chord-shape-table is a hash-table of chord shapes
+% in the form of diagram-descriptions that can be
+% fret-diagram-verbose markup-llsts or
+% fret-diagram-terse strings.
+% The hash keys are pairs of scheme symbols and
+% string tunings. For convenience, the symbols in
+% this file are LilyPond chordmode chord descriptions,
% but that is unnecessary.
-#(define base-chord-shapes '())
-
-
% music function for adding a chord shape to
-% base-chord-shapes
+% chord-shape-table
addChordShape =
-#(define-music-function (parser location key-symbol shape-string)
- (symbol? string?)
- "Add chord shape @code{shape-string} to the @code{base-chord-shapes}
-alist with the key @code{key-symbol}."
- (set! base-chord-shapes
- (acons key-symbol shape-string base-chord-shapes))
+#(define-music-function (parser location key-symbol tuning shape-definition)
+ (symbol? pair? string-or-pair?)
+ "Add chord shape @code{shape-definition} to the @code{chord-shape-table}
+hash with the key @code{(cons key-symbol tuning)}."
+ (hash-set! chord-shape-table
+ (cons key-symbol tuning)
+ shape-definition)
(make-music 'SequentialMusic 'void #t))
-% for convenience, to eliminate storage list in .ly references
-
-#(define (chord-shape shape-code)
- (get-chord-shape shape-code base-chord-shapes))
+#(define (chord-shape shape-code tuning)
+ (get-chord-shape shape-code tuning chord-shape-table))
% music function for adding a predefined diagram to
% fretboard-table
storePredefinedDiagram =
-#(define-music-function (parser location chord tuning terse-definition)
- (ly:music? list? string?)
- "Add predefined fret diagram defined by fret-diagram-terse definition
-string @code{terse-definition} for the chord pitches @code{chord} and
+#(define-music-function (parser location chord tuning diagram-definition)
+ (ly:music? pair? string-or-pair?)
+ "Add predefined fret diagram defined by @code{diagram-definition}
+for the chord pitches @code{chord} and
the stringTuning @code{tuning}."
(let* ((pitches (event-chord-pitches
(car (extract-named-music chord 'EventChord))))
- (hash-key (cons tuning pitches)))
+ (hash-key (cons tuning pitches))
+ (verbose-definition (if (string? diagram-definition)
+ (parse-terse-string diagram-definition)
+ diagram-definition)))
(hash-set! fretboard-table
hash-key
- (parse-terse-string terse-definition)))
+ verbose-definition))
(make-music 'SequentialMusic 'void #t))
\version "2.11.56"
-\addChordShape #'f #"1-1-(;3-3;3-4;2-2;1-1;1-1-);"
-\addChordShape #'f:m #"1-1-(;3-3;3-4;1-1;1-1;1-1-);"
-\addChordShape #'f:7 #"1-1-(;3-3;1-1;2-2;1-1;1-1-);"
-\addChordShape #'f:m7 #"1-1-(;3-3;1-1;1-1;1-1;1-1-);"
-\addChordShape #'bes #"x;1-1-(;3-2;3-3;3-4;1-1-);"
-\addChordShape #'bes:m #"x;1-1-(;3-3;3-4;2-2;1-1-);"
-\addChordShape #'bes:m7 #"x;1-1-(;3-3;1-1;2-2;1-1-);"
-\addChordShape #'bes:7 #"x;1-1-(;3-2;1-1;3-3;1-1-);"
-\addChordShape #'bes:maj7 #"x;1-1;3-3;2-2;3-4;x;"
-\addChordShape #'c:dim #"x;x;1-1;2-3;1-2;2-4;"
-\addChordShape #'c:aug #"x;x;2-2;1-1-(;1-1-);4-4;"
-\addChordShape #'cis #"x;x;3-3;1-1-(;2-2;1-1-);"
-\addChordShape #'ees:dim #"x;x;1-1;2-3;1-2;2-4;"
-\addChordShape #'a:dim #"x;x;1-1;2-3;1-2;2-4;"
+\addChordShape #'f #guitar-tuning #"1-1-(;3-3;3-4;2-2;1-1;1-1-);"
+\addChordShape #'f:m #guitar-tuning #"1-1-(;3-3;3-4;1-1;1-1;1-1-);"
+\addChordShape #'f:7 #guitar-tuning #"1-1-(;3-3;1-1;2-2;1-1;1-1-);"
+\addChordShape #'f:m7 #guitar-tuning #"1-1-(;3-3;1-1;1-1;1-1;1-1-);"
+\addChordShape #'bes #guitar-tuning #"x;1-1-(;3-2;3-3;3-4;1-1-);"
+\addChordShape #'bes:m #guitar-tuning #"x;1-1-(;3-3;3-4;2-2;1-1-);"
+\addChordShape #'bes:m7 #guitar-tuning #"x;1-1-(;3-3;1-1;2-2;1-1-);"
+\addChordShape #'bes:7 #guitar-tuning #"x;1-1-(;3-2;1-1;3-3;1-1-);"
+\addChordShape #'bes:maj7 #guitar-tuning #"x;1-1;3-3;2-2;3-4;x;"
+\addChordShape #'c:dim #guitar-tuning #"x;x;1-1;2-3;1-2;2-4;"
+\addChordShape #'c:aug #guitar-tuning #"x;x;2-2;1-1-(;1-1-);4-4;"
+\addChordShape #'cis #guitar-tuning #"x;x;3-3;1-1-(;2-2;1-1-);"
+\addChordShape #'ees:dim #guitar-tuning #"x;x;1-1;2-3;1-2;2-4;"
+\addChordShape #'a:dim #guitar-tuning #"x;x;1-1;2-3;1-2;2-4;"
%%% Add predefined chords
#"x;3-3;2-2;o;1-1;o;"
\storePredefinedDiagram \chordmode {c:m}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'bes:m))
+ #(offset-fret 2 (chord-shape 'bes:m guitar-tuning))
\storePredefinedDiagram \chordmode {c:aug}
#guitar-tuning
- #(chord-shape 'c:aug)
+ #(chord-shape 'c:aug guitar-tuning)
\storePredefinedDiagram \chordmode {c:dim}
#guitar-tuning
- #(chord-shape 'c:dim)
+ #(chord-shape 'c:dim guitar-tuning)
\storePredefinedDiagram \chordmode {c:7}
#guitar-tuning
#"o;3-3;2-2;3-4;1-1;o;"
#"x;3-3;2-2;o;o;o;"
\storePredefinedDiagram \chordmode {c:m7}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'bes:m7))
+ #(offset-fret 2 (chord-shape 'bes:m7 guitar-tuning))
%%%% cis chords
%
\storePredefinedDiagram \chordmode {cis}
#guitar-tuning
- #(chord-shape 'cis)
+ #(chord-shape 'cis guitar-tuning)
\storePredefinedDiagram \chordmode {cis:m}
#guitar-tuning
#"x;x;2-2;1-1;2-3;o;"
#"x;4-4;3-3;2-1;2-2;x;"
\storePredefinedDiagram \chordmode {cis:dim}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'c:dim))
+ #(offset-fret 1 (chord-shape 'c:dim guitar-tuning))
\storePredefinedDiagram \chordmode {cis:7}
#guitar-tuning
#"x;x;3-2;4-3;2-1;4-4;"
#"x;4-4;3-3;2-1;2-2;x;"
\storePredefinedDiagram \chordmode {des:dim}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'c:dim))
+ #(offset-fret 1 (chord-shape 'c:dim guitar-tuning))
\storePredefinedDiagram \chordmode {des:7}
#guitar-tuning
#"x;x;3-2;4-3;2-1;4-4;"
%
\storePredefinedDiagram \chordmode {dis}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'cis))
+ #(offset-fret 2 (chord-shape 'cis guitar-tuning))
\storePredefinedDiagram \chordmode {dis:m}
#guitar-tuning
#"x;x;4-3;3-2;4-4;1-1;"
#"3-3;2-2;1-1;o;o;3-4"
\storePredefinedDiagram \chordmode {dis:dim}
#guitar-tuning
- #(chord-shape 'ees:dim)
+ #(chord-shape 'ees:dim guitar-tuning)
\storePredefinedDiagram \chordmode {dis:7}
#guitar-tuning
#"x;x;1-1;3-3;2-2;3-4;"
%
\storePredefinedDiagram \chordmode {ees}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'cis))
+ #(offset-fret 2 (chord-shape 'cis guitar-tuning))
\storePredefinedDiagram \chordmode {ees:m}
#guitar-tuning
#"x;x;4-3;3-2;4-4;1-1;"
#"3-3;2-2;1-1;o;o;3-4"
\storePredefinedDiagram \chordmode {ees:dim}
#guitar-tuning
- #(chord-shape 'ees:dim)
+ #(chord-shape 'ees:dim guitar-tuning)
\storePredefinedDiagram \chordmode {ees:7}
#guitar-tuning
#"x;x;1-1;3-3;2-2;3-4;"
#"o;3-3;2-2;1-1;x;x;"
\storePredefinedDiagram \chordmode {e:dim}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'ees:dim))
+ #(offset-fret 1 (chord-shape 'ees:dim guitar-tuning))
\storePredefinedDiagram \chordmode {e:7}
#guitar-tuning
#"o;2-2;o;1-1;o;o;"
%
\storePredefinedDiagram \chordmode {f}
#guitar-tuning
- #(chord-shape 'f)
+ #(chord-shape 'f guitar-tuning)
\storePredefinedDiagram \chordmode {f:m}
#guitar-tuning
- #(chord-shape 'f:m)
+ #(chord-shape 'f:m guitar-tuning)
\storePredefinedDiagram \chordmode {f:aug}
#guitar-tuning
#"x;x;1-1;4-3;4-4;3-2;"
#"x;x;o;1-1;o;1-2;"
\storePredefinedDiagram \chordmode {f:7}
#guitar-tuning
- #(chord-shape 'f:7)
+ #(chord-shape 'f:7 guitar-tuning)
\storePredefinedDiagram \chordmode {f:maj7}
#guitar-tuning
#"x;3-3;3-4;2-2;1-1;"
\storePredefinedDiagram \chordmode {f:m7}
#guitar-tuning
- #(chord-shape 'f:m7)
+ #(chord-shape 'f:m7 guitar-tuning)
%%%% fis chords
%
\storePredefinedDiagram \chordmode {fis}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f))
+ #(offset-fret 1 (chord-shape 'f guitar-tuning))
\storePredefinedDiagram \chordmode {fis:m}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f:m))
+ #(offset-fret 1 (chord-shape 'f:m guitar-tuning))
\storePredefinedDiagram \chordmode {fis:aug}
#guitar-tuning
#"2-2;1-1;o;3-4-(;3-4-);2-3;"
#"x;x;1-1;2-3;1-2;2-4;"
\storePredefinedDiagram \chordmode {fis:7}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f:7))
+ #(offset-fret 1 (chord-shape 'f:7 guitar-tuning))
\storePredefinedDiagram \chordmode {fis:maj7}
#guitar-tuning
#"x;x;4-4;3-3;2-2;1-1;"
\storePredefinedDiagram \chordmode {fis:m7}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f:m7))
+ #(offset-fret 1 (chord-shape 'f:m7 guitar-tuning))
%%%% ges chords
%
\storePredefinedDiagram \chordmode {ges}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f))
+ #(offset-fret 1 (chord-shape 'f guitar-tuning))
\storePredefinedDiagram \chordmode {ges:m}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f:m))
+ #(offset-fret 1 (chord-shape 'f:m guitar-tuning))
\storePredefinedDiagram \chordmode {ges:aug}
#guitar-tuning
#"2-2;1-1;o;3-4-(;3-4-);2-3;"
#"x;x;1-1;2-3;1-2;2-4;"
\storePredefinedDiagram \chordmode {ges:7}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f:7))
+ #(offset-fret 1 (chord-shape 'f:7 guitar-tuning))
\storePredefinedDiagram \chordmode {ges:maj7}
#guitar-tuning
#"x;x;4-4;3-3;2-2;1-1;"
\storePredefinedDiagram \chordmode {ges:m7}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f:m7))
+ #(offset-fret 1 (chord-shape 'f:m7 guitar-tuning))
%%%% g chords
%
#"3-2;2-1;o;o;o;3-3;"
\storePredefinedDiagram \chordmode {g:m}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'f:m))
+ #(offset-fret 2 (chord-shape 'f:m guitar-tuning))
\storePredefinedDiagram \chordmode {g:aug}
#guitar-tuning
#"x;x;5-1;8-3;8-4;7-2;"
#"x;x;5-4;4-3;3-2;2-1;"
\storePredefinedDiagram \chordmode {g:m7}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'f:m7))
+ #(offset-fret 2 (chord-shape 'f:m7 guitar-tuning))
%%%% gis chords
%
\storePredefinedDiagram \chordmode {gis}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f))
+ #(offset-fret 3 (chord-shape 'f guitar-tuning))
\storePredefinedDiagram \chordmode {gis:m}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f:m))
+ #(offset-fret 3 (chord-shape 'f:m guitar-tuning))
\storePredefinedDiagram \chordmode {gis:aug}
#guitar-tuning
#"o;3-4;2-3;1-1;1-2;o;"
#"x;x;o;1-1;o;1-2;"
\storePredefinedDiagram \chordmode {gis:7}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f:7))
+ #(offset-fret 3 (chord-shape 'f:7 guitar-tuning))
\storePredefinedDiagram \chordmode {gis:maj7}
#guitar-tuning
#"x;x;1-1-(;1-1;1-1-);3-3;"
\storePredefinedDiagram \chordmode {gis:m7}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f:m7))
+ #(offset-fret 3 (chord-shape 'f:m7 guitar-tuning))
%%%% aes chords
%
\storePredefinedDiagram \chordmode {aes}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f))
+ #(offset-fret 3 (chord-shape 'f guitar-tuning))
\storePredefinedDiagram \chordmode {aes:m}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f:m))
+ #(offset-fret 3 (chord-shape 'f:m guitar-tuning))
\storePredefinedDiagram \chordmode {aes:aug}
#guitar-tuning
#"o;3-4;2-3;1-1;1-2;o;"
#"x;x;o;1-1;o;1-2;"
\storePredefinedDiagram \chordmode {aes:7}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f:7))
+ #(offset-fret 3 (chord-shape 'f:7 guitar-tuning))
\storePredefinedDiagram \chordmode {aes:maj7}
#guitar-tuning
#"x;x;1-1-(;1-1;1-1-);3-3;"
\storePredefinedDiagram \chordmode {aes:m7}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f:m7))
+ #(offset-fret 3 (chord-shape 'f:m7 guitar-tuning))
%%%% a chords
%
#"x;o;3-4;2-2;2-3;1-1;"
\storePredefinedDiagram \chordmode {a:dim}
#guitar-tuning
- #(chord-shape 'a:dim)
+ #(chord-shape 'a:dim guitar-tuning)
\storePredefinedDiagram \chordmode {a:7}
#guitar-tuning
#"x;o;2-1;o;2-3;o;"
%
\storePredefinedDiagram \chordmode {ais}
#guitar-tuning
- #(chord-shape 'bes)
+ #(chord-shape 'bes guitar-tuning)
\storePredefinedDiagram \chordmode {ais:m}
#guitar-tuning
- #(chord-shape 'bes:m)
+ #(chord-shape 'bes:m guitar-tuning)
\storePredefinedDiagram \chordmode {ais:aug}
#guitar-tuning
#"2-2;1-1;o;3-4-(;3-4-);2-3;"
\storePredefinedDiagram \chordmode {ais:dim}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'a:dim))
+ #(offset-fret 1 (chord-shape 'a:dim guitar-tuning))
\storePredefinedDiagram \chordmode {ais:7}
#guitar-tuning
- #(chord-shape 'bes:7)
+ #(chord-shape 'bes:7 guitar-tuning)
\storePredefinedDiagram \chordmode {ais:maj7}
#guitar-tuning
#"x;1-1;3-3;2-2;3-4;x;"
\storePredefinedDiagram \chordmode {ais:m7}
#guitar-tuning
- #(chord-shape 'bes:m7)
+ #(chord-shape 'bes:m7 guitar-tuning)
%%%% bes chords
%
\storePredefinedDiagram \chordmode {bes}
#guitar-tuning
- #(chord-shape 'bes)
+ #(chord-shape 'bes guitar-tuning)
\storePredefinedDiagram \chordmode {bes:m}
#guitar-tuning
- #(chord-shape 'bes:m)
+ #(chord-shape 'bes:m guitar-tuning)
\storePredefinedDiagram \chordmode {bes:aug}
#guitar-tuning
#"2-2;1-1;o;3-4-(;3-4-);2-3;"
\storePredefinedDiagram \chordmode {bes:dim}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'a:dim))
+ #(offset-fret 1 (chord-shape 'a:dim guitar-tuning))
\storePredefinedDiagram \chordmode {bes:7}
#guitar-tuning
- #(chord-shape 'bes:7)
+ #(chord-shape 'bes:7 guitar-tuning)
\storePredefinedDiagram \chordmode {bes:maj7}
#guitar-tuning
#"x;1-1;3-3;2-2;3-4;x;"
\storePredefinedDiagram \chordmode {bes:m7}
#guitar-tuning
- #(chord-shape 'bes:m7)
+ #(chord-shape 'bes:m7 guitar-tuning)
%%%% b chords
%
\storePredefinedDiagram \chordmode {b}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'bes))
+ #(offset-fret 1 (chord-shape 'bes guitar-tuning))
\storePredefinedDiagram \chordmode {b:m}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'bes:m))
+ #(offset-fret 1 (chord-shape 'bes:m guitar-tuning))
\storePredefinedDiagram \chordmode {b:aug}
#guitar-tuning
#"x;3-2;2-1;o;o;x;"
#"x;x;o;1-1;o;1-2;"
\storePredefinedDiagram \chordmode {b:7}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'bes:7))
+ #(offset-fret 1 (chord-shape 'bes:7 guitar-tuning))
\storePredefinedDiagram \chordmode {b:maj7}
#guitar-tuning
#"x;2-1;4-3;3-2;4-4;x;"
\storePredefinedDiagram \chordmode {b:m7}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'bes:m7))
+ #(offset-fret 1 (chord-shape 'bes:m7 guitar-tuning))
%
-\addChordShape #'c:9 #"x;3-2;2-1;3-3-(;3-3;3-3-);"
-\addChordShape #'f:9 #"1-1-(;3-3;1-1;2-2;1-1-);3-4;"
+\addChordShape #'c:9 #guitar-tuning #"x;3-2;2-1;3-3-(;3-3;3-3-);"
+\addChordShape #'f:9 #guitar-tuning #"1-1-(;3-3;1-1;2-2;1-1-);3-4;"
\storePredefinedDiagram \chordmode {c:9}
#guitar-tuning
- #(chord-shape 'c:9)
+ #(chord-shape 'c:9 guitar-tuning)
\storePredefinedDiagram \chordmode {cis:9}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'c:9))
+ #(offset-fret 1 (chord-shape 'c:9 guitar-tuning))
\storePredefinedDiagram \chordmode {des:9}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'c:9))
+ #(offset-fret 1 (chord-shape 'c:9 guitar-tuning))
\storePredefinedDiagram \chordmode {d:9}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'c:9))
+ #(offset-fret 2 (chord-shape 'c:9 guitar-tuning))
\storePredefinedDiagram \chordmode {dis:9}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'c:9))
+ #(offset-fret 3 (chord-shape 'c:9 guitar-tuning))
\storePredefinedDiagram \chordmode {ees:9}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'c:9))
+ #(offset-fret 3 (chord-shape 'c:9 guitar-tuning))
\storePredefinedDiagram \chordmode {e:9}
#guitar-tuning
#"o;2-2;o;1-1;o;2-3;"
\storePredefinedDiagram \chordmode {f:9}
#guitar-tuning
- #(chord-shape 'f:9)
+ #(chord-shape 'f:9 guitar-tuning)
\storePredefinedDiagram \chordmode {fis:9}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f:9))
+ #(offset-fret 1 (chord-shape 'f:9 guitar-tuning))
\storePredefinedDiagram \chordmode {ges:9}
#guitar-tuning
- #(offset-fret 1 (chord-shape 'f:9))
+ #(offset-fret 1 (chord-shape 'f:9 guitar-tuning))
\storePredefinedDiagram \chordmode {g:9}
#guitar-tuning
- #(offset-fret 2 (chord-shape 'f:9))
+ #(offset-fret 2 (chord-shape 'f:9 guitar-tuning))
\storePredefinedDiagram \chordmode {gis:9}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f:9))
+ #(offset-fret 3 (chord-shape 'f:9 guitar-tuning))
\storePredefinedDiagram \chordmode {aes:9}
#guitar-tuning
- #(offset-fret 3 (chord-shape 'f:9))
+ #(offset-fret 3 (chord-shape 'f:9 guitar-tuning))
\storePredefinedDiagram \chordmode {a:9}
#guitar-tuning
- #(offset-fret 4 (chord-shape 'f:9))
+ #(offset-fret 4 (chord-shape 'f:9 guitar-tuning))
\storePredefinedDiagram \chordmode {ais:9}
#guitar-tuning
- #(offset-fret 5 (chord-shape 'f:9))
+ #(offset-fret 5 (chord-shape 'f:9 guitar-tuning))
\storePredefinedDiagram \chordmode {bes:9}
#guitar-tuning
- #(offset-fret 5 (chord-shape 'f:9))
+ #(offset-fret 5 (chord-shape 'f:9 guitar-tuning))
\storePredefinedDiagram \chordmode {b:9}
#guitar-tuning
- #(offset-fret -1 (chord-shape 'c:9))
+ #(offset-fret -1 (chord-shape 'c:9 guitar-tuning))
fet_begingroup ("accidentals");
+%
+% Draw an arrow
+%
+% * `stemslant' gives the direction of the stem's left boundary
+% (needed for brushed stems, equals "up" for straight stems)
+% * `extend' is used to make the stem longer or shorter (if negative);
+% different kinds of accidentals need different values here
+%
+def draw_arrow (expr attach, stemwidth, stemslant, extend, pointingdown) =
+begingroup;
+ save htip; % tip height
+ save wwing; % wing `radius'
+ save angle_wing_bot, angle_wing_top, angle_tip;
+ save upshift;
+ clearxy;
+
+ wwing := 0.26 stemwidth;
+ htip := staff_space * 0.85 + stafflinethickness - wwing;
+
+ % `flip' is used to reflect the arrow vertically
+ % if arrow points downward
+ transform flip;
+ if pointingdown:
+ flip = identity reflectedabout (origin, right);
+ else:
+ flip = identity;
+ fi;
+
+ z1 = attach shifted (-stemwidth / 2, 0);
+ upshift := max (0, wwing + 0.1 staff_space + extend);
+ z2 = z1 shifted (((unitvector stemslant)
+ scaled upshift) transformed flip);
+
+ z7 = attach shifted ((stemwidth/2),0);
+ z6 = z7 shifted (((unitvector (-xpart stemslant, ypart stemslant))
+ scaled upshift) transformed flip);
+ z2 - z3 = ( 0.38 staff_space, 0.05 htip) transformed flip;
+ z6 - z5 = (-0.38 staff_space, 0.05 htip) transformed flip;
+
+ z4 = attach shifted ((-0.2 stemwidth, upshift + htip)
+ transformed flip);
+ z4'= attach shifted (( 0.2 stemwidth, upshift + htip)
+ transformed flip);
+
+ % `angle_wing_bot' is the angle at which the arc
+ % from z2 to z3a enters z3a
+ % `angle_wing_top' is the angle at which the arc
+ % from z3b to z4 leaves z3b
+ % `angle_tip' is the angle at which the arc
+ % from z4 to z4' leaves z4
+ angle_wing_bot = 30;
+ angle_wing_top = 55;
+ angle_tip = 68;
+
+ z3a = z3 shifted ((((dir angle_wing_bot) rotated -90)
+ scaled wwing) transformed flip);
+ z3b = z3 shifted ((((dir angle_wing_top) rotated 90)
+ scaled wwing) transformed flip);
+
+ z5a = z5 shifted ((((dir (180 - angle_wing_bot)) rotated 90)
+ scaled wwing) transformed flip);
+ z5b = z5 shifted ((((dir (180 - angle_wing_top)) rotated -90)
+ scaled wwing) transformed flip);
+
+ % Draw the arrow
+ pickup pencircle scaled 1;
+ fill z1
+ -- z2{stemslant transformed flip}
+ .. {(-dir angle_wing_bot) transformed flip}z3a
+ .. z3b{(dir angle_wing_top) transformed flip}
+ .. z4{(dir angle_tip) transformed flip}
+ .. z4'{(dir (-angle_tip)) transformed flip}
+ .. {(dir (-angle_wing_top)) transformed flip}z5b
+ .. z5a{(-dir (-angle_wing_bot)) transformed flip}
+ .. z6{((-stemslant) reflectedabout (origin, up)) transformed flip}
+ -- z7
+ -- cycle;
+
+ labels (range 0 thru 7, 4', 3a, 3b, 5a, 5b);
+endgroup;
+enddef;
save remember_pic;
picture remember_pic;
enddef;
-fet_beginchar ("Sharp", "sharp");
+def draw_sharp(expr arrowup, arrowdown) =
save stem, stemx, stemwidth;
save outer_space, interbeam;
+ save stemlength, extendleft, extendright, height, depth;
stemwidth# := stafflinethickness# + .05 staff_space#;
define_whole_blacker_pixels (stemwidth);
interbeam := 1.05 staff_space_rounded;
- set_char_box (0, 1.1 staff_space#,
- 1.5 staff_space#, 1.5 staff_space#);
+ stemlength# := 1.5 staff_space#;
+ define_pixels (stemlength);
+
+ height# = stemlength#;
+ depth# = stemlength#;
+ extendright# = 0;
+ extendleft# = 0;
+ if arrowup:
+ height# := height# + 1.2 staff_space#;
+ extendright# := extendright# + 1.5 stafflinethickness#;
+ fi;
+ if arrowdown:
+ depth# := depth# + 1.2 staff_space#;
+ extendleft# := extendleft# + 1.5 stafflinethickness#;
+ fi;
+ define_pixels (extendleft, extendright);
+ set_char_box (extendleft#, 1.1 staff_space#, depth#, height#);
stem := 7 / 16 * w;
stemx := hround stem;
draw_meta_sharp (w, -.5 interbeam);
draw_meta_sharp (w, -.5 interbeam + vround interbeam);
+ % expand the charbox so that it encloses the whole arrow;
+ % this must not happen earlier because some commands above
+ % still rely on the old width
+ w := w + extendright;
+
pickup pencircle scaled stemwidth;
lft x5 = lft x6 = outer_space;
lft x7 = lft x8 = outer_space + stemx;
- bot y5 = -d;
+ bot y5 = -stemlength;
top y6 = vround (1.5 staff_space - stem * beamslope);
bot y7 = -top y6 + feta_space_shift;
- top y8 = h;
+ top y8 = stemlength;
- labels (5, 6, 7, 8);
+ labels (5, 6, 7, 8);
draw_gridline (z5, z6, stemwidth);
draw_gridline (z7, z8, stemwidth);
+ if arrowup:
+ draw_arrow (z8, stemwidth, up,
+ stafflinethickness / 2 + stemwidth / 2, false);
+ fi;
+ if arrowdown:
+ draw_arrow (z5, stemwidth, up,
+ stafflinethickness / 2 + stemwidth / 2, true);
+ fi;
+
remember_pic := currentpicture;
draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("Sharp", "sharp");
+ draw_sharp (false, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrow up)", "sharp.arrowup");
+ draw_sharp (true, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrow down)", "sharp.arrowdown");
+ draw_sharp (false, true);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Sharp (arrows up and down)", "sharp.arrowboth");
+ draw_sharp (true, true);
fet_endchar;
% The stems of the natural are brushed (at least, in Barenreiter SCS)
%
-fet_beginchar ("Natural", "natural");
+def draw_natural (expr arrowup, arrowdown) =
save stemwidth, top_stem_thick;
save ne, pat_top, pat_bottom;
+ save depth, height, extendleft, extendright, stemlength;
+ save brush_scale_up, brush_scale_down;
pair ne;
path pat_top, pat_bottom;
stemwidth# = 0.09 staff_space# + .5 stafflinethickness#;
define_whole_blacker_pixels (top_stem_thick, stemwidth);
- set_char_box (0, 2/3 staff_space#,
- 1.5 staff_space#, 1.5 staff_space#);
+ stemlength# = 1.5 staff_space#;
+ define_pixels (stemlength);
+
+ height# = stemlength#;
+ depth# = stemlength#;
+ extendleft# = 0;
+ extendright# = 0;
+ if arrowup:
+ extendleft# := 3 stafflinethickness#;
+ height# := height# + 1.2 staff_space#;
+ fi;
+ if arrowdown:
+ extendright# := 3.15 stafflinethickness#;
+ depth# := depth# + 1.2 staff_space#;
+ fi;
+ define_pixels (extendright);
+
+ set_char_box (extendleft#, 2/3 staff_space#, depth#, height#);
d := d - feta_space_shift;
pickup pencircle scaled stemwidth;
+ brush_scale_up := 1.0;
+ brush_scale_down := 1.0;
+ % to look nice, arrowed stems must be less brushed
+ if arrowup:
+ brush_scale_up := 0.85;
+ fi;
+ if arrowdown:
+ brush_scale_down := 0.85;
+ fi;
+
penpos1 (top_stem_thick, 0);
penpos3 (top_stem_thick, 0);
penpos2 (stemwidth, 0);
penpos4 (stemwidth, 0);
+ % z1' and z3' are needed for the arrowed accidentals
+ penpos1' (top_stem_thick * brush_scale_up, 0);
+ penpos3' (top_stem_thick * brush_scale_down, 0);
x2r = w;
x4l = 0;
- x3 = x2;
- x1 = x4;
+ x3 = x3' = x2;
+ x1 = x1' = x4;
- y1 = h;
- y3 = -d;
+ y1 = y1' = stemlength;
+ y3 = y3' = -stemlength;
top y2 = vround (staff_space - 3/2 stafflinethickness);
y4 = -y2 + feta_space_shift;
pat_bottom := z4r{z4r - z1r}
.. bot z4
.. z4l{z1l - z4l};
- fill simple_serif (z1l, z1r, -30)
+ fill simple_serif (z1'l, z1'r, -30)
-- pat_bottom
-- cycle;
pat_top := z2r{z2r - z3r}
.. top z2
.. z2l{z3l - z2l};
- fill simple_serif (z3l, z3r, 30)
+ fill simple_serif (z3'l, z3'r, 30)
-- pat_top
-- cycle;
-- z24
-- cycle;
- penlabels (1, 2, 3, 4);
+ penlabels (1, 1', 2, 3, 3', 4);
labels (11, 11', 12, 13, 14, 21, 21', 22, 23, 24);
+ if arrowup:
+ draw_arrow (z1, top_stem_thick * brush_scale_up,
+ z1'l - z4l, stafflinethickness / 2, false);
+ fi;
+ if arrowdown:
+ draw_arrow (z3, top_stem_thick * brush_scale_down,
+ z2r - z3'r, stafflinethickness / 2, true);
+ w := w + extendright;
+ fi;
+
remember_pic := currentpicture;
draw_staff (-2, 2, 0);
+enddef;
+
+
+fet_beginchar ("Natural", "natural");
+ draw_natural (false, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrow up)", "natural.arrowup");
+ draw_natural (true, false);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrow down)", "natural.arrowdown");
+ draw_natural (false, true);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Natural (arrows up and down)", "natural.arrowboth");
+ draw_natural (true, true);
fet_endchar;
% TODO: document, simplify!
%
-def draw_meta_flat (expr xcenter, w, crook_fatness) =
+def draw_meta_flat (expr xcenter, w, crook_fatness, arrowup, arrowdown) =
save crook_thinness;
save bottom_overshoot, bot_crook_dir;
- save top_stem_thick, bottom_stem_thick, hair, smaller_hole;
+ save top_stem_thick, top_stem_thick_orig;
+ save bottom_stem_thick, hair, smaller_hole;
save top_crook_thinness;
save zwiep;
save center;
pair center, bot_crook_dir;
- save clearing;
+ save clearing, clearing_orig;
clearxy;
else:
smaller_hole = 0;
fi;
- clearing = 1.7 stafflinethickness;
crook_thinness = .7 stafflinethickness + .06 staff_space;
top_crook_thinness = 1 stafflinethickness + .065 staff_space;
+ clearing = 1.7 stafflinethickness;
+ clearing_orig = clearing;
+ if arrowup:
+ clearing := 0.5 staff_space;
+ fi;
bottom_overshoot = stafflinethickness;
bottom_stem_thick# = 0.06 staff_space# + 0.6 stafflinethickness#;
top_stem_thick# = 0.1 staff_space# + 1.2 stafflinethickness#;
- define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick);
+ top_stem_thick_orig# = top_stem_thick#;
+ if arrowup:
+ % to look nice, arrowed stems should be less brushed
+ top_stem_thick# := top_stem_thick# * 0.8;
+ fi;
+ define_whole_blacker_pixels (bottom_stem_thick, top_stem_thick,
+ top_stem_thick_orig);
if odd (top_stem_thick - bottom_stem_thick):
top_stem_thick := top_stem_thick - 1;
fi;
+ if odd (top_stem_thick_orig - bottom_stem_thick):
+ top_stem_thick_orig := top_stem_thick_orig - 1;
+ fi;
center = (xcenter, 0);
y1 = vround (2 staff_space - clearing);
x2l = hround (xcenter - .5 bottom_stem_thick);
y2 = -.5 staff_space - .5 stafflinethickness;
+ % z16 and the `*_orig' variables are needed for arrowed accidentals
+ % because their inner part should be unchanged from plain ones but
+ % the points z3l, z3r, and z10 depend on values that are different
+ % for arrowed accidentals
+ x16l = hround (xcenter -.5 top_stem_thick_orig);
+ y16 = vround (2 staff_space - clearing_orig);
penpos1 (top_stem_thick, 0);
+ penpos16 (top_stem_thick_orig, 0);
penpos2 (bottom_stem_thick, 0);
y3l = vfloor ((staff_space - stafflinethickness) / 2);
z3l = whatever [z2r, z1r];
- z3r = .3 [z2r, z1r] + (smaller_hole, 0);
+ z3r = .3 [z2r,
+ (z16r shifted (0, clearing_orig - 1.7 stafflinethickness))]
+ + (smaller_hole, 0);
x3r := hceiling x3r;
% we insert z3l to get better conversion with mf2pt1
-- z3l
-- cycle;
- z10 = whatever [z2r, z1r] + (smaller_hole, 0);
+ z10 = whatever [z2r, z16r] + (smaller_hole, 0);
y10 = -1/10 staff_space;
x10 := hceiling x10;
y11 = -vround (.5 (staff_space + stafflinethickness)
+ bottom_overshoot);
+ x2a = 0.2[x2r, x7];
+ y2a = 1.5[y2, y11];
+
penpos4 (whatever, 53);
y4l - y4r = top_crook_thinness;
.. z10{z3r - z10}
-- cycle;
- fill z2l{down}
- .. z11{right}
- .. z8{bot_crook_dir}
- .. z5l{up}
- .. z4l{left}
- .. z3l
- -- cycle;
+ if arrowdown:
+ fill z2l{down}
+ .. z2a{up}
+ .. z8{bot_crook_dir}
+ .. z5l{up}
+ .. z4l{left}
+ .. z3l
+ -- cycle;
+ else:
+ fill z2l{down}
+ .. z11{right}
+ .. z8{bot_crook_dir}
+ .. z5l{up}
+ .. z4l{left}
+ .. z3l
+ -- cycle;
+ fi;
+
+ if arrowup:
+ draw_arrow (z1, top_stem_thick, z1l - z2l,
+ 0.5 stafflinethickness, false);
+ fi;
+ if arrowdown:
+ draw_arrow ((0.5 [x2l, x2a], y2), x2a - x2l, up,
+ staff_space / 2, true);
+ fi;
enddef;
+def draw_arrowed_meta_flat (expr xcenter, width, crook_fatness,
+ arrowup, arrowdown) =
+ save depth, height, extendleft;
+
+ depth# = 0.6 staff_space#;
+ height# = 1.9 staff_space#;
+ extendleft# := 1.2 stafflinethickness#;
+ if arrowup:
+ extendleft# := 3.45 stafflinethickness#;
+ height# := height# + 0.8 staff_space#;
+ fi;
+ if arrowdown:
+ extendleft# := 3.45 stafflinethickness#;
+ depth# := depth# + 1.6 staff_space#;
+ fi;
+
+ set_char_box (extendleft#, width, depth#, height#);
+ draw_meta_flat(xcenter, w, crook_fatness, arrowup, arrowdown);
+enddef;
+
%
% unfortunately, 600dpi is not enough to show the brush of the stem.
%
fet_beginchar ("Flat", "flat");
- set_char_box (1.2 stafflinethickness#, .8 staff_space#,
- 0.6 staff_space#, 1.9 staff_space#);
-
- draw_meta_flat (0, w, 0.31 staff_space);
+ draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+ false, false);
penlabels (range 0 thru 11);
remember_pic := currentpicture;
draw_shifted_too;
+fet_beginchar ("Arrowed Flat (arrow up)", "flat.arrowup");
+ draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+ true, false);
+ penlabels (range 0 thru 23);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Flat (arrow down)", "flat.arrowdown");
+ draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+ false, true);
+ penlabels (range 0 thru 23);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
+fet_beginchar ("Arrowed Flat (arrow up and down)", "flat.arrowboth");
+ draw_arrowed_meta_flat (0, 0.8 staff_space#, 0.31 staff_space,
+ true, true);
+ penlabels (range 0 thru 23);
+
+ remember_pic := currentpicture;
+
+ draw_staff (-2, 2, 0);
+fet_endchar;
+
+
+draw_shifted_too;
+
+
fet_beginchar ("Flat (slashed)", "flat.slash");
set_char_box (.4 staff_space#, .8 staff_space#,
0.6 staff_space#, 1.9 staff_space#);
- draw_meta_flat (0, w, 0.31 staff_space);
+ draw_meta_flat (0, w, 0.31 staff_space, false, false);
clearxy;
set_char_box (.4 staff_space#, .8 staff_space#,
0.6 staff_space#, 1.9 staff_space#);
- draw_meta_flat (0, w, 0.31 staff_space);
+ draw_meta_flat (0, w, 0.31 staff_space, false, false);
clearxy;
set_char_box (1.2 stafflinethickness#, .8 staff_space#,
0.6 staff_space#, 1.9 staff_space#);
- draw_meta_flat (0, w, 0.31 staff_space);
+ draw_meta_flat (0, w, 0.31 staff_space, false, false);
currentpicture := currentpicture xscaled -1 shifted (w - b, 0);
fet_endchar;
set_char_box (.4 staff_space#, .8 staff_space#,
0.6 staff_space#, 1.9 staff_space#);
- draw_meta_flat (0, w, 0.31 staff_space);
+ draw_meta_flat (0, w, 0.31 staff_space, false, false);
clearxy;
set_char_box (1.2 stafflinethickness#,
(left_wid + right_wid - overlap) * staff_space#,
.6 staff_space#, 1.9 staff_space#);
- draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space);
+ draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space,
+ false, false);
draw_meta_flat (hround ((left_wid - overlap) * staff_space),
- right_wid * staff_space, 1/3 staff_space);
+ right_wid * staff_space, 1/3 staff_space,
+ false, false);
fet_endchar;
set_char_box (1.2 stafflinethickness#,
(left_wid + right_wid - overlap) * staff_space#,
.6 staff_space#, 1.9 staff_space#);
- draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space);
+ draw_meta_flat (0, left_wid * staff_space, 1/3 staff_space,
+ false, false);
draw_meta_flat (hround ((left_wid - overlap) * staff_space),
- right_wid * staff_space, 1/3 staff_space);
+ right_wid * staff_space, 1/3 staff_space,
+ false, false);
%% maybe we should clip part of the stems?
%% or make the 1st flat smaller?
str = re.sub ('InnerChoirStaff', 'ChoirStaff', str)
return str
+def conv(str):
+ if re.search(r'\\addChordShape', str):
+ stderr_write ("\n")
+ stderr_write (NOT_SMART % _("stringTuning must be added to \
+ addChordShape call.\n"))
+ stderr_write (UPDATE_MANUALLY)
+ raise FatalConversionError ()
+ if re.search(r'\\chord-shape', str):
+ stderr_write ("\n")
+ stderr_write (NOT_SMART % _("stringTuning must be added to \
+ chord-shape call.\n"))
+ stderr_write (UPDATE_MANUALLY)
+ raise FatalConversionError ()
+ return str
+
# Guidelines to write rules (please keep this at the end of this file)
#
# - keep at most one rule per version; if several conversions should be done,
self.type = None
def print_ly (self, printer):
- bar_symbol = { 'regular': "|", 'dotted': ":", 'dashed': ":",
+ bar_symbol = { 'regular': "|", 'dotted': ":", 'dashed': "dashed",
'heavy': "|", 'light-light': "||", 'light-heavy': "|.",
'heavy-light': ".|", 'heavy-heavy': ".|.", 'tick': "'",
- 'short': "'", 'none': "" }.get (self.type, None)
+ 'short': "'|", 'none': "" }.get (self.type, None)
if bar_symbol <> None:
printer.dump ('\\bar "%s"' % bar_symbol)
else:
(define-public (number-or-string? x)
(or (number? x) (string? x)))
+(define-public (string-or-pair? x)
+ (or (string? x) (pair? x)))
+
(define-public (scheme? x) #t)
Choices include @code{curved}, @code{straight}, and
@code{none}. Default @code{curved}.
@item
+@code{capo-thickness} -- Thickness of capo indicator, in
+multiples of fret-space. Default value 0.5.
+@item
@code{dot-color} -- Color of dots. Options include
@code{black} and @code{white}. Default @code{black}.
@item
;;;;
;;;; source file of the GNU LilyPOnd music typesetter
;;;;
+;;;; This file implements different flag styles in Scheme / GUILE, most
+;;;; notably the old-straight-flag and the modern-straight-flag styles.
+;;;;
+
(define-public (no-flag stem-grob)
"No flag: Simply return empty stencil"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; ;; TODO
-;; (define-public (add-stroke-straight stencil dir stroke-style)
-;; stencil
-;; )
-;;
-;; ;; Create a stencil for a straight flag
-;; ;; flag-thickness, -spacing are given in staff spaces
-;; ;; *flag-length are given in black notehead widths
-;; ;; TODO
-;; (define-public (straight-flag flag-thickness flag-spacing
-;; upflag-angle upflag-length
-;; downflag-angle downflag-length)
-;; (lambda (stem-grob)
-;; (let* ((log (ly:grob-property stem-grob 'duration-log))
-;; (staff-space 1) ; TODO
-;; (black-notehead-width 1) ; TODO
-;; (stem-thickness 1) ; TODO: get rid of
-;; (half-stem-thickness (/ stem-thickness 2))
-;; (staff-space 1) ; TODO
-;; (up-length (+ (* upflag-length black-notehead-width) half-stem-thickness))
-;; (down-length (+ (* downflag-length black-notehead-width) half-stem-thickness))
-;; (thickness (* flag-thickness staff-space))
-;; (spacing (* flag-spacing staff-space)))
-;; empty-stencil
-;; )
-;; )
-;; )
-;;
-;; ;; Modern straight flags: angles are not so large as with the old style
-;; (define-public (modern-straight-flag stem-grob)
-;; ((straight-flag 0.55 0.9 -18 0.95 22 1.0) stem-grob))
-;;
-;; ;; Old-straight flags (Bach, etc.): quite large flag angles
-;; (define-public (old-straight-flag stem-grob)
-;; ((straight-flag 0.55 0.9 -45 0.95 45 1.0) stem-grob))
+(define-public (add-stroke-straight stencil stem-grob dir log stroke-style offset length thickness stroke-thickness)
+ "Add the stroke for acciaccatura to the given flag stencil.
+ The stroke starts for up-flags at upper-end-of-flag+(0,length/2) and
+ ends at (0, vertical-center-of-flag-end) - (flag-x-width/2, flag-x-width + flag-thickness).
+ Here length is the whole length, while flag-x-width is just the
+ x-extent and thus depends on the angle! Other combinations don't look as
+ good... For down-stems the y-coordinates are simply mirrored."
+ (let* ((start (offset-add offset (cons 0 (* (/ length 2) dir))))
+ (end (offset-add (cons 0 (cdr offset))
+ (cons (- (/ (car offset) 2)) (* (- (+ thickness (car offset))) dir))))
+ (stroke (make-line-stencil stroke-thickness (car start) (cdr start) (car end) (cdr end))))
+ (ly:stencil-add stencil stroke)))
+
+(define PI-OVER-180 (/ (atan 1 1) 45))
+(define (degrees->radians angle-degrees)
+ "Convert the given angle from degrees to radians"
+ (* angle-degrees PI-OVER-180))
+
+(define (polar->rectangular radius angle-in-degrees)
+ "Convert polar coordinate @code{radius} and @code{angle-in-degrees}
+ to (x-length . y-length)"
+ (let* ((complex (make-polar
+ radius
+ (degrees->radians angle-in-degrees))))
+ (cons
+ (real-part complex)
+ (imag-part complex))))
+
+(define (buildflag flag-stencil remain curr-stencil spacing)
+ "Internal function to recursively create a stencil with @code{remain} flags
+ from the single-flag stencil curr-stencil, which is already translated to
+ the position of the previous flag position."
+ (if (> remain 0)
+ (let* ((translated-stencil (ly:stencil-translate-axis curr-stencil spacing Y))
+ (new-stencil (ly:stencil-add flag-stencil translated-stencil)))
+ (buildflag new-stencil (- remain 1) translated-stencil spacing))
+ flag-stencil))
+
+(define-public (straight-flag flag-thickness flag-spacing
+ upflag-angle upflag-length
+ downflag-angle downflag-length)
+ "Create a stencil for a straight flag.
+ flag-thickness, -spacing are given in staff spaces,
+ *flag-angle is given in degree, *flag-length is given in staff spaces.
+ All lengths will be scaled according to the font size of the note."
+ (lambda (stem-grob)
+ (let* ((log (ly:grob-property stem-grob 'duration-log))
+ (dir (ly:grob-property stem-grob 'direction))
+ (stem-up (eqv? dir UP))
+ (layout (ly:grob-layout stem-grob))
+ ; scale with the note size (e.g. for grace notes)
+ (factor (magstep (ly:grob-property stem-grob 'font-size 0)))
+ (grob-stem-thickness (ly:grob-property stem-grob 'thickness))
+ (line-thickness (ly:output-def-lookup layout 'line-thickness))
+ (half-stem-thickness (/ (* grob-stem-thickness line-thickness) 2))
+ (raw-length (if stem-up upflag-length downflag-length))
+ (angle (if stem-up upflag-angle downflag-angle))
+ (flag-length (+ (* raw-length factor) half-stem-thickness))
+ (flag-end (polar->rectangular flag-length angle))
+ (thickness (* flag-thickness factor))
+ (thickness-offset (cons 0 (* -1 thickness dir)))
+ (spacing (* -1 flag-spacing factor dir ))
+ (start (cons (- half-stem-thickness) (* half-stem-thickness dir)))
+ ; The points of a round-filled-polygon need to be given in clockwise
+ ; order, otherwise the polygon will be enlarged by blot-size*2!
+ (points (if stem-up (list start flag-end
+ (offset-add flag-end thickness-offset)
+ (offset-add start thickness-offset))
+ (list start
+ (offset-add start thickness-offset)
+ (offset-add flag-end thickness-offset)
+ flag-end)))
+ (stencil (ly:round-filled-polygon points half-stem-thickness))
+ ; Log for 1/8 is 3, so we need to subtract 3
+ (flag-stencil (buildflag stencil (- log 3) stencil spacing))
+ (stroke-style (ly:grob-property stem-grob 'stroke-style)))
+ (if (equal? stroke-style "grace")
+ (add-stroke-straight flag-stencil stem-grob
+ dir log
+ stroke-style
+ flag-end flag-length
+ thickness
+ (* half-stem-thickness 2))
+ flag-stencil))))
+
+(define-public (modern-straight-flag stem-grob)
+ "Modern straight flag style (for composers like Stockhausen, Boulez, etc.).
+ The angles are 18 and 22 degrees and thus smaller than for the ancient style
+ of Bach etc."
+ ((straight-flag 0.55 1 -18 1.1 22 1.2) stem-grob))
+
+(define-public (old-straight-flag stem-grob)
+ "Old straight flag style (for composers like Bach). The angles of the flags
+ are both 45 degrees."
+ ((straight-flag 0.55 1 -45 1.2 45 1.4) stem-grob))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (fret-parse-marking-list marking-list fret-count)
(let* ((fret-range (list 1 fret-count))
+ (capo-fret 0)
(barre-list '())
(dot-list '())
(xo-list '())
(set! xo-list (cons* my-item xo-list)))
((eq? my-code 'barre)
(set! barre-list (cons* (cdr my-item) barre-list)))
+ ((eq? my-code 'capo)
+ (set! capo-fret (cadr my-item)))
((eq? my-code 'place-fret)
(set! dot-list (cons* (cdr my-item) dot-list))))
(parse-item (cdr mylist)))))
;; calculate fret-range
- (let ((maxfret 0) (minfret 99))
+ (let ((maxfret 0)
+ (minfret (if (> capo-fret 0) capo-fret 99)))
(let updatemax ((fret-list dot-list))
(if (null? fret-list)
'()
(list minfret
(let ((upfret (- (+ minfret fret-count) 1)))
(if (> maxfret upfret) maxfret upfret)))))
+ (set! capo-fret (1+ (- capo-fret minfret)))
; subtract fret from dots
(set! dot-list (subtract-base-fret (- (car fret-range) 1) dot-list)))
(acons 'fret-range fret-range
(acons 'barre-list barre-list
(acons 'dot-list dot-list
- (acons 'xo-list xo-list '()))))))
+ (acons 'xo-list xo-list
+ (acons 'capo-fret capo-fret '())))))))
(define (subtract-base-fret base-fret dot-list)
"Subtract @var{base-fret} from every fret in @var{dot-list}"
(ly:make-stencil (list 'round-filled-box y1 y2 x1 x2 sth)
y-extent x-extent))))
+(define (draw-capo details string-count fret fret-count th size
+ dot-pos orientation)
+ "Draw a capo indicator across the full width of the fret-board
+ at fret capo-fret."
+ (let* ((sth (* th size))
+ (capo-thick
+ (* size (assoc-get 'capo-thickness details 0.5)))
+ (half-thick (* capo-thick 0.5))
+ (last-string-pos 0)
+ (first-string-pos (* size (- string-count 1)))
+ (fret-pos ( * size (if (eq? orientation 'normal)
+ (+ 2 (- fret-count fret dot-pos))
+ (1- (+ dot-pos fret))))))
+ (if (eq? orientation 'normal)
+ (make-line-stencil capo-thick
+ last-string-pos fret-pos first-string-pos fret-pos)
+ (make-line-stencil capo-thick
+ fret-pos last-string-pos fret-pos first-string-pos))))
+
+
(define (draw-frets fret-range string-count th size orientation)
"Draw the fret lines for a fret diagram with
@var{string-count} strings and frets as indicated in @var{fret-range}.
(* size (+ 1 label-vertical-offset)) X))))
(define-builtin-markup-command (fret-diagram-verbose layout props marking-list)
- (list?) ; argument type
+ (pair?) ; argument type (list, but use pair? for speed)
instrument-specific-markup ; markup type
((align-dir -0.4) ; properties and defaults
(size 1.0)
Place a barre indicator (much like a tie) from string @var{start-string}
to string @var{end-string} at fret @var{fret-number}.
+@item (capo @var{fret-number})
+Place a capo indicator (a large solid bar) across the entire fretboard
+at fret location @var{fret-number}. Also, set fret @var{fret-number}
+to be the lowest fret on the fret diagram.
+
@item (place-fret @var{string-number} @var{fret-number} @var{finger-value})
Place a fret playing indication on string @var{string-number} at fret
@var{fret-number} with an optional fingering label @var{finger-value}.
(label-space (* 0.25 size))
(label-dir (assoc-get 'label-dir details RIGHT))
(parameters (fret-parse-marking-list marking-list fret-count))
+ (capo-fret (assoc-get 'capo-fret parameters 0))
(dot-list (cdr (assoc 'dot-list parameters)))
(xo-list (cdr (assoc 'xo-list parameters)))
(fret-range (cdr (assoc 'fret-range parameters)))
(draw-xo layout props string-count fret-range
size xo-list orientation)
xo-padding))))
+ (if (> capo-fret 0)
+ (set! fret-diagram-stencil
+ (ly:stencil-add
+ fret-diagram-stencil
+ (draw-capo details string-count capo-fret fret-count
+ th size dot-position orientation))))
(if (> (car fret-range) 1)
(set! fret-diagram-stencil
(if (eq? orientation 'normal)
("" . ("" . ""))
(":" . (":" . ""))
("." . ("." . ()))
+ ("'" . ("'" . ()))
("empty" . (() . ()))
("brace" . (() . "brace"))
("bracket" . (() . "bracket"))
(define-public (parse-terse-string terse-definition)
"Parse a fret-diagram-terse definition string @code{terse-definition} and
-return a marking list, which can be used as with a fretboard grob."
+return a marking list, which can be used with a fretboard grob."
(cdr (fret-parse-terse-definition-string (list '()) terse-definition)))
-(define-public (get-chord-shape shape-code base-chord-shapes)
-"Return the chord shape associated with key @code{shape-code} in
-the alist @code{base-chord-shapes}."
- (assoc-get shape-code base-chord-shapes #f))
-
-(define-public (offset-fret fret-offset terse-string)
-"Add @code{fret-offset} to each fret indication in @code{terse-string}
-and return the resulting fret-diagram-terse definition string."
-
- (define (split-fretstring fret-string)
- (map (lambda (x) (split-item x))
- (string-split fret-string #\sp )))
-
- (define (split-item item-string)
- (string-split item-string #\- ))
-
- (define (split-terse-string terse-string)
- (let ((long-list
- (string-split terse-string #\;)))
- (map (lambda (x) (split-fretstring x))
- (list-head long-list (1- (length long-list))))))
-
- (define (join-terse-string terse-string-list)
- (string-join
- (map (lambda (x) (join-fretstring x)) terse-string-list)
- ";" 'suffix))
-
- (define (join-item item-list)
- (string-join item-list "-" ))
-
- (define (join-fretstring fretstring-list)
- (string-join
- (map (lambda (x) (join-item x)) fretstring-list)
- " " ))
-
- (define (add-item-fret-offset fret-offset item-list)
- (let ((fretval (string->number (car item-list))))
- (if fretval
- (cons (number->string (+ fretval fret-offset))
- (cdr item-list))
- item-list)))
-
- (define (add-fretstring-fret-offset fret-offset fretstring-list)
- (map (lambda (x) (add-item-fret-offset fret-offset x))
- fretstring-list))
-
- (define (add-terse-fret-offset fret-offset terse-string-list)
- (map (lambda (x) (add-fretstring-fret-offset fret-offset x))
- terse-string-list))
-
-;; body
- (join-terse-string
- (add-terse-fret-offset
- fret-offset
- (split-terse-string terse-string))))
+(define-public (get-chord-shape shape-code tuning base-chord-shapes)
+"Return the chord shape associated with @code{shape-code} and
+@code{tuning} in the hash-table @code{base-chord-shapes}."
+ (let ((hash-handle (hash-get-handle base-chord-shapes
+ (cons shape-code tuning))))
+ (if hash-handle
+ (cdr hash-handle)
+ '())))
+
+(define-public (offset-fret fret-offset diagram-definition)
+"Add @code{fret-offset} to each fret indication in @code{diagram-definition}
+and return the resulting verbose fret-diagram-definition."
+ (let ((verbose-definition
+ (if (string? diagram-definition)
+ (parse-terse-string diagram-definition)
+ diagram-definition)))
+ (map (lambda(item)
+ (let ((code (car item)))
+ (cond
+ ((eq? code 'barre)
+ (list-set! item 3
+ (+ fret-offset (list-ref item 3)))
+ item)
+ ((eq? code 'capo)
+ (list-set! item 1
+ (+ fret-offset (list-ref item 1)))
+ item)
+ ((eq? code 'place-fret)
+ (list-set! item 2
+ (+ fret-offset (list-ref item 2)))
+ item)
+ (else item))))
+ verbose-definition)))