lilypond-user
[Top][All Lists]
Advanced

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

Re: Possible feature request for 'q' shorthand or tie syntax


From: Gilles
Subject: Re: Possible feature request for 'q' shorthand or tie syntax
Date: Fri, 21 Sep 2012 10:48:44 +0200
User-agent: Opera Mail/12.02 (Win64)


You noticed yourself that this does not work well with chords, but it
also does not play overly well with \relative if you write \av c' for
example.

In the \samePitch function, i try to play with the property
'to-relative-callback. It seems to work also here but of course, it is
heavier -:(  (see below )
For chords, is it conceivable to imagine a ly:pitches? function, (so for
chords), that would be compatible in #{ #}, in the same way ly:pitch? is.
And even, an ly:pitch?-or-ly:pitches? function for notes and chords ?
(well, probably with better names ...)

--
Gilles



%%%%%%%%%%
#(define (set-rel-callback tied-music)
"set all pitches to the pitch of the first note, in relative mode."
(let((not-first? #f))
    (map-some-music
      (lambda (x)
        (case (ly:music-property x 'name)
          ((or NoteEvent EventChord)
             (if not-first?
               (ly:music-set-property! x 'to-relative-callback
                  (lambda (x p) ; set pitch to the prev value
                      (ly:prob-set-property! x 'pitch p)
                      p)))
               (set! not-first? x)
             x)
          (else #f)))
      tied-music)))


av = #(define-music-function (parser location x) (ly:pitch?)
(set-rel-callback
    #{
      $x 8 ~  $x 4
    #}))

   \new Staff \relative c' {
      c4. \av c' f4
      fis4. \av fis, g4
   }
%%%%%%%%%



reply via email to

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