lilypond-user
[Top][All Lists]
Advanced

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

Re: missing glissando features (bugs?)


From: Marc Hohl
Subject: Re: missing glissando features (bugs?)
Date: Thu, 14 May 2009 08:10:04 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090318)

Neil Puttock schrieb:
2009/5/11 Marc Hohl <address@hidden>:

   (if (and (= left-staff-position right-staff-position)
            (< (ly:pitch-semitones right-pitch) (ly:pitch-semitones
left-pitch)))
               -1
                1 )))

This will apply an extra-dy of 1 for glissandos which aren't on the
same staff-position.

No, it doesn't; at least in my test files. I have attached an example where the
default and the corrected behaviour are compared, please have a look at it.

Marc
Here I'm stuck, 'cause when I override the value for extra-dy manually, as
in

dytest = \relative c {
 \set TabStaff.minimumFret = #2
 \override Glissando #'extra-dy = #0
 c4 \glissando cis \glissando c2
}

\score {
  \new TabStaff { \clef "tab" \dytest } }
          the glissando line doesn't look as expected, it is parallel to the
staff lines and therefore
invisible. So, strange as it seems, the value "1" must be right here.

The default value for 'extra-dy is set to 0.75 for all glissandos,
even if they're on different lines; see the context definition in
engraver-init.ly.

Though I suggested using cond/else, it's probably easier to use nested
if clauses: if the staff-positions are equal, compare the pitches,
otherwise return a default value of 0.

     (if (= left-staff-position right-staff-position)
         (if (< (ly:pitch-semitones right-pitch) (ly:pitch-semitones 
left-pitch))
             -1
             1)

         ;; not on same staff-position -> no extra-dy
         0))

Just for the record: I think it would be reasonable to move the
glissando::calc-tab-extra-dy
call to tablature.ly, so all files are backwards compatible and tablature
users can profit from
the nicer glissando lines :-)

It would make an excellent addition to the file.

Regards,
Neil


\version "2.12.2"

\paper {
   indent = 0
   ragged-right = ##f
}


#(define (glissando::calc-extra-dy grob)
   (let* ((original (ly:grob-original grob))
          (left-bound (ly:spanner-bound original LEFT))
          (right-bound (ly:spanner-bound original RIGHT))
          (left-pitch (ly:event-property (event-cause left-bound) 'pitch))
          (right-pitch (ly:event-property (event-cause right-bound) 'pitch)))

     (if (and (= (ly:pitch-octave left-pitch) (ly:pitch-octave right-pitch))
              (= (ly:pitch-notename left-pitch) (ly:pitch-notename 
right-pitch)))
         (- (ly:pitch-alteration right-pitch) (ly:pitch-alteration left-pitch))
         0 )))

#(define (glissando::calc-tab-extra-dy grob)
   (let* ((original (ly:grob-original grob))
          (left-bound (ly:spanner-bound original LEFT))
          (right-bound (ly:spanner-bound original RIGHT))
          (left-pitch (ly:event-property (event-cause left-bound) 'pitch))
          (right-pitch (ly:event-property (event-cause right-bound) 'pitch))
          (left-staff-position (ly:grob-property left-bound 'staff-position))
          (right-staff-position (ly:grob-property right-bound 'staff-position)))

     (if (and (= left-staff-position right-staff-position)
              (< (ly:pitch-semitones right-pitch) (ly:pitch-semitones 
left-pitch)))
         -1
          1 )))

noten = \relative c {
   c4 \glissando cis
   c4 \glissando cis
   c4 \glissando ces
   c4 \glissando ces
   c4 \glissando d \glissando e \glissando f
}

tabs = \relative c {
   \set TabStaff.minimumFret = #2
   c4 \glissando cis \glissando c2
   c4 \glissando ces \glissando c2
   c4 \glissando c \glissando c2
   c4 \glissando d \glissando c2
   c4 \glissando d \glissando c2
   c'4 \glissando d \glissando e, \glissando f 
   \bar "|."
}

\score {
    \new Staff { \clef "G_8" 
                 \noten \break
                 \override Glissando #'extra-dy = #glissando::calc-extra-dy
                 \noten }
}

\score {
    \new TabStaff { \clef "tab"
                    \tabs \break
                    \override Glissando #'extra-dy = 
#glissando::calc-tab-extra-dy
                    \tabs }
}


reply via email to

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