]> git.donarmstrong.com Git - lilypond.git/commitdiff
* input/test/dpncnt.ly:
authorJan Nieuwenhuizen <janneke@gnu.org>
Tue, 3 Jun 2003 09:39:55 +0000 (09:39 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Tue, 3 Jun 2003 09:39:55 +0000 (09:39 +0000)
* input/test/chord-names-dpnj.ly: Resurrect.

* lily/my-lily-lexer.cc: Remove chordnames keyword.

* ly/chord-modifiers-init.ly (ignatzekExceptions): Update, tidy up.

* scm/chord-name.scm (sequential-music-to-chord-exceptions):
Better docstring, add parameter NON-ROOT, tidy up.

ChangeLog
input/test/chord-names-dpnj.ly
input/test/dpncnt.ly
lily/my-lily-lexer.cc
ly/chord-modifiers-init.ly
scm/chord-name.scm
scm/double-plus-new-chord-name.scm

index 347a81cbbc423a5dd93614f67af9e2fc439947a5..5578728585d88bd8fc342bb0042ddf0144ffce28 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-06-03  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * input/test/dpncnt.ly: 
+       * input/test/chord-names-dpnj.ly: Resurrect.
+
+       * lily/my-lily-lexer.cc: Remove chordnames keyword.
+
+       * ly/chord-modifiers-init.ly (ignatzekExceptions): Update, tidy up.
+
+       * scm/chord-name.scm (sequential-music-to-chord-exceptions):
+       Better docstring, add parameter NON-ROOT, tidy up.
+
 2003-06-03  Heikki Junes  <hjunes@cc.hut.fi>
 
        * lilypond-indent.el: match two-char slurs \[ ... \] and \( ... \).
index 3d85dd73716db039444bb600ff64afc541a6092b..886b2065a2a3e06a250adc461106e1dd1e9cb929 100644 (file)
@@ -1,14 +1,9 @@
-% FIXME: currently doesn't do anything useful.  fix or delete.
+\version "1.7.18"
+
 \header {
     texidoc = "Chord name scheme test -- double-plus-new-chord-name jazz"
 }
 
-\version "1.7.18"
-
-
-
-\score { \notes { c4^"fixme"}}
-
 %% This should only be necessary if your kpathsea setup is broken
 %
 % Make sure the correct msamxx.tfm is where lily can find it
@@ -19,7 +14,6 @@
 %   cp $(locate msam9.tfm) $LILYPONDPREFIX/fonts/tfm
 %
 
-%{
 
 scheme = \chords {
   % major chords
@@ -31,10 +25,10 @@ scheme = \chords {
 
   % minor chords
   c:m          % m = minor triad
-  c:m.6                % m6 = minor triad with added sixth
-  c:m.7+       % m triangle = minor major seventh chord
+  c:m6         % m6 = minor triad with added sixth
+  c:m7+        % m triangle = minor major seventh chord
   c:3-.6.9^7   % m6/9 
-  c:m.7                % m7
+  c:m7         % m7
   c:3-.9       % m9
   c:3-.9^7     % madd9
 
@@ -62,7 +56,7 @@ scheme = \chords {
   c:m5-.7-     % o = diminished seventh chord
 }
 
-efull = \chordnames {
+efullmusic = \notes {
 
     %% ? what 'bout maj7?
     %% c:7 = \markup { \normal-size-super "maj7" }
@@ -71,21 +65,32 @@ efull = \chordnames {
     %% American:
     %% c:3-.5-.7- = \markup { "dim" }
     %% Jazz:
-    c:3-.5-.7- = \markup { \super " o" }
-
-    %% Hmm
-
-    %% This ok?
-    c:7+ = \markup { \normal-size-super \override #'(font-family . math) "N" }
+    %% c:3-.5-.7-
+    <<c es ges bes>>-\markup { \super " o" }
+
+    %% Hmm, this ok?
+    %% c:7+
+    <<c e g b>>-\markup { \normal-size-super
+                         \override #'(font-family . math) "N" }
+    %%c:3.5.7 = \markup { \override #'(font-family . math) "M" }
+    %%c:3.5.7 = \markup { \normal-size-super "maj7" }
 }
 
-epartial = \chordnames {
-    c:2^3 = \markup { \normal-size-super "2" }
-    c:3-  = \markup { "m" }
-    c:4   = \markup { \normal-size-super "sus4" }
-    c:5^3 = \markup { \normal-size-super "5" }
+efull = #(sequential-music-to-chord-exceptions efullmusic #f)
+
+epartialmusic = \notes {
+    %c:2^3 =
+    <<c d>>-\markup { \normal-size-super "2" }
+    %c:3-
+    <<c es>>-\markup { "m" }
+    %c:4
+    <<c f>>-\markup { \normal-size-super "sus4" }
+    %c:5^3
+    <<c g>>-\markup { \normal-size-super "5" }
 }
 
+epartial = #(sequential-music-to-chord-exceptions epartialmusic #f)
+
 \score {
   \notes <
     \context ChordNames {
@@ -105,4 +110,3 @@ epartial = \chordnames {
 }
 %% new-chords-done %%
 
-%}
index f167d16b797c291a658e73765b2dca4f06c4e079..6f85c5e808bde5ebe4ca85fe104db72f78f3d54b 100644 (file)
@@ -1,15 +1,11 @@
+\version "1.7.18"
 
 \header {
     texidoc = "test file for new-new-chord names, ie, double-plus-new-chord-name
-TODO: FIXME.
 "
 }
 
-\score { \notes { c4^"fixme"}}
-
-%{
-
-efull = \chordnames {
+efullmusic = \notes {
 
     %% ? what 'bout maj7?
     %% c:7 = \markup { \normal-size-super "maj7" }
@@ -18,27 +14,32 @@ efull = \chordnames {
     %% American:
     %% c:3-.5-.7- = \markup { "dim" }
     %% Jazz:
-    c:3-.5-.7- = \markup { \super " o" }
-
-    %% Hmm
-    %%            ;;Pick your favorite maj7
-    %%    ((0) mathm-markup-object)  ;;a white triangle
-    %%    ;;((0) mathn-markup-object) ;;a black triangle
-    %% ;;((0) (make-simple-markup "maj7")) ;;good old maj7
+    %% c:3-.5-.7-
+    <<c es ges bes>>-\markup { \super " o" }
 
-    %% This ok?
-    c:7+ = \markup { \normal-size-super \override #'(font-family . math) "N" }
+    %% Hmm, this ok?
+    %% c:7+
+    <<c e g b>>-\markup { \normal-size-super
+                         \override #'(font-family . math) "N" }
     %%c:3.5.7 = \markup { \override #'(font-family . math) "M" }
     %%c:3.5.7 = \markup { \normal-size-super "maj7" }
 }
 
-epartial = \chordnames {
-    c:2^3 = \markup { \normal-size-super "2" }
-    c:3-  = \markup { "m" }
-    c:4   = \markup { \normal-size-super "sus4" }
-    c:5^3 = \markup { \normal-size-super "5" }
+efull = #(sequential-music-to-chord-exceptions efullmusic #f)
+
+epartialmusic = \notes {
+    %c:2^3 =
+    <<c d>>-\markup { \normal-size-super "2" }
+    %c:3-
+    <<c es>>-\markup { "m" }
+    %c:4
+    <<c f>>-\markup { \normal-size-super "sus4" }
+    %c:5^3
+    <<c g>>-\markup { \normal-size-super "5" }
 }
 
+epartial = #(sequential-music-to-chord-exceptions epartialmusic #f)
+
 
 ch = \notes \transpose c' c' 
 {
@@ -117,5 +118,3 @@ ch = \notes \transpose c' c'
        }
     }
 }
-
-%} 
index c24a153de15af383f86c0d5626c0f024b1c9f70f..5919b84188c12d08c29456011111087967e546fc 100644 (file)
@@ -38,7 +38,6 @@ static Keyword_ent the_key_tab[]={
   {"bar", BAR},
   {"breathe", BREATHE},
   {"chordmodifiers", CHORDMODIFIERS},
-  {"chordnames", CHORDNAMES},
   {"chords", CHORDS},
   {"clef", CLEF},
   {"consists", CONSISTS},
index 294feac5e6a0803365ea3c6f1dc76768e710c8ec..2f023d21e06b74f62bdb6664214a6136882d0a9f 100644 (file)
@@ -1,19 +1,20 @@
 \version "1.7.18"
 
-
 \chordmodifiers #default-chord-modifier-list
 
+whiteTriangleMarkup = #(make-override-markup
+                       '(font-family . math) (make-simple-markup "M"))
 
-whiteTriangleMarkup =#(make-override-markup '(font-family . math) (make-simple-markup "M"))
-
-blackTriangleMarkup = #(make-override-markup '(font-family . math) (make-simple-markup "N"))
+blackTriangleMarkup = #(make-override-markup
+                       '(font-family . math) (make-simple-markup "N"))
 
-ignatzekExceptionMusic =  \notes {
+ignatzekExceptionMusic = \notes{
        <<c e gis>>1-\markup { "+" }
        <<c es ges>>-\markup { \super "o" } % should be $\circ$ ?
        <<c es ges bes>>-\markup { \super \combine "o" "/" }
        <<c es ges beses>>-\markup { \super  "o7" }
 }
 
-ignatzekExceptions = #(sequential-music-to-chord-exceptions ignatzekExceptionMusic)
+ignatzekExceptions = #(sequential-music-to-chord-exceptions
+                      ignatzekExceptionMusic #t)
 
index ea336010aa8c07c27da4d6dce9e2e9611c706965..e43123cd6713c908748f40d5df0782652fd3efba 100644 (file)
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;
 
-(define-public (sequential-music-to-chord-exceptions seq)
-  "Transform sequential music of <<a b c>>-\markup{ foobar } type to
- (cons ABC-PITCHES FOOBAR-MARKUP)
- "
-  
+(define-public (sequential-music-to-chord-exceptions seq omit-root)
+  "Transform sequential music SEQ of type <<c d e>>-\markup{ foobar }
+to (cons CDE-PITCHES FOOBAR-MARKUP), or to (cons DE-PITCHES
+FOOBAR-MARKUP) if OMIT-ROOT.
+"
+  (define (chord-to-exception-entry m)
+    (let* ((elts (ly:get-mus-property m 'elements))
+          (pitches (map (lambda (x) (ly:get-mus-property x 'pitch))
+                        (filter-list
+                         (lambda (y) (memq 'note-event
+                                           (ly:get-mus-property y 'types)))
+                         elts)))
+          (sorted (sort pitches ly:pitch<?))
+          (root (car sorted))
+          (normalized (map (lambda (x) (ly:pitch-diff x root)) sorted))
+          (texts (map (lambda (x) (ly:get-mus-property x 'text))
+                      (filter-list
+                       (lambda (y) (memq 'text-script-event
+                                         (ly:get-mus-property y 'types)))
+                       elts)))
+          (text (if (null? texts) #f (car texts))))
+      (cons (if omit-root (cdr normalized) normalized) text)))
+
   (define (is-req-chord? m)
     (and
      (memq 'event-chord (ly:get-mus-property m 'types))
-     (not (equal? (ly:make-moment 0 1) (ly:get-music-length m)))
-    ))
-
-  (define (chord-to-exception-entry m)
-    (let*
-       (
-        (elts   (ly:get-mus-property m 'elements))
-        (pitches (map
-                  (lambda (x)
-                    (ly:get-mus-property x 'pitch)
-                    )
-                  (filter-list
-                   (lambda (y) (memq 'note-event (ly:get-mus-property y 'types)))
-                   elts)))
-        (sorted  (sort pitches ly:pitch<? ))
-        (root (car sorted))
-        (non-root (map (lambda (x) (ly:pitch-diff x root)) (cdr sorted)))
-        (texts (map
-                (lambda (x)
-                  (ly:get-mus-property x 'text)
-                  )
-                
-                (filter-list
-                 (lambda (y)
-                   (memq 'text-script-event
-                         (ly:get-mus-property y 'types))) elts)
-                ))
-        (text (if (null? texts)
-                  #f
-                  (car texts)))
-
-        )
-      (cons non-root text)
-    ))
-
-  (let*
-    (
-     (elts (filter-list is-req-chord? (ly:get-mus-property seq 'elements)))
-     (alist (map chord-to-exception-entry elts))
-     )
-    (filter-list (lambda (x) (cdr x)) alist)
-  ))
-
+     (not (equal? (ly:make-moment 0 1) (ly:get-music-length m)))))
 
+  (let* ((elts (filter-list is-req-chord? (ly:get-mus-property seq 'elements)))
+        (alist (map chord-to-exception-entry elts)))
+    (filter-list (lambda (x) (cdr x)) alist)))
 
 
 (define-public (new-chord-name-brew-molecule grob)
index 5446a04e0280156fd5e67e5d421d5437e34fb8ae..0ae5af29c566616a5fc8ad6a75c5d7a879bc02e9 100644 (file)
@@ -132,8 +132,8 @@ input/test/dpncnt.ly).
        '(())))
 
   (if #f (begin  
-  (write-me "options: " options)
-  (write-me "pitches: " pitches)))
+          (write-me "options: " options)
+          (write-me "pitches: " pitches)))
   (let* ((full-exceptions (assoc-get 'full-exceptions options))
         (full-exception (full-match full-exceptions))
         (full-markup (cdr full-exception))
@@ -161,16 +161,16 @@ input/test/dpncnt.ly).
         
 
      (if #f (begin
-    (write-me "full:" full)
-    ;; (write-me "partial-pitches:" partial-pitches)
-    (write-me "full-markup:" full-markup)
-    (write-me "partial-markup:" partial-markup)
-    (write-me "all:" all)
-    (write-me "altered:" altered)
-    (write-me "missing:" missing)
-    (write-me "consecutive:" consecutive)
-    (write-me "rest:" rest)
-    (write-me "base:" base)))
+             (write-me "full:" full)
+             ;; (write-me "partial-pitches:" partial-pitches)
+             (write-me "full-markup:" full-markup)
+             (write-me "partial-markup:" partial-markup)
+             (write-me "all:" all)
+             (write-me "altered:" altered)
+             (write-me "missing:" missing)
+             (write-me "consecutive:" consecutive)
+             (write-me "rest:" rest)
+             (write-me "base:" base)))
 
     (case func
       ((banter)