Hi everybody,

Thank you for the great job you do with Lily.

I saw a few months ago a thread about italian chord names. Here is a
patch for italian and french chords (in french, D is 'r�' instead of
're').

As the root chord names have several letters, it can be better to write
for "Am" something like "La m" than a glued "Lam". Thus the patch adds
in scm/chord-ignatzek-names.scm a small space after the root (only when
there's a prefix and no accidental). I'm not sure that it was the
correct way, but I added a property chordPrefixSpacer for this.

In scm/chord-name.scm, I mimicked chord-name->markup with
more appropriate spacings. Then italianChords and frenchChords
are provided in ly/property-init.ly.

Mathieu

-- 
Mathieu Giraud - �quipe Symbiose
IRISA, Campus de Beaulieu, 35042 Rennes cedex, France
? Documentation/out
? Documentation/bibliography/out
? Documentation/misc/out
? Documentation/pictures/out
? Documentation/topdocs/out
? Documentation/user/out
? buildscripts/out
? cygwin/out
? debian/out
? elisp/out
? flower/out
? flower/include/out
? input/out
? input/mutopia/out
? input/mutopia/E.Satie/out
? input/mutopia/F.Schubert/out
? input/mutopia/J.S.Bach/out
? input/mutopia/R.Schumann/out
? input/mutopia/W.A.Mozart/out
? input/no-notation/out
? input/regression/out
? input/test/out
? input/tutorial/out
? kpath-guile/out
? lily/out
? lily/include/out
? ly/out
? make/out
? mf/out
? po/out
? ps/out
? python/out
? scm/out
? scripts/out
? stepmake/out
? stepmake/bin/out
? stepmake/stepmake/out
? tex/out
? ttftool/out
? ttftool/include/out
? vim/out
Index: ChangeLog
===================================================================
RCS file: /cvsroot/lilypond/lilypond/ChangeLog,v
retrieving revision 1.3443
diff -u -r1.3443 ChangeLog
--- ChangeLog   16 Apr 2005 14:55:31 -0000      1.3443
+++ ChangeLog   17 Apr 2005 13:21:57 -0000
@@ -1,3 +1,17 @@
+
+2005-04-17  Mathieu Giraud  <[EMAIL PROTECTED]>
+
+       * 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-16  Jan Nieuwenhuizen  <[EMAIL PROTECTED]>
 
        * po/lilypond.pot, ...: Update using bison-CVS.
Index: ly/engraver-init.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/ly/engraver-init.ly,v
retrieving revision 1.224
diff -u -r1.224 engraver-init.ly
--- ly/engraver-init.ly 9 Apr 2005 14:31:55 -0000       1.224
+++ ly/engraver-init.ly 17 Apr 2005 13:21:59 -0000
@@ -513,6 +513,7 @@
   chordNameExceptions = #ignatzekExceptions
   chordNoteNamer = #'()
   chordRootNamer = #note-name->markup
+  chordPrefixSpacer = #0
   chordNameExceptionsFull = #fullJazzExceptions
   chordNameExceptionsPartial = #partialJazzExceptions
   
Index: ly/property-init.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/ly/property-init.ly,v
retrieving revision 1.68
diff -u -r1.68 property-init.ly
--- ly/property-init.ly 14 Feb 2005 23:01:41 -0000      1.68
+++ ly/property-init.ly 17 Apr 2005 13:21:59 -0000
@@ -176,7 +176,15 @@
     \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: scm/chord-ignatzek-names.scm
===================================================================
RCS file: /cvsroot/lilypond/lilypond/scm/chord-ignatzek-names.scm,v
retrieving revision 1.13
diff -u -r1.13 chord-ignatzek-names.scm
--- scm/chord-ignatzek-names.scm        4 Feb 2005 13:48:10 -0000       1.13
+++ scm/chord-ignatzek-names.scm        17 Apr 2005 13:22:00 -0000
@@ -177,7 +177,10 @@
       (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: scm/chord-name.scm
===================================================================
RCS file: /cvsroot/lilypond/lilypond/scm/chord-name.scm,v
retrieving revision 1.70
diff -u -r1.70 chord-name.scm
--- scm/chord-name.scm  13 Feb 2005 13:39:02 -0000      1.70
+++ scm/chord-name.scm  17 Apr 2005 13:22:00 -0000
@@ -31,6 +31,17 @@
        (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
@@ -70,6 +81,23 @@
           (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: scm/define-context-properties.scm
===================================================================
RCS file: /cvsroot/lilypond/lilypond/scm/define-context-properties.scm,v
retrieving revision 1.36
diff -u -r1.36 define-context-properties.scm
--- scm/define-context-properties.scm   14 Apr 2005 06:36:43 -0000      1.36
+++ scm/define-context-properties.scm   17 Apr 2005 13:22:01 -0000
@@ -132,6 +132,9 @@
      (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
_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to