]> git.donarmstrong.com Git - lilypond.git/commitdiff
Mathieu Giraud's patch
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 17 Apr 2005 20:59:43 +0000 (20:59 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 17 Apr 2005 20:59:43 +0000 (20:59 +0000)
ChangeLog
ly/engraver-init.ly
ly/property-init.ly
scm/chord-ignatzek-names.scm
scm/chord-name.scm
scm/define-context-properties.scm

index 004418afa8533fa52c2f33231f4030dc48822459..71c5e3b1dd02f97ded8b9e13c191dc06a04883d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-04-17  Mathieu Giraud  <magiraud@free.fr>
+
+       * scm/chord-name.scm : support for italian and french
+       chords names.
+
+       * scm/chord-ignatzek-names.scm (ignatzek-chord-names): add
+       a space defined by chordPrefixSpacer when the root name is
+       direclty followed by a prefix.
+
+       * ly/engraver-init.ly : chordPrefixSpacer       
+       * scm/define-context-properties.scm : chordPrefixSpacer
+       * ly/property-init.ly : italianChords, frenchChords 
+
 2005-04-17  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * SConstruct: Require pkg-config.
index 94fed640aa29757bfd2b318d61491223bdd7cd4c..9fed117387d3313f409a153e88d23bc0b1373ce3 100644 (file)
@@ -513,6 +513,7 @@ AncientRemoveEmptyStaffContext = \context {
   chordNameExceptions = #ignatzekExceptions
   chordNoteNamer = #'()
   chordRootNamer = #note-name->markup
+  chordPrefixSpacer = #0
   chordNameExceptionsFull = #fullJazzExceptions
   chordNameExceptionsPartial = #partialJazzExceptions
   
index bdc433603da34e6a4a6170a8e727c94b6a9b78c7..ee2829ead9ef904d9d4ab733f8b326f50f196c1d 100644 (file)
@@ -176,7 +176,15 @@ semiGermanChords = {
     \set chordNoteNamer = #note-name->german-markup
 }
 
+frenchChords = {
+    \set chordRootNamer = #(chord-name->italian-markup #t)
+    \set chordPrefixSpacer = #0.4
+}
 
+italianChords = {
+    \set chordRootNamer = #(chord-name->italian-markup #f)
+    \set chordPrefixSpacer = #0.4
+}
 
 improvisationOn =  {
     \set squashedPosition = #0
index 0d9295e301876b3970301b78b37b0419c4c276bf..5ce64b7c908f20cce515a2a8dffcb9b85d2f3470 100644 (file)
@@ -177,7 +177,10 @@ work than classifying the pitches."
       (set! base-stuff
            (append
             (list root-markup
-                  (markup-join prefixes sep)
+                  (conditional-kern-before (markup-join prefixes sep)
+                                           (and (not (null? prefixes))
+                                                (= (ly:pitch-alteration root) NATURAL))
+                                           (ly:context-property context 'chordPrefixSpacer))
                   (make-super-markup to-be-raised-stuff))
             base-stuff))
       (make-line-markup base-stuff)))
index e05469f0db90ef7b9722e2a4947fa483585fdc4c..6570b49055226433b14bb9a5cb2f63e279fc046c 100644 (file)
        (alteration->text-accidental-markup alteration)
        (= alteration FLAT) 0.2)))
 
+(define (accidental->markup-italian alteration)
+  "Return accidental markup for ALTERATION, for use after an italian chord root name."
+  (if (= alteration 0)
+      (make-hspace-markup 0.2)
+      (make-line-markup
+       (list
+        (make-hspace-markup (if (= alteration FLAT) 0.7 0.5))
+       (make-raise-markup 0.7 (alteration->text-accidental-markup alteration))
+       (make-hspace-markup (if (= alteration SHARP) 0.2 0.1))
+       ))))
+
 (define-public (note-name->markup pitch)
   "Return pitch markup for PITCH."
   (make-line-markup
           (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (/ (cdr n-a) 2)))
           (list-ref '("eses" "es" "" "is" "isis") (+ 2 (/ (cdr n-a) 2)))))))))
 
+(define-public ((chord-name->italian-markup re-with-eacute) pitch)
+  "Return pitch markup for PITCH, using italian/french note names.
+   If re-with-eacute is set to #t, french 'ré' is returned for D instead of 're'
+"
+  (let* ((name (ly:pitch-notename pitch))
+         (alt (ly:pitch-alteration pitch)))
+    (make-line-markup
+     (list
+      (make-simple-markup
+       (vector-ref
+        (if re-with-eacute
+            #("Do" "Ré" "Mi" "Fa" "Sol" "La" "Si")
+            #("Do" "Re" "Mi" "Fa" "Sol" "La" "Si"))
+        name))
+      (accidental->markup-italian alt)
+      ))))
+
 ;; fixme we should standardize on omit-root (or the other one.)
 ;; perhaps the default should also be reversed --hwn
 (define-safe-public (sequential-music-to-chord-exceptions seq . rest)
index dd2c40da41ccb6fb1f491a4e89a439799fc3afd4..2c3654be3c21cfc444a485f74461ff66a43bd5a9 100644 (file)
@@ -132,6 +132,9 @@ Contains (@var{chord} . @var{markup}) entries.")
      (chordNameSeparator ,markup?
                         "The markup object used to separate
  parts of a chord name.")
+     (chordPrefixSpacer ,number?
+                       "The space added between the root symbol and the prefix
+ of a chord name")
      (chordChanges ,boolean? "Only show changes in chords scheme?")
      (clefGlyph ,string? "Name of the symbol within the music font.")
      (clefOctavation ,integer? "Add