[Top][All Lists]

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

Re: chordnames tweaking again

From: Carl Sorensen
Subject: Re: chordnames tweaking again
Date: Wed, 21 Oct 2009 04:37:15 -0600

On 10/20/09 1:27 PM, "fiëé visuëlle" <address@hidden> wrote:

> 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?

I assume you want to get Es for E flat major and es for e flat minor.
(I'm not sure about this -- I'm totally american in my chord experience).

> #(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
             ((and (= alteration FLAT) (= (car n-a) 2)) (make-simple-markup
>            ((= alteration FLAT) (make-simple-markup "es"))
>            ((= alteration SHARP) (make-simple-markup "is"))
>            (else empty-markup)))))))

Note: code above is untested, but it illustrates the principle.

> (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?

Probably the easiest way to do these is to use a custom chord name
exceptions list.  See the snippet Chord name exceptions in Customizing chord
names of section 2.7.2 of the docs.




reply via email to

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