[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tweaking glissando timing stems
From: |
Thomas Morley |
Subject: |
Re: Tweaking glissando timing stems |
Date: |
Sun, 13 Oct 2019 19:23:40 +0200 |
Am Do., 10. Okt. 2019 um 14:51 Uhr schrieb Leo Correia de Verdier
<address@hidden>:
>
> Dear list!
>
> I'm soon going to start engraving a piece that contains very many glissandi
> with timing marks (or actually, glissandi with broken bowing and
> articulations during the way). The snippet in
> http://lilypond.org/doc/v2.19/Documentation/notation/expressive-marks-as-lines#glissando
> mentions the stems might need to be repositioned slightly, and I was
> wondering if this would be possible to automate.
>
> I realize this will be complicated, since it (as I understand it at least)
> will require changing stem lengths and notehead attachments after the
> horizontal spacing is calculated (possibly changing pitches too, but the
> solution I’m imagining would not do that). So I would need to access the
> calculated positions of the stems and of the endpoints of the glissando. Is
> that possible? Where and what do I need to read up to accomplish it? Or has
> someone already done something similar?
>
> I have seen Piaras Hobans code in this thread:
> https://lists.gnu.org/archive/html/lilypond-user/2014-03/msg00717.html , and
> it’s interesting for me, but it relies on the stems being equally spaced,
> which they shouldn’t be in my case.
>
> In the following example I’m looking for a way to calculate up and y-diff in
> the glissNote function, instead of having to type them in by hand after
> looking at the resulting score. (The gap between the stems and glissando-line
> is intentional, the articulation positioning is just not done yet). I have
> not done it minimal because I wanted to give a glimpse of the point of the
> notation also.
>
> %%%%%%%%%
>
> \version "2.19.82"
>
> glissNote = #(define-music-function (up y-diff note) (boolean? number?
> ly:music?)
> #{ \tweak transparent ##t
> \tweak no-ledgers ##t
> \tweak stem-attachment #(cons (if up -1 1) y-diff)
> #note #} )
>
> glissRest = #(define-music-function (staff-position rest) (number? ly:music?)
> #{ \tweak Y-offset #staff-position
> \tweak layer #-1
> \tweak whiteout #10
> \parenthesize
> #rest #} )
>
> glissSkip = #(define-music-function (music) (ly:music?)
> #{ \override NoteColumn.glissando-skip = ##t
> #music
> \revert NoteColumn.glissando-skip #} )
>
> \relative c'' {
> \time 6/8
> \set glissandoMap = #'((1 . 1))
> <a f'>16-> -\tweak layer #-2 \glissando
> \glissSkip {
> <a \glissNote ##f #.5 f'>8-. <a \glissNote ##f #0.3 f'>16-. <a \glissNote
> ##f #.1 f'>8->
> << {\glissRest #2.5 r8 s4} \\
> {d,8_-_> <a' \glissNote ##f #-0.4 f'>^. <a \glissNote ##f #-.6 f'>^.}
> >>
> }
> \time 2/4 <a a'>2--
> }
>
> %%%%%%%%%%
>
> Thanks a lot!
> /Leo
Hi Leo,
the topic of glissando-stems pops up from time to time.
See older discussions, p.e. here:
https://codereview.appspot.com/4661061/#ps1
Some time ago I started to code something in this regard and took your
request to polish it a bit.
Though, there are still some TODOs:
- Scripts are not always positioned nicely.
- "Inner" beams 'positions can't be affected from Glissando.after-line-breaking.
etc
Furthermore I'm not sure the whole approach fits your needs.
Nevertheless the code is attached, probably you'll find the
calculation for "gliss-stem-intersections" helpful.
Cheers,
Harm
glissando-stems-03.ly
Description: Text Data
glissando-stems-03.png
Description: PNG image
- Tweaking glissando timing stems, Leo Correia de Verdier, 2019/10/10
- Re: Tweaking glissando timing stems,
Thomas Morley <=
- Re: Tweaking glissando timing stems, Leo Correia de Verdier, 2019/10/14
- Re: Tweaking glissando timing stems, Thomas Morley, 2019/10/16
- Re: Tweaking glissando timing stems, Leo Correia de Verdier, 2019/10/18
- Re: Tweaking glissando timing stems, Thomas Morley, 2019/10/19
- Re: Tweaking glissando timing stems, Leo Correia de Verdier, 2019/10/19
- Re: Tweaking glissando timing stems, Thomas Morley, 2019/10/22
- Re: Tweaking glissando timing stems, Leo Correia de Verdier, 2019/10/25
- Re: Tweaking glissando timing stems, Thomas Morley, 2019/10/26