--- /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.11.62"
+
+\header {
+ lsrtags = "pitches, vocal-music"
+
+ texidoc = "
+Ambitus indicate pitch ranges for voices.
+
+
+Accidentals only show up if they are not part of the key signature.
+@code{AmbitusNoteHead} grobs also have ledger lines.
+
+"
+ doctitle = "Ambitus"
+} % begin verbatim
+\layout {
+ ragged-right = ##t
+ \context {
+ \Voice
+ \consists "Ambitus_engraver"
+ }
+}
+
+\relative
+<<
+ \new Staff {
+ \time 2/4 c4 f'
+ }
+ \new Staff \relative {
+ \time 2/4
+ \key d \major
+ cis as'
+ }
+>>
+
-incipit.ly
+transcription-of-ancient-music-with-incipit.ly
mensurstriche-layout-bar-lines-between-the-staves.ly
adding-a-figured-bass-above-or-below-the-notes.ly
+incipit.ly
chant-or-psalms-notation.ly
ancient-notation-template----modern-transcription-of-mensural-music.ly
ancient-fonts.ly
\version "2.11.62"
\header {
- lsrtags = "winds"
+ lsrtags = "expressive-marks"
texidoc = "
Breathing signs are available in different tastes: commas (default),
\version "2.11.62"
\header {
+ texidoces = "
+Para cambiar el tempo en la salida MIDI sin
+imprimir nada, hacemos invisible la indicación metronómica:
+
+"
+
+ doctitlees = "Cambiar el tempo sin indicación metronómica"
+
lsrtags = "staff-notation"
texidoc = "To change the tempo in MIDI output without printing
anything, make the metronome mark invisible:"
--- /dev/null
+%% Do not edit this file; it is auto-generated from input/new
+%% This file is in the public domain.
+\version "2.11.62"
+\header {
+ lsrtags = "pitches,editorial-annotations,really-cool"
+ texidoc = "
+It is possible to color note heads depending on their pitch and/or their names:
+the function used in this example even makes it possible to distinguish enharmonics.
+"
+ doctitle = "Coloring notes depending on their pitch"
+} % begin verbatim
+
+%Association list of pitches to colors.
+#(define color-mapping
+ (list
+ (cons (ly:make-pitch 0 0 0) (x11-color 'red))
+ (cons (ly:make-pitch 0 0 1/2) (x11-color 'green))
+ (cons (ly:make-pitch 0 1 -1/2) (x11-color 'green))
+ (cons (ly:make-pitch 0 2 0) (x11-color 'red))
+ (cons (ly:make-pitch 0 2 1/2) (x11-color 'green))
+ (cons (ly:make-pitch 0 3 -1/2) (x11-color 'red))
+ (cons (ly:make-pitch 0 3 0) (x11-color 'green))
+ (cons (ly:make-pitch 0 4 1/2) (x11-color 'red))
+ (cons (ly:make-pitch 0 5 0) (x11-color 'green))
+ (cons (ly:make-pitch 0 5 -1/2) (x11-color 'red))
+ (cons (ly:make-pitch 0 6 1/2) (x11-color 'red))
+ (cons (ly:make-pitch 0 1 0) (x11-color 'blue))
+ (cons (ly:make-pitch 0 3 1/2) (x11-color 'blue))
+ (cons (ly:make-pitch 0 4 -1/2) (x11-color 'blue))
+ (cons (ly:make-pitch 0 5 1/2) (x11-color 'blue))
+ (cons (ly:make-pitch 0 6 -1/2) (x11-color 'blue))
+ ))
+
+%Compare pitch and alteration (not octave).
+#(define (pitch-equals? p1 p2)
+ (and
+ (= (ly:pitch-alteration p1) (ly:pitch-alteration p2))
+ (= (ly:pitch-notename p1) (ly:pitch-notename p2))))
+
+#(define (pitch-to-color pitch)
+ (let ((color (assoc pitch color-mapping pitch-equals?)))
+ (if color
+ (cdr color))))
+
+#(define (color-notehead grob)
+ (pitch-to-color
+ (ly:event-property (ly:grob-property grob 'cause) 'pitch)))
+
+\score {
+ \new Staff \relative c' {
+ \override NoteHead #'color = #color-notehead
+ c8 b d dis ees f g aes
+ }
+}
<c-1 e-3 a-5>4
\set fingeringOrientations = #'(down)
<c-1 e-3 a-5>4
- \set fingeringOrientations = #'(right)
+ \set fingeringOrientations = #'(down right up)
<c-1 e-3 a-5>4
\set fingeringOrientations = #'(up)
<c-1 e-3 a-5>4
- \set fingeringOrientations = #'(left down)
- <c-1 e-3 a-5>2
- \set fingeringOrientations = #'(up right down)
- <c-1 e-3 a-5>2
+ \set fingeringOrientations = #'(left)
+ <c-1>2
+ \set fingeringOrientations = #'(right)
+ <e-3>2
}
\version "2.11.62"
\header {
+ texidoces = "
+Se pueden crear indicaciones metronómicas nuevas en modo de
+marcado, pero no cambian el tempo en la salida MIDI.
+
+"
+ doctitlees = "Crear indicaciones metronómicas en modo de marcado"
+
+
lsrtags = "staff-notation"
texidoc = "New metronome marks can be created in markup mode,
but they will not change the tempo in MIDI output."
%% This file is in the public domain.
\version "2.11.62"
\header {
+ texidoces = "
+Si hay un solo pentagrama en un de los tipos de sistema
+@code{ChoirStaff}, @code{InnerChoirStaff}, @code{InnerStaffGroup}
+o @code{StaffGroup}, el comportamiento predeterminado es que no se
+imprima el corchete en la barra inicial. Esto se puede cambiar
+sobreescribiendo las propiedades adecuadas.
+
+Observe que en contextos como @code{PianoStaff} y
+@code{GrandStaff} en que los sistemas empiezan con una llave en
+lugar de un corchete, se debe establecer el valor de una propiedad
+distinta, como se ve en el segundo sistema del ejemplo.
+
+"
+ doctitlees = "Mostrar corchete o llave en grupos de un solo pentagrama"
+
+
lsrtags = "staff-notation,tweaks-and-overrides"
texidoc = "If there is only one staff in one of the staff types
@code{ChoirStaff}, @code{InnerChoirStaff}, @code{InnerStaffGroup}
measure-counter.ly
creating-blank-staves.ly
controlling-the-placement-of-chord-fingerings.ly
-making-some-staff-lines-thicker-than-the-others.ly
+marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
applying-note-head-styles-depending-on-the-step-of-the-scale.ly
embedding-native-postscript-in-a--markup-block.ly
changing-the-appearance-of-a-slur-from-solid-to-dotted-or-dashed.ly
using-postscript-to-generate-special-note-head-shapes.ly
blanking-staff-lines-using-the--whiteout-command.ly
analysis-brackets-above-the-staff.ly
+coloring-notes-depending-on-their-pitch.ly
+making-some-staff-lines-thicker-than-the-others.ly
hiding-the-extender-line-for-text-dynamics.ly
vertically-aligning-dynamics-across-multiple-notes.ly
horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly
+breathing-signs.ly
changing-text-and-spanner-styles-for-text-dynamics.ly
controlling-the-vertical-ordering-of-scripts.ly
inserting-a-caesura.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.11.62"
+
+\header {
+ lsrtags = "winds"
+
+ texidoc = "
+It is possible to indicate special articulation techniques such as
+flute's \"tongue slap\", by replacing the note head with the
+appropriate glyph.
+
+"
+ doctitle = "Flute slap notation"
+} % begin verbatim
+slap =
+#(define-music-function (parser location music) (ly:music?)
+#{\override NoteHead #'stencil = #ly:text-interface::print
+ \override NoteHead #'text = \markup \musicglyph #"scripts.sforzato"
+ \override NoteHead #'extra-offset = #'(0.1 . 0.0 )
+ $music
+ \revert NoteHead #'stencil
+ \revert NoteHead #'text
+ \revert NoteHead #'extra-offset #})
+
+\relative c' {
+ c \slap c d r \slap { g a } b r
+}
--- /dev/null
+%% Do not edit this file; it is auto-generated from input/new
+%% This file is in the public domain.
+\version "2.11.62"
+
+\header {
+ lsrtags = "editorial-annotations, vocal-music"
+
+ texidoc = "
+This example shows how to put crosses on stems. Mark the beginning
+of a spoken section with the @code{\\speakOn} keyword, and end it
+with the @code{\\speakOff} keyword. Remember to end cross sections
+before entering any rest: this function also adds crosses to the
+invisible stems of rests.
+"
+ doctitle = "Marking notes of spoken parts with a cross on the stem"
+} % begin verbatim
+
+speakOn = {
+ \override Stem #'stencil = #(lambda (grob)
+ (ly:stencil-combine-at-edge
+ (ly:stem::print grob)
+ Y
+ (- (ly:grob-property grob 'direction))
+ (grob-interpret-markup grob
+ (markup #:hspace -1.025 #:fontsize -4
+ #:musicglyph "noteheads.s2cross"))
+ -2.3 0))
+}
+
+speakOff = {
+ \revert Stem #'stencil
+}
+
+\score {
+ \new Staff {
+ \relative c'' {
+ a4 b a c
+ \speakOn
+ g4 f r g
+ b4 r d e
+ \speakOff
+ c4 a g f
+ }
+ }
+}
\version "2.11.62"
\header {
+texidoces = "
+Los elementos de marcado aplicados a un silencio multicompás se
+centran encima o debajo de éste. Los elementos de marcado extensos
+que se adjuntan a silencios multicompás no producen la expansión del
+compás. Para expandir un silencio multicompás de forma que quepa todo
+el marcado, utilice un silencio de separación con un marcado aplicado
+antes del silencio multicompás.
+
+Observe que el silencio separador produce la inserción de un compás.
+El texto aplicado a un siencio sparador de esta forma se alinea por la
+izquierda a la posición en que la nota estaría situada dentro del
+compás, pero si la longitud del compás está determinada por la
+longitud del texto, éste aparecerá centrado.
+
+"
+
+doctitlees = "Marcado de silencios multicompás"
lsrtags = "rhythms, text"
texidoc = "Markups attached to a multi-measure rest will be
centered above or below it. Long markups attached to multi-measure
doctitlees = "Plantilla de piano con melodía y letra"
texidocde = "
-as nächste Beispiel ist typisch für ein Lied: Im oberen System die
+Das nächste Beispiel ist typisch für ein Lied: Im oberen System die
Melodie mit Text, darunter Klavierbegleitung.
"
adding-ambitus-per-voice.ly
applying-note-head-styles-depending-on-the-step-of-the-scale.ly
+ambitus.ly
transposing-pitches-with-minimum-accidentals-smart-transpose.ly
ottava-text.ly
tweaking-clef-properties.ly
ambitus-with-multiple-voices.ly
generating-random-notes.ly
makam-example.ly
+coloring-notes-depending-on-their-pitch.ly
dodecaphonic-style-accidentals-for-each-note-including-naturals.ly
preventing-natural-signs-from-being-printed-when-the-key-signature-changes.ly
quoting-another-voice-with-transposition.ly
%% This file is in the public domain.
\version "2.11.62"
\header {
- texidoces = "Los pasajes citados tienen en cuenta la
-transposición de la fuente tanto como la del destino. En este
-ejemplo, todos los instrumentos interpreta una nota con el sonido
-del Do central; el destino de un instrumento transpositor en Fa.
-La parte de destino se puede transponer utilizando
-@code{\\transpose}. En este caso se transportan todas las notas
-(incluidas las citadas).
+ texidoces = "
+Los pasajes citados tienen en cuenta la transposición de la fuente
+tanto como la del destino. En este ejemplo, todos los
+instrumentos interpreta una nota con el sonido del Do central; el
+destino de un instrumento transpositor en Fa. La parte de destino
+se puede transponer utilizando @code{\\transpose}. En este caso
+se transportan todas las notas (incluidas las citadas).
"
%% This file is in the public domain.
\version "2.11.62"
\header {
+ texidoces = "
+La propiedad @code{quotedEventTypes} determina los tipos de
+eventos musicales que resultan citados. El valor predeterminado
+es @code{(note-event rest-event)}, que significa que sólo aparecen
+en la expresión @code{\\quoteDuring} las notas y los silencios.
+En el ejemplo siguiente, el silencio de semicorchea no aparece en
+el fragmento citado porque @code{rest-event} no está dentro de los
+@code{quotedEventTypes}.
+
+"
+ doctitlees = "Citar otra voz"
lsrtags = "staff-notation"
texidoc = "The @code{quotedEventTypes} property determines the
music event types that are quoted. The default value is
\header {
lsrtags = "staff-notation, tweaks-and-overrides, breaks"
+ texidoces = "
+El primer pentagrama vacío también se puede suprimir de la
+partitura estableciendo la propiedad @code{remove-first} de
+@code{VerticalAxisGroup}. Esto se puede hacer globalmente dentro
+del bloque @code{\\layout}, o localmente dentro del pentagrama
+concreto que se quiere suprimir. En este último caso, tenemos que
+especificar el contexto (@code{Staff} se aplica sólo al pentagrama
+actual) delante de la propiedad.
+
+El pentagrama inferior del segundo grupo no se elimina, porque el
+ajuste sólo se aplica al pentagrama concreto dentro del que se
+escribe.
+
+"
+ doctitlees = "Quitar la primera línea vacía"
+
texidoc = "
The first empty staff can also be removed from the score by setting the
@code{VerticalAxisGroup} property @code{remove-first}. This can be done
--- /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.11.62"
+
+\header {
+ lsrtags = "ancient-notation, tweaks-and-overrides"
+
+ texidoces = "
+A modo de alternativa para obtener auténticos «incipit»
+independientes de la partitura principal, se incluyen como
+elemento de marcado en el campo que se usa normalmente para el
+nombre del instrumento. Por el momento, la letra sólo se puede
+añadir como marcado directo. Por desgracia, su espaciado no es
+análogo al de la letra principal.
+
+"
+ doctitlees = "Transcripción de música antigua con incipit"
+
+ texidoc = "
+As a workaround to get real incipits which are independent from the
+main score these are included as a markup into the field normally used
+for the instrument name. As for now lyrics can only be added as a
+direct markup. It doesn't unfortunately conform with the spacing of the
+main lyrics.
+
+"
+ doctitle = "Transcription of Ancient music with incipit"
+} % begin verbatim
+global = {
+ \set Score.skipBars = ##t
+ \key g \major
+ \time 4/4
+
+ %make the staff lines invisible on staves
+ \override Staff.BarLine #'transparent = ##t
+ \skip 1*8 % the actual music
+
+ % let finis bar go through all staves
+ \override Staff.BarLine #'transparent = ##f
+
+ % finis bar
+ \bar "|."
+}
+
+
+discantusNotes = {
+ \transpose c' c'' {
+ \clef "treble"
+ d'2. d'4 |
+ b e' d'2 |
+ c'4 e'4.( d'8 c' b |
+ a4) b a2 |
+ b4.( c'8 d'4) c'4 |
+ \once \override NoteHead #'transparent = ##t c'1 |
+ b\breve |
+ }
+}
+
+discantusLyrics = \lyricmode {
+ Ju -- bi -- |
+ la -- te De -- |
+ o, om --
+ nis ter -- |
+ ra, __ om- |
+ "..." |
+ -us. |
+}
+
+altusNotes = {
+ \transpose c' c'' {
+ \clef "treble"
+ r2 g2. e4 fis g | % two bars
+ a2 g4 e |
+ fis g4.( fis16 e fis4) |
+ g1 |
+ \once \override NoteHead #'transparent = ##t g1 |
+ g\breve |
+ }
+}
+
+altusLyrics = \lyricmode {
+ Ju -- bi -- la -- te | % two bars
+ De -- o, om -- |
+ nis ter -- ra, |
+ "..." |
+ -us. |
+}
+
+tenorNotes = {
+ \transpose c' c' {
+ \clef "treble_8"
+ R1 |
+ R1 |
+ R1 |
+ r2 d'2. d'4 b e' | % two bars
+ \once \override NoteHead #'transparent = ##t e'1 |
+ d'\breve |
+ }
+}
+
+tenorLyrics = \lyricmode {
+ Ju -- bi -- la -- te | % two bars
+ "..." |
+ -us.
+}
+
+bassusNotes = {
+ \transpose c' c' {
+ \clef "bass"
+ R1 |
+ R1 |
+ R1 |
+ R1 |
+ g2. e4 |
+ \once \override NoteHead #'transparent = ##t e1 |
+ g\breve |
+ }
+}
+
+bassusLyrics = \lyricmode {
+ Ju -- bi- |
+ "..." |
+ -us.
+}
+
+incipitDiscantus = \markup{
+ \score{
+ {
+ \set Staff.instrumentName="Discantus "
+ \override NoteHead #'style = #'neomensural
+ \override Rest #'style = #'neomensural
+ \override Staff.TimeSignature #'style = #'neomensural
+ \cadenzaOn
+ \clef "neomensural-c1"
+ \key f \major
+ \time 2/2
+ c''1._"IV-" s2 %two bars
+ \skip 1*8 % eight bars
+ }
+ \layout {
+ \context {\Voice
+ \remove Ligature_bracket_engraver
+ \consists Mensural_ligature_engraver
+ }
+ line-width=4.5\cm
+ }
+ }
+}
+
+incipitAltus = \markup{
+ \score{
+ {
+ \set Staff.instrumentName="Altus "
+ \override NoteHead #'style = #'neomensural
+ \override Rest #'style = #'neomensural
+ \override Staff.TimeSignature #'style = #'neomensural
+ \cadenzaOn
+ \clef "neomensural-c3"
+ \key f \major
+ \time 2/2
+ r1 % one bar
+ f'1._"IV-" s2 % two bars
+ \skip 1*7 % seven bars
+ }
+ \layout {
+ \context {\Voice
+ \remove Ligature_bracket_engraver
+ \consists Mensural_ligature_engraver
+ }
+ line-width=4.5\cm
+ }
+ }
+}
+
+incipitTenor = \markup{
+ \score{ {
+ \set Staff.instrumentName = "Tenor "
+ \override NoteHead #'style = #'neomensural
+ \override Rest #'style = #'neomensural
+ \override Staff.TimeSignature #'style = #'neomensural
+ \cadenzaOn
+ \clef "neomensural-c4"
+ \key f \major
+ \time 2/2
+ r\longa % four bars
+ r\breve % two bars
+ r1 % one bar
+ c'1._"IV-" s2 % two bars
+ \skip 1 % one bar
+ }
+ \layout {
+ \context {\Voice
+ \remove Ligature_bracket_engraver
+ \consists Mensural_ligature_engraver
+ }
+ line-width=4.5\cm
+}
+}
+}
+
+incipitBassus = \markup{
+ \score{ {
+ \set Staff.instrumentName = "Bassus "
+ \override NoteHead #'style = #'neomensural
+ \override Rest #'style = #'neomensural
+ \override Staff.TimeSignature #'style = #'neomensural
+ \cadenzaOn
+ \clef "bass"
+ \key f \major
+ \time 2/2
+ % incipit
+ r\maxima % eight bars
+ f1._"IV-" s2 % two bars
+ }
+ \layout {
+ \context {\Voice
+ \remove Ligature_bracket_engraver
+ \consists Mensural_ligature_engraver
+ }
+ line-width=4.5\cm
+ }
+ }
+}
+
+%StaffGroup is used instead of ChoirStaff to get bar lines between systems
+\score {
+ <<
+ \new StaffGroup = choirStaff <<
+ \new Voice =
+ "discantusNotes" << \global
+ \set Staff.instrumentName=\incipitDiscantus
+ \discantusNotes >>
+ \new Lyrics =
+ "discantusLyrics" \lyricsto discantusNotes { \discantusLyrics }
+
+ \new Voice =
+ "altusNotes" << \global
+ \set Staff.instrumentName=\incipitAltus
+ \altusNotes >>
+ \new Lyrics =
+ "altusLyrics" \lyricsto altusNotes { \altusLyrics }
+
+ \new Voice =
+ "tenorNotes" << \global
+ \set Staff.instrumentName=\incipitTenor
+ \tenorNotes >>
+ \new Lyrics =
+ "tenorLyrics" \lyricsto tenorNotes { \tenorLyrics }
+
+ \new Voice =
+ "bassusNotes" << \global
+ \set Staff.instrumentName=\incipitBassus
+ \bassusNotes >>
+ >>
+ \new Lyrics =
+ "bassusLyrics" \lyricsto bassusNotes { \bassusLyrics }
+ %Keep the bass lyrics outside of the staff group to avoid bar lines
+ %between the lyrics.
+ >>
+
+ \layout {
+ \context {
+ \Score
+
+ % no bars in staves
+ \override BarLine #'transparent = ##t
+ }
+ % the next three instructions keep the lyrics between the barlines
+ \context { \Lyrics
+ \consists "Bar_engraver"
+ \override BarLine #'transparent = ##t }
+ \context { \StaffGroup \consists "Separating_line_group_engraver" }
+ \context {
+ \Voice
+
+ % no slurs
+ \override Slur #'transparent = ##t
+
+ % Comment in the below "\remove" command to allow line
+ % breaking also at those barlines where a note overlaps
+ % into the next bar. The command is commented out in this
+ % short example score, but especially for large scores, you
+ % will typically yield better line breaking and thus improve
+ % overall spacing if you comment in the following command.
+ %\remove "Forbid_line_break_engraver"
+ }
+ indent=5\cm
+ }
+}
tweaking-clef-properties.ly
proportional-strict-notespacing.ly
making-an-object-invisible-with-the-transparent-property.ly
+transcription-of-ancient-music-with-incipit.ly
alignment-vertical-spacing.ly
drawing-circles-around-various-objects.ly
analysis-brackets-above-the-staff.ly
\header {
lsrtags = "vocal-music, tweaks-and-overrides, spacing"
+ texidoces = "
+Este fragmento de código muestra el uso de las propiedades de
+contexto @code{alignBelowContext} y @code{alignAboveContext} para
+controlar la posición de la letra y los compases de ossia.
+
+"
+ doctitlees = "Alineación vertical de la letra y los compases de ossia"
+
texidoc = "
This snippet demonstrates the use of the context properties
@code{alignBelowContext} and @code{alignAboveContext} to control the
+changing-stanza-fonts.ly
+ambitus-with-multiple-voices.ly
+formatting-lyrics-syllables.ly
chant-or-psalms-notation.ly
-single-staff-template-with-notes-and-lyrics.ly
adding-ambitus-per-voice.ly
single-staff-template-with-notes,-lyrics,-chords-and-frets.ly
skips-in-lyric-mode-2.ly
-changing-stanza-fonts.ly
lyrics-alignment.ly
+vertically-aligning-ossias-and-lyrics.ly
+vocal-ensemble-template.ly
+adjusting-lyrics-vertical-spacing.ly
vocal-ensemble-template-with-automatic-piano-reduction.ly
-ambitus-with-multiple-voices.ly
+vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly
how-to-put-ties-between-syllables-in-lyrics.ly
piano-template-with-melody-and-lyrics.ly
-vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly
+demo-midiinstruments.ly
+single-staff-template-with-notes-and-lyrics.ly
+marking-notes-of-spoken-parts-with-a-cross-on-the-stem.ly
+ambitus.ly
single-staff-template-with-notes,-lyrics,-and-chords.ly
-formatting-lyrics-syllables.ly
-vertically-aligning-ossias-and-lyrics.ly
vertically-centered-common-lyrics.ly
-demo-midiinstruments.ly
-vocal-ensemble-template.ly
-adjusting-lyrics-vertical-spacing.ly
skips-in-lyric-mode.ly
-breathing-signs.ly
+flute-slap-notation.ly
%Association list of pitches to colors.
#(define color-mapping
- (list
- (cons (ly:make-pitch 0 0 0) (x11-color 'red))
- (cons (ly:make-pitch 0 0 1/2) (x11-color 'green))
- (cons (ly:make-pitch 0 1 -1/2) (x11-color 'green))
- (cons (ly:make-pitch 0 2 0) (x11-color 'red))
- (cons (ly:make-pitch 0 2 1/2) (x11-color 'green))
- (cons (ly:make-pitch 0 3 -1/2) (x11-color 'red))
- (cons (ly:make-pitch 0 3 0) (x11-color 'green))
- (cons (ly:make-pitch 0 4 1/2) (x11-color 'red))
- (cons (ly:make-pitch 0 5 0) (x11-color 'green))
- (cons (ly:make-pitch 0 5 -1/2) (x11-color 'red))
- (cons (ly:make-pitch 0 6 1/2) (x11-color 'red))
- (cons (ly:make-pitch 0 1 0) (x11-color 'blue))
- (cons (ly:make-pitch 0 3 1/2) (x11-color 'blue))
- (cons (ly:make-pitch 0 4 -1/2) (x11-color 'blue))
- (cons (ly:make-pitch 0 5 1/2) (x11-color 'blue))
- (cons (ly:make-pitch 0 6 -1/2) (x11-color 'blue))
- ))
+ (list
+ (cons (ly:make-pitch 0 0 0) (x11-color 'red))
+ (cons (ly:make-pitch 0 0 1/2) (x11-color 'green))
+ (cons (ly:make-pitch 0 1 -1/2) (x11-color 'green))
+ (cons (ly:make-pitch 0 2 0) (x11-color 'red))
+ (cons (ly:make-pitch 0 2 1/2) (x11-color 'green))
+ (cons (ly:make-pitch 0 3 -1/2) (x11-color 'red))
+ (cons (ly:make-pitch 0 3 0) (x11-color 'green))
+ (cons (ly:make-pitch 0 4 1/2) (x11-color 'red))
+ (cons (ly:make-pitch 0 5 0) (x11-color 'green))
+ (cons (ly:make-pitch 0 5 -1/2) (x11-color 'red))
+ (cons (ly:make-pitch 0 6 1/2) (x11-color 'red))
+ (cons (ly:make-pitch 0 1 0) (x11-color 'blue))
+ (cons (ly:make-pitch 0 3 1/2) (x11-color 'blue))
+ (cons (ly:make-pitch 0 4 -1/2) (x11-color 'blue))
+ (cons (ly:make-pitch 0 5 1/2) (x11-color 'blue))
+ (cons (ly:make-pitch 0 6 -1/2) (x11-color 'blue))
+ ))
%Compare pitch and alteration (not octave).
#(define (pitch-equals? p1 p2)
- (and (= (ly:pitch-alteration p1) (ly:pitch-alteration p2))
- (= (ly:pitch-notename p1) (ly:pitch-notename p2))))
+ (and
+ (= (ly:pitch-alteration p1) (ly:pitch-alteration p2))
+ (= (ly:pitch-notename p1) (ly:pitch-notename p2))))
#(define (pitch-to-color pitch)
- (let ((color (assoc pitch color-mapping pitch-equals?)))
- (if color (cdr color))))
+ (let ((color (assoc pitch color-mapping pitch-equals?)))
+ (if color
+ (cdr color))))
#(define (color-notehead grob)
- (pitch-to-color (ly:event-property (ly:grob-property grob 'cause) 'pitch)))
-
+ (pitch-to-color
+ (ly:event-property (ly:grob-property grob 'cause) 'pitch)))
\score {
- \new Staff \relative c' {
- \override NoteHead #'color = #color-notehead
- c8 b d dis ees f g aes
- }
+ \new Staff \relative c' {
+ \override NoteHead #'color = #color-notehead
+ c8 b d dis ees f g aes
+ }
}
--- /dev/null
+\version "2.11.62"
+
+\header {
+ lsrtags = "editorial-annotations, vocal-music"
+
+ texidoc = "
+This example shows how to put crosses on stems. Mark the beginning
+of a spoken section with the @code{\\speakOn} keyword, and end it
+with the @code{\\speakOff} keyword. Remember to end cross sections
+before entering any rest: this function also adds crosses to the
+invisible stems of rests.
+"
+ doctitle = "Marking notes of spoken parts with a cross on the stem"
+}
+
+speakOn = {
+ \override Stem #'stencil = #(lambda (grob)
+ (ly:stencil-combine-at-edge
+ (ly:stem::print grob)
+ Y
+ (- (ly:grob-property grob 'direction))
+ (grob-interpret-markup grob
+ (markup #:hspace -1.025 #:fontsize -4
+ #:musicglyph "noteheads.s2cross"))
+ -2.3 0))
+}
+
+speakOff = {
+ \revert Stem #'stencil
+}
+
+\score {
+ \new Staff {
+ \relative c'' {
+ a4 b a c
+ \speakOn
+ g4 f r g
+ b4 r d e
+ \speakOff
+ c4 a g f
+ }
+ }
+}