From 3438bf4758616bef3dde936061e4e339a31fd99b Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Sun, 10 Aug 2008 21:15:24 +0100 Subject: [PATCH] LSR: Update. --- input/lsr/broken-crescendo-hairpin.ly | 4 +- input/lsr/changing-partcombine-texts.ly | 8 ++ input/lsr/changing-the-breath-mark-symbol.ly | 2 +- .../combining-two-parts-on-the-same-staff.ly | 21 ++++ .../customizing-fretboard-fret-diagrams.ly | 67 ++++++++++ input/lsr/customizing-markup-fret-diagrams.ly | 92 ++++++++++++++ input/lsr/expressive-marks.snippet-list | 3 +- input/lsr/fretted-strings.snippet-list | 2 + ...ynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly | 117 ++++++++++++++++++ .../stem-and-beam-behavior-in-tablature.ly | 2 +- input/lsr/tweaks-and-overrides.snippet-list | 3 + .../lsr/vertically-centered-common-lyrics.ly | 55 ++++++++ input/lsr/vocal-music.snippet-list | 1 + input/new/broken-crescendo-hairpin.ly | 4 +- .../customizing-fretboard-fret-diagrams.ly | 65 ++++++++++ input/new/customizing-markup-fret-diagrams.ly | 90 ++++++++++++++ 16 files changed, 531 insertions(+), 5 deletions(-) create mode 100644 input/lsr/customizing-fretboard-fret-diagrams.ly create mode 100644 input/lsr/customizing-markup-fret-diagrams.ly create mode 100644 input/lsr/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly create mode 100644 input/lsr/vertically-centered-common-lyrics.ly create mode 100644 input/new/customizing-fretboard-fret-diagrams.ly create mode 100644 input/new/customizing-markup-fret-diagrams.ly diff --git a/input/lsr/broken-crescendo-hairpin.ly b/input/lsr/broken-crescendo-hairpin.ly index 9e8edf5ccd..4f6180c112 100644 --- a/input/lsr/broken-crescendo-hairpin.ly +++ b/input/lsr/broken-crescendo-hairpin.ly @@ -50,7 +50,9 @@ draw the rectangle over the hairpin. \dynamicUp \override DynamicLineSpanner #'staff-padding = #4 r2 r16 c'8.\pp r4 - } \\ { + } + \\ + { \override DynamicLineSpanner #'layer = #0 des,2\mf\< ~ \override TextScript #'layer = #2 diff --git a/input/lsr/changing-partcombine-texts.ly b/input/lsr/changing-partcombine-texts.ly index f8c645982c..0b5af64503 100644 --- a/input/lsr/changing-partcombine-texts.ly +++ b/input/lsr/changing-partcombine-texts.ly @@ -5,6 +5,14 @@ \header { lsrtags = "simultaneous-notes" + texidoces = " +Al utilizar la posibilidad de combinación automática de partes, se +puede modificar el texto que se imprime para las secciones de solo +y de unísono: + +" + doctitlees = "Cambiar los textos de partcombine" + texidoc = " When using the automatic part combining feature, the printed text for the solo and unison sections may be changed: diff --git a/input/lsr/changing-the-breath-mark-symbol.ly b/input/lsr/changing-the-breath-mark-symbol.ly index e9be018cfd..1ed784efce 100644 --- a/input/lsr/changing-the-breath-mark-symbol.ly +++ b/input/lsr/changing-the-breath-mark-symbol.ly @@ -23,7 +23,7 @@ text. } % begin verbatim \relative c'' { c2 - \override BreathingSign #'text = #(make-musicglyph-markup "scripts.rvarcomma") + \override BreathingSign #'text = \markup { \musicglyph #"scripts.rvarcomma" } \breathe d2 } diff --git a/input/lsr/combining-two-parts-on-the-same-staff.ly b/input/lsr/combining-two-parts-on-the-same-staff.ly index 93fb0f05d6..873043409b 100644 --- a/input/lsr/combining-two-parts-on-the-same-staff.ly +++ b/input/lsr/combining-two-parts-on-the-same-staff.ly @@ -5,6 +5,27 @@ \header { lsrtags = "simultaneous-notes, text" + texidoces = " +La herramienta de combinación de partes ( instrucción +@code{\partcombine}) permite la combinación de varias partes +diferentes sobre el mismo pentagrama. Las indicaciones textuales +tales como \"solo\" o \"a2\" se añaden de forma predeterminada; +para quitarlas, sencillamente establezca la proopiedad +@code{printPartCombineTexts} al valor \"falso\". Para partituras +vocales (como himnos), no hay necesidad de añadir los textos +\"solo\" o \"a2\", por lo que se deben desactivar. Sin embargo, +podría ser mejor no usarlo si hay solos, porque éstos no se +indicarán. En tales casos podría ser preferible la notación +polifónica estándar. + +Este fragmento de código presenta las tres formas en que se pueden +imprimir dos partes sobre un solo pentagrama: polifonía estándar, +@code{\partcombine} sin textos, y @code{\partcombine} con +textos. + +" + doctitlees = "Combinar dos partes sobre el mismo pentagrama" + texidoc = " The part combiner tool ( @code{\\partcombine} command ) allows the combination of several different parts on the same staff. Text diff --git a/input/lsr/customizing-fretboard-fret-diagrams.ly b/input/lsr/customizing-fretboard-fret-diagrams.ly new file mode 100644 index 0000000000..30a3fb5882 --- /dev/null +++ b/input/lsr/customizing-fretboard-fret-diagrams.ly @@ -0,0 +1,67 @@ +%% Do not edit this file; it is auto-generated from input/new +%% This file is in the public domain. +\version "2.11.55" + +\header { + lsrtags = "fretted-strings,tweaks-and-overrides" + + texidoc = "Fret diagram properties can be set through +@code{fret-diagram-details}. For FretBoard fret diagrams, +overrides are applied to the @code{FretBoards.FretBoard} object. +" + doctitle = "Customizing fretboard fret diagrams" +} % begin verbatim + +\include "predefined-guitar-fretboards.ly" +\storePredefinedDiagram \chordmode { c' } + #guitar-tuning + #"x;1-1-(;3-2;3-3;3-4;1-1-);" +<< + \context ChordNames { + \chordmode { c1 c c d } + } + \context FretBoards { + % Set global properties of fret diagram + \override FretBoards.FretBoard #'size = #'1.2 + \override FretBoards.FretBoard #'fret-diagram-details + #'finger-code = #'in-dot + \override FretBoards.FretBoard #'fret-diagram-details + #'dot-color = #'white + \chordmode { + c + \once \override FretBoards.FretBoard #'size = #'1.0 + \once \override FretBoards.FretBoard #'fret-diagram-details + #'barre-type = #'straight + \once \override FretBoards.FretBoard #'fret-diagram-details + #'dot-color = #'black + \once \override FretBoards.FretBoard #'fret-diagram-details + #'finger-code = #'below-string + c' + \once \override FretBoards.FretBoard #'fret-diagram-details + #'barre-type = #'none + \once \override FretBoards.FretBoard #'fret-diagram-details + #'number-type = #'arabic + \once \override FretBoards.FretBoard #'fret-diagram-details + #'orientation = #'landscape + \once \override FretBoards.FretBoard #'fret-diagram-details + #'mute-string = #"M" + \once \override FretBoards.FretBoard #'fret-diagram-details + #'label-dir = #-1 + \once \override FretBoards.FretBoard #'fret-diagram-details + #'dot-color = #'black + c' + \once \override FretBoards.FretBoard #'fret-diagram-details + #'finger-code = #'below-string + \once \override FretBoards.FretBoard #'fret-diagram-details + #'dot-radius = #0.35 + \once \override FretBoards.FretBoard #'fret-diagram-details + #'dot-position = #0.5 + \once \override FretBoards.FretBoard #'fret-diagram-details + #'fret-count = #3 + d + } + } + \context Voice { + c'1 c' c' d' + } +>> diff --git a/input/lsr/customizing-markup-fret-diagrams.ly b/input/lsr/customizing-markup-fret-diagrams.ly new file mode 100644 index 0000000000..23bbb82229 --- /dev/null +++ b/input/lsr/customizing-markup-fret-diagrams.ly @@ -0,0 +1,92 @@ +%% Do not edit this file; it is auto-generated from input/new +%% This file is in the public domain. +\version "2.11.55" + +\header { + lsrtags = "fretted-strings,tweaks-and-overrides" + + texidoc = "Fret diagram properties can be set through +@code{fret-diagram-details}. For markup fret diagrams, overrides +can be applied to the @code{Voice.TextScript} object or directly +to the markup. +" + doctitle = "Customizing markup fret diagrams" +} % begin verbatim + +<< + \chords { c1 c c d } + + \new Voice = "mel" { + \textLengthOn + % Set global properties of fret diagram + \override Voice.TextScript #'size = #'1.2 + \override Voice.TextScript #'fret-diagram-details + #'finger-code = #'in-dot + \override Voice.TextScript #'fret-diagram-details + #'dot-color = #'white + + %% C major for guitar, no barre, using defaults + % terse style + c'1^\markup { \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" } + + %% C major for guitar, barred on third fret + % verbose style + % size 1.0 + % roman fret label, finger labels below string, straight barre + c'1^\markup { + % standard size + \override #'(size . 1.0) { + \override #'(fret-diagram-details . ( + (number-type . roman-lower) + (finger-code . in-dot) + (barre-type . straight))) { + \fret-diagram-verbose #'((mute 6) + (place-fret 5 3 1) + (place-fret 4 5 2) + (place-fret 3 5 3) + (place-fret 2 5 4) + (place-fret 1 3 1) + (barre 5 1 3)) + } + } + } + + %% C major for guitar, barred on third fret + % verbose style + % landscape orientation, arabic numbers, M for mute string + % no barre, fret label down or left, small mute label font + c'1^\markup { + \override #'(fret-diagram-details . ( + (finger-code . below-string) + (number-type . arabic) + (label-dir . -1) + (mute-string . "M") + (orientation . landscape) + (barre-type . none) + (xo-font-magnification . 0.4) + (xo-padding . 0.3))) { + \fret-diagram-verbose #'((mute 6) + (place-fret 5 3 1) + (place-fret 4 5 2) + (place-fret 3 5 3) + (place-fret 2 5 4) + (place-fret 1 3 1) + (barre 5 1 3)) + } + } + + %% simple D chord + % terse style + % larger dots, centered dots, fewer frets + % label below string + d'1^\markup { + \override #'(fret-diagram-details . ( + (finger-code . below-string) + (dot-radius . 0.35) + (dot-position . 0.5) + (fret-count . 3))) { + \fret-diagram-terse #"x;x;o;2-1;3-2;2-3;" + } + } + } +>> diff --git a/input/lsr/expressive-marks.snippet-list b/input/lsr/expressive-marks.snippet-list index c03626f27f..5237b9da62 100644 --- a/input/lsr/expressive-marks.snippet-list +++ b/input/lsr/expressive-marks.snippet-list @@ -10,7 +10,7 @@ adding-parentheses-around-an-expressive-mark-or-chordal-note.ly line-arrows.ly hiding-the-extender-line-for-text-dynamics.ly vertically-aligning-dynamics-across-multiple-notes.ly -modifying-default-values-for-articulation-shorthand-notation.ly +horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly changing-text-and-spanner-styles-for-text-dynamics.ly controlling-the-vertical-ordering-of-scripts.ly inserting-a-caesura.ly @@ -25,6 +25,7 @@ combining-dynamics-with-markup-texts.ly creating-slurs-across-voices.ly caesura-railtracks-with-fermata.ly changing-the-breath-mark-symbol.ly +modifying-default-values-for-articulation-shorthand-notation.ly creating-simultaneous-rehearsal-marks.ly setting-hairpin-behavior-at-bar-lines.ly changing--flageolet-mark-size.ly diff --git a/input/lsr/fretted-strings.snippet-list b/input/lsr/fretted-strings.snippet-list index 3f3fbe0e69..9cbdabd59a 100644 --- a/input/lsr/fretted-strings.snippet-list +++ b/input/lsr/fretted-strings.snippet-list @@ -10,7 +10,9 @@ letter-tablature-formatting.ly laissez-vibrer-ties.ly controlling-the-placement-of-chord-fingerings.ly allowing-fingerings-to-be-printed-inside-the-staff.ly +customizing-fretboard-fret-diagrams.ly faking-a-hammer-in-tablatures.ly fret-diagrams-explained-and-developed.ly modern-tab-text-clef.ly stem-and-beam-behavior-in-tablature.ly +customizing-markup-fret-diagrams.ly diff --git a/input/lsr/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly b/input/lsr/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly new file mode 100644 index 0000000000..748081171c --- /dev/null +++ b/input/lsr/horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly @@ -0,0 +1,117 @@ +%% 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.55" + +\header { + lsrtags = "expressive-marks, tweaks-and-overrides" + + texidoc = " +Some dynamic expressions involve additional text, like \"sempre pp\". +Since lilypond aligns all dynamics centered on the note, the \\pp would +be displayed way after the note it applies to. + +To correctly align the \"sempre \\pp\" horizontally, so that it is +aligned as if it were only the \\pp, there are several approaches: + +* Simply use @code{\\once\\override DynamicText #'X-offset = #-9.2} +before the note with the dynamics to manually shift it to the correct +position. Drawback: This has to be done manually each time you use that +dynamic markup... * Add some padding (@code{#:hspace 7.1}) into the +definition of your custom dynamic mark, so that after lilypond +center-aligns it, it is already correctly aligned. Drawback: The +padding really takes up that space and does not allow any other markup +or dynamics to be shown in that position. + +* Shift the dynamic script @code{\\once\\override ... #'X-offset = ..}. +Drawback: @code{\\once\\override} is needed for every invocation! + +* Set the dimensions of the additional text to 0 (using +@code{#:with-dimensions '(0 . 0) '(0 . 0)}). Drawback: To lilypond +\"sempre\" has no extent, so it might put other stuff there and create +collisions (which are not detected by the collision dection!). Also, +there seems to be some spacing, so it's not exactly the same alignment +as without the additional text + +* Add an explicit shifting directly inside the scheme function for the +dynamic-script. + +* Set an explicit alignment inside the dynamic-script. By default, this +won't have any effect, only if one sets X-offset! Drawback: One needs +to set @code{DynamicText #'X-offset}, which will apply to all dynamic +texts! Also, it is aligned at the right edge of the additional text, +not at the center of pp. + + + + +" + doctitle = "Horizontally aligning custom dynamics (e.g. \"sempre pp\", \"piu f\", \"subito p\")" +} % begin verbatim +\header { title = "Horizontally aligning custom dynamics" } +\layout { ragged-right = ##t } + +% Solution 1: Using a simple markup with a particular halign value +% Drawback: It's a markup, not a dynamic command, so \dynamicDown etc. will have no effect +semppMarkup = \markup { \halign #1.4 \italic "sempre" \dynamic "pp" } + +% Solution 2: Using a dynamic script and shifting with \once\override ... #'X-offset = .. +% Drawback: \once\override needed for every invocation +semppK = #(make-dynamic-script (markup #:line( #:normal-text #:italic "sempre" #:dynamic "pp"))) + +% Solution 3: Padding the dynamic script so the center-alignment puts it to the correct position +% Drawback: the padding really reserves the space, nothing else can be there +semppT = #( + make-dynamic-script ( + markup #:line ( + #:normal-text #:italic "sempre" #:dynamic "pp" #:hspace 7.1 + ) + ) +) + +% Solution 4: Dynamic, setting the dimensions of the additional text to 0 +% Drawback: To lilypond "sempre" has no extent, so it might put other stuff there => collisions +% Drawback: Also, there seems to be some spacing, so it's not exactly the +% same alignment as without the additional text +semppM = #(make-dynamic-script (markup #:line( #:with-dimensions '(0 . 0) '(0 . 0) #:right-align #:normal-text #:italic "sempre" #:dynamic "pp"))) + +% Solution 5: Dynamic with explicit shifting inside the scheme function +semppG = #(make-dynamic-script + (markup + #:hspace 0 #:translate (cons -18.85 0 ) + #:line( #:normal-text #:italic "sempre" #:dynamic "pp")) +) + +% Solution 6: Dynamic with explicit alignment. This has only effect, if one sets X-offset! +% Drawback: One needs to set DynamicText #'X-offset! +% Drawback: Aligned at the right edge of the additional text, not at the center of pp +semppMII = #(make-dynamic-script (markup #:line(#:right-align #:normal-text #:italic "sempre" #:dynamic "pp"))) + + +\context StaffGroup << + \context Staff="s" << \set Staff.instrumentName = "Normal" + \relative c'' { \key es \major c4\pp c\p c c | c\ff c c\pp c } + >> + \context Staff="sMarkup" << \set Staff.instrumentName = \markup\column{"Normal" "Markup"} + \relative c'' { \key es \major c4-\semppMarkup c\p c c | c\ff c c-\semppMarkup c} + >> + \context Staff="sK" << \set Staff.instrumentName = \markup\column{"Explicit" "shifting"} + \relative c'' { \key es \major + \once \override DynamicText #'X-offset = #-9.2 c4\semppK c\p c c | + c\ff c \once \override DynamicText #'X-offset = #-9.2 c\semppK c } + >> + \context Staff="sT" << \set Staff.instrumentName = \markup\column{"Right" "padding"} + \relative c'' { \key es \major c4\semppT c\p c c | c\ff c c\semppT c } + >> + \context Staff="sM" << \set Staff.instrumentName = \markup\column{"Setting" "dimension" "to zero"} + \relative c'' { \key es \major c4\semppM c\p c c | c\ff c c\semppM c } + >> + \context Staff="sG" << \set Staff.instrumentName = \markup\column{"Shifting" "inside" "dynamics"} + \relative c'' { \key es \major c4\semppG c\p c c | c\ff c c\semppG c} + >> + \context Staff="sMII" << \set Staff.instrumentName = \markup\column{"Alignment" "inside" "dynamics"} + \relative c'' { \key es \major + \override DynamicText #'X-offset = #0 % Setting to ##f (false) gives the same resul + c4\semppMII c\p c c | c\ff c c\semppMII c } + >> +>> + diff --git a/input/lsr/stem-and-beam-behavior-in-tablature.ly b/input/lsr/stem-and-beam-behavior-in-tablature.ly index 3d61a8715a..f8f86a4d29 100644 --- a/input/lsr/stem-and-beam-behavior-in-tablature.ly +++ b/input/lsr/stem-and-beam-behavior-in-tablature.ly @@ -17,7 +17,7 @@ example. \relative c { g16 b d g b d g b \stemDown - \override Beam #'damping = #100000 + \override Beam #'damping = #+inf.0 g,,16 b d g b d g b } } diff --git a/input/lsr/tweaks-and-overrides.snippet-list b/input/lsr/tweaks-and-overrides.snippet-list index 9c196e61e7..12cce7b080 100644 --- a/input/lsr/tweaks-and-overrides.snippet-list +++ b/input/lsr/tweaks-and-overrides.snippet-list @@ -8,12 +8,14 @@ custodes.ly printing-a-repeat-sign-at-the-beginning-of-a-piece.ly creating-text-spanners.ly rest-styles.ly +horizontally-aligning-custom-dynamics-e.g.-sempre-pp,-piu-f,-subito-p.ly how-to-change-fret-diagram-position.ly using-the--tweak-command-to-tweak-individual-grobs.ly suppressing-warnings-for-clashing-note-columns.ly controlling-tuplet-bracket-visibility.ly positioning-multi--measure-rests.ly changing-the-staff-size.ly +customizing-markup-fret-diagrams.ly changing-text-and-spanner-styles-for-text-dynamics.ly fine-tuning-pedal-brackets.ly controlling-the-vertical-ordering-of-scripts.ly @@ -35,5 +37,6 @@ caesura-railtracks-with-fermata.ly changing-form-of-multi--measure-rests.ly time-signature-in-parentheses.ly changing-a-single-notes-size-in-a-chord.ly +customizing-fretboard-fret-diagrams.ly creating-simultaneous-rehearsal-marks.ly nesting-staves.ly diff --git a/input/lsr/vertically-centered-common-lyrics.ly b/input/lsr/vertically-centered-common-lyrics.ly new file mode 100644 index 0000000000..f73fe433c8 --- /dev/null +++ b/input/lsr/vertically-centered-common-lyrics.ly @@ -0,0 +1,55 @@ +%% 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.55" + +\header { + lsrtags = "vocal-music" + + texidoc = " +In a vocal piece where there are several (two,four or more) lines of +lyrics, and common lyrics for all voices at some point, these common +lyrics may be vertically centered regardingly, as shown in the +following example: + +" + doctitle = "Vertically centered common lyrics" +} % begin verbatim + +\include "english.ly" +leftbrace = \markup { \override #'(font-encoding . fetaBraces) \lookup #"brace240" } +rightbrace = \markup { \rotate #180 \leftbrace } + +dropLyrics = +{ + \override LyricText #'extra-offset = #'(0 . -5) + \override LyricHyphen #'extra-offset = #'(0 . -5) + \override LyricExtender #'extra-offset = #'(0 . -5) +} + +raiseLyrics = +{ + \revert LyricText #'extra-offset + \revert LyricHyphen #'extra-offset + \revert LyricExtender #'extra-offset +} + +skipFour = \repeat unfold 4 { \skip 8 } + +lyricsA = \lyricmode { The first verse has \dropLyrics the com -- mon +__ words \raiseLyrics used in all four. } +lyricsB = \lyricmode { In stan -- za two, \skipFour al -- so ap -- pear. } +lyricsC = \lyricmode { By the third verse, \skipFour are get -- ting dull. } +lyricsD = \lyricmode { Last stan -- za, and \skipFour get used once more. } + +melody = \relative c' { c4 d e f g f e8( e f) d4 c e d c } + +\score +{ + << + \new Voice = m \melody + \new Lyrics \lyricsto m \lyricsA + \new Lyrics \lyricsto m \lyricsB + \new Lyrics \lyricsto m \lyricsC + \new Lyrics \lyricsto m \lyricsD + >> +} diff --git a/input/lsr/vocal-music.snippet-list b/input/lsr/vocal-music.snippet-list index 3933610301..472f7c8a35 100644 --- a/input/lsr/vocal-music.snippet-list +++ b/input/lsr/vocal-music.snippet-list @@ -12,6 +12,7 @@ vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.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 diff --git a/input/new/broken-crescendo-hairpin.ly b/input/new/broken-crescendo-hairpin.ly index 8ff4fc4229..6ead4937e3 100644 --- a/input/new/broken-crescendo-hairpin.ly +++ b/input/new/broken-crescendo-hairpin.ly @@ -26,7 +26,9 @@ draw the rectangle over the hairpin. \dynamicUp \override DynamicLineSpanner #'staff-padding = #4 r2 r16 c'8.\pp r4 - } \\ { + } + \\ + { \override DynamicLineSpanner #'layer = #0 des,2\mf\< ~ \override TextScript #'layer = #2 diff --git a/input/new/customizing-fretboard-fret-diagrams.ly b/input/new/customizing-fretboard-fret-diagrams.ly new file mode 100644 index 0000000000..1b9ab8f912 --- /dev/null +++ b/input/new/customizing-fretboard-fret-diagrams.ly @@ -0,0 +1,65 @@ +\version "2.11.55" + +\header { + lsrtags = "fretted-strings,tweaks-and-overrides" + + texidoc = "Fret diagram properties can be set through +@code{fret-diagram-details}. For FretBoard fret diagrams, +overrides are applied to the @code{FretBoards.FretBoard} object. +" + doctitle = "Customizing fretboard fret diagrams" +} + +\include "predefined-guitar-fretboards.ly" +\storePredefinedDiagram \chordmode { c' } + #guitar-tuning + #"x;1-1-(;3-2;3-3;3-4;1-1-);" +<< + \context ChordNames { + \chordmode { c1 c c d } + } + \context FretBoards { + % Set global properties of fret diagram + \override FretBoards.FretBoard #'size = #'1.2 + \override FretBoards.FretBoard #'fret-diagram-details + #'finger-code = #'in-dot + \override FretBoards.FretBoard #'fret-diagram-details + #'dot-color = #'white + \chordmode { + c + \once \override FretBoards.FretBoard #'size = #'1.0 + \once \override FretBoards.FretBoard #'fret-diagram-details + #'barre-type = #'straight + \once \override FretBoards.FretBoard #'fret-diagram-details + #'dot-color = #'black + \once \override FretBoards.FretBoard #'fret-diagram-details + #'finger-code = #'below-string + c' + \once \override FretBoards.FretBoard #'fret-diagram-details + #'barre-type = #'none + \once \override FretBoards.FretBoard #'fret-diagram-details + #'number-type = #'arabic + \once \override FretBoards.FretBoard #'fret-diagram-details + #'orientation = #'landscape + \once \override FretBoards.FretBoard #'fret-diagram-details + #'mute-string = #"M" + \once \override FretBoards.FretBoard #'fret-diagram-details + #'label-dir = #-1 + \once \override FretBoards.FretBoard #'fret-diagram-details + #'dot-color = #'black + c' + \once \override FretBoards.FretBoard #'fret-diagram-details + #'finger-code = #'below-string + \once \override FretBoards.FretBoard #'fret-diagram-details + #'dot-radius = #0.35 + \once \override FretBoards.FretBoard #'fret-diagram-details + #'dot-position = #0.5 + \once \override FretBoards.FretBoard #'fret-diagram-details + #'fret-count = #3 + d + } + } + \context Voice { + c'1 c' c' d' + } +>> diff --git a/input/new/customizing-markup-fret-diagrams.ly b/input/new/customizing-markup-fret-diagrams.ly new file mode 100644 index 0000000000..c170f847c4 --- /dev/null +++ b/input/new/customizing-markup-fret-diagrams.ly @@ -0,0 +1,90 @@ +\version "2.11.55" + +\header { + lsrtags = "fretted-strings,tweaks-and-overrides" + + texidoc = "Fret diagram properties can be set through +@code{fret-diagram-details}. For markup fret diagrams, overrides +can be applied to the @code{Voice.TextScript} object or directly +to the markup. +" + doctitle = "Customizing markup fret diagrams" +} + +<< + \chords { c1 c c d } + + \new Voice = "mel" { + \textLengthOn + % Set global properties of fret diagram + \override Voice.TextScript #'size = #'1.2 + \override Voice.TextScript #'fret-diagram-details + #'finger-code = #'in-dot + \override Voice.TextScript #'fret-diagram-details + #'dot-color = #'white + + %% C major for guitar, no barre, using defaults + % terse style + c'1^\markup { \fret-diagram-terse #"x;3-3;2-2;o;1-1;o;" } + + %% C major for guitar, barred on third fret + % verbose style + % size 1.0 + % roman fret label, finger labels below string, straight barre + c'1^\markup { + % standard size + \override #'(size . 1.0) { + \override #'(fret-diagram-details . ( + (number-type . roman-lower) + (finger-code . in-dot) + (barre-type . straight))) { + \fret-diagram-verbose #'((mute 6) + (place-fret 5 3 1) + (place-fret 4 5 2) + (place-fret 3 5 3) + (place-fret 2 5 4) + (place-fret 1 3 1) + (barre 5 1 3)) + } + } + } + + %% C major for guitar, barred on third fret + % verbose style + % landscape orientation, arabic numbers, M for mute string + % no barre, fret label down or left, small mute label font + c'1^\markup { + \override #'(fret-diagram-details . ( + (finger-code . below-string) + (number-type . arabic) + (label-dir . -1) + (mute-string . "M") + (orientation . landscape) + (barre-type . none) + (xo-font-magnification . 0.4) + (xo-padding . 0.3))) { + \fret-diagram-verbose #'((mute 6) + (place-fret 5 3 1) + (place-fret 4 5 2) + (place-fret 3 5 3) + (place-fret 2 5 4) + (place-fret 1 3 1) + (barre 5 1 3)) + } + } + + %% simple D chord + % terse style + % larger dots, centered dots, fewer frets + % label below string + d'1^\markup { + \override #'(fret-diagram-details . ( + (finger-code . below-string) + (dot-radius . 0.35) + (dot-position . 0.5) + (fret-count . 3))) { + \fret-diagram-terse #"x;x;o;2-1;3-2;2-3;" + } + } + } +>> -- 2.39.5