lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

chordnames tweaking again


From: fiëé visuëlle
Subject: chordnames tweaking again
Date: Tue, 20 Oct 2009 21:27:53 +0200

Hello again, still fiddling with chord names...

(1)
I use this nice Scheme function by Carl Sorensen to get "fis" and "des" names instead of "f#" and "db".
I don't understand enough Scheme to avoid "ees" - do you?

(The lowercase stuff works only with a patch by Thomas Morgan, sorry, so I can't provide a working example here.
Carl's original version is here: 
http://lists.gnu.org/archive/html/lilypond-user/2009-09/msg00622.html)


#(define (conditional-string-downcase str condition)
  (if condition
      (string-downcase str)
      str))

#(define (pitch-alteration-semitones pitch)
 (inexact->exact (round (* (ly:pitch-alteration pitch) 2))))

#(define ((chord-name->german-markup-text-alteration
         B-instead-of-Bb) pitch lowercase?)
  "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).  Alterations are indicated with -es and -is
instead of the flat and sharp symbols."
 (let* ((name (ly:pitch-notename pitch))
        (alt-semitones  (pitch-alteration-semitones pitch))
(n-a (if (member (cons name alt-semitones) `((6 . -1) (6 . -2)))
                 (cons 7 (+ (if B-instead-of-Bb 1 0) alt-semitones))
                 (cons name alt-semitones))))
   (make-line-markup
    (list
     (make-simple-markup
      (conditional-string-downcase
       (vector-ref #("C" "D" "E" "F" "G" "A" "H" "B") (car n-a))
      lowercase?))
     (let ((alteration (/ (cdr n-a) 2)))
       (cond
          ((= alteration FLAT) (make-simple-markup "es"))
          ((= alteration SHARP) (make-simple-markup "is"))
          (else empty-markup)))))))


(2) Different, probably easier problem:
I must display some alterations as follows:
f:dim => f-
f:aug => f5+
f:maj7 => f7+

I found the last one on my one, since there is a "majorSevenSymbol" hook, but I found nothing similar like "diminishedSymbol". How can I change the chordname "enhancement symbol" for each one of these special cases, favourably in combination with the above chord namer?


Greetlings from Lake Constance
---
fiëé visuëlle
Henning Hraban Ramm
http://www.fiee.net
http://angerweit.tikon.ch/lieder/
https://www.cacert.org (I'm an assurer)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]