]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/clef.scm
release: 1.4.1
[lilypond.git] / scm / clef.scm
index 1a80cc09fd99746d313b7490298db5f5f29b161a..a6f11bd692de919ac1db0597d8756ee0f032e350 100644 (file)
@@ -1,9 +1,8 @@
 
-
-;;
 ;; (name . (glyph clef-position octavation))
-;; -- the name clefOctavation is misleading the value 7 is 1 octave not 7 Octaves.
 ;;
+;; -- the name clefOctavation is misleading. The value 7 is 1 octave, not 7 Octaves.
+
 (define supported-clefs '(
          ("treble" . ("clefs-G" -2 0))
          ("violin" . ("clefs-G" -2 0))
@@ -13,6 +12,7 @@
          ("soprano" . ("clefs-C" -4  0))
          ("mezzosoprano" . ("clefs-C" -2  0))
          ("alto" . ("clefs-C" 0 0))
+         ("C" . ("clefs-C" 0 0))
          ("tenor" . ("clefs-C" 2 0))
          ("baritone" . ("clefs-C" 4  0))
          ("varbaritone"  . ("clefs-F" 0 0))
        )
 )
 
+
+;; "an alist mapping GLYPHNAME to the position of the central C for that symbol"
+(define c0-pitch-alist
+  '(("clefs-G" . -4)
+    ("clefs-C" . 0)
+    ("clefs-F" . 4)
+    ("clefs-percussion" . 0)
+    ("clefs-vaticana_do" . 0)
+    ("clefs-vaticana_fa" . 4)
+    ("clefs-medicaea_do" . 0)
+    ("clefs-medicaea_fa" . 4)
+    ("clefs-hufnagel_do" . 0)
+    ("clefs-hufnagel_fa" . 4)
+    ("clefs-hufnagel_do_fa" . 0)
+    ("clefs-mensural1_c" . 0)
+    ("clefs-mensural2_c" . 0)
+    ("clefs-mensural3_c" . 0)
+    ("clefs-mensural1_f" . 4)
+    ("clefs-mensural2_f" . 4)
+    ("clefs-mensural_g" . -4))
+  )
+
 (define (clef-name-to-properties cl)
   (let ((e '())
+       (c0 0)
        (oct 0)
        (l (string-length cl))
        )
     (if (equal? "8" (substring cl (- l 1) l))
        (begin
        (if (equal? "^" (substring cl (- l 2) (- l 1)))
-           (set! oct 7)
-           (set! oct -7))
+           (set! oct -7)
+           (set! oct 7))
        
        (set! cl (substring cl 0 (- l 2)))))
 
 
     (set! e  (assoc cl supported-clefs))
+
     (if (pair? e)
        `(((symbol . clefGlyph)
           (iterator-ctor . ,Property_iterator::constructor)
           (value . ,(cadr e))
           )
          
-;        ((symbol . forceClef)
-;         (iterator-ctor . ,Property_iterator::constructor)
-;         (value . #t)
-;         )
-
+         ((symbol . centralCPosition)
+          (iterator-ctor . ,Property_iterator::constructor)
+          (value . ,(+ oct (caddr e) (cdr  (assoc  (cadr e) c0-pitch-alist))))
+          )
          ((symbol . clefPosition)
           (iterator-ctor . ,Property_iterator::constructor)
           (value . ,(caddr e))
           )
          ((symbol . clefOctavation)
                 (iterator-ctor . ,Property_iterator::constructor)
-                (value . ,oct)
+                (value . ,(- oct))
               )
          )
        (begin