lilypond-devel
[Top][All Lists]
Advanced

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

Re: Scheme help for lyric align on vowel


From: Carl D. Sorensen
Subject: Re: Scheme help for lyric align on vowel
Date: Tue, 27 Jan 2009 13:57:18 -0700

> 
> "Carl D. Sorensen" <c_sorensen <at> byu.edu> writes:
> 
> >
> > I need to define a function (double x) that can work as follows.  I want
> >
> > (map double '(1 2 3))
> >
> > to return 
> >
> > (1 1 2 2 3 3)
> >
> >
> > Can anybody help me figure out how to do this?  As far as I can see, it's
> > not possible.
> 
> Definitely impossible.  map returns a list with the same number of
> elements as its input.  Why do you need to use map in this manner?
> 

I want to apply musicMap to a music expression.  The proc I want to apply
would evaluate the music to see if it's a LyricEvent.  If it is, it would
add a ContextSpeccedMusic event to give a custom self-align-x value.  But
the ContextSpeccedMusic event must be a sibling, not a child, of the
LyricEvent.  Oops, I guess it's an aunt, not a sibling.  It's a sibling of
the EventChord that contains the LyricEvent.  But I can do that part as
well.

(list (make-music
          'ContextSpeccedMusic
          'context-type
          'Bottom
          'element
          (make-music
            'OverrideProperty
            'pop-first
            #t
            'grob-property-path
            (list (quote self-alignment-X))
            'grob-value
            -0.5
            'once
            #t
            'symbol
            'LyricText))
        (make-music
          'EventChord
          'elements
          (list (make-music
                  'LyricEvent
                  'duration
                  (ly:make-duration 0 0 1 1)
                  'text
                  "Each")))
 

I know how to calculate the value, I know how to musicMap the music, but I
don't know how to add a new element to the list if necessary to adjust the
lyric positioning.

I can probably figure out how to do it by parsing the list myself and using
set-cdr!, but I was hoping to let musicMap do the work.

Carl





reply via email to

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