[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    Re: adjusting double glissandi
From:       Rachel Green <rg433n () outlook ! com>
Date:       2022-01-26 1:36:20
Message-ID: 52B9E61A-6D08-4359-AD70-3A02A7B67F5A () outlook ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

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 }
  >>
}
%%%%
[cid:04D61D31-92B1-49EE-83B2-5CEEFD81DDD4]




On Jan 25, 2022, at 3:00 PM, Aaron Hill \
<lilypond@hillvisions.com<mailto: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


[Attachment #5 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: \
after-white-space;" class=""> <div class="">Hi Aaron,</div>
<div class="">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.</div> <div class="">Rachel</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">%%%%</div>
<div class="">
<div class="">\version &quot;2.20.0&quot;</div>
<div class=""><br class="">
</div>
<div class="">\language &quot;english&quot;</div>
<div class="">#(set-global-staff-size 20)</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Treble = \relative c'</div>
<div class="">&nbsp; {</div>
<div class="">&nbsp;\time 3/2 &nbsp;</div>
<div class="">&nbsp; \set Voice.baseMoment = #(ly:make-moment 1/8)</div>
<div class="">&nbsp; &nbsp;\set Voice.beatStructure = 1,1,1,1,1,1,1,1,1,1,1,1</div>
<div class="">&nbsp;<span class="Apple-tab-span" style="white-space:pre"> \
</span>\override Glissando.minimum-length = #6</div> <div class="">&nbsp;\override \
Glissando.springs-and-rods = #ly:spanner::set-spacing-rods</div> <div class="">&nbsp; \
&nbsp; &nbsp;\override Glissando.bound-details.right.arrow = ##t</div> <div \
class="">&nbsp; &nbsp; &nbsp;\voiceOne</div> <div class=""><span \
class="Apple-tab-span" style="white-space:pre"></span>&lt;c g' a c&gt;8&nbsp;</div> \
<div class="">&nbsp; &nbsp; &nbsp; &nbsp; \once \override \
Voice.Glissando.extra-offset =</div> <div class="">&nbsp; &nbsp;#(lambda (grob)</div>
<div class="">&nbsp; &nbsp; &nbsp; (if (= 1 (ly:grob-property grob 'glissando-index)) \
'(0 . -1)</div> <div class="">'(0 . 1)))</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>&lt;e, \
g&gt;32*2\glissando &lt;d''' e&gt; \once \stemDown &lt;e g&gt;8 &lt;c,, g' a c&gt; \
&lt;f g b d&gt;&nbsp;</div> <div class=""><span class="Apple-tab-span" \
style="white-space:pre"></span>&lt;f, g&gt;32*2\glissando &lt;d''' f&gt; \once \
\stemDown &lt;f g&gt;8 &lt;f,, g b d&gt; &lt;e g c e&gt;&nbsp;</div> <div \
class=""><span class="Apple-tab-span" style="white-space:pre"></span>&lt;e, \
g&gt;32*2\glissando &lt;d''' e&gt; \once \stemDown &lt;e g&gt;8 &lt;e,, g c e&gt; \
|&nbsp;</div> <div class="">&nbsp; }</div>
<div class=""><br class="">
</div>
<div class="">&nbsp;Bass = \relative c</div>
<div class="">&nbsp; {</div>
<div class="">&nbsp; \clef bass</div>
<div class="">&nbsp; &nbsp; R1*3/2</div>
<div class="">&nbsp; }</div>
<div class=""><br class="">
</div>
<div class="">\score {</div>
<div class="">&nbsp; \new GrandStaff</div>
<div class="">&nbsp; &lt;&lt;</div>
<div class="">&nbsp; \new Staff = &quot;treble&quot; { \Treble }</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>\new Staff \
= &quot;bass&quot; { \Bass }</div> <div class="">&nbsp; &gt;&gt;</div>
<div class="">}</div>
</div>
<div class="">%%%%</div>
<div class=""><img apple-inline="yes" id="F55725E4-459F-4EFD-924F-257EFD61DAC3" \
width="496" height="180" src="cid:04D61D31-92B1-49EE-83B2-5CEEFD81DDD4" \
class=""></div> <div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jan 25, 2022, at 3:00 PM, Aaron Hill &lt;<a \
href="mailto:lilypond@hillvisions.com" class="">lilypond@hillvisions.com</a>&gt; \
wrote:</div> <br class="Apple-interchange-newline">
<div class="">
<div class="">On 2022-01-25 11:46 am, Rachel Green wrote:<br class="">
<blockquote type="cite" class="">Hi,<br class="">
I'm trying to adjust the glissandi in this excerpt so that the lines<br class="">
are parallel and not too close to each other. I found some settings<br class="">
for adjusting a single glissando, but not for a double glissando. Any<br class="">
ideas?<br class="">
</blockquote>
<br class="">
There is prior work on this subject. &nbsp;Harm has provided some code [1] before.<br \
class=""> <br class="">
[1]: <a href="https://lists.gnu.org/archive/html/lilypond-user/2013-08/msg00547.html" \
class=""> https://lists.gnu.org/archive/html/lilypond-user/2013-08/msg00547.html</a><br \
class=""> <br class="">
Here is an adaptation of that logic:<br class="">
<br class="">
%%%%<br class="">
glissandoTweak =<br class="">
#(define-music-function<br class="">
&nbsp;(after? tweaks) ((boolean? #t) list?)<br class="">
&nbsp;(define (proc grob)<br class="">
&nbsp;&nbsp;(if after? (ly:spanner::kill-zero-spanned-time grob))<br class="">
&nbsp;&nbsp;(for-each<br class="">
&nbsp;&nbsp;&nbsp;(lambda (x)<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;(let ((prop (car x)) (value (cdr x)))<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(if (key-list? prop)<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(ly:grob-set-nested-property! grob prop value)<br \
class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(ly:grob-set-property! grob prop \
value))))<br class=""> &nbsp;&nbsp;&nbsp;(ly:assoc-get<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;(ly:grob-property grob 'glissando-index) tweaks '())))<br \
class=""> &nbsp;(if after?<br class="">
&nbsp;&nbsp;#{ \once \override Glissando.after-line-breaking = #proc #}<br class="">
&nbsp;&nbsp;#{ \once \override Glissando.before-line-breaking = #proc #}))<br \
class=""> <br class="">
{<br class="">
\glissandoTweak<br class="">
#`((0 . ((color . ,red)<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Y-offset . -0.5)))<br \
class=""> &nbsp;&nbsp;&nbsp;(1 . ((color . ,blue)<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((bound-details right arrow) . \
#t))))<br class=""> &lt;c' e'&gt;2\glissando &lt;g'' b''&gt;<br class="">
}<br class="">
%%%%<br class="">
<br class="">
<br class="">
-- Aaron Hill<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</body>
</html>


["Screen Shot 2022-01-25 at 6.31.22 PM.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic