Re: [frogs] [PATCH] chord names language

[ Thread Index | Date Index | More lilynet.net/frogs Archives ]


On Thu, Dec 9, 2010 at 6:06 AM, Carl Sorensen <c_sorensen@xxxxxxx> wrote:
> Actually, we have it hardcoded in multiple lists.
>
> We have note-name->german-markup, note-name->semi-german-markup, and
> note-name->italian-markup as well.

Indeed, and whilst simpler it's still rather ugly.

> This code won't work for German and Norwegian note names, where b is what
> english calls b flat, and h is what english calls b.  There needs to be
> something more general, and I'm not exactly sure what it is.

Oh, indeed. Nice catch!

> Perhaps the note name files should define both a pitch and a base name for
> each of the pitches, and then we look up the base name from the pitch in the
> given language, instead of trying to fake it with some other function.
>
> I'm thinking that perhaps the lists in scm/define-note-names.scm

Does that mean I can push my define-note-names.scm patch? ;-)

> would look
> like
>
> (nederlands . ((entry-names . (
>                              (ceses . ,(ly:make-pitch -1 0 DOUBLE-FLAT))
>                              ...
>                              ))
>               (display-names . (
>                                ((0 DOUBLE-FLAT) . "C")
>                                ((0 SEMI-FLAT) . "C")
>                              ...
>                                ))))
>
> and then we'd need to modify the functions that get the pitch-name-alist to
> get the entry-names key from the language alist.  The markup we'd get by
> getting  display-names alist, and we'd do something like
>
> (define (pitch->markup pitch)
>  (let ((note-name (ly:pitch-notename pitch))
>        (alteration (ly:pitch-alteration pitch)))
>   (assoc-get (list note-name alteration) display-names-alist "")))

That could work. But wouldn't that be a tad bit overkill?

Another option is to just adapt what I suggested to the
Norwegian/German situation, by adding a has-bflat-letter? variable.
I'm sure I can do that pretty easily.

Upside: it would keep things simple.
Downside: it wouldn't be easily extensible if we are to add other
exotic note-name-languages that have more peculiar specificities. But
I can't see that happening anytime soon.

Cheers,
Valentin.

---
----
Join the Frogs!


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/