]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorRune Zedeler <rune@lilypond.org>
Sun, 20 Apr 2003 21:29:38 +0000 (21:29 +0000)
committerRune Zedeler <rune@lilypond.org>
Sun, 20 Apr 2003 21:29:38 +0000 (21:29 +0000)
ChangeLog
Documentation/user/refman.itely
aclocal.m4
input/test/chord-names-german.ly
lily/chord-name-engraver.cc
ly/engraver-init.ly
scm/chords-ignatzek.scm
scm/translator-property-description.scm

index 744671a493de07a5c260b6e6ac3552a0af880e40..bd35b8d849abeef81880441269a4f212ce1af4ce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-04-20  Rune Zedeler  <rune@zedeler.dk>
+
+       * input/test/chord-names-german.ly: modified.
+
+       * scm/chords-ignatzek.scm:
+         chord-name->german-markup: Added
+         note-name->german-markup: Changed (now producing lowercase notenames)
+
+       * lily/chord-name-engraver.cc: Reads property chordNoteNamer
+       
 2003-04-20  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
        * ly/german-chords-init.ly: remove file
index 7fe70a71edf84fdcbec050fff26c1e967d4a720b..e97f573aa65be0af527eb3088b9b0e8eb43fa865 100644 (file)
@@ -3289,8 +3289,14 @@ The root of a chord is usually printed as a letter with an optional
 alteration. The transformation from pitch to letter is done by this
 function.  An application of setting this function, is providing chord
 names with german notation for the root.
-@end table
 
+@item chordNoteNamer
+The default is to print single notes (as for instance the bass note)
+using the chordRootNamer. However, by setting this function to a non-null
+value you can specify a different function. I.e. you could use letters
+in lower case for the base note.
+
+@end table
 
 @seealso
 
index c1f4aee49b10d9c10d00216ea41243e1b593a7ac..eae65025b5ff34d90f3fe1d6b11997b7e58124fc 100644 (file)
@@ -1,7 +1,4 @@
 dnl aclocal.m4   -*-shell-script-*-
-dnl WARNING WARNING WARNING
-dnl do not edit! this is aclocal.m4, generated from /home/hanwen/usr/src/lilypond/stepmake/aclocal.m4
-dnl aclocal.m4   -*-shell-script-*-
 dnl StepMake subroutines for configure.in
 
 
index 9d883cddfd9ef8f5f20845b0f35c9f45b2b12a70..e0d155adec5779a3ddb88ed8617f40ed97cd87a6 100644 (file)
@@ -1,5 +1,5 @@
 
-\version "1.7.16"
+\version "1.7.17"
 \header  {
 
     texidoc = "By setting @code{ChordNames.chordRootNamer}, the root
@@ -7,12 +7,14 @@
 
 }
 
-scm = \chords { c4 b bes } 
+scm = \chords { c4/c cis/cis cisis/cisis ces/ces ceses/ceses b/b bis/bis bes/bes beses/beses } 
 \score {
-
 <    \context ChordNames \chords <
-    \property ChordNames. chordRootNamer = #note-name->german-markup
+    % #t gives true german chord-names
+    % #f gives semi-german chord-names -
+    % - with Bb and below keeping the english names
+    \property ChordNames. chordRootNamer = #(chord-name->german-markup #f)
+    \property ChordNames. chordNoteNamer = #note-name->german-markup
     \scm >
     \context Voice \scm >
-\paper { raggedright = ##t }
 }
index 28f9cf803f84479bffd2d3654363a4eb5ddf7d9f..bc3c882f38298e593f96d9309e9f57a5477f4875 100644 (file)
@@ -153,5 +153,5 @@ ENTER_DESCRIPTION(Chord_name_engraver,
 /* accepts */     "note-event",
 /* acks  */      "",
 /* reads */       "chordChanges chordNameExceptions chordNameFunction "
-"chordRootNamer chordNameExceptions majorSevenSymbol",
+"chordNoteNamer chordRootNamer chordNameExceptions majorSevenSymbol",
 /* write */       "");
index 0a2fc103ab7cce92f58081709ee09a65c904852b..3e930cc84e2e371095a5bb137f0c742386909fc6 100644 (file)
@@ -441,6 +441,7 @@ ScoreContext = \translator {
        majorSevenSymbol = #whiteTriangleMarkup
        chordNameSeparator = #(make-simple-markup  "/")
        chordNameExceptions = #ignatzekExceptions
+       chordNoteNamer = #'()
        chordRootNamer = #note-name->markup
        
        %% tablature:
index f0b4599c619e2b9c2e282cc0febc76a53c0b12dd..c247c90340e66cd9071b491fe4ac236c7ba78a5d 100644 (file)
      (accidental->markup (ly:pitch-alteration pitch))))))
 
 
-(define-public (note-name->german-markup pitch)
-  "Return pitch markup for PITCH, using german note names."
-  (make-line-markup
-   (list
-    (make-simple-markup
-     (vector-ref #("C" "D" "E" "F" "G" "A" "H") (ly:pitch-notename pitch)))
-    (make-normal-size-super-markup
-     (accidental->markup (ly:pitch-alteration pitch))))))
-
-
+(define-public ((chord-name->german-markup B-instead-of-Bb) pitch)
+  "Return pitch markup for PITCH, using german note names.
+   If B-instead-of-Bb is set to #t real german names are returned.
+   Otherwise semi-german names (with Bb and below keeping the british names)
+"
+  (let* ((name (ly:pitch-notename pitch))
+         (alt (ly:pitch-alteration pitch))
+        (n-a (if (member (cons name alt) '((6 . -1) (6 . -2)))
+                (cons 7 (+ (if B-instead-of-Bb 1 0) alt))
+                (cons name alt))))
+    (make-line-markup
+     (list
+      (make-simple-markup
+       (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a)))
+      (make-normal-size-super-markup
+       (accidental->markup (cdr n-a)))))))
+
+
+(define-public (note-name->german-markup  pitch)
+  (let* ((name (ly:pitch-notename pitch))
+        (alt (ly:pitch-alteration pitch))
+        (n-a (if (member (cons name alt) '((6 . -1) (6 . -2)))
+                 (cons 7 (+ 1 alt))
+                 (cons name alt))))
+    (make-line-markup
+     (list
+      (string-append
+       (list-ref '("c" "d" "e" "f" "g" "a" "h" "b") (car n-a))
+       (if (or (equal? (car n-a) 2) (equal? (car n-a) 5))
+          (list-ref '( "ses"  "s" "" "is" "isis") (+ 2 (cdr n-a)))
+          (list-ref '("eses" "es" "" "is" "isis") (+ 2 (cdr n-a)))))))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
        )
     )
   (define name-root (ly:get-context-property context 'chordRootNamer))
+  (define name-note 
+    (let ((nn (ly:get-context-property context 'chordNoteNamer)))
+      (if (eq? nn '())
+         ; replacing the next line with name-root gives guile-error...? -rz
+         (ly:get-context-property context 'chordRootNamer)
+         nn)))
 
   (define (is-natural-alteration? p)
     (= (natural-chord-alteration p)  (ly:pitch-alteration p))
@@ -290,7 +317,7 @@ work than classifying the pitches."
                               suffixes
                               add-markups) sep))
         (base-stuff (if bass-pitch
-                        (list sep (name-root bass-pitch))
+                        (list sep (name-note bass-pitch))
                         '()))
         )
 
index 79f57f5b46490f14d2aebf87be8813caea6a293c..a216f88c53918d274f6ad549ad9bd34d3b05e09d 100644 (file)
@@ -156,9 +156,12 @@ into one staff.")
 (translator-property-description
  'chordNameFunction procedure?
  "The function that converts lists of pitches to chord names.")
+(translator-property-description
+ 'chordNoteNamer procedure?
+ "Function that converts from a pitch object to a text markup. Used for single pitches.")
 (translator-property-description
  'chordRootNamer procedure?
- "Function that converts from a pitch object to a text markup.")
+ "Function that converts from a pitch object to a text markup. Used for chords.")
 (translator-property-description
  'chordNameExceptions list?
  "Alist of chord exceptions. Contains (CHORD . MARKUP) entries.")