]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add slashChordSeparator
authorAdam Spiers <lilypond@adamspiers.org>
Tue, 1 Nov 2011 18:14:36 +0000 (18:14 +0000)
committerAdam Spiers <lilypond@adamspiers.org>
Tue, 29 Nov 2011 11:04:43 +0000 (11:04 +0000)
Issue 1572 and issue 1503 - Allow choice of chord modifier separator
independently of chord inversion separator, since conventionally the
latter is always a slash (hence the term "slash chords"), whereas the
former seldom involves slashes.

Documentation/notation/chords.itely
input/regression/chord-slash-separator.ly [new file with mode: 0644]
ly/engraver-init.ly
scm/chord-ignatzek-names.scm
scm/define-context-properties.scm

index 50ac2bf9ed2277191bae3c5a9a8be1c3670f74c9..92d01477f82c9f6f7c89db7fcb380e56bec286b5 100644 (file)
@@ -631,9 +631,40 @@ bass note can be printed in lower case.
 
 @item chordNameSeparator
 
-Different parts of a chord name are normally separated by a slash.
-By setting @code{chordNameSeparator}, you can use any desired markup
-for a separator.
+Different parts of a chord name are normally separated by a small
+amount of horizontal space.  By setting @code{chordNameSeparator}, you
+can use any desired markup for a separator.  This does not affect the
+separator between a chord and its bass note; to customize that, use
+@code{slashChordSeparator}.
+
+@lilypond[verbatim,quote,ragged-right]
+\chords {
+  c4:7.9- c:7.9-/g
+  \set chordNameSeparator = \markup { "/" }
+  \break
+  c4:7.9- c:7.9-/g
+}
+@end lilypond
+
+@funindex slashChordSeparator
+
+@item slashChordSeparator
+
+Chords can be played over a bass note other than the conventional root
+of the chord.  These are known as ``inversions'' or ``slash chords'',
+because the default way of notating them is with a forward slash
+between the main chord and the bass note.  Therefore the value of
+@code{slashChordSeparator} defaults to a forward slash, but you can
+change it to any markup you choose.
+
+@lilypond[verbatim,quote,ragged-right]
+\chords {
+  c4:7.9- c:7.9-/g
+  \set slashChordSeparator = \markup { " over " }
+  \break
+  c4:7.9- c:7.9-/g
+}
+@end lilypond
 
 @funindex chordNameExceptions
 
diff --git a/input/regression/chord-slash-separator.ly b/input/regression/chord-slash-separator.ly
new file mode 100644 (file)
index 0000000..6abbcdb
--- /dev/null
@@ -0,0 +1,11 @@
+\version "2.15.16"
+\header {
+    texidoc = "The layout of chord inversions can be tuned with
+@code{slashChordSeparator}."
+}
+
+\chords {
+    des/c
+    \set slashChordSeparator = " over "
+    des/c
+}
index a416974ba08169371f411782dfeda42ac6163171..71a191d4b446cddfe0e2e9b1010d9c91eadb7a6f 100644 (file)
@@ -647,7 +647,8 @@ automatically when an output definition (a @code{\score} or
   chordNameFunction = #ignatzek-chord-names
   majorSevenSymbol = #whiteTriangleMarkup
   chordNameLowercaseMinor = ##f
-  chordNameSeparator = #(make-simple-markup  "/")
+  chordNameSeparator = #(make-hspace-markup 0.5)
+  slashChordSeparator = #(make-simple-markup "/")
   chordNameExceptions = #ignatzekExceptions
   chordNoteNamer = #'()
   chordRootNamer = #note-name->markup
index dbff86a8b08f97738bfe24773d4039fc736eed0e..6aad8967954add5d72f9ffe7a8948b397dd94d40 100644 (file)
@@ -168,6 +168,7 @@ work than classifying the pitches."
         (make-line-markup total)))
 
     (let* ((sep (ly:context-property context 'chordNameSeparator))
+           (slashsep (ly:context-property context 'slashChordSeparator))
            (root-markup (name-root root lowercase-root?))
            (add-markups (map (lambda (x) (glue-word-to-step "add" x))
                              addition-pitches))
@@ -183,7 +184,7 @@ work than classifying the pitches."
                                  suffixes
                                  add-markups) sep))
            (base-stuff (if (ly:pitch? bass-pitch)
-                           (list sep (name-note bass-pitch #f))
+                           (list slashsep (name-note bass-pitch #f))
                            '())))
 
       (set! base-stuff
@@ -209,7 +210,7 @@ work than classifying the pitches."
        ,exception-markup
        .
        ,(if (ly:pitch? bass-pitch)
-            (list (ly:context-property context 'chordNameSeparator)
+            (list (ly:context-property context 'slashChordSeparator)
                   (name-note bass-pitch #f))
             '()))))
 
index fb2994f383f97258e03660f4a9eb92652f639b35..32595e759eb847748ed263a745be922d4d794ee4 100644 (file)
@@ -148,6 +148,9 @@ of pitches to chord names.")
      (chordNameLowercaseMinor ,boolean? "Downcase roots of minor chords?")
      (chordNameSeparator ,markup? "The markup object used to
 separate parts of a chord name.")
+     (slashChordSeparator ,markup? "The markup object used to separate
+a chord name from its root note in case of inversions or slash
+chords.")
      (chordNoteNamer ,procedure? "A function that converts from a pitch
 object to a text markup.  Used for single pitches.")
      (chordPrefixSpacer ,number? "The space added between the root