lilypond-user
[Top][All Lists]
Advanced

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

Re: adjusting double glissandi


From: Rachel Green
Subject: Re: adjusting double glissandi
Date: Wed, 26 Jan 2022 01:36:20 +0000

Hi Aaron,
Thanks for the reply! Both your code and the code in the thread you linked to works for adding space between the two glissandi lines, but I’m still not sure how to rotate one of the lines so that they are parallel. What would be the grob property for rotation? Sorry I’m not familiar enough with Scheme. These particular glissandi have significantly different angles due to the different intervals of the chords.
Rachel


%%%%
\version "2.20.0"

\language "english"
#(set-global-staff-size 20)


Treble = \relative c'
  {
 \time 3/2  
  \set Voice.baseMoment = #(ly:make-moment 1/8)
   \set Voice.beatStructure = 1,1,1,1,1,1,1,1,1,1,1,1
  \override Glissando.minimum-length = #6
 \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
     \override Glissando.bound-details.right.arrow = ##t
     \voiceOne
<c g' a c>8 
        \once \override Voice.Glissando.extra-offset =
   #(lambda (grob)
      (if (= 1 (ly:grob-property grob 'glissando-index)) '(0 . -1)
'(0 . 1)))

<e, g>32*2\glissando <d''' e> \once \stemDown <e g>8 <c,, g' a c> <f g b d> 
<f, g>32*2\glissando <d''' f> \once \stemDown <f g>8 <f,, g b d> <e g c e> 
<e, g>32*2\glissando <d''' e> \once \stemDown <e g>8 <e,, g c e> | 
  }

 Bass = \relative c
  {
  \clef bass
    R1*3/2
  }

\score {
  \new GrandStaff
  <<
  \new Staff = "treble" { \Treble }
\new Staff = "bass" { \Bass }
  >>
}
%%%%




On Jan 25, 2022, at 3:00 PM, Aaron Hill <lilypond@hillvisions.com> wrote:

On 2022-01-25 11:46 am, Rachel Green wrote:
Hi,
I’m trying to adjust the glissandi in this excerpt so that the lines
are parallel and not too close to each other. I found some settings
for adjusting a single glissando, but not for a double glissando. Any
ideas?

There is prior work on this subject.  Harm has provided some code [1] before.

[1]: https://lists.gnu.org/archive/html/lilypond-user/2013-08/msg00547.html

Here is an adaptation of that logic:

%%%%
glissandoTweak =
#(define-music-function
 (after? tweaks) ((boolean? #t) list?)
 (define (proc grob)
  (if after? (ly:spanner::kill-zero-spanned-time grob))
  (for-each
   (lambda (x)
    (let ((prop (car x)) (value (cdr x)))
     (if (key-list? prop)
      (ly:grob-set-nested-property! grob prop value)
      (ly:grob-set-property! grob prop value))))
   (ly:assoc-get
    (ly:grob-property grob 'glissando-index) tweaks '())))
 (if after?
  #{ \once \override Glissando.after-line-breaking = #proc #}
  #{ \once \override Glissando.before-line-breaking = #proc #}))

{
\glissandoTweak
#`((0 . ((color . ,red)
         (Y-offset . -0.5)))
   (1 . ((color . ,blue)
         ((bound-details right arrow) . #t))))
<c' e'>2\glissando <g'' b''>
}
%%%%


-- Aaron Hill


reply via email to

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