From a5a93e38e9e2fcf49317093a08d55cd2ebb414de Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 00:58:50 +0000 Subject: [PATCH] lilypond-1.3.142 --- input/test/test-german-chords.ly | 14 +++++++++ lily/system-start-delimiter-engraver.cc | 8 +++++ ly/german-chords.ly | 39 +++++++++++++++++++++++++ scm/chord-name.scm | 18 ++++++++---- 4 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 input/test/test-german-chords.ly create mode 100644 ly/german-chords.ly diff --git a/input/test/test-german-chords.ly b/input/test/test-german-chords.ly new file mode 100644 index 0000000000..0df2a1a39d --- /dev/null +++ b/input/test/test-german-chords.ly @@ -0,0 +1,14 @@ +\include "german-chords.ly" +% #(set! german-Bb #t) + +ch = \chords { beses1/+beses bes/+bes b/+b bis/+bis ases/+ases as/+as a/+a ais/+ais fisis/+fisis} + + +\score { + < + \context ChordNames=ch {\ch} + \context Staff=st \chords {\ch} + > + \paper {} +} + diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index 1f4504a733..27ee99dc86 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -53,6 +53,14 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf) if (gh_symbol_p (gl) && gl == ly_symbol2scm ("brace") && gh_symbol_p (my_gl) && my_gl == ly_symbol2scm ("bracket")) inf.elem_l_->translate_axis (-1.0, X_AXIS); // ugh + else if (gh_symbol_p (gl) && gl == ly_symbol2scm ("bracket") + && gh_symbol_p (my_gl) && my_gl == ly_symbol2scm ("bracket")) + { + inf.elem_l_->translate_axis ( -0.8, X_AXIS); // ugh + inf.elem_l_->set_grob_property ("arch-height", + gh_double2scm(gh_scm2double(inf.elem_l_->get_grob_property + ("arch-height"))+0.5)); + } } } diff --git a/ly/german-chords.ly b/ly/german-chords.ly new file mode 100644 index 0000000000..e158592b34 --- /dev/null +++ b/ly/german-chords.ly @@ -0,0 +1,39 @@ + +% german-chords.ly: +% german/norwegian/danish? + +% To get Bb instead of B, use +% \include "german-chords.ly" +% #(set! german-Bb #t) + +#(define german-Bb #f) + +#(define (pitch->chord-name-text-banter pitch) + (if (equal? (cdr pitch) '(6 -1)) + (if german-Bb + (cons "B" (accidental->text -1)) + '("B") + ) + (cons + (list-ref '("C" "D" "E" "F" "G" "A" "H") (cadr pitch)) + (accidental->text (caddr pitch)) + ) + ) + ) + + +#(define (pitch->note-name-text-banter pitch) + (if (equal? (cdr pitch) '(6 -1)) + '("b") + (cons + (string-append + (list-ref '("c" "d" "e" "f" "g" "a" "h") (cadr pitch)) + (if (or (equal? (cadr pitch) 2) (equal? (cadr pitch) 5)) + (list-ref '( "ses" "s" "" "is" "isis") (+ 2 (caddr pitch))) + (list-ref '("eses" "es" "" "is" "isis") (+ 2 (caddr pitch))) + ) + ) + '() + ) + ) + ) diff --git a/scm/chord-name.scm b/scm/chord-name.scm index bcdf7aaa1f..5bbb2017e4 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -253,11 +253,9 @@ (define (pitch->note-name pitch) (cons (cadr pitch) (caddr pitch))) - -(define (pitch->text pitch) - (cons - (make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65))) - (if (= (caddr pitch) 0) + +(define (accidental->text acc) + (if (= acc 0) '() (list (append '(music) @@ -268,7 +266,15 @@ (list (append '((raise . 0.6)) (list (string-append "accidentals-" - (number->string (caddr pitch))))))))))))))) + (number->string acc)))))))))))) +) + +(define (pitch->text pitch) + (cons + (make-string 1 (integer->char (+ (modulo (+ (cadr pitch) 2) 7) 65))) + (accidental->text (caddr pitch)) + ) +) ;;; Hooks to override chord names and note names, ;;; see input/tricks/german-chords.ly -- 2.39.5