bug in lyric syllable magnetic snap

2019-05-16 Thread Alexander Kobel

Hi David, hi Mike, hi all,

I sometimes (still use Lilypond, and when I do, I typically use) your 
wonderful snippet for snapping "close" syllables into a single token.


(For those who don't know this contribution: it's meant to get rid of 
unpleasant thin-space gaps between syllables in cramped conditions, when 
LyricHyphens are not shown, but there's a "kerning" problem due to the 
fact that syllables are engraved as separate entities.)


Now I stumbled across an issue with that: two syllables are combined 
which are clearly far apart; see the attached screenshot and reduced 
working example from an actual engraving. It's not exactly minimal, but 
at least it's reasonably short and shows the problem. And the exact 
circumstances when the bug occurs are not clear to me, and it's somewhat 
sensitive to reduction.


According to my tests, it's related to the facts that there is

(1) a hyphen *before* the syllable "bor" in "ver -- bor -- gen" in the 
alto part;


(2) a line break exactly there (moving the break "remedies" the 
problem); and


(3) another voice/staff simultaneously (commenting out the soprano 
mitigates the issue as well).


It's not, however, related to the accidental in the soprano, or the fact 
that the whole note in the lower voice is wider than the quarter in the 
upper voice (replacing d'1 by d'4*4 doesn't help).



Any thoughts on what goes wrong here, and about a possible fix or 
workarounds?



[ In case you wonder: it's an excerpt of Heinrich Schütz' "Die Himmel 
erzählen", converted from James Gibb's contribution 46745 to CPDL 
(engraved in Capella) via musicxml2ly. I mainly want to fix a couple of 
minor spelling errors; the conversion worked fairly pleasant in general. ]



Cheers,
Alex
\version "2.18.0" % absolutely necessary!

\header {
  snippet-title = "Magnetic snapping lyric syllables"
  snippet-author = "David Nalesnik and Mike Solomon,"
  snippet-source = 
"http://lists.gnu.org/archive/html/lilypond-user/2014-03/msg00489.html";
  snippet-description = \markup {
This snippet handles lyric syllables that belong to one word together
and ensures that there are no irritating gaps between them (solves issue 
2458).
  }
  % add comma-separated tags to make searching more effective:
  tags = "lyrics, syllable, gap, hyphen"
  % is this snippet ready?  See meta/status-values.md
  status = "undecided"
}

%%
% here goes the snippet: %
%%

% ADD NEW GROB INTERFACE %%

#(ly:add-interface
  'lyric-word-interface
  "A word of lyrics. Includes syllables and hyphens."
  '(text-items))

%%%

% CREATE NEW GROB PROPERTY 

#(define (define-grob-property symbol type? description)
   (if (not (equal? (object-property symbol 'backend-doc) #f))
   (ly:error (_ "symbol ~S redefined") symbol))

   (set-object-property! symbol 'backend-type? type?)
   (set-object-property! symbol 'backend-doc description)
   symbol)

#(map
  (lambda (x)
(apply define-grob-property x))

  `(
 (text-items ,list? "Syllables and hyphens of a word of lyrics")))

%%%

 ADD DEFINITION OF GROB %%%

#(define (add-grob-definition grob-name grob-entry)
   (let* ((meta-entry   (assoc-get 'meta grob-entry))
  (class(assoc-get 'class meta-entry))
  (ifaces-entry (assoc-get 'interfaces meta-entry)))
 (set-object-property! grob-name 'translation-type? ly:grob-properties?)
 (set-object-property! grob-name 'is-grob? #t)
 (set! ifaces-entry (append (case class
  ((Item) '(item-interface))
  ((Spanner) '(spanner-interface))
  ((Paper_column) '((item-interface
 paper-column-interface)))
  ((System) '((system-interface
   spanner-interface)))
  (else '(unknown-interface)))
  ifaces-entry))
 (set! ifaces-entry (uniq-list (sort ifaces-entry symbol (interval-length hyphen-ex) threshold)
 '() ; no compression--DO NOTHING!

 (let*
  ((syl-a-text (ly:grob-property syl-a 'text))
   (syl-a-text (if (markup? syl-a-text) syl-a-text (markup syl-a-text)))
   (syl-b-text (ly:grob-property syl-b 'text))
   (syl-b-text (if (markup? syl-b-text) syl-b-text (markup syl-b-text)))
   (full-text (make-concat-markup (list syl-a-text syl-b-text

  (set! (ly:grob-property syl-a 'text) full-text)
  (set! (ly:grob-property syl-b 'text) empty-markup)
  (set! (ly:grob-property syl-a 'stencil) lyric-

Re: Pitched Trill: two notes on the same parenthesis

2019-05-16 Thread Andrew Bernard
Hi Stefano,

I think this has been an enhancement request since 2008. I have no idea if
it has ever been implemented,

Sorry I cannot be more helpful.

Andrew


On Thu, 16 May 2019 at 13:28, Stefano Troncaro 
wrote:

> Hello everyone, is there a way to have two notes one the same parenthesis
> in a pitched tril?
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Predicting accidentals

2019-05-16 Thread Leo Correia de Verdier
This looks like it’s working, but doesn’t give the expected results (the second 
c-sharp is shown as having an accidental while the following c is shown 
without).

Can you find any misstakes in it (either writing misstakes or how its thought)?

\version "2.19.82"

printAcc = #(define-music-function (note) (ly:music?)
  (let* ((pitch (ly:music-property note 'pitch))
 (autoacc 0)
 (staff-context 0))
#{
  \context Staff \applyContext
  #(lambda (context)
 (begin
  (set! autoacc (cadr (ly:context-property context 
'autoAccidentals)))
  (set! staff-context context)))
  \context Timing  \applyContext
  #(lambda (timing-context)
 (let* ((barnum (ly:context-property timing-context 
'currentBarNumber))
(measurepos (ly:context-property timing-context 
'measurePosition)))
   (pretty-print (autoacc staff-context pitch barnum 
measurepos
  #note
#}
))

\fixed c' {
  \printAcc cis4
  \printAcc cis
  \printAcc c
}


> 7 maj 2019 kl. 12:13 skrev Leo Correia de Verdier 
> :
> 
> Dear list!
> 
> Is there a way to run the functions in autoAccidental before they would 
> normally be evaluated, to see beforehand if a note would get an accidental?
> 
> What I would like iso do is a function that in some cases (depending on other 
> circumstances in code) forces an accidental with a tweak, but only on notes 
> that doesn’t already have one.
> 
> Thanks a lot for your help! Your’e doing a great work!


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


Difficulty with a missing tie

2019-05-16 Thread Michael Welsh Duggan
In the following snippet I run into the problem that the c1 ~ c tie is
not recognized.  Does anyone have any idea how I should do this instead?

\version "2.21.0"
\include "english.ly"

{
  \new PianoStaff \with {
\consists #Span_stem_engraver
  } 
  <<
\new Staff = "up" {
  r2. << {a'4 ~ }
 \context Staff = "down" \crossStaff {\stemUp a ~} >>
  << a'1 \context Staff = "down" \crossStaff {a} >>
}
\new Staff = "down" {
  \clef bass
  c1 ~ c
}
  >>
}


-- 
Michael Welsh Duggan
(m...@md5i.com)
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Difficulty with a missing tie

2019-05-16 Thread Pierre Perol-Schneider
Hi Michael,
See: http://lsr.di.unimi.it/LSR/Item?id=770
e.g.:

\version "2.21"
\include "english.ly"


{
  \new PianoStaff <<
\new Staff = "up" {
  r2. a'4 ~ 1
}
\new Staff = "down" {
  \clef bass
   <<
 {
  \override Stem.cross-staff = ##t
  \override Stem.length = #19
   s2. a4_~ 1 }
 \\ { c1 ~ 1 } >>
}
  >>
}

Cheers,
Pierre


Le jeu. 16 mai 2019 à 21:01, Michael Welsh Duggan  a écrit :

> In the following snippet I run into the problem that the c1 ~ c tie is
> not recognized.  Does anyone have any idea how I should do this instead?
>
> \version "2.21.0"
> \include "english.ly"
>
> {
>   \new PianoStaff \with {
> \consists #Span_stem_engraver
>   }
>   <<
> \new Staff = "up" {
>   r2. << {a'4 ~ }
>  \context Staff = "down" \crossStaff {\stemUp a ~} >>
>   << a'1 \context Staff = "down" \crossStaff {a} >>
> }
> \new Staff = "down" {
>   \clef bass
>   c1 ~ c
> }
>   >>
> }
>
>
> --
> Michael Welsh Duggan
> (m...@md5i.com)
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Difficulty with a missing tie

2019-05-16 Thread Thomas Morley
Am Do., 16. Mai 2019 um 21:01 Uhr schrieb Michael Welsh Duggan :
>
> In the following snippet I run into the problem that the c1 ~ c tie is
> not recognized.  Does anyone have any idea how I should do this instead?
>
> \version "2.21.0"
> \include "english.ly"
>
> {
>   \new PianoStaff \with {
> \consists #Span_stem_engraver
>   }
>   <<
> \new Staff = "up" {
>   r2. << {a'4 ~ }
>  \context Staff = "down" \crossStaff {\stemUp a ~} >>
>   << a'1 \context Staff = "down" \crossStaff {a} >>
> }
> \new Staff = "down" {
>   \clef bass
>   c1 ~ c
> }
>   >>
> }

Probably:

\new PianoStaff
  \with {
\consists #Span_stem_engraver
  }
  <<
\new Staff = "up" {
  r2.
  <<
{ a'4^~ a'1 }
  \context Staff = "down"
%% probably unneeded:
\context Voice = "downUp"
  \crossStaff { a4_~ a1 }
  >>
}
\new Staff = "down"
  <<
\new Voice = "downUp" {
  \voiceOne s1*2
}
\new Voice = "downDown" {
  \clef bass
  \voiceTwo
  c1 ~ c1
}
  >>
  >>


Cheers,
  Harm

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


tie four 8 note to 4 chord

2019-05-16 Thread MING TSANG


I try to transcribe the above image.
Question: is this  normal / standard score?
The below code is my attempt: %code  \key a\major  \clef bass  \time 3/4   d8~ 
f~ gs~ b~ 4 |}%endThe result and log:


Thanks,Ming

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


Re: tie four 8 note to 4 chord

2019-05-16 Thread Andrew Bernard
Hi Ming,

\set tieWaitForNote = ##t

It's in the Notation Reference manual.

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


Re: Difficulty with a missing tie

2019-05-16 Thread Michael Welsh Duggan
Pierre Perol-Schneider  writes:

> See: http://lsr.di.unimi.it/LSR/Item?id=770
> e.g.:
>
> \version "2.21"
> \include "english.ly"
>
>
> {
>   \new PianoStaff <<
> \new Staff = "up" {
>   r2. a'4 ~ 1
> }
> \new Staff = "down" {
>   \clef bass
><<
>  {
>   \override Stem.cross-staff = ##t
>   \override Stem.length = #19
>s2. a4_~ 1 }
>  \\ { c1 ~ 1 } >>
> }
>   >>
> }

Thank you.  That would work, but I'm not fond of the change in
semantics.  It's more of a graphical tweak than the solution I am
looking for.

-- 
Michael Welsh Duggan
(m...@md5i.com)


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


Re: Difficulty with a missing tie

2019-05-16 Thread Michael Welsh Duggan
Thomas Morley  writes:

> Am Do., 16. Mai 2019 um 21:01 Uhr schrieb Michael Welsh Duggan 
> :
>>
>> In the following snippet I run into the problem that the c1 ~ c tie is
>> not recognized.  Does anyone have any idea how I should do this instead?
>>
>> \version "2.21.0"
>> \include "english.ly"
>>
>> {
>>   \new PianoStaff \with {
>> \consists #Span_stem_engraver
>>   }
>>   <<
>> \new Staff = "up" {
>>   r2. << {a'4 ~ }
>>  \context Staff = "down" \crossStaff {\stemUp a ~} >>
>>   << a'1 \context Staff = "down" \crossStaff {a} >>
>> }
>> \new Staff = "down" {
>>   \clef bass
>>   c1 ~ c
>> }
>>   >>
>> }
>
> Probably:
>
> \new PianoStaff
>   \with {
> \consists #Span_stem_engraver
>   }
>   <<
> \new Staff = "up" {
>   r2.
>   <<
> { a'4^~ a'1 }
>   \context Staff = "down"
> %% probably unneeded:
> \context Voice = "downUp"
>   \crossStaff { a4_~ a1 }
>   >>
> }
> \new Staff = "down"
>   <<
> \new Voice = "downUp" {
>   \voiceOne s1*2
> }
> \new Voice = "downDown" {
>   \clef bass
>   \voiceTwo
>   c1 ~ c1
> }
>   >>
>   >>

Thank you.  That led me to a working solution, which was creating a new
voice for the tied notes in the bass line.

-- 
Michael Welsh Duggan
(m...@md5i.com)


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


Initial (but only initial) staff hiding

2019-05-16 Thread Michael Welsh Duggan
Here's the situation: I have a keyboard and vocal score that I am
typesetting.  I want the VocalStaff group not to begin until the system
with the first non-rest (interesting) event, but after that I want all
staff in the staffgroup to always exist, regardless of notes or lack
thereof.

I figured out how to tie the vocal staffs together using the
Keep_alive_together_engraver, but I can't use \RemoveAllEmptyStaves,
since that also will remove systems that contain only rests after the
first vocal note.  I tried a few things like setting
VerticalAxisGroup.remove_empty to ##f after the first note, but I
couldn't get that to work.  Can anyone suggest how I can do what I want
here?

-- 
Michael Welsh Duggan
(m...@md5i.com)


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


Re: Initial (but only initial) staff hiding

2019-05-16 Thread Kieren MacMillan
Hi Michael,

> I want the VocalStaff group not to begin until the system
> with the first non-rest (interesting) event, but after that I want all
> staff in the staffgroup to always exist, regardless of notes or lack thereof.

showMMRs = {
  \set Staff.keepAliveInterfaces =
#'( rhythmic-grob-interface
multi-measure-rest-interface
lyric-interface
stanza-number-interface
percent-repeat-interface) }

Once there’s something interesting, put \showMMRs to force the staff to show no 
matter what.

Hope that helps!
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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