lilypond-user
[Top][All Lists]
Advanced

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

Re: creating chords like F/A(D/F#) with \chordmode { }


From: Thomas Morley
Subject: Re: creating chords like F/A(D/F#) with \chordmode { }
Date: Tue, 15 Mar 2016 10:29:01 +0100

2016-03-15 9:49 GMT+01:00 David Kastrup <address@hidden>:
> Eby Mani <address@hidden> writes:
>
>> I'm getting the following error on Lilypond 2.18.2 while trying your
>> "\altChord" function. Are those functions limited to Lilypond 2.19 ?.
>>
>> "Parsing.../opt/lilypond/usr/share/lilypond/current/scm/ly-syntax-constructors.scm:56:23:
>> In expression (apply (ly:music-function-extract fun) parser ...):
>> /opt/lilypond/usr/share/lilypond/current/scm/ly-syntax-constructors.scm:56:23:
>> Wrong number of arguments to #<procedure #f (m1 m2)>"
>>
>> Eby
>
> altChords =
> #(define-music-function (m1 m2)(ly:music? ly:music?)
>
> has to be
>
> altChords =
> #(define-music-function (parser location m1 m2)(ly:music? ly:music?)
>
> in 2.18 instead.
>
> --
> David Kastrup

The arguments of applyOutput should be changed as well.
Complete 2.18.-code of the final function:

altChords =
#(define-music-function (parser location m1 m2)(ly:music? ly:music?)
"Return the default ChordName of @var{m1}, with an added parenthesized ChordName
derived from @var{m2}"
#{
   \applyOutput ChordNames %.ChordName
     #(lambda (g ctx p)
        (let ((main-text (ly:grob-property g 'text))
              (alt-text
                (apply
                  ignatzek-chord-names
                  (pitches-bass-inversion-context-list m2 ctx))))
         (ly:grob-set-property! g 'text
           #{
             \markup
               { $main-text \hspace #0.4 \fontsize #-3 \parenthesize $alt-text }
           #})))
   $m1
#})


Cheers,
  Harm



reply via email to

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