lilypond-user
[Top][All Lists]
Advanced

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

Re: Glissando fall/rises with no termination


From: Benedict Singer
Subject: Re: Glissando fall/rises with no termination
Date: Fri, 02 Jun 2006 00:13:59 -0500
User-agent: Thunderbird 1.4 (Macintosh/20050908)

Thanks to your input I looked in the 2.9 manual rather than the 2.8 manual and found the excellent examples there; I then came up with the functions at the end of this mail; my Scheme training is useful for once! Almost everything is perfect, however, I can't seem to suppress the ledger lines with the method included below. LedgerLineEngraver is all I've been able to find relating to ledger lines. If I have to turn them off for the duration of the piece I could probably live with that, and just use pitches within the staff, but it would be easier (and more portable) to be able to suppress them for a single note. Thanks!

Ben

%%

fallAdjust =
   #(define-music-function (parser location oct note) (number? ly:music?)
(let ((pitch (ly:music-property (first (ly:music-property note 'elements)) 'pitch)))
       (make-music
        'EventChord
        'elements (list (make-music
            'NoteEvent
            'duration
            (ly:make-duration 3 0)
            'pitch
(ly:make-pitch (+ (ly:pitch-octave pitch) oct) (ly:pitch-notename pitch) 0)))))) glissFall =
   #(define-music-function (parser location note) (ly:music?)
       #{ $note
          \once \override NoteHead #'transparent = ##t
          \once \override Stem #'transparent = ##t
          \once \override Staff.LedgerLineSpanner #'transparent = ##t
          \fallAdjust #-1 $note
       #})
glissRise =
   #(define-music-function (parser location note) (ly:music?)
       #{ $note
          \once \override NoteHead #'transparent = ##t
          \once \override Stem #'transparent = ##t
          \once \override Staff.LedgerLineSpanner #'transparent = ##t
          \fallAdjust #1 $note
       #})

varVI = {
   \clef bass
   \time 3/4
   \override Glissando #'style = #'zigzag
   \override Score.SeparationItem #'padding = #1.5

   f4-.^"sempre pizz." \glissFall f4*1/2-.\glissando r4
   \glissFall f4*1/2-.\glissando \glissFall c4*1/2-.\glissando r4
   \glissFall f4*1/2-.\glissando \glissFall d4*1/2-.\glissando r4
   f4 c d
   \glissFall g4*1/2-.\glissando r2
f4-. \glissRise f4*1/2-.\glissando r4
   \glissRise f4*1/2-.\glissando \glissRise c4*1/2-.\glissando r4
   \glissRise f4*1/2-.\glissando \glissRise d4*1/2-.\glissando r4
   f4 c d
   \glissRise g4*1/2-.\glissando r2

   \bar "||"
}

Graham Percival wrote:

On 1-Jun-06, at 8:12 PM, Benedict Singer wrote:

glissFall =
   #(define-music-function (parser location note) (ly:music?)
#{ $note \once \override NoteHead #'transparent = ##t \once \override Stem #'transparent = ##t \relative c { f,8 } #})

varVI = \relative c' {
   \override Glissando #'style = #'zigzag

   \glissFall f,4*1/2\glissando r2
}

I'm looking for tips from the Scheme/LilyPond pros to make this a bit better.

1) If you always want zigzag gliss, I would move that line (with a \once) inside the glissFall function. 2) Only have one command per line inside the music function. This is good advice for lilypond in general, but particularly inside music functions!

In particular, the ending note is currently hard-coded, so the gliss down from the F is much shorter than the one down from the C. Is there a way to use the note that \glissFall takes as input and modify it to construct the invisible note somehow?

Yes, but I don't know how to do it offhand. See 11.3 Building complicated functions for tips. The basic idea is to use scheme to take the initial note, subtract 9 semitones (or whatever you want), and create a new (invisible) note.

Cheers,
- Graham






reply via email to

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