Re: Splitting chaotic glissando to parts

2018-06-12 Thread Thomas Morley
2018-06-12 8:35 GMT+02:00 Helge Kruse :
> I have struggling for a while with few measures and I am currently a bit
> frustrated. I use the great fancy glissando from LSR 1066
> (http://lsr.di.unimi.it/LSR/Item?id=1066) to write some chaotic
> glissandi. The players should start one after the other. For that
> purpose the composer used a triplet as then notation.
>
> I think I got a acceptable result in the score. The starting points of
> the glissando lines are a bit too far from the note heads though.

You use hidden notes as glissandi-start, but they don't match
rhythmically with the chords from which the glissando should start, so
the glissando starts later, thus the gap(s)

>
> But it's hard to generate the parts. I tried \keepWithTag for the first
> time to get just one item of the triplet. But now I get even more
> unexpected results. The first part has a double glissando surprisingly.

Not really.
Glissando between chords prints per default multiple lines. Each of
those glissandi is affected by \fancy-gliss.
Though, you can customize behaviour using the
glissandoMap-context-property, see NR.

> The line ends not before but inside the terminating chord. The second
> part has an additional gap between the starting chord and the begin of
> the glissando line.
>
> How can this be fixed (double line terminating x position in 1st part)
> and improved (distance in 2nd and 3rd part)?

While on it, I simplified fancy-gliss, renaming it fancy-gliss-II.
Be aware I deleted the \once. You now need to revert it explicitely,
if you can't use \once \fancy-gliss-II
Overrides for bound-details.left/right.padding are possible.


\version "2.19.81"

%% disregard the 2.18.2-warnings
#(if (string=? (lilypond-version) "2.18.2")
  (for-each
(lambda (i)
  (ly:expect-warning "ignoring too many clashing note columns"))
(iota 2)))


lengthen-gliss =
#(define-music-function (parser loation nmbr)(number?)
#{
  \once \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
  \once \override Glissando.minimum-length = #nmbr
#})

fancy-gliss-II =
#(define-music-function (parser location pts-list)(list?)
#{
 \override Glissando.after-line-breaking =
  #(lambda (grob)
(let ((stil (ly:line-spanner::print grob)))
 (if (ly:stencil? stil)
 (let*
   ((left-bound-info (ly:grob-property grob 'left-bound-info))
(left-Y (assoc-get 'Y left-bound-info))
(stil-x-ext (ly:stencil-extent stil X))
(factor
  (/ (interval-length (ly:stencil-extent stil X))
 (car (take-right (last pts-list) 2
(new-stil
  (make-connected-path-stencil
(map
  (lambda (e)
(cond ((= (length e) 2)
   (cons (* (car e) factor) (cdr e)))
  ((= (length e) 6)
   (list
 (* (car e) factor)
 (cadr e)
 (* (third e) factor)
 (fourth e)
 (* (fifth e) factor)
 (sixth e)))
  (else
(ly:error
  "Some element(s) of the given list do not fit"
  pts-list)
(layout-line-thickness grob) ;line-width
1   ;scaling
1   ;scaling
#f
#f)))

   (ly:grob-set-property! grob 'stencil
 (ly:stencil-translate
   new-stil
   (cons (car stil-x-ext) left-Y
 (begin
   (ly:warning
 "Cannot find stencil. Please set 'minimum-length accordingly")
   #f
#})

%% comment me
%#(display "\n\tLimitations:
%\t-Does not work with line-break
%\t-dotted notes with glissando may return a warning for unknown reasons,
%\t strange things may happen, if contexts die prematurely")

\version "2.19.81"
\language "deutsch"

%\include "FancyGliss.ily"


scoreDUpperHarpI = \relative c'' {
  \override Glissando.cross-staff = ##t
  \set glissandoMap = #'((3 . 0))
  \once \fancy-gliss-II
#'(
 (.5 -2)
 (1 -0.5)
 (1.5 -3)
 (2 0)
 (2.5 -14)
 (3 0)
 )
  \tag #'partiture
{ 4*1/2\glissando s8 }
  \tag #'partI {
\tuplet 3/2 {
  8\glissando
  \temporary \override NoteColumn.glissando-skip = ##t
  r r
}
  }
  s8*14
  \revert NoteColumn.glissando-skip
  < h' h'>4 r
  \unset glissandoMap
}

scoreDLowerHarpI = \relative c' {
  \time 2/4
  s2 s s s
  r4 r
}

scoreDUpperHarpII = \relative c'' {
  \override Glissando.cross-staff = ##t
  \set glissandoMap = #'((3 . 0))
  \fancy-gliss-II
#'(
 (0.8 -14)
 (2.4 2)
 )
  \tag #'partiture {
s8*2/3
4*2/3\glissando
  }
  \tag #'partII {
\tuplet 3/2 {
  r8
  8\glissando
  \temporary \override NoteColumn.

Splitting chaotic glissando to parts

2018-06-11 Thread Helge Kruse
I have struggling for a while with few measures and I am currently a bit
frustrated. I use the great fancy glissando from LSR 1066
(http://lsr.di.unimi.it/LSR/Item?id=1066) to write some chaotic
glissandi. The players should start one after the other. For that
purpose the composer used a triplet as then notation.

I think I got a acceptable result in the score. The starting points of
the glissando lines are a bit too far from the note heads though.

But it's hard to generate the parts. I tried \keepWithTag for the first
time to get just one item of the triplet. But now I get even more
unexpected results. The first part has a double glissando surprisingly.
The line ends not before but inside the terminating chord. The second
part has an additional gap between the starting chord and the begin of
the glissando line.

How can this be fixed (double line terminating x position in 1st part)
and improved (distance in 2nd and 3rd part)?

The example is not very minimal. But I hope it's short enough. The file
from the LSR is attached as file because I don't think that's in
question. The score in question is below.


Best regards,
Helge


\version "2.19.81"
\language "deutsch"

\include "FancyGliss.ily"


scoreDUpperHarpI = \relative c'' {
  \override Glissando.cross-staff = ##t
  \fancy-gliss
#'(
 (.5 -2)
 (1 -0.5)
 (1.5 -3)
 (2 0)
 (2.5 -12)
 (3 0)
 )

\tag #'partiture {
   \hideNotes e'8*16\glissando  \unHideNotes
< h h'>4 r
}
\tag #'partI {
  \tuplet 3/2 { 8\glissando
\temporary \override NoteColumn.glissando-skip = ##t
r r }
  s8*14

\revert NoteColumn.glissando-skip
< h h'>4 r
}
}

scoreDLowerHarpI = \relative c' {
  \time 2/4
   s2 s s s
   r4 r
}

scoreDUpperHarpII = \relative c'' {
\tag #'partII {
  \tuplet 3/2 { r8 8 r
  }
  \override Glissando.cross-staff = ##t
  \fancy-gliss
#'(
 (0.8 -14)
 (2.4 2)
 )
  \hideNotes g'8*14\glissando  \unHideNotes
  \revert NoteColumn.glissando-skip
  < h h'>4 r
}
\tag #'partiture
{
  s8
  \override Glissando.cross-staff = ##t
  \fancy-gliss
#'(
 (0.8 -14)
 (2.4 2)
 )
  \hideNotes e8*15\glissando  \unHideNotes
  < h h'>4 r
}
}

scoreDLowerHarpII = \relative c' {
   \time 2/4
   s2 s s s
   r4 r
}

scoreDUpperHarpIII = \relative c'' {
  |
\tuplet 3/2 {
  \tag #'partiture {
\voiceTwo
\change Staff=upperI 8
\change Staff=upperII 
\change Staff=upperIII 
  }
  \tag #'partIII {
r8 r 

  }
}
\override Glissando.cross-staff = ##t
\fancy-gliss
#'(
 (.1 -4)
 (.6 -2.5)
 (1.4 -5)
 (1.6 -2.5)
 (2.1 -14)
 (2.6 0)
 )
 \stemNeutral
\hideNotes e8*14\glissando  \unHideNotes
< h' h'>4 r
}

scoreDLowerHarpIII = \relative c' {
  \time 2/4
  s2 s s s
  r4 r
}


%% =
scoreDHarpIPart = \new PianoStaff <<
  \new Staff = "upperI"  <<  \scoreDUpperHarpI >>
  \new Staff = "lowerI"  { \clef bass \scoreDLowerHarpI }
>>

scoreDHarpIIPart = \new PianoStaff <<
  \new Staff = "upperII"  << \scoreDUpperHarpII >>
  \new Staff = "lowerII"  { \clef bass \scoreDLowerHarpII }
>>

scoreDHarpIIIPart = \new PianoStaff <<
  \new Staff = "upperIII"  << \scoreDUpperHarpIII >>
  \new Staff = "lowerIII"  { \clef bass \scoreDLowerHarpIII }
>>

\book {
\bookpart {
\score {
  \keepWithTag #'partiture
  <<
\scoreDHarpIPart
\scoreDHarpIIPart
\scoreDHarpIIIPart
  >>
}

\score { \keepWithTag #'partI  \scoreDHarpIPart }
\score { \keepWithTag #'partII \scoreDHarpIIPart }
\score { \keepWithTag #'partIII \scoreDHarpIIIPart }
  }
}

lengthen-gliss =
#(define-music-function (parser loation nmbr)(number?)
#{
  \once \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
  \once \override Glissando.minimum-length = #nmbr
#})

fancy-gliss =
#(define-music-function (parser location pts-list)(list?)
#{
 \once \override Glissando.after-line-breaking =
  #(lambda (grob)
(let ((stil (ly:line-spanner::print grob)))
 (if (ly:stencil? stil)
 (let*
   ((left-bound-info (ly:grob-property grob 'left-bound-info))
(left-bound (ly:spanner-bound grob LEFT))
(y-off (assoc-get 'Y left-bound-info))
(padding (assoc-get 'padding left-bound-info))
(note-column (ly:grob-parent left-bound X))
(note-heads (ly:grob-object note-column 'note-heads))
(ext-X
  (if (null? note-heads)
  '(0 . 0)
  (ly:relative-group-extent note-heads grob X)))
(dot-column (ly:note-column-dot-column note-column))
(dots
  (if (null? dot-column)
  '()