From: Adam Spiers Date: Mon, 7 Nov 2011 11:48:33 +0000 (+0000) Subject: Issue 1503 - Allow choice of minor chord modifier. X-Git-Tag: release/2.15.21-1~30 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b85edb1f85ea1dac790fc9c460407c51fd81081f;p=lilypond.git 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 { "-" } --- diff --git a/Documentation/notation/chords.itely b/Documentation/notation/chords.itely index 92d01477f8..a8884d2866 100644 --- a/Documentation/notation/chords.itely +++ b/Documentation/notation/chords.itely @@ -675,13 +675,32 @@ is a set of pitches used to identify the steps present in the chord. The second item is a markup that will follow the @code{chordRootNamer} output to create the chord name. +@funindex minorChordModifier + +@item minorChordModifier + +Minor chords are often denoted via a @q{m} suffix to the right of the +root of the chord. However some idioms prefer other suffices, such as +a minus sign. + +@lilypond[verbatim,quote,ragged-right] +\chords { + c4:min f:min7 + \set minorChordModifier = \markup { "-" } + \break + c4:min f:min7 +} +@end lilypond + @funindex chordPrefixSpacer + @item chordPrefixSpacer -The @q{m} for minor chords is usually printed immediately to the -right of the root of the chord. A spacer can be placed between -the root and @q{m} by setting @code{chordPrefixSpacer}. -The spacer is not used when the root is altered. +The modifier for minor chords as determined by +@code{minorChordModifier} is usually printed immediately to the right +of the root of the chord. A spacer can be placed between the root and +the modifier by setting @code{chordPrefixSpacer}. The spacer is not +used when the root is altered. @end table diff --git a/input/regression/chord-name-minor.ly b/input/regression/chord-name-minor.ly new file mode 100644 index 0000000000..09314094a7 --- /dev/null +++ b/input/regression/chord-name-minor.ly @@ -0,0 +1,13 @@ +\version "2.15.16" +\header { + texidoc = "The layout of the minor chord can be tuned with +@code{minorChordModifier}." +} + +\chords { + c:min + c:min7 + \set minorChordModifier = \markup { "-" } + c:min + c:min7 +} diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 71a191d4b4..f88705e300 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -645,6 +645,7 @@ automatically when an output definition (a @code{\score} or %% chord names: chordNameFunction = #ignatzek-chord-names + minorChordModifier = #(make-simple-markup "m") majorSevenSymbol = #whiteTriangleMarkup chordNameLowercaseMinor = ##f chordNameSeparator = #(make-hspace-markup 0.5) diff --git a/scm/chord-ignatzek-names.scm b/scm/chord-ignatzek-names.scm index 6aad896795..aaf9703985 100644 --- a/scm/chord-ignatzek-names.scm +++ b/scm/chord-ignatzek-names.scm @@ -130,7 +130,9 @@ 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) diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index 32595e759e..ecf50fba82 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -375,6 +375,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? "Markup displayed following the root +for a minor chord") (noChordSymbol ,markup? "Markup to be displayed for rests in a ChordNames context.")