From 55abb833082b6871d8c1b7c3e52f8eceb6362039 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 3 Jun 2003 09:39:55 +0000 Subject: [PATCH] * 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. --- ChangeLog | 12 +++++ input/test/chord-names-dpnj.ly | 52 +++++++++++---------- input/test/dpncnt.ly | 43 +++++++++-------- lily/my-lily-lexer.cc | 1 - ly/chord-modifiers-init.ly | 13 +++--- scm/chord-name.scm | 75 +++++++++++------------------- scm/double-plus-new-chord-name.scm | 24 +++++----- 7 files changed, 107 insertions(+), 113 deletions(-) diff --git a/ChangeLog b/ChangeLog index 347a81cbbc..5578728585 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2003-06-03 Jan Nieuwenhuizen + + * 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 * lilypond-indent.el: match two-char slurs \[ ... \] and \( ... \). diff --git a/input/test/chord-names-dpnj.ly b/input/test/chord-names-dpnj.ly index 3d85dd7371..886b2065a2 100644 --- a/input/test/chord-names-dpnj.ly +++ b/input/test/chord-names-dpnj.ly @@ -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- + <>-\markup { \super " o" } + + %% Hmm, this ok? + %% c:7+ + <>-\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 = + <>-\markup { \normal-size-super "2" } + %c:3- + <>-\markup { "m" } + %c:4 + <>-\markup { \normal-size-super "sus4" } + %c:5^3 + <>-\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 %% -%} diff --git a/input/test/dpncnt.ly b/input/test/dpncnt.ly index f167d16b79..6f85c5e808 100644 --- a/input/test/dpncnt.ly +++ b/input/test/dpncnt.ly @@ -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- + <>-\markup { \super " o" } - %% This ok? - c:7+ = \markup { \normal-size-super \override #'(font-family . math) "N" } + %% Hmm, this ok? + %% c:7+ + <>-\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 = + <>-\markup { \normal-size-super "2" } + %c:3- + <>-\markup { "m" } + %c:4 + <>-\markup { \normal-size-super "sus4" } + %c:5^3 + <>-\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' } } } - -%} diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index c24a153de1..5919b84188 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -38,7 +38,6 @@ static Keyword_ent the_key_tab[]={ {"bar", BAR}, {"breathe", BREATHE}, {"chordmodifiers", CHORDMODIFIERS}, - {"chordnames", CHORDNAMES}, {"chords", CHORDS}, {"clef", CLEF}, {"consists", CONSISTS}, diff --git a/ly/chord-modifiers-init.ly b/ly/chord-modifiers-init.ly index 294feac5e6..2f023d21e0 100644 --- a/ly/chord-modifiers-init.ly +++ b/ly/chord-modifiers-init.ly @@ -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{ <>1-\markup { "+" } <>-\markup { \super "o" } % should be $\circ$ ? <>-\markup { \super \combine "o" "/" } <>-\markup { \super "o7" } } -ignatzekExceptions = #(sequential-music-to-chord-exceptions ignatzekExceptionMusic) +ignatzekExceptions = #(sequential-music-to-chord-exceptions + ignatzekExceptionMusic #t) diff --git a/scm/chord-name.scm b/scm/chord-name.scm index ea336010aa..e43123cd67 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -77,58 +77,37 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -(define-public (sequential-music-to-chord-exceptions seq) - "Transform sequential music of <>-\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 <>-\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