lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

changes in chord names formatting (1503, 1572) (issue 4981052)


From: janek . lilypond
Subject: changes in chord names formatting (1503, 1572) (issue 4981052)
Date: Sat, 10 Sep 2011 20:59:23 +0000

Reviewers: adam.spiers,

Message:
Patches from Adam Spiers.

Description:
http://code.google.com/p/lilypond/issues/detail?id=1503
http://code.google.com/p/lilypond/issues/detail?id=1572

1503 - Allow choice of prefix for chord modifiers.

This was previously "add", e.g. "Cmaj7 add6add9",
but this results in too much clutter and
is rarely used.

Issue 1503 - Allow choice of minor chord modifier.

For example, often it is preferred to use a hyphen
instead of "m". This can now be achieved via:

  \set minorChordModifier = \markup { "-" }

add chordInversionSeparator

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.

Issue 1503 - Recognise Lydian chords


enlarge half-diminished slashed circle symbol

Please review this at http://codereview.appspot.com/4981052/

Affected files:
  M ly/chord-modifiers-init.ly
  M ly/engraver-init.ly
  M scm/chord-ignatzek-names.scm
  M scm/define-context-properties.scm


Index: ly/chord-modifiers-init.ly
diff --git a/ly/chord-modifiers-init.ly b/ly/chord-modifiers-init.ly
index 75b804bb051aeb455676df081c5960d03485997a..91cb1e1fc15bd989fc5ed85daf5d68554c4eb20d 100644
--- a/ly/chord-modifiers-init.ly
+++ b/ly/chord-modifiers-init.ly
@@ -27,9 +27,10 @@ ignatzekExceptionMusic = {
        <c es ges>-\markup { \super "o" } % should be $\circ$ ?
        <c es ges bes>-\markup {
          %%  f8 is o with slash.
-         \super #(ly:export (ly:wide-char->utf-8 #x00f8))
+         \normal-size-super #(ly:export (ly:wide-char->utf-8 #x00f8))
        }
        <c es ges beses>-\markup { \super  "o7" }
+       <c e g b fis'>-\markup { \super "lyd" } % Lydian
 }

 partialJazzMusic = {
Index: ly/engraver-init.ly
diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index a2ba6551f678d11061d13afae9d6bcc90a6946a1..37cd695e383e1147e010123990f1ebb93f0160b4 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -641,9 +641,12 @@ automatically when an output definition (a @code{\score} or

 %% chord names:
   chordNameFunction = #ignatzek-chord-names
+  minorChordModifier = "m"
+  additionalPitchPrefix = "" % was "add"
   majorSevenSymbol = #whiteTriangleMarkup
   chordNameLowercaseMinor = ##f
-  chordNameSeparator = #(make-simple-markup  "/")
+  chordNameSeparator = #(make-hspace-markup 0.5)
+  chordInversionSeparator = #(make-simple-markup "/")
   chordNameExceptions = #ignatzekExceptions
   chordNoteNamer = #'()
   chordRootNamer = #note-name->markup
Index: scm/chord-ignatzek-names.scm
diff --git a/scm/chord-ignatzek-names.scm b/scm/chord-ignatzek-names.scm
index 696d02fc7af43ab3ae2383f670a51ecc98afde9d..0302f35e82f7ab8472ac1f222f5d3b0515bf3597 100644
--- a/scm/chord-ignatzek-names.scm
+++ b/scm/chord-ignatzek-names.scm
@@ -130,7 +130,8 @@ work than classifying the pitches."
     (define (prefix-modifier->markup mod)
       (if (and (= 3 (pitch-step mod))
               (= FLAT (ly:pitch-alteration mod)))
-         (make-simple-markup (if lowercase-root? "" "m"))
+      (if lowercase-root? (empty-markup)
+          (ly:context-property context 'minorChordModifier))
          (make-simple-markup "huh")))

     (define (filter-alterations alters)
@@ -168,8 +169,10 @@ work than classifying the pitches."
        (make-line-markup total)))

     (let* ((sep (ly:context-property context 'chordNameSeparator))
+           (invsep (ly:context-property context 'chordInversionSeparator))
           (root-markup (name-root root lowercase-root?))
-          (add-markups (map (lambda (x) (glue-word-to-step "add" x))
+ (add-pitch-prefix (ly:context-property context 'additionalPitchPrefix))
+          (add-markups (map (lambda (x) (glue-word-to-step add-pitch-prefix x))
                             addition-pitches))
           (filtered-alterations (filter-alterations alteration-pitches))
           (alterations (map name-step filtered-alterations))
@@ -183,7 +186,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 invsep (name-note bass-pitch #f))
                           '())))

       (set! base-stuff
Index: scm/define-context-properties.scm
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index e9acd9690713e8924844cda7d0ff90f3f565a16c..e03cd1076b209d8496424cc645e4fbd13b47b432 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -45,6 +45,8 @@
      ;; TODO FIXME

      (aDueText ,markup? "Text to print at a unisono passage.")
+     (additionalPitchPrefix ,string? "Text with which to prefix
+additional pitches within a chord name.")
      (alignAboveContext ,string? "Where to insert newly created context in
 vertical alignment.")
      (alignBassFigureAccidentals ,boolean? "If true, then the accidentals
@@ -148,6 +150,8 @@ 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.")
+     (chordInversionSeparator ,markup? "The markup object used to
+separate a chord name from its root note in case of inversions.")
      (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
@@ -373,6 +377,8 @@ page turn to be allowed.")
      (minimumRepeatLengthForPageTurn ,ly:moment? "Minimum length of a
 repeated section for a page turn to be allowed within that section.")

+     (minorChordModifier ,markup? "How should minor chords be formatted
+in a chord name?")

      (noChordSymbol ,markup? "Markup to be displayed for rests in a
 ChordNames context.")





reply via email to

[Prev in Thread] Current Thread [Next in Thread]