]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.45.jcn2
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 16 Apr 2000 19:21:37 +0000 (21:21 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 16 Apr 2000 19:21:37 +0000 (21:21 +0200)
1.3.45.jcn2

* Fixed chord-name customisation and made small chord-name build fixes.

CHANGES
Documentation/regression-test.tely
VERSION
input/test/chord-names.ly [new file with mode: 0644]
lily/chord-name.cc
scm/chord-names.scm

diff --git a/CHANGES b/CHANGES
index 4323a76f64faa2733dc60614f6c02d66a94de9b1..d2c573bfadb49ad4300466027c3448802c0d7bf6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+1.3.45.jcn2
+
+* Fixed chord-name customisation and made small chord-name build fixes.
+
 1.3.45.jcn1
 ===========
 
index dc4a9de032c0a67872deab670458965735bf3ec2..82025c42ef5624938f64fd9914238112508ff2a4 100644 (file)
@@ -101,6 +101,14 @@ not be on staff lines.
 
 @mudelafile{staccato-pos.ly}
 
+@section Chord names
+
+Chord names are generated from a list pitches, and are customisable
+from guile.  For some unlogical names, guile customisation is used
+by default.
+
+@mudelafile{chord-names.ly}
+
 @section Grace notes
 
 Grace notes are typeset as an encapsulated piece of music. You can
diff --git a/VERSION b/VERSION
index 6503af2527838dec39c11bc19c1849674f5e5f90..561e316769dd90f3e6256eea363cae80ba884f7d 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=45
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff --git a/input/test/chord-names.ly b/input/test/chord-names.ly
new file mode 100644 (file)
index 0000000..87e82c4
--- /dev/null
@@ -0,0 +1,24 @@
+chord = \notes\transpose c''\chords{
+   c1
+   c:m
+   c:m5-
+   c:m5-.7-
+   c:7+
+   c:m5-.7
+   c:5-.7+
+   c:m7
+   c:7
+}
+
+\score{
+    <
+           \context ChordNames \chord
+           \context Staff \chord
+    >
+    \paper{
+       linewidth = -1.0;
+        \translator { \ChordNameContext chordNameWordSpace = #1 }
+        \translator { \LyricsContext textScriptWordSpace = #0.3 }
+    }
+}
+
index 3bd520d66a34ec7fec12ff2cdfef57d2f882be4a..75a16226c95d9e76a2c55a2cc8f1bc0c185f9e22 100644 (file)
@@ -31,11 +31,14 @@ Chord_name::ly_word2molecule (SCM scm) const
   String style;
   if (gh_pair_p (scm))
     {
-      style = ly_scm2string (gh_car (scm));
+      SCM s = gh_car (scm);
+      if (gh_string_p (s))
+       style = ly_scm2string (s);
       scm = gh_cdr (scm);
     }
-  String text = ly_scm2string (scm);
-  return lookup_l ()->text (style, text, paper_l ());
+  if (gh_string_p (scm))
+    return lookup_l ()->text (style, ly_scm2string (scm), paper_l ());
+  return Molecule ();
 }
 
 /*
@@ -51,12 +54,16 @@ Chord_name::ly_text2molecule (SCM scm) const
     {
       while (gh_cdr (scm) != SCM_EOL)
         {
-         mol.add_at_edge (X_AXIS, RIGHT, ly_word2molecule (gh_car (scm)), 0);
+         Molecule m = ly_word2molecule (gh_car (scm));
+         if (!m.empty_b ())
+           mol.add_at_edge (X_AXIS, RIGHT, m, 0);
          scm = gh_cdr (scm);
        }
       scm = gh_car (scm);
     }  
-  mol.add_at_edge (X_AXIS, RIGHT, ly_word2molecule (scm), 0);
+  Molecule m = ly_word2molecule (scm);
+  if (!m.empty_b ())
+    mol.add_at_edge (X_AXIS, RIGHT, m, 0);
   return mol;
 }
 
index a5a428d649affda0a3e5c768f5e2554e0474bafb..7a8777fbc72adf80fdd64ab9a1b07158364494f6 100644 (file)
@@ -20,7 +20,7 @@
       note-names-alist))
 
 (define (pitch->note-name pitch)
-  (cons (car pitch) (cadr pitch)))
+  (cons (cadr pitch) (caddr pitch)))
   
 (define (user-pitch-name pitch)
   (let ((entry (assoc (pitch->note-name pitch) note-names-alist)))
       (append 
       '(
        ; C iso C.no3.no5
-       (((0 . 0)) . ("" . ""))
+       (((0 . 0)) . (#f . #f))
        ; C iso C.no5
-       (((0 . 0) (2 . 0)) . ("" . ""))
+       (((0 . 0) (2 . 0)) . (#f . #f))
        ; Cm iso Cm.no5
-       (((0 . 0) (2 . -1)) . ("m" . ""))
+       (((0 . 0) (2 . -1)) . ("m" . #f))
        ; Cdim iso Cm5-
-       (((0 . 0) (2 . -1) (4 . -1)) . ("dim" . ""))
+       (((0 . 0) (2 . -1) (4 . -1)) . ("dim" . #f))
        ; Co iso Cm5-7-
        ; urg
         ; (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("feta-1" . ".")))
-        (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . ("" . ("script" . "o")))
+        (((0 . 0) (2 . -1) (4 . -1) (6 . -2)) . (#f . ("script" . "o")))
        ; Cdim9
        (((0 . 0) (2 . -1) (4 . -1) (6 . -2) (1 . -1)) . ("dim" . ("script" . "9")))
        (((0 . 0) (2 . -1) (4 . -1) (6 . -2) (1 . -1) (3 . -1)) . ("dim" . ("script" . "11")))