[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 "2.20.0"</div>
<div class=""><br class="">
</div>
<div class="">\language "english"</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=""> {</div>
<div class=""> \time 3/2 </div>
<div class=""> \set Voice.baseMoment = #(ly:make-moment 1/8)</div>
<div class=""> \set Voice.beatStructure = 1,1,1,1,1,1,1,1,1,1,1,1</div>
<div class=""> <span class="Apple-tab-span" style="white-space:pre"> \
</span>\override Glissando.minimum-length = #6</div> <div class=""> \override \
Glissando.springs-and-rods = #ly:spanner::set-spacing-rods</div> <div class=""> \
\override Glissando.bound-details.right.arrow = ##t</div> <div \
class=""> \voiceOne</div> <div class=""><span \
class="Apple-tab-span" style="white-space:pre"></span><c g' a c>8 </div> \
<div class=""> \once \override \
Voice.Glissando.extra-offset =</div> <div class=""> #(lambda (grob)</div>
<div class=""> (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><e, \
g>32*2\glissando <d''' e> \once \stemDown <e g>8 <c,, g' a c> \
<f g b d> </div> <div class=""><span class="Apple-tab-span" \
style="white-space:pre"></span><f, g>32*2\glissando <d''' f> \once \
\stemDown <f g>8 <f,, g b d> <e g c e> </div> <div \
class=""><span class="Apple-tab-span" style="white-space:pre"></span><e, \
g>32*2\glissando <d''' e> \once \stemDown <e g>8 <e,, g c e> \
| </div> <div class=""> }</div>
<div class=""><br class="">
</div>
<div class=""> Bass = \relative c</div>
<div class=""> {</div>
<div class=""> \clef bass</div>
<div class=""> R1*3/2</div>
<div class=""> }</div>
<div class=""><br class="">
</div>
<div class="">\score {</div>
<div class=""> \new GrandStaff</div>
<div class=""> <<</div>
<div class=""> \new Staff = "treble" { \Treble }</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>\new Staff \
= "bass" { \Bass }</div> <div class=""> >></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 <<a \
href="mailto:lilypond@hillvisions.com" class="">lilypond@hillvisions.com</a>> \
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. 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="">
(after? tweaks) ((boolean? #t) list?)<br class="">
(define (proc grob)<br class="">
(if after? (ly:spanner::kill-zero-spanned-time grob))<br class="">
(for-each<br class="">
(lambda (x)<br class="">
(let ((prop (car x)) (value (cdr x)))<br class="">
(if (key-list? prop)<br class="">
(ly:grob-set-nested-property! grob prop value)<br \
class=""> (ly:grob-set-property! grob prop \
value))))<br class=""> (ly:assoc-get<br class="">
(ly:grob-property grob 'glissando-index) tweaks '())))<br \
class=""> (if after?<br class="">
#{ \once \override Glissando.after-line-breaking = #proc #}<br class="">
#{ \once \override Glissando.before-line-breaking = #proc #}))<br \
class=""> <br class="">
{<br class="">
\glissandoTweak<br class="">
#`((0 . ((color . ,red)<br class="">
(Y-offset . -0.5)))<br \
class=""> (1 . ((color . ,blue)<br class="">
((bound-details right arrow) . \
#t))))<br class=""> <c' e'>2\glissando <g'' b''><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