Re: alternative notehead style breaks cross-staff stem

2016-11-13 Thread Phil Holmes
- Original Message - 
From: "Urs Liska" 

To: "lilypond-user" 
Sent: Sunday, November 13, 2016 2:45 PM
Subject: alternative notehead style breaks cross-staff stem



Hi all,

I'm trying to build something like similar to an automated harmonic
display on two staves, and it seems that alternative note head styles
break the cross staff stems:

Is this known (at least not said in the NR)? Is there a way around this
issue? Note that the example code isn't necessarily the ideal approach
but a first attempt. What I eventually need is a way for a music
function to produce such a "chord" distributed on two staves, connected
by a cross-staff stem and either note head configurable in appearance.

TIA for any hints or pointers
Urs


Fairly certain that the cross-staff stem engraver is in 
scm/music-functions.scm.   Look for "cross-staff-connect".  I don't know 
scheme and so can't see what the code does, but you may be able to see 
what's going on.


--
Phil Holmes 



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: alternative notehead style breaks cross-staff stem

2016-11-13 Thread Malte Meyn



Am 13.11.2016 um 15:45 schrieb Urs Liska:

I'm trying to build something like similar to an automated harmonic
display on two staves, and it seems that alternative note head styles
break the cross staff stems:

Is this known (at least not said in the NR)? Is there a way around this
issue?


I found the same bug in september but it seems like I didn’t report it …

http://lists.gnu.org/archive/html/lilypond-user/2016-09/msg00698.html

I posted a quick-and-dirty workaround in that thread.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: alternative notehead style breaks cross-staff stem

2016-11-13 Thread Thomas Morley
2016-11-13 15:45 GMT+01:00 Urs Liska :
> Hi all,
>
> I'm trying to build something like similar to an automated harmonic
> display on two staves, and it seems that alternative note head styles
> break the cross staff stems:
>
> Is this known (at least not said in the NR)? Is there a way around this
> issue? Note that the example code isn't necessarily the ideal approach
> but a first attempt. What I eventually need is a way for a music
> function to produce such a "chord" distributed on two staves, connected
> by a cross-staff stem and either note head configurable in appearance.
>
> TIA for any hints or pointers
> Urs
>
>
> \version "2.19.51"
>
> \layout {
>   \context {
> \PianoStaff
> \consists #Span_stem_engraver
>   }
> }
>
> \score {
>   <<
> \new PianoStaff <<
>   \new Staff = "one" {
> s1
>   }
>
>   \new Staff = "two" {
> \clef bass
> <<
>   \crossStaff {
> c,4 c, c, c,
>   }
>   \new Voice {
> \stemUp
> \change Staff = "one"
> \override NoteHead.style = #'harmonic
> e' g' bes' c''
>   }
> >>
>
>   }
> >>
>   >>
> }


Hi Urs,

cross-staff Stems are only printed if certain conditions are fullfilled.
One of them is the Stem's left edge are within a range 0.001
-> `close-enough?' in music-functions.scm

In a recent thread I developed `pushNC' to force the Stems doing so.
http://lists.gnu.org/archive/html/lilypond-user/2016-11/msg00230.html

Works here as well:


\version "2.19.49"

pushNC =
\override NoteColumn.X-offset =
  #(lambda (grob)
(let* ((p-c (ly:grob-parent grob X))
   (p-c-elts (ly:grob-object p-c 'elements))
   (stems
 (if (ly:grob-array? p-c-elts)
 (filter
   (lambda (elt)(grob::has-interface elt 'stem-interface))
   (ly:grob-array->list p-c-elts))
 #f))
   (stems-x-exts
 (if stems
 (map
   (lambda (stem)
 (ly:grob-extent
   stem
   (ly:grob-common-refpoint grob stem X)
   X))
   stems)
 '()))
   (sane-ext
 (filter interval-sane? stems-x-exts))
   (cars (map car sane-ext)))
(if (pair? cars)
(abs (- (apply max cars)  (apply min cars)))
0)))

\layout {
  \context {
\PianoStaff
\consists #Span_stem_engraver
  }
}

\score {
  <<
\new PianoStaff <<
  \new Staff = "one" {
s1
  }

  \new Staff = "two" {
\clef bass
<<
  \crossStaff {
c,4 c, c, c,
  }
  \new Voice {
\stemUp
\change Staff = "one"
\override NoteHead.style = #'harmonic
%\once
\pushNC
e' g' bes' c''
  }
>>
  }
>>
  >>
}

HTH,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: alternative notehead style breaks cross-staff stem

2016-11-14 Thread Urs Liska


Am 13.11.2016 um 21:44 schrieb Thomas Morley:
> 2016-11-13 15:45 GMT+01:00 Urs Liska :
>> Hi all,
>>
>> I'm trying to build something like similar to an automated harmonic
>> display on two staves, and it seems that alternative note head styles
>> break the cross staff stems:
>>
>> ...
>
> Hi Urs,
>
> cross-staff Stems are only printed if certain conditions are fullfilled.
> One of them is the Stem's left edge are within a range 0.001
> -> `close-enough?' in music-functions.scm
>
> In a recent thread I developed `pushNC' to force the Stems doing so.
> http://lists.gnu.org/archive/html/lilypond-user/2016-11/msg00230.html
>
> Works here as well:
>
> ...
>
> HTH,
>   Harm

Thank you, this indeed works well for my purpose, I'll soon share the
results.

The next step would be to have two notes connect their stems when *not*
in different staves, e.g.

\new Staff {
  <<
{
  \voiceOne
  g''4 -\harmonic
}
\new Voice {
  \voiceOne
  c'4
}
  >>
}

It seem crossStaff doesn't support this. But OTOH it may be simple to
calculate the lower stem's length in this case (as opposed to real cross
staff where you don't know the staff distance).

Urs

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: alternative notehead style breaks cross-staff stem

2016-11-14 Thread Urs Liska


Am 14.11.2016 um 14:43 schrieb Urs Liska:
> The next step would be to have two notes connect their stems when *not*
> in different staves, e.g.

Never mind, I have found out how to generate my stuff as a chord.

Urs
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: alternative notehead style breaks cross-staff stem

2016-11-14 Thread Urs Liska


Am 14.11.2016 um 14:43 schrieb Urs Liska:
>
> Am 13.11.2016 um 21:44 schrieb Thomas Morley:
>> 2016-11-13 15:45 GMT+01:00 Urs Liska :
>>> Hi all,
>>>
>>> I'm trying to build something like similar to an automated harmonic
>>> display on two staves, and it seems that alternative note head styles
>>> break the cross staff stems:
>>>
>>> ...
>> Hi Urs,
>>
>> cross-staff Stems are only printed if certain conditions are fullfilled.
>> One of them is the Stem's left edge are within a range 0.001
>> -> `close-enough?' in music-functions.scm
>>
>> In a recent thread I developed `pushNC' to force the Stems doing so.
>> http://lists.gnu.org/archive/html/lilypond-user/2016-11/msg00230.html
>>
>> Works here as well:
>>
>> ...
>>
>> HTH,
>>   Harm
> Thank you, this indeed works well for my purpose, I'll soon share the
> results.
>
> The next step would be to have two notes connect their stems when *not*
> in different staves, e.g.
>
> \new Staff {
>   <<
> {
>   \voiceOne
>   g''4 -\harmonic
> }
> \new Voice {
>   \voiceOne
>   c'4
> }
>   >>
> }
>
> It seem crossStaff doesn't support this. But OTOH it may be simple to
> calculate the lower stem's length in this case (as opposed to real cross
> staff where you don't know the staff distance).
>
> Urs

For reference and for the curious the current state of the result can be
seen here:
https://github.com/openlilylib/ji/blob/ee00de2701a5921d63237b5b40702247c7dc5183/display.ily
The package this is in is not actually usable yet as it's still a
construction site. But there will be proper example files available and
the paper for which I'm actually doing this right now.

As a first impression the attached output is generated from the
following input (using the package) (note that the constant change of
display options is not what one would do in real-world scores but
intends to show how the output con easily be configured and reconfigured):

\score {
  <<
\new PianoStaff <<
  \new Staff = "one" {
s1*2
  }

  \new Staff = "two"  {
\clef bass
\setOption ji.show.notehead-style #'harmonic
\setOption ji.show.ratio ##t
\setOption ji.show.cent ##t
   
\jiNote c, 2 7/1
   
\setOption ji.show.ratio ##f
\jiNote 4 6/1
   
\setOption ji.show.ratio ##t
\setOption ji.show.cent ##f
\setOption ji.conf.use-cross-staff ##f
\jiNote 5/1
   
\change Staff = "one"
   
\jiNote c' 2 7/4
   
\setOption ji.show.cent ##t
\setOption ji.show.ratio ##f
\jiNote d' 3/2
  }
>>
  >>
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user