lilypond-user
[Top][All Lists]
Advanced

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

Re: question about minor + fourth


From: David Kastrup
Subject: Re: question about minor + fourth
Date: Sun, 28 Aug 2016 15:13:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Thomas Morley <address@hidden> writes:

> Here a more elaborate code, which could probably replace current
> state. Works with default note-mode and chordmode, even mixed.
> Though, questions in-line, anyone with some hints?
>
> \version "2.18.2"
>
> %%;; fixme we should standardize on omit-root (or the other one.)
> %%;; perhaps the default should also be reversed --hwn
> #(define (my-sequential-music-to-chord-exceptions seq . rest)

Like with \beamExceptions , this should probably be available as a
scheme function.

>   ;; TODO change doc-string
>   "Transform sequential music SEQ of type <<c d e>>-\\markup{ foobar }
> to (cons CDE-PITCHES FOOBAR-MARKUP), or to (cons DE-PITCHES
> FOOBAR-MARKUP) if OMIT-ROOT is given and non-false.
> "
>
>   (define (chord-to-exception-entry m)
>     (let* ((omit-root (and (pair? rest) (car rest)))
>            (pitches (event-chord-pitches m))
>            (sorted (sort pitches ly:pitch<?))
>            (root (car sorted))
>
>            ;; ugh?
>            ;;(diff (ly:pitch-diff root (ly:make-pitch -1 0 0)))
>            ;; FIXME.  This results in #<Pitch c> ...,
>            ;; but that is what we need because default octave for
>            ;; \chords has changed to c' too?
>            (diff (ly:pitch-diff root (ly:make-pitch 0 0 0)))
>            (normalized (map (lambda (x) (ly:pitch-diff x diff)) sorted))
> ;; Question
> ;; why this mapping? Obviously `text' selects from this list, but why? --harm
>            (texts
>              (map
>                (lambda (x) (ly:music-property x 'text))
>                (extract-typed-music m 'text-script-event)))
>            (text (if (null? texts) #f (if omit-root (car texts) texts))))
>       (cons (if omit-root (cdr normalized) normalized) text)))

Hm?  This looks for text scripts and takes the first one (if any) if
omit-root is set (because of available rest arguments) or otherwise all
scripts.

-- 
David Kastrup



reply via email to

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