Die Standardfußzeile ist leer mit Ausnahme der ersten Seite, auf der
das @code{copyright}-Feld aus der @code{\header}-Umgebung eingefügt wird,
und die letzte Seite, auf der das @code{tagline}-Feld eingefügt wird.
-Der Standardinhalt von @code{tagline} ist @qq{Music engraving by
+Der Standardinhalt von @code{tagline} ist @qq{Music engraving by
LilyPond (@var{version})---www.lilypond.org}. Gut gesetzte Noten werben sehr effektiv
für LilyPond, darum bitten wir darum, diese Zeile stehen zu lassen,
wenn es möglich ist.
Der @code{\tag #'@var{TeilA}}-Befehl markiert einen musikalischen
Ausdruck mit der Bezeichnung @var{TeilA}. Ausdrücke, die auf diese
Weise markiert werden, können mit ihrer Bezeichnung später ausgewählt
-bzw. ausgefiltert werden. Das geschieht mit den Befehlen
+bzw. ausgefiltert werden. Das geschieht mit den Befehlen
@code{\keepWithTag #'@var{Bezeichnung}} bzw. @code{\removeWithTag #'@var{Bezeichnung}}.
Die Wirkung dieser Filter auf die markierten Notenabschnitte ist
wie folgt:
@headitem Filter
@tab Resultat
-
+
@item
Markierte Noten mit vorgesetztem @code{\keepWithTag #'@var{Bezeichnung}}
@tab Unmarkierte Noten und Noten mit der Marke @var{Bezeichnung} werden
gesetzt, Noten mit einer anderen Marke werden nicht angezeigt.
-
+
@item
Markierte Noten mit vorgesetztem @code{\removeWithTag #'@var{Bezeichnung}}
@tab Unmarkierte Noten und Noten mit einer anderen Marke als
andere möglichkeit, ein eigenes MIDI-Tempo anzugeben, wird weiter
unten gezeigt, siehe @ref{MIDI block}.
+Aufgrund einiger Einschränkungen auf Windows ist auf Windows-Systemen
+die Standarddateierweiterung von MIDI-Dateien @code{.mid}. Andere
+Betriebssysteme verwenden weiterhin @code{.midi}. Wenn eine
+andere Endung erwünscht ist, kann man die folgende Zeile auf oberster
+Ebene der Quelldatei, vor Beginn eines @code{\book}, @code{\bookpart}
+oder @code{\score} Blocks einfügen:
+
+@example
+#(ly:set-option 'midi-extension "midi")
+@end example
+
+Diese Codezeile setzt die Dateiendung auf @code{.midi}.
+
+Als Alternative kann man diese Option auch als Kommandozeilenparameter
+übergeben:
+
+@example
+lilypond … -dmidi-extension=midi lilyDatei.ly
+@end example
@unnumberedsubsubsec Instrument names
@example
\score @{
- \new Score @{ @dots{}Noten@dots{} @}
+ \new Score @{ @dots{}Noten@dots{} @}
\midi @{ @}
@}
@end example
@item
A @code{\bookpart} block. A book may be divided into several parts,
using @code{\bookpart} blocks, in order to ease the page breaking,
-or to use different @code{\paper} settings in different parts.
+or to use different @code{\paper} settings in different parts.
@item
A compound music expression, such as
of specifying the inital or overall MIDI tempo is described below,
see @ref{MIDI block}.
+Due to some limitations on Windows, the default extension for
+MIDI files on Windows is @code{.mid}. Other operating systems still
+use the extension @code{.midi}. If a different extension is preferred,
+insert the following line at the top-level of the input file,
+before the start of any @code{\book}, @code{\bookpart} or @code{\score} blocks:
+
+@example
+#(ly:set-option 'midi-extension "midi")
+@end example
+
+The line above will set the default extension for MIDI files to
+@code{.midi}.
+
+Alternatively, this option can also be supplied on the command line:
+
+@example
+lilypond … -dmidi-extension=midi lilyFile.ly
+@end example
+
+
@unnumberedsubsubsec Instrument names
@cindex instrument names
@code{\maxima}, but this is supported only within ancient music
notation. For details, see @ref{Ancient notation}.
+@cindex duration, default
+@cindex default note duration
+@cindex note duration, default
+
If the duration is omitted, it is set to the previously
entered duration. The default for the first note is a quarter
note.
c4 c \times 2/3 { b4 a g }
@end lilypond
+@cindex tuplet bracket placement
+
@funindex \tupletUp
@funindex tupletUp
@funindex \tupletDown
@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
{entering-several-tuplets-using-only-one--times-command.ly}
+@cindex Tuplet number changes
+
@funindex TupletNumber
@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
@rinternals{TupletNumber},
@rinternals{TimeScaledMusic}.
+@cindex grace notes within tuplet brackets
@knownissues
-@cindex grace notes within tuplet brackets
When the first note on a staff is a grace note followed by a
tuplet the grace note must be placed before the @code{\times}
command to avoid errors. Anywhere else, grace notes may be
@code{s1*23}.
@cindex compressing music
+@cindex expanding music
@funindex \scaleDurations
@funindex scaleDurations
@node Rests
@unnumberedsubsubsec Rests
+
@cindex rest
@cindex rest, entering durations
@cindex maxima rest
@cindex multi-measure rest, script
@cindex fermata on multi-measure rest
@cindex multi-measure rest, attaching fermata
+@cindex markup on multi-measure rest
+@cindex multi-measure rest with markup
@funindex \fermataMarkup
@funindex fermataMarkup
+@funindex MultiMeasureRestText
Markups can be added to multi-measure rests.
The predefined command @code{\fermataMarkup}
setting, resulting bar-check warnings may not be displayed.
+@funindex \textLengthOn
+@funindex textLengthOn
+@funindex \textLengthOff
+@funindex textLenthOff
+@funindex \fermataMarkup
+@funindex fermataMarkup
+@funindex \compressFullBarRests
+@funindex compressFullBarRests
+@funindex \expandFullBarRests
+@funindex expandFullBarRests
+
@predefined
@code{\textLengthOn},
@code{\textLengthOff},
@cindex measure, partial
@cindex pickup measure
@cindex measure, change length
-@cindex measurePosition
+@funindex measurePosition
@funindex \partial
@funindex partial
@rlsr{Rhythms}.
+@cindex cadenza line breaks
+@cindex cadenza page breaks
+@cindex unmetered music, line breaks
+@cindex unmetered music, page breaks
+@cindex breaks in unmetered music
+@cindex line breaks in cadenzas
+@cindex page breaks in cadenzas
+@cindex line breaks in unmetered music
+@cindex page breaks in unmetered music
+
@knownissues
LilyPond will insert line breaks and page breaks only at a
c16 c8
@end lilypond
+@cindex melismata, beams
+@cindex beams and melismata
+
@warning{If beams are used to indicate melismata in songs, then
automatic beaming should be switched off with @code{\autoBeamOff}
and the beams indicated manually.}
If there are no beam-ending rules defined for the beam duration of a
particular beam in the time signature in use, its beaming is
-controlled by three context properties:
-@code{measureLength}, @code{beatLength} and @code{beatGrouping}.
-These properties may be set in the @code{Score}, @code{Staff} or
-@code{Voice} contexts to delimit their scope. The default values
-are set while processing @code{\time} commands, so any @code{\set}
-commands to modify their value must be placed after all @code{\time}
-commands.
+controlled by three context properties: @code{measureLength},
+@code{beatLength} and @code{beatGrouping}. These properties may be
+set in the @code{Score}, @code{Staff} or @code{Voice} contexts to
+delimit their scope. The default values are set while processing
+@code{\time} commands, so any @code{\set} commands to modify their
+value must be placed after all @code{\time} commands.
@warning{These three properties become effective for a particular
beam @strong{only} if there are no beam-ending rules predefined for
@cindex grouping beats
@cindex measure sub-grouping
+@funindex autoBeamSettings
+@funindex beam-limit
+@funindex beam-numerator
+@funindex beam-denominator
+
+
@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
{conducting-signs,-measure-grouping-signs.ly}
only @code{end} is effective.
@item @code{beam-numerator/beam-denominator} is the beam duration
-to which the rule is to apply. A beam is considered to have
-the duration of its shortest note. Set @code{beam-numerator}
-and @code{beam-denominator} to @code{'*'} to have this rule apply
-to beams of any duration.
+to which the rule is to apply. A beam is considered to have the
+duration of its shortest note. Set @code{beam-numerator} and
+@code{beam-denominator} to @code{'*'} to have this rule apply to beams
+of any duration.
+
+@funindex time-signature-numerator
+@funindex time-signature-denominator
@item @code{time-signature-numerator/time-signature-denominator}
-specifies the time signature to which this rule should apply.
-If @code{time-signature-numerator} and
-@code{time-signature-denominator} are set to @code{'*'} this rule
-will apply in any time signature.
+specifies the time signature to which this rule should apply. If
+@code{time-signature-numerator} and @code{time-signature-denominator}
+are set to @code{'*'} this rule will apply in any time signature.
+
+@funindex moment-numerator
+@funindex moment-denominator
-@item @code{monent-numerator/moment-denominator} is the position
+@item @code{moment-numerator/moment-denominator} is the position
in the bar at which the beam should end.
+@funindex score-override-auto-beam-setting
+@funindex override-auto-beam-setting
+
@item @code{context} is optional, and it specifies the context at which
the change should be made. The default is @code{'Voice}.
possible interference, because the beam endings defined there will
still apply in addition to your own.}
+@funindex revert-auto-beam-setting
+
Any unwanted or conflicting default endings must be reverted for
your time signature(s). Existing default or user-defined
beam-ending rules are removed by using
@unnumberedsubsubsec Feathered beams
@cindex beams, feathered
+@cindex feathered beams
@funindex \featherDurations
@funindex featherDurations
@code{]}, and the beam feathering is turned on by specifying a
direction to the @code{Beam} property @code{grow-direction}.
-If the placement of the notes and the sound in the MIDI output
-is to reflect the ritardando or accelerando indicated by the
-feathered beam the notes must be grouped as a
-music expression delimited by braces and preceded by a
-@code{featheredDurations} command which specifies the ratio
-between the durations of the first and last notes in the group.
+If the placement of the notes and the sound in the MIDI output is to
+reflect the ritardando or accelerando indicated by the feathered beam
+the notes must be grouped as a music expression delimited by braces
+and preceded by a @code{featherDurations} command which specifies
+the ratio between the durations of the first and last notes in the
+group.
The square brackets show the extent of the beam and the braces show
which notes are to have their durations modified. Normally these
@cindex bar lines
@cindex measure lines
+@cindex closing bar lines
+@cindex bar lines, closing
+@cindex double bar lines
+@cindex bar lines, double
@cindex repeat bars
@funindex \bar
@end lilypond
+@cindex default bar lines, changing
+@cindex bar lines, default, changing
+
@snippets
@funindex whichBar
c1 c c c
@end lilypond
-
-@snippets
-
@cindex bar numbers, regular spacing
@funindex barNumberVisibility
-
-@c Uncomment this after next LSR update.
-@c @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
-@c {printing-the-bar-number-for-the-first-measure.ly}
+@funindex BarNumber
Bar numbers can be typeset at regular intervals instead of just at
the beginning of every line. To do this the default behavior
@lilypond[verbatim,quote,relative=1]
\override Score.BarNumber #'break-visibility = #'#(#t #t #t)
\set Score.currentBarNumber = #11
-\bar "" % Permit first bar number to be printed
-c1 c c c
+% Permit first bar number to be printed
+\bar ""
+c1 | c | c | c
\break
-c c c c
+c1 | c | c | c
@end lilypond
-@c All the rest of these examples will be added to LSR
-@c and moved into the Snippets. -gp
-@noindent
-and here the bar numbers are printed every two measures
-except at the end of the line:
+@snippets
-@lilypond[verbatim,quote,relative=1]
-\override Score.BarNumber #'break-visibility = #'#(#f #t #t)
-\set Score.currentBarNumber = #11
-\bar "" % Permit first bar number to be printed
-% Print a bar number every second measure
-\set Score.barNumberVisibility = #(every-nth-bar-number-visible 2)
-c1 c c c c
-\break
-c c c c c
-@end lilypond
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{printing-the-bar-number-for-the-first-measure.ly}
+
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{printing-bar-numbers-at-regular-intervals.ly}
@cindex measure number, format
@cindex bar number, format
-The size of the bar number may be changed. This is illustrated
-in the following example, which also shows how to enclose bar
-numbers in boxes and circles, and shows an alternative way
-of specifying @code{#(#f #t #t)} for @code{break-visibility}.
-
-@lilypond[verbatim,quote,relative=1]
-% Prevent bar numbers at the end of a line and permit them elsewhere
-\override Score.BarNumber #'break-visibility
- = #end-of-line-invisible
-
-% Increase the size of the bar number by 2
-\override Score.BarNumber #'font-size = #2
-\repeat unfold 3 { c1 } \bar "|"
-
-% Draw a box round the following bar number(s)
-\override Score.BarNumber #'stencil
- = #(make-stencil-boxer 0.1 0.25 ly:text-interface::print)
-\repeat unfold 3 { c1 } \bar "|"
-
-% Draw a circle round the following bar number(s)
-\override Score.BarNumber #'stencil
- = #(make-stencil-circler 0.1 0.25 ly:text-interface::print)
-\repeat unfold 4 { c1 } \bar "|."
-@end lilypond
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{printing-bar-numbers-inside-boxes-or-circles.ly}
@cindex bar number alignment
-Bar numbers by default are left-aligned to their parent object.
-This is usually the left edge of a line or, if numbers are printed
-within a line, the left bar line of the measure. The numbers may also
-be positioned directly on the bar line or right-aligned to the
-bar line:
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{aligning-bar-numbers.ly}
-@lilypond[verbatim,quote,relative=1]
-\set Score.currentBarNumber = #111
-\override Score.BarNumber #'break-visibility = #'#(#t #t #t)
-% Increase the size of the bar number by 2
-\override Score.BarNumber #'font-size = #2
-% Print a bar number every second measure
-\set Score.barNumberVisibility = #(every-nth-bar-number-visible 2)
-c1 c1
-% Center-align bar numbers
-\override Score.BarNumber #'self-alignment-X = #0
-c1 c1
-% Right-align bar numbers
-\override Score.BarNumber #'self-alignment-X = #-1
-c1 c1
-@end lilypond
-
-Bar numbers can be removed entirely by removing the
-@code{Bar_number_engraver} from the @code{Score} context.
-
-@lilypond[verbatim,quote]
-\layout {
- \context {
- \Score
- \remove "Bar_number_engraver"
- }
-}
-\relative c''{
- c4 c c c \break
- c4 c c c
-}
-@end lilypond
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{removing-bar-numbers-from-a-score.ly}
@seealso
@funindex \barNumberCheck
@funindex barNumberCheck
-When copying large pieces of music, it can be helpful to check
-that the LilyPond bar number corresponds to the original that you
-are entering from. This can be checked with
-@code{\barNumberCheck}, for example,
+When copying large pieces of music, it can be helpful to check that
+the LilyPond bar number corresponds to the original that you are
+entering from. This can be checked with @code{\barNumberCheck}, for
+example,
@verbatim
\barNumberCheck #123
@cindex rehearsal mark, manual
@cindex mark, rehearsal, manual
@cindex custom rehearsal mark
+@cindex manual rehearsal mark
The style is defined by the property @code{markFormatter}. It is
a function taking the current mark (an integer) and the current
@cindex segno
@cindex coda
-@cindex D.S al Fine
+@cindex D.S. al Fine
@cindex fermata
@cindex music glyphs
@cindex glyphs, music
}
@end lilypond
+@cindex tweaking grace notes
+@cindex grace notes, tweaking
+@cindex grace notes, changing layout settings
+
A @code{\grace} music expression will introduce special
typesetting settings, for example, to produce smaller type, and
set directions. Hence, when introducing layout tweaks to
@snippets
-The slash through the stem found in @emph{acciaccatura}s can be applied
-in other situations:
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{using-grace-note-slashes-with-normal-heads.ly}
-@lilypond[quote,verbatim,relative=2]
-\relative c'' {
- \override Stem #'stroke-style = #"grace"
- c8( d2) e8( f4)
-}
-@end lilypond
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{tweaking-grace-layout-within-music.ly}
-The layout of grace expressions can be changed throughout the
-music using the function @code{add-grace-property}. The following
-example undefines the @code{Stem} direction for this grace, so
-that stems do not always point up.
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{redefining-grace-note-global-defaults.ly}
-@lilypond[quote,verbatim,relative=2]
-\relative c'' {
- \new Staff {
- #(add-grace-property 'Voice 'Stem 'direction ly:stem::calc-direction)
- #(remove-grace-property 'Voice 'Stem 'direction)
- \new Voice {
- \acciaccatura { f16 } g4
- \grace { d16[ e] } f4
- \appoggiatura { a,32[ b c d] } e2
- }
- }
-}
-@end lilypond
-
-Another option is to change the variables @code{startGraceMusic},
-@code{stopGraceMusic}, @code{startAcciaccaturaMusic},
-@code{stopAcciaccaturaMusic}, @code{startAppoggiaturaMusic},
-@code{stopAppoggiaturaMusic}. The default values of these can be
-seen in the file @code{ly/@/grace@/-init@/.ly}. By redefining
-them other effects may be obtained.
-
-Grace notes may be forced to align with regular notes
-in other staves:
-
-@lilypond[verbatim,quote]
-\relative c'' {
- <<
- \override Score.SpacingSpanner #'strict-grace-spacing = ##t
- \new Staff {
- c4
- \afterGrace c4 { c16[ c8 c16] }
- c4 r
- }
- \new Staff {
- c16 c c c c c c c c4 r
- }
- >>
-}
-@end lilypond
+@lilypondfile[verbatim,lilyquote,texidoc,doctitle]
+{positioning-grace-notes-with-floating-space.ly}
@seealso
@knownissues
+@cindex acciaccatura, multi-note
+@cindex multi-note acciaccatura
+@cindex grace-note synchronization
+
A multi-note beamed @i{acciaccatura} is printed without a slash,
and looks exactly the same as a multi-note beamed
@i{appoggiatura}.
staves without, for example,
@lilypond[quote,relative=2,verbatim]
-<< \new Staff { e4 \bar "|:" \grace c16 d2. }
- \new Staff { c4 \bar "|:" d2. } >>
+<<
+ \new Staff { e4 \bar "|:" \grace c16 d2. }
+ \new Staff { c4 \bar "|:" d2. }
+>>
@end lilypond
@noindent
durations in the other staves. For the above example
@lilypond[quote,relative=2,verbatim]
-<< \new Staff { e4 \bar "|:" \grace c16 d2. }
- \new Staff { c4 \bar "|:" \grace s16 d2. } >>
+<<
+ \new Staff { e4 \bar "|:" \grace c16 d2. }
+ \new Staff { c4 \bar "|:" \grace s16 d2. }
+>>
@end lilypond
Grace sections should only be used within sequential music
@rinternals{staff-symbol-interface}.
-@knownissues
-
-When setting vertical staff line positions manually, bar lines are
-always centered on position 0, so the maximum distance between the
-outermost bar lines in either direction must be equal.
-
-
@node Ossia staves
@unnumberedsubsubsec Ossia staves
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+ lsrtags = "rhythms"
+
+ texidoc = "
+Bar numbers by default are right-aligned to their parent object. This
+is usually the left edge of a line or, if numbers are printed within a
+line, the left hand side of a bar line. The numbers may also be
+positioned directly over the bar line or left-aligned to the bar line.
+
+"
+ doctitle = "Aligning bar numbers"
+} % begin verbatim
+
+\relative c' {
+ \set Score.currentBarNumber = #111
+ \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
+ % Increase the size of the bar number by 2
+ \override Score.BarNumber #'font-size = #2
+ % Print a bar number every second measure
+ \set Score.barNumberVisibility = #(every-nth-bar-number-visible 2)
+ c1 | c1
+ % Center-align bar numbers
+ \override Score.BarNumber #'self-alignment-X = #CENTER
+ c1 | c1
+ % Left-align bar numbers
+ \override Score.BarNumber #'self-alignment-X = #LEFT
+ c1 | c1
+}
engravers-one-by-one.ly
mensurstriche-layout-bar-lines-between-the-staves.ly
nesting-staves.ly
+removing-bar-numbers-from-a-score.ly
use-square-bracket-at-the-start-of-a-staff-group.ly
vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly
\new TabStaff {
\override Staff.Clef #'stencil = #(lambda (grob)
- ly:clef::print (grob-interpret-markup grob TAB))
+ (grob-interpret-markup grob TAB))
a
}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+ lsrtags = "rhythms"
+
+ texidoc = "
+Setting the property @code{'strict-grace-spacing} makes the musical
+columns for grace notes 'floating', i.e., decoupled from the non-grace
+notes: first the normal notes are spaced, then the (musical columns of
+the) graces are put left of the musical columns for the main notes.
+
+"
+ doctitle = "Positioning grace notes with floating space"
+} % begin verbatim
+
+\relative c'' {
+ <<
+ \override Score.SpacingSpanner #'strict-grace-spacing = ##t
+ \new Staff \new Voice {
+ \afterGrace c4 { c16[ c8 c16] }
+ c8[ \grace { b16[ d] } c8]
+ c4 r
+ }
+ \new Staff {
+ c16 c c c c c c c c4 r
+ }
+ >>
+}
+
+
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+ lsrtags = "rhythms"
+
+ texidoc = "
+Bar numbers can be printed at regular intervals by setting the property
+@code{barNumberVisibility}. Here the bar numbers are printed every two
+measures except at the end of the line.
+
+"
+ doctitle = "Printing bar numbers at regular intervals"
+} % begin verbatim
+
+\relative c' {
+ \override Score.BarNumber #'break-visibility = #'#(#f #t #t)
+ \set Score.currentBarNumber = #11
+ % Permit first bar number to be printed
+ \bar ""
+ % Print a bar number every second measure
+ \set Score.barNumberVisibility = #(every-nth-bar-number-visible 2)
+ c1 | c | c | c | c
+ \break
+ c1 | c | c | c | c
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+ lsrtags = "rhythms, tweaks-and-overrides"
+
+ texidoc = "
+Bar numbers can also be printed inside boxes or circles.
+
+
+
+"
+ doctitle = "Printing bar numbers inside boxes or circles"
+} % begin verbatim
+
+\relative c'{
+ % Prevent bar numbers at the end of a line and permit them elsewhere
+ \override Score.BarNumber #'break-visibility = #end-of-line-invisible
+ \set Score.barNumberVisibility = #(every-nth-bar-number-visible 4)
+
+ % Increase the size of the bar number by 2
+ \override Score.BarNumber #'font-size = #2
+
+ % Draw a box round the following bar number(s)
+ \override Score.BarNumber #'stencil
+ = #(make-stencil-boxer 0.1 0.25 ly:text-interface::print)
+ \repeat unfold 5 { c1 }
+
+ % Draw a circle round the following bar number(s)
+ \override Score.BarNumber #'stencil
+ = #(make-stencil-circler 0.1 0.25 ly:text-interface::print)
+ \repeat unfold 4 { c1 } \bar "|."
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+ lsrtags = "rhythms"
+
+ texidoc = "
+The global defaults for grace notes are stored in the identifiers
+@code{startGraceMusic}, @code{stopGraceMusic},
+@code{startAcciaccaturaMusic}, @code{stopAcciaccaturaMusic},
+@code{startAppoggiaturaMusic} and @code{stopAppoggiaturaMusic}, which
+are defined in the file @code{ly/grace-init.ly}. By redefining them
+other effects may be obtained.
+
+"
+ doctitle = "Redefining grace note global defaults"
+} % begin verbatim
+
+startAcciaccaturaMusic = {
+ s1*0(
+ \override Stem #'stroke-style = #"grace"
+ \slurDashed
+}
+
+stopAcciaccaturaMusic = {
+ \revert Stem #'stroke-style
+ \slurSolid
+ s1*0)
+}
+
+\relative c'' {
+ \acciaccatura d8 c1
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+ lsrtags = "rhythms, contexts-and-engravers"
+
+ texidoc = "
+Bar numbers can be removed entirely by removing the
+@code{Bar_number_engraver} from the @code{Score} context.
+
+"
+ doctitle = "Removing bar numbers from a score"
+} % begin verbatim
+
+\layout {
+ \context {
+ \Score
+ \remove "Bar_number_engraver"
+ }
+}
+
+\relative c'' {
+ c4 c c c \break
+ c4 c c c
+}
adding-beams,-slurs,-ties-etc.-when-using-tuplet-and-non-tuplet-rythms..ly
adding-drum-parts.ly
+aligning-bar-numbers.ly
automatic-beam-subdivisions.ly
automatic-beams-two-per-two-in-4-4-or-2-2-time-signature.ly
avoiding-collisions-with-chord-fingerings.ly
multi--measure-rest-markup.ly
non-default-tuplet-numbers.ly
permitting-line-breaks-within-beamed-tuplets.ly
+positioning-grace-notes-with-floating-space.ly
positioning-multi--measure-rests.ly
+printing-bar-numbers-at-regular-intervals.ly
+printing-bar-numbers-inside-boxes-or-circles.ly
printing-metronome-and-rehearsal-marks-below-the-staff.ly
printing-music-with-different-time-signatures.ly
printing-the-bar-number-for-the-first-measure.ly
+redefining-grace-note-global-defaults.ly
+removing-bar-numbers-from-a-score.ly
rest-styles.ly
reverting-default-beam-endings.ly
rhythmic-slashes.ly
stemlets.ly
sub-dividing-beams.ly
three-sided-box.ly
+tweaking-grace-layout-within-music.ly
using-beatlength-and-beatgrouping.ly
+using-grace-note-slashes-with-normal-heads.ly
using-ties-with-arpeggios.ly
--- /dev/null
+%% Do not edit this file; it is auto-generated from input/new
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+ lsrtags = "rhythms"
+ texidoc = "
+The layout of grace expressions can be changed throughout the
+music using the functions @code{add-grace-property} and
+@code{remove-grace-property}. The following example undefines
+the @code{Stem} direction for this grace, so that stems do not
+always point up, and changes the default note heads to crosses.
+"
+ doctitle = "Tweaking grace layout within music"
+} % begin verbatim
+
+
+\relative c'' {
+ \new Staff {
+ #(remove-grace-property 'Voice 'Stem 'direction)
+ #(add-grace-property 'Voice 'NoteHead 'style 'cross)
+ \new Voice {
+ \acciaccatura { f16 } g4
+ \grace { d16[ e] } f4
+ \appoggiatura { f,32[ g a] } e2
+ }
+ }
+}
positioning-multi--measure-rests.ly
positioning-text-markups-inside-slurs.ly
printing-a-repeat-sign-at-the-beginning-of-a-piece.ly
+printing-bar-numbers-inside-boxes-or-circles.ly
printing-metronome-and-rehearsal-marks-below-the-staff.ly
proportional-strict-notespacing.ly
removing-the-first-empty-line.ly
--- /dev/null
+%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%% This file is in the public domain.
+\version "2.13.1"
+
+\header {
+ lsrtags = "rhythms"
+
+ texidoc = "
+The slash through the stem found in acciaccaturas can be applied in
+other situations.
+
+"
+ doctitle = "Using grace note slashes with normal heads"
+} % begin verbatim
+
+\relative c'' {
+ \override Stem #'stroke-style = #"grace"
+ c8( d2) e8( f4)
+}
\new TabStaff {
\override Staff.Clef #'stencil = #(lambda (grob)
- ly:clef::print (grob-interpret-markup grob TAB))
+ (grob-interpret-markup grob TAB))
a
}
--- /dev/null
+\version "2.12.0"
+
+\header {
+ lsrtags = "rhythms"
+ texidoc = "
+The layout of grace expressions can be changed throughout the
+music using the functions @code{add-grace-property} and
+@code{remove-grace-property}. The following example undefines
+the @code{Stem} direction for this grace, so that stems do not
+always point up, and changes the default note heads to crosses.
+"
+ doctitle = "Tweaking grace layout within music"
+}
+
+\relative c'' {
+ \new Staff {
+ #(remove-grace-property 'Voice 'Stem 'direction)
+ #(add-grace-property 'Voice 'NoteHead 'style 'cross)
+ \new Voice {
+ \acciaccatura { f16 } g4
+ \grace { d16[ e] } f4
+ \appoggiatura { f,32[ g a] } e2
+ }
+ }
+}
-
\version "2.12.0"
\header{
texidoc="
"
}
-
-\layout { ragged-right = ##t }
-
thenotes = \relative cis' {
\time 4/4
gisis'4 gis geses ges |
<<
\context Staff \thenotes
- \context NoteNames {
- \override NoteNames.NoteName #'no-spacing-rods = ##f
- \thenotes
- }
+ \context NoteNames \thenotes
>>
-
-
--- /dev/null
+\version "2.12.0"
+
+\header {
+ texidoc="
+Fret diagrams of different orientation should share a common origin
+of the topmost fret or string.
+
+"
+}
+
+\include "predefined-guitar-fretboards.ly"
+\layout { ragged-right = ##t }
+<<
+ \chords {
+ c1 |
+ c1 |
+ c1
+ }
+
+ \new FretBoards {
+ \chordmode{
+ c1 |
+ \override FretBoard #'fret-diagram-details
+ #'orientation = #'landscape
+ c1 |
+ \override FretBoard #'fret-diagram-details
+ #'orientation = #'opposing-landscape
+ c1
+ }
+ }
+
+ \new Voice {
+ c'1 |
+ c'1 |
+ c'
+ }
+>>
+
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="2.0">
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">Several ties that have their end tag missing.</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name></part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="1">
+ <attributes>
+ <divisions>1</divisions>
+ <key>
+ <fifths>0</fifths>
+ <mode>major</mode>
+ </key>
+ <time symbol="common">
+ <beats>4</beats>
+ <beat-type>4</beat-type>
+ </time>
+ <clef>
+ <sign>G</sign>
+ <line>2</line>
+ </clef>
+ </attributes>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <tie type="start"/>
+ <voice>1</voice>
+ <type>whole</type>
+ <notations>
+ <tied type="start"/>
+ </notations>
+ <lyric number="1">
+ <syllabic>end</syllabic>
+ <text>A</text>
+ </lyric>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="2">
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ <lyric number="1">
+ <syllabic>end</syllabic>
+ <text>B</text>
+ </lyric>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="3">
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <tie type="stop"/>
+ <tie type="start"/>
+ <voice>1</voice>
+ <type>whole</type>
+ <notations>
+ <tied type="stop"/>
+ <tied type="start"/>
+ </notations>
+ <lyric number="1">
+ <syllabic>end</syllabic>
+ <text>C</text>
+ </lyric>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="4">
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <tie type="start"/>
+ <voice>1</voice>
+ <type>whole</type>
+ <notations>
+ <tied type="start"/>
+ </notations>
+ <lyric number="1" name="verse">
+ <syllabic>end</syllabic>
+ <text>D</text>
+ </lyric>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="5">
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <tie type="stop"/>
+ <voice>1</voice>
+ <type>whole</type>
+ <notations>
+ <tied type="stop"/>
+ </notations>
+ <lyric number="1" name="verse">
+ <syllabic>end</syllabic>
+ <text>E</text>
+ </lyric>
+ </note>
+ <barline location="right">
+ <bar-style>light-heavy</bar-style>
+ </barline>
+ </measure>
+ </part>
+ <!--=========================================================-->
+</score-partwise>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="2.0">
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">A part with no id attribute.
+ Since this piece has only one part, it is clear which part
+ is described by the one part element.</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name print-object="no">MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <part>
+ <measure number="1">
+ <note>
+ <rest/>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ </part>
+</score-partwise>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="2.0">
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">This piece has more part elements
+ than the part-list section gives. One can either convert all
+ the parts present, but not listed in the part-list, or simply
+ not import / ignore them.</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name print-object="no">MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <part id="P1">
+ <measure number="1">
+ <note>
+ <rest/>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ </part>
+ <part id="P3">
+ <measure number="1">
+ <note>
+ <rest/>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ </part>
+ <part id="P4">
+ <measure number="1">
+ <note>
+ <rest/>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ </part>
+</score-partwise>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="2.0">
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">Measures can contain less notes
+ than the time signature says. Here, the first and third measures
+ contain only two quarters instead of four.</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name>MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="1">
+ <attributes>
+ <divisions>1</divisions>
+ <time>
+ <beats>4</beats>
+ <beat-type>4</beat-type>
+ </time>
+ <clef>
+ <sign>G</sign>
+ <line>2</line>
+ </clef>
+ </attributes>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ </measure>
+ <measure number="2">
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ </measure>
+ <measure number="3">
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ </measure>
+ <measure number="4">
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ </measure>
+ </part>
+</score-partwise>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="2.0">
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">Pickup measure with chord names
+ and figured bass.</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name>MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="0" implicit="yes">
+ <attributes>
+ <divisions>2</divisions>
+ <key>
+ <fifths>0</fifths>
+ <mode>major</mode>
+ </key>
+ <time>
+ <beats>4</beats>
+ <beat-type>4</beat-type>
+ </time>
+ </attributes>
+ <harmony print-frame="no">
+ <root>
+ <root-step>C</root-step>
+ </root>
+ <kind>major</kind>
+ </harmony>
+ <figured-bass>
+ <figure><figure-number>3</figure-number></figure>
+ <duration>1</duration>
+ </figured-bass>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>eighth</type>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>1</duration>
+ <voice>1</voice>
+ <type>eighth</type>
+ </note>
+ </measure>
+ <measure number="1">
+ <harmony print-frame="no">
+ <root>
+ <root-step>C</root-step>
+ </root>
+ <kind>major</kind>
+ </harmony>
+ <figured-bass>
+ <figure><figure-number>3</figure-number></figure>
+ <duration>1</duration>
+ </figured-bass>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>2</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>2</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>2</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>2</duration>
+ <voice>1</voice>
+ <type>quarter</type>
+ </note>
+ </measure>
+ </part>
+</score-partwise>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="2.0">
+ <work>
+ <work-number></work-number>
+ <work-title></work-title>
+ </work>
+ <movement-number></movement-number>
+ <movement-title>Empty work-title, non-empty movement-title</movement-title>
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">A piece with an empty (but
+ existing) work-title, but a non-empty movement-title. In this case
+ the movement-title should be chosen, even though the work-title
+ exists.</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name print-object="no">MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="1">
+ <note>
+ <rest/>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ </part>
+ <!--=========================================================-->
+</score-partwise>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 1.1 Partwise//EN"
+ "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise>
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">System and page breaks, given in
+ a <print> element</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name print-object="no">MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="1">
+ <attributes>
+ <divisions>1</divisions>
+ <time symbol="common">
+ <beats>4</beats>
+ <beat-type>4</beat-type>
+ </time>
+ </attributes>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="2">
+ <print new-system="yes"/>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ <!--=======================================================-->
+ <measure number="3">
+ <print new-page="yes"/>
+ <note>
+ <pitch>
+ <step>C</step>
+ <octave>5</octave>
+ </pitch>
+ <duration>4</duration>
+ <voice>1</voice>
+ <type>whole</type>
+ </note>
+ </measure>
+ </part>
+ <!--=========================================================-->
+</score-partwise>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE score-partwise PUBLIC "-//Recordare//DTD MusicXML 2.0 Partwise//EN" "http://www.musicxml.org/dtds/partwise.dtd">
+<score-partwise version="2.0">
+ <identification>
+ <miscellaneous>
+ <miscellaneous-field name="description">There can be multiple subsequent
+ harmony elements, indicating a harmony change during a note</miscellaneous-field>
+ </miscellaneous>
+ </identification>
+ <part-list>
+ <score-part id="P1">
+ <part-name>MusicXML Part</part-name>
+ </score-part>
+ </part-list>
+ <!--=========================================================-->
+ <part id="P1">
+ <measure number="1">
+ <attributes>
+ <divisions>480</divisions>
+ <key>
+ <fifths>0</fifths>
+ <mode>major</mode>
+ </key>
+ <time>
+ <beats>4</beats>
+ <beat-type>4</beat-type>
+ </time>
+ <clef>
+ <sign>G</sign>
+ <line>2</line>
+ </clef>
+ </attributes>
+ <harmony print-frame="no">
+ <root>
+ <root-step>C</root-step>
+ </root>
+ <kind text="">major</kind>
+ </harmony>
+ <harmony print-frame="no">
+ <root>
+ <root-step>F</root-step>
+ <root-alter>1</root-alter>
+ </root>
+ <kind text="m6">minor-sixth</kind>
+ </harmony>
+ <note>
+ <pitch>
+ <step>A</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>960</duration>
+ <voice>1</voice>
+ <type>half</type>
+ </note>
+ <harmony print-frame="no">
+ <root>
+ <root-step>D</root-step>
+ </root>
+ <kind text="m7">minor-seventh</kind>
+ </harmony>
+ <harmony print-frame="no">
+ <root>
+ <root-step>G</root-step>
+ </root>
+ <kind text="7">dominant</kind>
+ </harmony>
+ <note>
+ <pitch>
+ <step>G</step>
+ <octave>4</octave>
+ </pitch>
+ <duration>960</duration>
+ <voice>1</voice>
+ <type>half</type>
+ </note>
+ </measure>
+ </part>
+</score-partwise>
-
\version "2.12.0"
\header{
- texidoc=" By default, text is set with empty horizontal dimensions.
-The boolean property @code{no-spacing-rods} in @code{TextScript} is used
-to control the horizontal size of text. " }
+ texidoc = "By default, text is set with empty horizontal dimensions.
+The property @code{extra-spacing-width} in @code{TextScript} is used
+to control the horizontal size of text."
+}
\layout {
line-width = 3.0\cm
\relative c''{
%% \textLengthOff
- %% short for \override TextScript #'no-spacing-rods = ##t
+ %% short for \override TextScript #'extra-spacing-width = #'(+inf.0 . -inf.0)
+ %% \override TextScript #'extra-spacing-height = #'(0 . 0)
c2_"very wide and long text" c | \break
- %% short for \override TextScript #'no-spacing-rods = ##f
+ %% short for \override TextScript #'extra-spacing-width = #'(0 . 0)
+ %% \override TextScript #'extra-spacing-height = #'(-inf.0 . +inf.0)
\textLengthOn
- c_"very wide and long text" c
+ c2_"very wide and long text" c
}
-
-
\version "2.12.0"
\header {
- texidoc = "Spacing corrections for kneed beams still work when compression is involved."
+ texidoc = "Spacing corrections for kneed beams still work when
+compression is involved."
}
-\paper { line-width = 14.4 \cm }
+\paper { line-width = 14.4\cm }
rh = \change Staff = "rh"
lh = \change Staff = "lh"
\new PianoStaff <<
- \new Staff ="rh" {
- s1*3
- }
- \new Staff ="lh" {
- \clef bass
- \repeat unfold 12 { \rh a'16 \lh d \rh a' \lh d \noBreak}
- }
+ \new Staff ="rh" {
+ s1*3
+ }
+ \new Staff ="lh" \new Voice {
+ \clef bass
+ \repeat unfold 12 { \rh a'16 \lh d \rh a' \lh d \noBreak }
+ }
>>
\ No newline at end of file
--- /dev/null
+\version "2.13.1"
+\header {
+ texidoc = "Consecutive trill spans work without explicit
+@code{\\stopTrillSpan} commands, since successive trill spanners
+will automatically become the right bound of the previous trill.
+"
+}
+
+\paper { ragged-right = ##f }
+
+\relative c'' {
+ c1\startTrillSpan
+ c1\startTrillSpan
+ c2\stopTrillSpan r
+}
--- /dev/null
+\version "2.13.1"
+\header {
+ texidoc = "Chained trills end at the next trill or barline.
+Collisions can be prevented by overriding @code{bound-details}.
+"
+}
+
+\paper { ragged-right = ##f }
+
+\relative c'' {
+ g8 f\startTrillSpan ~
+ f8 g\stopTrillSpan \startTrillSpan ~
+ g8 r\stopTrillSpan r4
+ \once \override TrillSpanner #'to-barline = ##t
+ c1\startTrillSpan ~
+ c1
+ \once \override TrillSpanner #'(bound-details right padding) = #1.2
+ c1\stopTrillSpan \startTrillSpan
+ c1\stopTrillSpan\startTrillSpan
+}
{
SCM details = him->get_property ("details");
- /*
- TODO: The default values should be copied to define-grobs.scm.
- */
- INTER_QUANT_PENALTY = get_detail (details, ly_symbol2scm ("inter-quant-penalty"), 1000.0);
SECONDARY_BEAM_DEMERIT = get_detail (details, ly_symbol2scm ("secondary-beam-demerit"), 10.0);
STEM_LENGTH_DEMERIT_FACTOR = get_detail (details, ly_symbol2scm ("stem-length-demerit-factor"), 5);
REGION_SIZE = get_detail (details, ly_symbol2scm ("region-size"), 2);
"The @code{thickness} property is the weight of beams,"
" measured in staffspace. The @code{direction} property is"
" not user-serviceable. Use the @code{direction} property"
- " of @code{Stem} instead.",
+ " of @code{Stem} instead.\n"
+ "\n"
+ "The following properties may be set in the @code{details}"
+ " list.\n"
+ "\n"
+ "@table @code\n"
+ "@item stem-length-demerit-factor\n"
+ "Demerit factor used for inappropriate stem lengths.\n"
+ "@item secondary-beam-demerit\n"
+ "Demerit used in quanting calculations for multiple"
+ " beams.\n"
+ "@item region-size\n"
+ "Size of region for checking quant scores.\n"
+ "@item beam-eps\n"
+ "Epsilon for beam quant code to check for presence"
+ " in gap.\n"
+ "@item stem-length-limit-penalty\n"
+ "Penalty for differences in stem lengths on a beam.\n"
+ "@item damping-direction-penalty\n"
+ "Demerit penalty applied when beam direction is different"
+ " from damping direction.\n"
+ "@item hint-direction-penalty\n"
+ "Demerit penalty applied when beam direction is different"
+ " from damping direction, but damping slope is"
+ " <= @code{round-to-zero-slope}.\n"
+ "@item musical-direction-factor\n"
+ "Demerit scaling factor for difference between"
+ " beam slope and music slope.\n"
+ "@item ideal-slope-factor\n"
+ "Demerit scaling factor for difference between"
+ " beam slope and damping slope.\n"
+ "@item round-to-zero-slope\n"
+ "Damping slope which is considered zero for purposes of"
+ " calculating direction penalties.\n"
+ "@end table\n",
/* properties */
"annotation "
/*
- beaming-info.cc -- implement Beam_rhythmic_element, Beaming_pattern
+ beaming-pattern.cc -- implement Beam_rhythmic_element, Beaming_pattern
A Beaming_pattern object takes a set of stems at given moments and calculates
the pattern of their beam. That is, it works out, for each stem, how many
grouping_ = context->get_property ("beatGrouping");
subdivide_beams_ = to_boolean (context->get_property ("subdivideBeams"));
beat_length_ = robust_scm2moment (context->get_property ("beatLength"), Moment (1, 4));
- measure_length_ = robust_scm2moment (context->get_property ("measureLength"), Moment (1, 4));
+ measure_length_ = robust_scm2moment (context->get_property ("measureLength"), Moment (4, 4));
}
Beaming_options::Beaming_options ()
" The error is formatted with @code{format} and @var{rest}.")
{
LY_ASSERT_TYPE (scm_is_string, str, 1);
+ if (scm_is_pair(scm_car(rest)))
+ rest=scm_car(rest);
str = scm_simple_format (SCM_BOOL_F, str, rest);
error (ly_scm2string (str));
return SCM_UNSPECIFIED;
*/
struct Beam_quant_parameters
{
- Real INTER_QUANT_PENALTY;
Real SECONDARY_BEAM_DEMERIT;
Real STEM_LENGTH_DEMERIT_FACTOR;
Real REGION_SIZE;
Midi_note::Midi_note (Audio_note *a)
{
audio_ = a;
- dynamic_byte_ = 0x7f;
+ dynamic_byte_ = 0x5a;
}
on_ = n;
channel_ = n->channel_;
- // Anybody who hears any difference, or knows how this works?
- // 0 should definitely be avoided, notes stick on some sound cards.
- // 64 is supposed to be neutral
-
- aftertouch_byte_ = 64;
+ // use note_on with velocity=0 instead of note_off
+ aftertouch_byte_ = 0;
}
string
Midi_note_off::to_string () const
{
- Byte status_byte = (char) (0x80 + channel_);
+ Byte status_byte = (char) (0x90 + channel_);
string str = ::to_string ((char)status_byte);
str += ::to_string ((char) (get_semitone_pitch () + Midi_note::c0_pitch_));
finished_ = 0;
current_event_ = 0;
span_ = 0;
- event_drul_[START] = 0;
- event_drul_[STOP] = 0;
+ event_drul_.set (0, 0);
}
IMPLEMENT_TRANSLATOR_LISTENER (Trill_spanner_engraver, trill_span);
void
Trill_spanner_engraver::acknowledge_note_column (Grob_info info)
{
- if (span_) {
- Pointer_group_interface::add_grob (span_,
- ly_symbol2scm ("note-columns"),
- info.grob());
- add_bound_item (span_, info.grob ());
- } else if (finished_) {
- Pointer_group_interface::add_grob (finished_, ly_symbol2scm ("note-columns"),
- info.grob());
- add_bound_item (finished_, info.grob ());
- }
+ if (span_)
+ {
+ Pointer_group_interface::add_grob (span_,
+ ly_symbol2scm ("note-columns"),
+ info.grob());
+ if (!span_->get_bound (LEFT))
+ add_bound_item (span_, info.grob ());
+ }
+ else if (finished_)
+ {
+ Pointer_group_interface::add_grob (finished_, ly_symbol2scm ("note-columns"),
+ info.grob());
+ if (!finished_->get_bound (RIGHT))
+ add_bound_item (finished_, info.grob ());
+ }
}
void
Trill_spanner_engraver::process_music ()
{
- if (event_drul_[STOP])
+ if (span_
+ && (event_drul_[STOP] || event_drul_[START]))
{
- if (!span_)
- event_drul_[STOP]->origin ()->warning (_ ("cannot find start of trill spanner"));
- else
- {
- finished_ = span_;
- announce_end_grob (finished_, SCM_EOL);
- span_ = 0;
- current_event_ = 0;
- }
+ Stream_event *ender = event_drul_[STOP];
+ if (!ender)
+ ender = event_drul_[START];
+ finished_ = span_;
+ announce_end_grob (finished_, ender->self_scm ());
+ span_ = 0;
+ current_event_ = 0;
}
if (event_drul_[START])
{
- if (current_event_)
- event_drul_[START]->origin ()->warning (_ ("already have a trill spanner"));
- else
- {
- current_event_ = event_drul_[START];
- span_ = make_spanner ("TrillSpanner", event_drul_[START]->self_scm ());
- Side_position_interface::set_axis (span_, Y_AXIS);
- event_drul_[START] = 0;
- }
+ current_event_ = event_drul_[START];
+ span_ = make_spanner ("TrillSpanner", event_drul_[START]->self_scm ());
+ Side_position_interface::set_axis (span_, Y_AXIS);
}
}
}
typeset_all ();
- event_drul_[START] = 0;
- event_drul_[STOP] = 0;
+ event_drul_.set (0, 0);
}
void
typeset_all ();
if (span_)
{
- finished_ = span_;
- typeset_all ();
+ Grob *e = unsmob_grob (get_property ("currentCommandColumn"));
+ span_->set_bound (RIGHT, e);
}
}
"TrillSpanner ",
/* read */
- "",
+ "currentCommandColumn "
+ "currentMusicalColumn ",
/* write */
""
$Texi2HTML::Config::foot_line_and_ref = \&makeinfo_like_foot_line_and_ref;
$Texi2HTML::Config::foot_lines = \&makeinfo_like_foot_lines;
$Texi2HTML::Config::paragraph = \&makeinfo_like_paragraph;
-$Texi2HTML::Config::init_out = \&lilypond_init_out;
# according to node titles, which works by simply overriding the id element of
# the $element hash.
# If an external nodename<=>filename/anchor map file is found (loaded in
-# lilypond_init_out, use the externally created values, otherwise use the
+# the command handler, use the externally created values, otherwise use the
# same logic here.
sub lilypond_element_file_name($$$)
{
$page_toc_depth = 1;
}
}
-# We can't use a command-handler, because texinfo variables are not yet
-# available at that stage:
-# push @Texi2HTML::Config::command_handler_init, \&lilypond_init_toc_depth;
+# Set the TOC-depth (depending on a texinfo variable short_toc) in a
+# command-handler, so we have them available when creating the pages
+push @Texi2HTML::Config::command_handler_process, \&lilypond_init_toc_depth;
-# Initialize the toc_depth to 1 if the command-line option -D=short_toc is given
-sub lilypond_init_out()
-{
- my $rval = t2h_default_init_out();
- lilypond_init_toc_depth ();
- return $rval;
-}
# recursively generate the TOC entries for the element and its children (which
# are only shown up to maxlevel. All ancestors of the current element are also
sub lilypond_toc_body($)
{
my $elements_list = shift;
- # Workaround: Initialize the toc-depth here, because init_out is called
- # only later in texi2html 1.83
- lilypond_init_toc_depth ();
# Generate a default TOC for pages without THIS_ELEMENT
@default_toc = lilypond_generate_page_toc_body(@$elements_list[0]);
return T2H_GPL_toc_body($elements_list);
return re.sub ('ly:clone-parser',
'ly:parser-clone', str)
+@rule ((2, 11, 3), "no-spacing-rods -> extra-spacing-width")
+def conv (str):
+ str = re.sub (r"no-spacing-rods\s+=\s+##t", r"extra-spacing-width = #'(+inf.0 . -inf.0)", str)
+ str = re.sub (r"no-spacing-rods\s+=\s+##f", r"extra-spacing-width = #'(0 . 0)", str)
+ return str
+
@rule ((2, 11, 5), _ ("deprecate cautionary-style. Use AccidentalCautionary properties"))
def conv (str):
return 'R%s' % self.duration.ly_expression ()
+class Break (Music):
+ def __init__ (self, tp="break"):
+ Music.__init__ (self)
+ self.type = tp
+ def print_ly (self, printer):
+ if self.type:
+ printer.dump ("\\%s" % self.type)
+
class StaffGroup:
def __init__ (self, command = "StaffGroup"):
self.stafftype = command
if not (isinstance (n, Note) or isinstance (n, Attributes) or
isinstance (n, Direction) or isinstance (n, Partial) or
isinstance (n, Barline) or isinstance (n, Harmony) or
- isinstance (n, FiguredBass) ):
+ isinstance (n, FiguredBass) or isinstance (n, Print)):
continue
if isinstance (n, Attributes) and not start_attr:
voices[v].add_element (staff_attributes)
continue
- if isinstance (n, Partial) or isinstance (n, Barline):
+ if isinstance (n, Partial) or isinstance (n, Barline) or isinstance (n, Print):
for v in voices.keys ():
voices[v].add_element (n)
continue
class PerMinute (Music_xml_node):
pass
+class Print (Music_xml_node):
+ pass
+
## need this, not all classes are instantiated
'pedal': Pedal,
'per-minute': PerMinute,
'pitch': Pitch,
+ 'print': Print,
'rest': Rest,
'root': Root,
'score-part': Score_part,
whitespace. If negative, no line is drawn at all.")
(default-direction ,ly:dir? "Direction determined by note head
positions.")
+ (details ,list? "Alist of parameters for detailed grob behavior.
+More information on the allowed parameters for a grob can be found by
+looking at the top of the Internals Reference page for each interface
+having a @code{details} property.")
(digit-names ,vector "Names for string finger digits.")
(direction ,ly:dir? "If @code{side-axis} is @code{0} (or
@code{#X}), then this property determines whether the object is placed
(cause ,scheme? "Any kind of causation objects (i.e., music, or perhaps
translator) that was the cause for this grob.")
- (delta-position ,number? "The vertical position difference.")
- (details ,list? "Alist of parameters for detailed grob behavior.
-More information on the allowed parameters can be found by inspecting
-@file{lily/slur-scoring.cc}, @file{lily/beam-quanting.cc}, and
-@file{lily/tie-formatting-problem.cc}. Setting @code{debug-tie-scoring},
-@code{debug-beam-scoring} or @code{debug-slur-scoring} also provides
-useful clues.")
+ (delta-position ,number? "The vertical position difference.")
(font ,ly:font-metric? "A cached font metric object.")
(stencil . ,ly:beam::print)
(clip-edges . #t)
(cross-staff . ,ly:beam::calc-cross-staff)
-
- (details . ((hint-direction-penalty . 20)))
+ (details
+ .(
+ (secondary-beam-demerit . 10)
+ (stem-length-demerit-factor . 5)
+ (region-size . 2)
+ (beam-eps . 0.001)
+ (stem-length-limit-penalty . 5000)
+ (damping-direction-penalty . 800)
+ (hint-direction-penalty . 20)
+ (musical-direction-factor . 400)
+ (ideal-slope-factor . 10)
+ (round-to-zero-slope . 0.02)))
;; TODO: should be in SLT.
(thickness . 0.48) ; in staff-space
(neutral-direction . ,DOWN)
; Utility functions
;
;
-
+
(define (string-x-extent start-point end-point)
"Return the x-extent of a string that goes from start-point
to end-point."
(third this-list)))
(subtract-base-fret base-fret (cdr dot-list))))))
-(define (make-bezier-sandwich-list start stop base height
- half-thickness orientation)
- "Make the argument list for a bezier sandwich from
-string coordinate @var{start} to string-coordinate @var{stop} with a
-baseline at fret coordinate @var{base}, a height of
-@var{height}, and a half thickness of @var{half-thickness}."
- (let* ((width (+ (- stop start) 1))
- (cp-left-width (+ (* width half-thickness) start))
- (cp-right-width (- stop (* width half-thickness)))
- (bottom-control-point-height
- (- base (- height half-thickness)))
- (top-control-point-height
- (- base height))
- (left-end-point
- (stencil-coordinates base start orientation))
- (right-end-point
- (stencil-coordinates base stop orientation))
- (left-upper-control-point
- (stencil-coordinates
- top-control-point-height cp-left-width orientation))
- (left-lower-control-point
- (stencil-coordinates
- bottom-control-point-height cp-left-width orientation))
- (right-upper-control-point
- (stencil-coordinates
- top-control-point-height cp-right-width orientation))
- (right-lower-control-point
- (stencil-coordinates
- bottom-control-point-height cp-right-width orientation)))
- ; order of bezier control points is:
- ; left cp low, right cp low, right end low, left end low
- ; right cp high, left cp high, left end high, right end high.
- ;
- (list left-lower-control-point
- right-lower-control-point
- right-end-point
- left-end-point
- right-upper-control-point
- left-upper-control-point
- left-end-point
- right-end-point)))
-
(define (drop-paren item-list)
"Drop a final parentheses from a fret indication list
@code{item-list} resulting from a terse string specification of barre."
;
; Conversions between fret/string coordinate system and x-y coordinate
; system.
-;
+;
; Fret coordinates are measured down the fretboard from the nut,
; starting at 0.
;
(cons (- (cdr extent)) (- (car extent))))
(define (stencil-fretboard-extent stencil fretboard-axis orientation)
- "Return the extent of @code{stencil} in the @code{fretboard-axis}
+ "Return the extent of @code{stencil} in the @code{fretboard-axis}
direction."
(if (eq? fretboard-axis 'fret)
(cond ((eq? orientation 'landscape)
(define (stencil-fretboard-offset stencil fretboard-axis orientation)
"Return a the stencil coordinates of the center of @code{stencil}
in the @code{fretboard-axis} direction."
- (* 0.5 (interval-length
+ (* 0.5 (interval-length
(stencil-fretboard-extent stencil fretboard-axis orientation))))
-(define (stencil-coordinates fret-coordinate string-coordinate orientation)
- "Return a pair @code{(x-coordinate . y-coordinate)} in stencil coordinate
-system."
- (cond
- ((eq? orientation 'landscape)
- (cons fret-coordinate string-coordinate))
- ((eq? orientation 'opposing-landscape)
- (cons (- fret-coordinate) (- string-coordinate)))
- (else
- (cons string-coordinate (- fret-coordinate)))))
-
+
(define (string-thickness string thickness-factor)
(expt (1+ thickness-factor) (1- string)))
-
+
;
; Functions that create stencils used in the fret diagram
;
(prepend-alist-chain 'font-family 'sans props))))
(interpret-markup layout my-props text)))
-
-(define (string-stencil string string-count fret-range
- th thickness-factor size orientation)
- "Make a stencil for @code{string}, given the fret-diagram
-overall parameters."
- (let* ((string-coordinate (- string-count string))
- (current-string-thickness
- (* th size (string-thickness string thickness-factor)))
- (fret-half-thickness (* size th 0.5))
- (half-string (* current-string-thickness 0.5))
- (start-coordinates
- (stencil-coordinates
- (- fret-half-thickness)
- (- (* size string-coordinate) half-string)
- orientation))
- (end-coordinates
- (stencil-coordinates
- (+ fret-half-thickness (* size (1+ (fret-count fret-range))))
- (+ half-string (* size string-coordinate))
- orientation)))
- (ly:round-filled-box (string-x-extent start-coordinates end-coordinates)
- (string-y-extent start-coordinates end-coordinates)
- (* th size))))
-
-(define (fret-stencil fret string-count th
- thickness-factor size orientation)
- "Make a stencil for @code{fret}, given the fret-diagram overall parameters."
- (let* ((low-string-half-thickness
- (* 0.5 size th (string-thickness string-count thickness-factor)))
- (fret-half-thickness (* 0.5 size th))
- (start-coordinates
- (stencil-coordinates
- (* size fret)
- (- fret-half-thickness low-string-half-thickness)
- orientation))
- (end-coordinates
- (stencil-coordinates
- (* size fret)
- (* size (1- string-count))
- orientation)))
- (make-line-stencil
- (* size th)
- (car start-coordinates) (cdr start-coordinates)
- (car end-coordinates) (cdr end-coordinates))))
-
-(define (make-straight-barre-stencil
- size half-thickness fret-coordinate
- start-string-coordinate end-string-coordinate orientation)
- "Create a straight barre stencil."
- (let ((start-point
- (stencil-coordinates
- (* size fret-coordinate)
- (* size start-string-coordinate)
- orientation))
- (end-point
- (stencil-coordinates
- (* size fret-coordinate)
- (* size end-string-coordinate)
- orientation)))
- (make-line-stencil
- half-thickness
- (car start-point)
- (cdr start-point)
- (car end-point)
- (cdr end-point))))
-
-(define (make-curved-barre-stencil
- size half-thickness fret-coordinate
- start-string-coordinate end-string-coordinate orientation)
- "Create a curved barre stencil."
- (let* ((bezier-thick 0.1)
- (bezier-height 0.5)
- (bezier-list
- (make-bezier-sandwich-list
- (* size start-string-coordinate)
- (* size end-string-coordinate)
- (* size fret-coordinate)
- (* size bezier-height)
- (* size bezier-thick)
- orientation))
- (box-lower-left
- (stencil-coordinates
- (+ (* size fret-coordinate) half-thickness)
- (- (* size start-string-coordinate) half-thickness)
- orientation))
- (box-upper-right
- (stencil-coordinates
- (- (* size fret-coordinate) (* size bezier-height) half-thickness)
- (+ (* size end-string-coordinate) half-thickness)
- orientation))
- (x-extent (cons (car box-lower-left) (car box-upper-right)))
- (y-extent (cons (cdr box-lower-left) (cdr box-upper-right))))
- (ly:make-stencil
- (list 'bezier-sandwich
- `(quote ,bezier-list)
- (* size bezier-thick))
- x-extent
- y-extent)))
-
-
-;
-;
-; Functions used to draw fret-diagram elements
-;
-;
-
-(define (draw-strings string-count fret-range th
- thickness-factor size orientation)
- "Draw the string lines for a fret diagram with
-@var{string-count} strings and frets as indicated in @var{fret-range}.
-Line thickness is given by @var{th}, fret & string spacing by
-@var{size}. Orientation is determined by @var{orientation}. "
-
- (define (helper x)
- (if (null? (cdr x))
- (string-stencil
- (car x) string-count fret-range th
- thickness-factor size orientation)
- (ly:stencil-add
- (string-stencil
- (car x) string-count fret-range th
- thickness-factor size orientation)
- (helper (cdr x)))))
-
- (let* ( (string-list (map 1+ (iota string-count))))
- (helper string-list)))
-
-(define (draw-fret-lines fret-count string-count th
- thickness-factor size orientation)
- "Draw @var{fret-count} fret lines for a fret diagram
-with @var{string-count} strings. Line thickness is given by @var{th},
-fret & string spacing by @var{size}. Orientation is given by @var{orientation}"
- (define (helper x)
- (if (null? (cdr x))
- (fret-stencil
- (car x) string-count th thickness-factor
- size orientation)
- (ly:stencil-add
- (fret-stencil
- (car x) string-count th thickness-factor
- size orientation)
- (helper (cdr x)))))
-
- (let* ( (fret-list (iota (1+ fret-count))))
- (helper fret-list)))
-
-(define (draw-thick-zero-fret details string-count th
- thickness-factor size orientation)
- "Draw a thick zeroth fret for a fret diagram whose base fret is 1."
- (let* ((sth (* th size))
- (half-lowest-string-thickness
- (* 0.5 th (string-thickness string-count thickness-factor)))
- (half-thick (* 0.5 sth))
- (top-fret-thick
- (* sth (assoc-get 'top-fret-thickness details 3.0)))
- (start-string-coordinate (- half-lowest-string-thickness))
- (end-string-coordinate (+ (* size (1- string-count)) half-thick))
- (start-fret-coordinate half-thick)
- (end-fret-coordinate (- half-thick top-fret-thick))
- (lower-left
- (stencil-coordinates
- start-fret-coordinate start-string-coordinate orientation))
- (upper-right
- (stencil-coordinates
- end-fret-coordinate end-string-coordinate orientation)))
- (ly:round-filled-box
- (cons (car lower-left) (car upper-right))
- (cons (cdr lower-left) (cdr upper-right))
- sth)))
-
-
-(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 @var{fret}."
-(let* ((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 (1- (+ dot-pos fret))))
- (start-point
- (stencil-coordinates fret-pos first-string-pos orientation))
- (end-point
- (stencil-coordinates fret-pos last-string-pos orientation)))
- (make-line-stencil
- capo-thick
- (car start-point) (cdr start-point)
- (car end-point) (cdr end-point))))
-
-(define (draw-frets fret-range string-count th
- thickness-factor size orientation)
- "Draw the fret lines for a fret diagram with
-@var{string-count} strings and frets as indicated in @var{fret-range}.
-Line thickness is given by @var{th}, fret & string spacing by
-@var{size}. Orientation is given by @var{orientation}."
- (let* ((my-fret-count (fret-count fret-range)))
- (draw-fret-lines
- my-fret-count string-count th thickness-factor size orientation)))
-
-(define (draw-dots layout props string-count fret-count
- size finger-code
- dot-position dot-radius dot-thickness dot-list orientation)
- "Make dots for fret diagram."
-
- (let* ((details (merge-details 'fret-diagram-details props '()))
- (scale-dot-radius (* size dot-radius))
- (scale-dot-thick (* size dot-thickness))
- (dot-color (assoc-get 'dot-color details 'black))
- (finger-label-padding 0.3)
- (dot-label-font-mag
- (* scale-dot-radius (assoc-get 'dot-label-font-mag details 1.0)))
- (string-label-font-mag
- (* size
- (assoc-get 'string-label-font-mag details
- (cond ((or (eq? orientation 'landscape)
- (eq? orientation 'opposing-landscape))
- 0.5)
- (else 0.6)))))
- (mypair (car dot-list))
- (restlist (cdr dot-list))
- (string (car mypair))
- (fret (cadr mypair))
- (fret-coordinate (* size (+ (1- fret) dot-position)))
- (string-coordinate (* size (- string-count string)))
- (dot-coordinates
- (stencil-coordinates fret-coordinate string-coordinate orientation))
- (extent (cons (- scale-dot-radius) scale-dot-radius))
- (finger (caddr mypair))
- (finger (if (number? finger) (number->string finger) finger))
- (dot-stencil (if (eq? dot-color 'white)
- (ly:stencil-add
- (make-circle-stencil
- scale-dot-radius scale-dot-thick #t)
- (ly:stencil-in-color
- (make-circle-stencil
- (- scale-dot-radius (* 0.5 scale-dot-thick))
- 0 #t)
- 1 1 1))
- (make-circle-stencil
- scale-dot-radius scale-dot-thick #t)))
- (positioned-dot (ly:stencil-translate dot-stencil dot-coordinates))
- (labeled-dot-stencil
- (cond
- ((or (eq? finger '())(eq? finger-code 'none))
- positioned-dot)
- ((eq? finger-code 'in-dot)
- (let ((finger-label
- (centered-stencil
- (sans-serif-stencil
- layout props dot-label-font-mag finger))))
- (ly:stencil-translate
- (ly:stencil-add
- dot-stencil
- (if (eq? dot-color 'white)
- finger-label
- (ly:stencil-in-color finger-label 1 1 1)))
- dot-coordinates)))
- ((eq? finger-code 'below-string)
- (let* ((label-stencil
- (centered-stencil
- (sans-serif-stencil
- layout props string-label-font-mag
- finger)))
- (label-fret-offset
- (stencil-fretboard-offset
- label-stencil 'fret orientation))
- (label-fret-coordinate
- (+ (* size (+ 1 fret-count finger-label-padding))
- label-fret-offset))
- (label-string-coordinate string-coordinate)
- (label-translation
- (stencil-coordinates
- label-fret-coordinate
- label-string-coordinate
- orientation)))
- (ly:stencil-add
- positioned-dot
- (ly:stencil-translate label-stencil label-translation))))
- (else ;unknown finger-code
- positioned-dot))))
- (if (null? restlist)
- labeled-dot-stencil
- (ly:stencil-add
- (draw-dots
- layout props string-count fret-count size finger-code
- dot-position dot-radius dot-thickness restlist orientation)
- labeled-dot-stencil))))
-
-(define (draw-xo
- layout props string-count fret-range size xo-list orientation)
- "Put open and mute string indications on diagram, as contained in
-@var{xo-list}."
- (let* ((details (merge-details 'fret-diagram-details props '()))
- (xo-font-mag
- (* size (assoc-get
- 'xo-font-magnification details
- (cond ((or (eq? orientation 'landscape)
- (eq? orientation 'opposing-landscape))
- 0.4)
- (else 0.4)))))
- (mypair (car xo-list))
- (restlist (cdr xo-list))
- (glyph-string (if (eq? (car mypair) 'mute)
- (assoc-get 'mute-string details "X")
- (assoc-get 'open-string details "O")))
- (glyph-string-coordinate (* (- string-count (cadr mypair)) size))
- (glyph-stencil
- (centered-stencil
- (sans-serif-stencil
- layout props (* size xo-font-mag) glyph-string)))
- (glyph-stencil-coordinates
- (stencil-coordinates 0 glyph-string-coordinate orientation))
- (positioned-glyph
- (ly:stencil-translate glyph-stencil glyph-stencil-coordinates)))
- (if (null? restlist)
- positioned-glyph
- (ly:stencil-add
- (draw-xo
- layout props string-count fret-range size restlist orientation)
- positioned-glyph))))
-
-(define (draw-barre layout props string-count fret-range
- size finger-code dot-position dot-radius
- barre-list orientation)
- "Create barre indications for a fret diagram"
- (if (not (null? barre-list))
- (let* ((details (merge-details 'fret-diagram-details props '()))
- (string1 (caar barre-list))
- (string2 (cadar barre-list))
- (barre-fret (caddar barre-list))
- (top-fret (cdr fret-range))
- (low-fret (car fret-range))
- (fret (1+ (- barre-fret low-fret)))
- (barre-vertical-offset 0.5)
- (dot-center-fret-coordinate (+ (1- fret) dot-position))
- (barre-fret-coordinate
- (+ dot-center-fret-coordinate
- (* (- barre-vertical-offset 0.5) dot-radius)))
- (barre-start-string-coordinate (- string-count string1))
- (barre-end-string-coordinate (- string-count string2))
- (scale-dot-radius (* size dot-radius))
- (barre-type (assoc-get 'barre-type details 'curved))
- (barre-stencil
- (cond
- ((eq? barre-type 'straight)
- (make-straight-barre-stencil
- size scale-dot-radius
- barre-fret-coordinate barre-start-string-coordinate
- barre-end-string-coordinate orientation))
- ((eq? barre-type 'curved)
- (make-curved-barre-stencil
- size scale-dot-radius
- barre-fret-coordinate barre-start-string-coordinate
- barre-end-string-coordinate orientation)))))
- (if (not (null? (cdr barre-list)))
- (ly:stencil-add
- barre-stencil
- (draw-barre layout props string-count fret-range size finger-code
- dot-position dot-radius (cdr barre-list) orientation))
- barre-stencil ))))
-
-(define (label-fret layout props string-count fret-range size orientation)
- "Label the base fret on a fret diagram"
- (let* ((details (merge-details 'fret-diagram-details props '()))
- (base-fret (car fret-range))
- (label-font-mag (assoc-get 'fret-label-font-mag details 0.5))
- (label-space (* 0.5 size))
- (label-dir (assoc-get 'label-dir details RIGHT))
- (label-vertical-offset
- (assoc-get 'fret-label-vertical-offset details 0))
- (number-type
- (assoc-get 'number-type details 'roman-lower))
- (label-text
- (cond
- ((equal? number-type 'roman-lower)
- (fancy-format #f "~(~@r~)" base-fret))
- ((equal? number-type 'roman-upper)
- (fancy-format #f "~@r" base-fret))
- ((equal? 'arabic number-type)
- (fancy-format #f "~d" base-fret))
- (else (fancy-format #f "~(~@r~)" base-fret))))
- (label-stencil
- (centered-stencil
- (sans-serif-stencil
- layout props (* size label-font-mag) label-text)))
- (label-half-width
- (stencil-fretboard-offset label-stencil 'string orientation))
- (label-outside-diagram (+ label-space label-half-width)))
- (ly:stencil-translate
- label-stencil
- (stencil-coordinates
- (1+ (* size label-vertical-offset))
- (if (eq? label-dir LEFT)
- (- label-outside-diagram)
- (+ (* size (1- string-count)) label-outside-diagram))
- orientation))))
-
;;
;;
;; markup commands and associated functions
(set! dot-list (cons* (cdr my-item) dot-list))))
(parse-item (cdr mylist)))))
;; calculate fret-range
- (let ((maxfret 0)
+ (let ((maxfret 0)
(minfret (if (> capo-fret 0) capo-fret 99)))
(let updatemax ((fret-list dot-list)) ;CHANGE THIS TO HELPER FUNCTION?
(if (null? fret-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 (make-fret-diagram layout props marking-list)
; called from this routine. If they're only used in one of the
; sub-procedure, they're obtained in that procedure
(size (chain-assoc-get 'size props 1.0)) ; needed for everything
-;TODO -- get string-count directly from length of stringTunings;
-; from FretBoard engraver, but not from markup call
+ ;TODO -- get string-count directly from length of stringTunings;
+ ; from FretBoard engraver, but not from markup call
(details (merge-details 'fret-diagram-details props '()))
(string-count
- (assoc-get 'string-count details 6)) ; needed for everything
+ (assoc-get 'string-count details 6)) ; needed for everything
(my-fret-count
- (assoc-get 'fret-count details 4)) ; needed for everything
+ (assoc-get 'fret-count details 4)) ; needed for everything
(orientation
- (assoc-get 'orientation details 'normal)) ; needed for everything
+ (assoc-get 'orientation details 'normal)) ; needed for everything
(finger-code
- (assoc-get
- 'finger-code details 'none)) ; needed for draw-dots and draw-barre
+ (assoc-get
+ 'finger-code details 'none)) ; needed for draw-dots and draw-barre
(default-dot-radius
(if (eq? finger-code 'in-dot) 0.425 0.25)) ; bigger dots if labeled
(default-dot-position
(if (eq? finger-code 'in-dot)
(- 0.95 default-dot-radius)
- 0.6)) ; move up to make room for bigger if labeled
+ 0.6)) ; move up to make room for bigger dot if labeled
(dot-radius
- (assoc-get
- 'dot-radius details default-dot-radius)) ; needed for draw-dots
- ; and draw-barre
+ (assoc-get
+ 'dot-radius details default-dot-radius)) ; needed for draw-dots
+ ; and draw-barre
(dot-position
- (assoc-get
- 'dot-position details default-dot-position)) ; needed for draw-dots
- ; and draw-barre
+ (assoc-get
+ 'dot-position details default-dot-position)) ; needed for
+ ; draw-dots and draw-barre
(th
- (* (ly:output-def-lookup layout 'line-thickness)
- (chain-assoc-get 'thickness props 0.5))) ; needed for draw-frets
- ; and draw-strings
+ (* (ly:output-def-lookup layout 'line-thickness)
+ (chain-assoc-get 'thickness props 0.5))) ; needed for draw-frets
+ ; and draw-strings
+ (sth (* size th))
(thickness-factor (assoc-get 'string-thickness-factor details 0))
(alignment
- (chain-assoc-get 'align-dir props -0.4)) ; needed only here
+ (chain-assoc-get 'align-dir props -0.4)) ; needed only here
(xo-padding
- (* size (assoc-get 'xo-padding details 0.2))) ; needed only here
+ (* size (assoc-get 'xo-padding details 0.2))) ; needed only here
(parameters (fret-parse-marking-list marking-list my-fret-count))
(capo-fret (assoc-get 'capo-fret parameters 0))
(dot-list (cdr (assoc 'dot-list parameters)))
(my-fret-count (fret-count fret-range))
(barre-list (cdr (assoc 'barre-list parameters)))
(barre-type
- (assoc-get 'barre-type details 'curved))
- (fret-diagram-stencil
+ (assoc-get 'barre-type details 'curved))
+ (fret-diagram-stencil '()))
+ ;
+ ;; Here are the fret diagram helper functions that depend on the
+ ;; fret diagram parameters. The functions are here because the
+ ;; diagram parameters are part of the lexical scope here.
+
+ (define (stencil-coordinates fret-coordinate string-coordinate)
+ "Return a pair @code{(x-coordinate . y-coordinate)}
+ in stencil coordinate system."
+ (cond
+ ((eq? orientation 'landscape)
+ (cons fret-coordinate
+ (- string-coordinate (1- string-count))))
+ ((eq? orientation 'opposing-landscape)
+ (cons (- fret-coordinate) (- string-coordinate)))
+ (else
+ (cons string-coordinate (- fret-coordinate)))))
+
+ (define (make-bezier-sandwich-list start stop base height
+ half-thickness)
+ "Make the argument list for a bezier sandwich from
+string coordinate @var{start} to string-coordinate @var{stop} with a
+baseline at fret coordinate @var{base}, a height of
+@var{height}, and a half thickness of @var{half-thickness}."
+ (let* ((width (+ (- stop start) 1))
+ (cp-left-width (+ (* width half-thickness) start))
+ (cp-right-width (- stop (* width half-thickness)))
+ (bottom-control-point-height
+ (- base (- height half-thickness)))
+ (top-control-point-height
+ (- base height))
+ (left-end-point
+ (stencil-coordinates base start))
+ (right-end-point
+ (stencil-coordinates base stop))
+ (left-upper-control-point
+ (stencil-coordinates
+ top-control-point-height cp-left-width))
+ (left-lower-control-point
+ (stencil-coordinates
+ bottom-control-point-height cp-left-width))
+ (right-upper-control-point
+ (stencil-coordinates
+ top-control-point-height cp-right-width))
+ (right-lower-control-point
+ (stencil-coordinates
+ bottom-control-point-height cp-right-width)))
+ ; order of bezier control points is:
+ ; left cp low, right cp low, right end low, left end low
+ ; right cp high, left cp high, left end high, right end high.
+ ;
+ (list left-lower-control-point
+ right-lower-control-point
+ right-end-point
+ left-end-point
+ right-upper-control-point
+ left-upper-control-point
+ left-end-point
+ right-end-point)))
+
+ (define (draw-strings)
+ "Draw the string lines for a fret diagram with
+@var{string-count} strings and frets as indicated in @var{fret-range}.
+Line thickness is given by @var{th}, fret & string spacing by
+@var{size}. Orientation is determined by @var{orientation}. "
+
+ (define (helper x)
+ (if (null? (cdr x))
+ (string-stencil (car x))
(ly:stencil-add
- (draw-strings
- string-count fret-range th thickness-factor size orientation)
- (draw-frets
- fret-range string-count th thickness-factor size orientation))))
+ (string-stencil (car x))
+ (helper (cdr x)))))
+
+ (let* ( (string-list (map 1+ (iota string-count))))
+ (helper string-list)))
+
+ (define (string-stencil string)
+ "Make a stencil for @code{string}, given the fret-diagram
+ overall parameters."
+ (let* ((string-coordinate (- string-count string))
+ (current-string-thickness
+ (* th size (string-thickness string thickness-factor)))
+ (fret-half-thickness (* size th 0.5))
+ (half-string (* current-string-thickness 0.5))
+ (start-coordinates
+ (stencil-coordinates
+ (- fret-half-thickness)
+ (- (* size string-coordinate) half-string)))
+ (end-coordinates
+ (stencil-coordinates
+ (+ fret-half-thickness (* size (1+ (fret-count fret-range))))
+ (+ half-string (* size string-coordinate)))))
+ (ly:round-filled-box
+ (string-x-extent start-coordinates end-coordinates)
+ (string-y-extent start-coordinates end-coordinates)
+ (* th size))))
+
+ (define (draw-frets)
+ "Draw the fret lines for a fret diagram with
+@var{string-count} strings and frets as indicated in @var{fret-range}.
+Line thickness is given by @var{th}, fret & string spacing by
+@var{size}. Orientation is given by @var{orientation}."
+ (define (helper x)
+ (if (null? (cdr x))
+ (fret-stencil (car x))
+ (ly:stencil-add
+ (fret-stencil (car x))
+ (helper (cdr x)))))
+
+ (let ((fret-list (iota (1+ my-fret-count))))
+ (helper fret-list)))
+
+ (define (fret-stencil fret)
+ "Make a stencil for @code{fret}, given the
+fret-diagram overall parameters."
+ (let* ((low-string-half-thickness
+ (* 0.5
+ size
+ th
+ (string-thickness string-count thickness-factor)))
+ (fret-half-thickness (* 0.5 size th))
+ (start-coordinates
+ (stencil-coordinates
+ (* size fret)
+ (- fret-half-thickness low-string-half-thickness)))
+ (end-coordinates
+ (stencil-coordinates
+ (* size fret)
+ (* size (1- string-count)))))
+ (make-line-stencil
+ (* size th)
+ (car start-coordinates) (cdr start-coordinates)
+ (car end-coordinates) (cdr end-coordinates))))
+
+ (define (draw-barre barre-list)
+ "Create barre indications for a fret diagram"
+ (if (not (null? barre-list))
+ (let* ((string1 (caar barre-list))
+ (string2 (cadar barre-list))
+ (barre-fret (caddar barre-list))
+ (top-fret (cdr fret-range))
+ (low-fret (car fret-range))
+ (fret (1+ (- barre-fret low-fret)))
+ (barre-vertical-offset 0.5)
+ (dot-center-fret-coordinate (+ (1- fret) dot-position))
+ (barre-fret-coordinate
+ (+ dot-center-fret-coordinate
+ (* (- barre-vertical-offset 0.5) dot-radius)))
+ (barre-start-string-coordinate (- string-count string1))
+ (barre-end-string-coordinate (- string-count string2))
+ (scale-dot-radius (* size dot-radius))
+ (barre-type (assoc-get 'barre-type details 'curved))
+ (barre-stencil
+ (cond
+ ((eq? barre-type 'straight)
+ (make-straight-barre-stencil
+ barre-fret-coordinate
+ barre-start-string-coordinate
+ barre-end-string-coordinate
+ scale-dot-radius))
+ ((eq? barre-type 'curved)
+ (make-curved-barre-stencil
+ barre-fret-coordinate
+ barre-start-string-coordinate
+ barre-end-string-coordinate
+ scale-dot-radius)))))
+ (if (not (null? (cdr barre-list)))
+ (ly:stencil-add
+ barre-stencil
+ (draw-barre (cdr barre-list)))
+ barre-stencil ))))
+
+ (define (make-straight-barre-stencil
+ fret-coordinate
+ start-string-coordinate
+ end-string-coordinate
+ half-thickness)
+ "Create a straight barre stencil."
+ (let ((start-point
+ (stencil-coordinates
+ (* size fret-coordinate)
+ (* size start-string-coordinate)))
+ (end-point
+ (stencil-coordinates
+ (* size fret-coordinate)
+ (* size end-string-coordinate))))
+ (make-line-stencil
+ half-thickness
+ (car start-point)
+ (cdr start-point)
+ (car end-point)
+ (cdr end-point))))
+
+ (define (make-curved-barre-stencil
+ fret-coordinate
+ start-string-coordinate
+ end-string-coordinate
+ half-thickness)
+ "Create a curved barre stencil."
+ (let* ((bezier-thick 0.1)
+ (bezier-height 0.5)
+ (bezier-list
+ (make-bezier-sandwich-list
+ (* size start-string-coordinate)
+ (* size end-string-coordinate)
+ (* size fret-coordinate)
+ (* size bezier-height)
+ (* size bezier-thick)))
+ (box-lower-left
+ (stencil-coordinates
+ (+ (* size fret-coordinate) half-thickness)
+ (- (* size start-string-coordinate) half-thickness)))
+ (box-upper-right
+ (stencil-coordinates
+ (- (* size fret-coordinate)
+ (* size bezier-height)
+ half-thickness)
+ (+ (* size end-string-coordinate) half-thickness)))
+ (x-extent (cons (car box-lower-left) (car box-upper-right)))
+ (y-extent (cons (cdr box-lower-left) (cdr box-upper-right))))
+ (ly:make-stencil
+ (list 'bezier-sandwich
+ `(quote ,bezier-list)
+ (* size bezier-thick))
+ x-extent
+ y-extent)))
+
+ (define (draw-dots dot-list)
+ "Make dots for fret diagram."
+
+ (let* ( (scale-dot-radius (* size dot-radius))
+ (scale-dot-thick (* size th))
+ (dot-color (assoc-get 'dot-color details 'black))
+ (finger-label-padding 0.3)
+ (dot-label-font-mag
+ (* scale-dot-radius
+ (assoc-get 'dot-label-font-mag details 1.0)))
+ (string-label-font-mag
+ (* size
+ (assoc-get
+ 'string-label-font-mag details
+ (cond ((or (eq? orientation 'landscape)
+ (eq? orientation 'opposing-landscape))
+ 0.5)
+ (else 0.6)))))
+ (mypair (car dot-list))
+ (restlist (cdr dot-list))
+ (string (car mypair))
+ (fret (cadr mypair))
+ (fret-coordinate (* size (+ (1- fret) dot-position)))
+ (string-coordinate (* size (- string-count string)))
+ (dot-coordinates
+ (stencil-coordinates fret-coordinate string-coordinate))
+ (extent (cons (- scale-dot-radius) scale-dot-radius))
+ (finger (caddr mypair))
+ (finger (if (number? finger) (number->string finger) finger))
+ (dot-stencil (if (eq? dot-color 'white)
+ (ly:stencil-add
+ (make-circle-stencil
+ scale-dot-radius scale-dot-thick #t)
+ (ly:stencil-in-color
+ (make-circle-stencil
+ (- scale-dot-radius (* 0.5 scale-dot-thick))
+ 0 #t)
+ 1 1 1))
+ (make-circle-stencil
+ scale-dot-radius scale-dot-thick #t)))
+ (positioned-dot
+ (ly:stencil-translate dot-stencil dot-coordinates))
+ (labeled-dot-stencil
+ (cond
+ ((or (eq? finger '())(eq? finger-code 'none))
+ positioned-dot)
+ ((eq? finger-code 'in-dot)
+ (let ((finger-label
+ (centered-stencil
+ (sans-serif-stencil
+ layout props dot-label-font-mag finger))))
+ (ly:stencil-translate
+ (ly:stencil-add
+ dot-stencil
+ (if (eq? dot-color 'white)
+ finger-label
+ (ly:stencil-in-color finger-label 1 1 1)))
+ dot-coordinates)))
+ ((eq? finger-code 'below-string)
+ (let* ((label-stencil
+ (centered-stencil
+ (sans-serif-stencil
+ layout props string-label-font-mag
+ finger)))
+ (label-fret-offset
+ (stencil-fretboard-offset
+ label-stencil 'fret orientation))
+ (label-fret-coordinate
+ (+ (* size
+ (+ 1 my-fret-count finger-label-padding))
+ label-fret-offset))
+ (label-string-coordinate string-coordinate)
+ (label-translation
+ (stencil-coordinates
+ label-fret-coordinate
+ label-string-coordinate)))
+ (ly:stencil-add
+ positioned-dot
+ (ly:stencil-translate
+ label-stencil
+ label-translation))))
+ (else ;unknown finger-code
+ positioned-dot))))
+ (if (null? restlist)
+ labeled-dot-stencil
+ (ly:stencil-add
+ (draw-dots restlist)
+ labeled-dot-stencil))))
+
+ (define (draw-thick-zero-fret)
+ "Draw a thick zeroth fret for a fret diagram whose base fret is 1."
+ (let* ((half-lowest-string-thickness
+ (* 0.5 th (string-thickness string-count thickness-factor)))
+ (half-thick (* 0.5 sth))
+ (top-fret-thick
+ (* sth (assoc-get 'top-fret-thickness details 3.0)))
+ (start-string-coordinate (- half-lowest-string-thickness))
+ (end-string-coordinate (+ (* size (1- string-count)) half-thick))
+ (start-fret-coordinate half-thick)
+ (end-fret-coordinate (- half-thick top-fret-thick))
+ (lower-left
+ (stencil-coordinates
+ start-fret-coordinate start-string-coordinate))
+ (upper-right
+ (stencil-coordinates
+ end-fret-coordinate end-string-coordinate)))
+ (ly:round-filled-box
+ (cons (car lower-left) (car upper-right))
+ (cons (cdr lower-left) (cdr upper-right))
+ sth)))
+
+ (define (draw-xo xo-list)
+ "Put open and mute string indications on diagram, as contained in
+@var{xo-list}."
+ (let* ((xo-font-mag
+ (* size (assoc-get
+ 'xo-font-magnification details
+ (cond ((or (eq? orientation 'landscape)
+ (eq? orientation 'opposing-landscape))
+ 0.4)
+ (else 0.4)))))
+ (mypair (car xo-list))
+ (restlist (cdr xo-list))
+ (glyph-string (if (eq? (car mypair) 'mute)
+ (assoc-get 'mute-string details "X")
+ (assoc-get 'open-string details "O")))
+ (glyph-string-coordinate (* (- string-count (cadr mypair)) size))
+ (glyph-stencil
+ (centered-stencil
+ (sans-serif-stencil
+ layout props (* size xo-font-mag) glyph-string)))
+ (glyph-stencil-coordinates
+ (stencil-coordinates 0 glyph-string-coordinate))
+ (positioned-glyph
+ (ly:stencil-translate
+ glyph-stencil
+ glyph-stencil-coordinates)))
+ (if (null? restlist)
+ positioned-glyph
+ (ly:stencil-add
+ (draw-xo restlist)))))
+
+ (define (draw-capo fret)
+ "Draw a capo indicator across the full width of the fret-board
+at @var{fret}."
+ (let* ((capo-thick
+ (* size (assoc-get 'capo-thickness details 0.5)))
+ (half-thick (* capo-thick 0.5))
+ (last-string-position 0)
+ (first-string-position (* size (- string-count 1)))
+ (fret-position ( * size (1- (+ dot-position fret))))
+ (start-point
+ (stencil-coordinates
+ fret-position
+ first-string-position))
+ (end-point
+ (stencil-coordinates
+ fret-position
+ last-string-position)))
+ (make-line-stencil
+ capo-thick
+ (car start-point) (cdr start-point)
+ (car end-point) (cdr end-point))))
+
+ (define (label-fret fret-range)
+ "Label the base fret on a fret diagram"
+ (let* ((base-fret (car fret-range))
+ (label-font-mag (assoc-get 'fret-label-font-mag details 0.5))
+ (label-space (* 0.5 size))
+ (label-dir (assoc-get 'label-dir details RIGHT))
+ (label-vertical-offset
+ (assoc-get 'fret-label-vertical-offset details 0))
+ (number-type
+ (assoc-get 'number-type details 'roman-lower))
+ (label-text
+ (cond
+ ((equal? number-type 'roman-lower)
+ (fancy-format #f "~(~@r~)" base-fret))
+ ((equal? number-type 'roman-upper)
+ (fancy-format #f "~@r" base-fret))
+ ((equal? 'arabic number-type)
+ (fancy-format #f "~d" base-fret))
+ (else (fancy-format #f "~(~@r~)" base-fret))))
+ (label-stencil
+ (centered-stencil
+ (sans-serif-stencil
+ layout props (* size label-font-mag) label-text)))
+ (label-half-width
+ (stencil-fretboard-offset
+ label-stencil
+ 'string
+ orientation))
+ (label-outside-diagram (+ label-space label-half-width)))
+ (ly:stencil-translate
+ label-stencil
+ (stencil-coordinates
+ (1+ (* size label-vertical-offset))
+ (if (eq? label-dir LEFT)
+ (- label-outside-diagram)
+ (+ (* size (1- string-count)) label-outside-diagram))))))
+
+
+ ; Here is the body of make-fret-diagram
+ ;
+
+ (set! fret-diagram-stencil
+ (ly:stencil-add (draw-strings) (draw-frets)))
(if (and (not (null? barre-list))
(not (eq? 'none barre-type)))
- (set! fret-diagram-stencil
- (ly:stencil-add
- (draw-barre layout props string-count fret-range size
- finger-code dot-position dot-radius
- barre-list orientation)
- fret-diagram-stencil)))
+ (set! fret-diagram-stencil
+ (ly:stencil-add
+ (draw-barre barre-list)
+ fret-diagram-stencil)))
(if (not (null? dot-list))
- (set! fret-diagram-stencil
- (ly:stencil-add
- fret-diagram-stencil
- (draw-dots layout props string-count my-fret-count
- size finger-code dot-position dot-radius
- th dot-list orientation))))
+ (set! fret-diagram-stencil
+ (ly:stencil-add
+ fret-diagram-stencil
+ (draw-dots dot-list))))
(if (= (car fret-range) 1)
- (set! fret-diagram-stencil
- (ly:stencil-add
- fret-diagram-stencil
- (draw-thick-zero-fret
- details string-count th
- thickness-factor size orientation))))
- (if (not (null? xo-list))
- (let* ((diagram-fret-top
- (car (stencil-fretboard-extent
- fret-diagram-stencil
- 'fret
- orientation)))
- (xo-stencil
- (draw-xo layout props string-count fret-range
- size xo-list orientation))
- (xo-fret-offset
- (stencil-fretboard-offset
- xo-stencil 'fret orientation)))
(set! fret-diagram-stencil
(ly:stencil-add
fret-diagram-stencil
- (ly:stencil-translate
- xo-stencil
- (stencil-coordinates
- (- diagram-fret-top
- xo-fret-offset
- (* size xo-padding))
- 0 ; no string offset
- orientation))))))
-
- (if (> capo-fret 0)
+ (draw-thick-zero-fret))))
+ (if (not (null? xo-list))
+ (let* ((diagram-fret-top
+ (car (stencil-fretboard-extent
+ fret-diagram-stencil
+ 'fret
+ orientation)))
+ (xo-stencil (draw-xo xo-list))
+ (xo-fret-offset
+ (stencil-fretboard-offset
+ xo-stencil 'fret orientation)))
(set! fret-diagram-stencil
- (ly:stencil-add
- fret-diagram-stencil
- (draw-capo details string-count capo-fret my-fret-count
- th size dot-position orientation))))
+ (ly:stencil-add
+ fret-diagram-stencil
+ (ly:stencil-translate
+ xo-stencil
+ (stencil-coordinates
+ (- diagram-fret-top
+ xo-fret-offset
+ (* size xo-padding))
+ 0)))))) ; no string offset
+
+ (if (> capo-fret 0)
+ (set! fret-diagram-stencil
+ (ly:stencil-add
+ fret-diagram-stencil
+ (draw-capo capo-fret))))
(if (> (car fret-range) 1)
(set! fret-diagram-stencil
(ly:stencil-add
- fret-diagram-stencil
- (label-fret
- layout props string-count fret-range size orientation))))
- (ly:stencil-aligned-to fret-diagram-stencil X alignment)))
+ fret-diagram-stencil
+ (label-fret fret-range))))
+ (ly:stencil-aligned-to fret-diagram-stencil X alignment)))
(define (fret-parse-definition-string props definition-string)
"Parse a fret diagram string and return a pair containing:
(prepend-alist-chain 'fret-diagram-details details props))
`(,props . ,output-list))) ;ugh -- hard-coded spell -- procedure better
-(define-public
+(define-public
(fret-parse-terse-definition-string props definition-string)
- "Parse a fret diagram string that uses terse syntax;
+ "Parse a fret diagram string that uses terse syntax;
return a pair containing:
@var{props}, modified to include the string-count determined by the
definition-string, and
`(,props . ,output-list))) ; ugh -- hard coded; proc is better
-(define-builtin-markup-command
+(define-builtin-markup-command
(fret-diagram-verbose layout props marking-list)
(pair?) ; argument type (list, but use pair? for speed)
instrument-specific-markup ; markup type
(ly:error
(string-append
make-name ": "
- (_ "Invalid argument in position ~A. Expect: ~A, found: ~S.")
- error-msg))
+ (_ "Invalid argument in position ~A. Expect: ~A, found: ~S."))
+ error-msg)
(cons markup-function args))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;
if value:
header.set_field (field, musicxml.escape_ly_output_string (value))
+ movement_title = tree.get_maybe_exist_named_child ('movement-title')
+ if movement_title:
+ set_if_exists ('title', movement_title.get_text ())
work = tree.get_maybe_exist_named_child ('work')
if work:
+ # Overwrite the title from movement-title with work->title
set_if_exists ('title', work.get_work_title ())
set_if_exists ('worknumber', work.get_work_number ())
set_if_exists ('opus', work.get_opus ())
- else:
- movement_title = tree.get_maybe_exist_named_child ('movement-title')
- if movement_title:
- set_if_exists ('title', movement_title.get_text ())
identifications = tree.get_named_children ('identification')
for ids in identifications:
# Case 1: "Sibelius 5.1" with the "Dolet 3.4 for Sibelius" plugin
# is missing all beam ends => ignore all beaming information
- if "Dolet 3.4 for Sibelius" in software:
- conversion_settings.ignore_beaming = True
- progress (_ ("Encountered file created by Dolet 3.4 for Sibelius, containing wrong beaming information. All beaming information in the MusicXML file will be ignored"))
- # ditto for Dolet 3.5
- if "Dolet 3.5 for Sibelius" in software:
- conversion_settings.ignore_beaming = True
- progress (_ ("Encountered file created by Dolet 3.5 for Sibelius, containing wrong beaming information. All beaming information in the MusicXML file will be ignored"))
- if "Noteworthy Composer" in software:
- conversion_settings.ignore_beaming = True
- progress (_ ("Encountered file created by Noteworthy Composer's nwc2xml, containing wrong beaming information. All beaming information in the MusicXML file will be ignored"))
- # TODO: Check for other unsupported features
-
+ ignore_beaming_software = {
+ "Dolet 4 for Sibelius, Beta 2": "Dolet 4 for Sibelius, Beta 2",
+ "Dolet 3.5 for Sibelius": "Dolet 3.5 for Sibelius",
+ "Dolet 3.4 for Sibelius": "Dolet 3.4 for Sibelius",
+ "Dolet 3.3 for Sibelius": "Dolet 3.3 for Sibelius",
+ "Dolet 3.2 for Sibelius": "Dolet 3.2 for Sibelius",
+ "Dolet 3.1 for Sibelius": "Dolet 3.1 for Sibelius",
+ "Dolet for Sibelius 1.3": "Dolet for Sibelius 1.3",
+ "Noteworthy Composer": "Noteworthy Composer's nwc2xm[",
+ }
+ for s in software:
+ app_description = ignore_beaming_software.get (s, False);
+ if app_description:
+ conversion_settings.ignore_beaming = True
+ progress (_ ("Encountered file created by %s, containing wrong beaming information. All beaming information in the MusicXML file will be ignored") % app_description)
+
+ # TODO: Check for other unsupported features
return header
class PartGroupInfo:
elts.append (ev)
return elts
+
+def musicxml_print_to_lily (el):
+ # TODO: Implement other print attributes
+ # <!ELEMENT print (page-layout?, system-layout?, staff-layout*,
+ # measure-layout?, measure-numbering?, part-name-display?,
+ # part-abbreviation-display?)>
+ # <!ATTLIST print
+ # staff-spacing %tenths; #IMPLIED
+ # new-system %yes-no; #IMPLIED
+ # new-page %yes-no-number; #IMPLIED
+ # blank-page NMTOKEN #IMPLIED
+ # page-number CDATA #IMPLIED
+ # >
+ elts = []
+ if (hasattr (el, "new-system")):
+ val = getattr (el, "new-system")
+ if (val == "yes"):
+ elts.append (musicexp.Break ("break"))
+ if (hasattr (el, "new-page")):
+ val = getattr (el, "new-page")
+ if (val == "yes"):
+ elts.append (musicexp.Break ("pageBreak"))
+ return elts
+
class Marker (musicexp.Music):
def __init__ (self):
'diminished': 'dim5',
# Sevenths:
'dominant': '7',
+ 'dominant-seventh': '7',
'major-seventh': 'maj7',
'minor-seventh': 'm7',
'diminished-seventh': 'dim7',
def current_duration (self):
return self.end_moment - self.begin_moment
- def add_music (self, music, duration):
+ def add_music (self, music, duration, relevant = True):
assert isinstance (music, musicexp.Music)
if self.pending_multibar > Rational (0):
self._insert_multibar ()
- self.has_relevant_elements = True
+ self.has_relevant_elements = self.has_relevant_elements or relevant
self.elements.append (music)
self.begin_moment = self.end_moment
self.set_duration (duration)
self.pending_dynamics = []
# Insert some music command that does not affect the position in the measure
- def add_command (self, command):
+ def add_command (self, command, relevant = True):
assert isinstance (command, musicexp.Music)
if self.pending_multibar > Rational (0):
self._insert_multibar ()
- self.has_relevant_elements = True
+ self.has_relevant_elements = self.has_relevant_elements or relevant
self.elements.append (command)
- def add_barline (self, barline):
- # TODO: Implement merging of default barline and custom bar line
- self.add_music (barline, Rational (0))
+ def add_barline (self, barline, relevant = False):
+ # Insert only if we don't have a barline already
+ # TODO: Implement proper merging of default barline and custom bar line
+ has_relevant = self.has_relevant_elements
+ if (not (self.elements) or
+ not (isinstance (self.elements[-1], musicexp.BarLine)) or
+ (self.pending_multibar > Rational (0))):
+ self.add_music (barline, Rational (0))
+ self.has_relevant_elements = has_relevant or relevant
def add_partial (self, command):
self.ignore_skips = True
+ # insert the partial, but restore relevant_elements (partial is not relevant)
+ relevant = self.has_relevant_elements
self.add_command (command)
+ self.has_relevant_elements = relevant
def add_dynamics (self, dynamic):
# store the dynamic item(s) until we encounter the next note/rest:
def add_bar_check (self, number):
# re/store has_relevant_elements, so that a barline alone does not
# trigger output for figured bass, chord names
- has_relevant = self.has_relevant_elements
b = musicexp.BarLine ()
b.bar_number = number
self.add_barline (b)
- self.has_relevant_elements = has_relevant
def jumpto (self, moment):
current_end = self.end_moment + self.pending_multibar
evc = musicexp.ChordEvent ()
evc.elements.append (skip)
- self.add_music (evc, diff)
+ self.add_music (evc, diff, False)
if diff > Rational (0) and moment == 0:
self.ignore_skips = False
voice_builder.set_measure_length (current_measure_length)
for n in voice._elements:
+ tie_started = False
if n.get_name () == 'forward':
continue
staff = n.get_maybe_exist_named_child ('staff')
a = musicxml_partial_to_lily (n.partial)
if a:
voice_builder.add_partial (a)
+ figured_bass_builder.add_partial (a)
+ chordnames_builder.add_partial (a)
continue
is_chord = n.get_maybe_exist_named_child ('chord')
if not is_chord and not is_after_grace:
try:
voice_builder.jumpto (n._when)
+ figured_bass_builder.jumpto (n._when)
+ chordnames_builder.jumpto (n._when)
except NegativeSkip, neg:
voice_builder.correct_negative_skip (n._when)
+ figured_bass_builder.correct_negative_skip (n._when)
+ chordnames_builder.correct_negative_skip (n._when)
n.message (_ ("Negative skip found: from %s to %s, difference is %s") % (neg.here, neg.dest, neg.dest - neg.here))
if isinstance (n, musicxml.Barline):
for a in barlines:
if isinstance (a, musicexp.BarLine):
voice_builder.add_barline (a)
+ figured_bass_builder.add_barline (a, False)
+ chordnames_builder.add_barline (a, False)
elif isinstance (a, RepeatMarker) or isinstance (a, EndingMarker):
voice_builder.add_command (a)
+ figured_bass_builder.add_barline (a, False)
+ chordnames_builder.add_barline (a, False)
+ continue
+
+
+ if isinstance (n, musicxml.Print):
+ for a in musicxml_print_to_lily (n):
+ voice_builder.add_command (a, False)
continue
# Continue any multimeasure-rests before trying to add bar checks!
if mxl_tie and mxl_tie.type == 'start':
ev_chord.append (musicexp.TieEvent ())
is_tied = True
+ tie_started = True
else:
is_tied = False
if not lnr in note_lyrics_processed:
lyrics[lnr].append ("\skip4")
- ## force trailing mm rests to be written out.
+ # Assume that a <tie> element only lasts for one note.
+ # This might not be correct MusicXML interpretation, but works for
+ # most cases and fixes broken files, which have the end tag missing
+ if is_tied and not tie_started:
+ is_tied = False
+
+ ## force trailing mm rests to be written out.
voice_builder.add_music (musicexp.ChordEvent (), Rational (0))
ly_voice = group_tuplets (voice_builder.elements, tuplet_events)
# create \figuremode { figured bass elements }
if figured_bass_builder.has_relevant_elements:
fbass_music = musicexp.SequentialMusic ()
- fbass_music.elements = figured_bass_builder.elements
+ fbass_music.elements = group_repeats (figured_bass_builder.elements)
v = musicexp.ModeChangingMusicWrapper()
v.mode = 'figuremode'
v.element = fbass_music
# create \chordmode { chords }
if chordnames_builder.has_relevant_elements:
cname_music = musicexp.SequentialMusic ()
- cname_music.elements = chordnames_builder.elements
+ cname_music.elements = group_repeats (chordnames_builder.elements)
v = musicexp.ModeChangingMusicWrapper()
v.mode = 'chordmode'
v.element = cname_music
def voices_in_part_in_parts (parts):
"""return a Part -> Name -> Voice dictionary"""
- return dict([(p.id, voices_in_part (p)) for p in parts])
+ # don't crash if p doesn't have an id (that's invalid MusicXML,
+ # but such files are out in the wild!
+ dictionary = {}
+ for p in parts:
+ voices = voices_in_part (p)
+ if (hasattr (p, "id")):
+ dictionary[p.id] = voices
+ else:
+ # TODO: extract correct part id from other sources
+ dictionary[None] = voices
+ return dictionary;
def get_all_voices (parts):