Re: Supress cross-system tuplet courtesy text?

2021-04-19 Thread Michael Blankenship
  
Brilliant, as usual. And removing the "not" creates the opposite effect, 
putting the text on the far side of the \break.
  
​Even works on Horizontal Brackets.
  
​
  
​Thanks Harm!
  
​
  
​
  
​
  
​
  
​
  
  
On Apr 19 2021, at 6:05 pm, Thomas Morleywrote:
  
>   
>   
> Am Mo., 19. Apr. 2021 um 17:18 Uhr schrieb Michael Blankenship
>   
> :
>   
> >
>   
> >  I'm wondering if anyone knows a way to stop the tuplet engraver from 
> > reprinting the "number" (which in this case is really a string) when the 
> > tuplet (which is really an analysis bracket) is split over a system break?
>   
> >  It would very helpful to be able to use both horizontal brackets and 
> > tuplet brackets with different formatting settings for parallel analysis.
>   
> >  The tiny example of what I'm using now looks like this:gClass =
>   
> >
>   
> >  #(define-music-function
>   
> >
>   
> >(string note)
>   
> >
>   
> >(string? ly:music?)
>   
> >
>   
> >  #{
>   
> >
>   
> >  \tweak TupletNumber.text #string
>   
> >
>   
> >  \tuplet 1/1
>   
> >
>   
> >  #note
>   
> >
>   
> >  #})
>   
> >
>   
> >  Anyone got any ideas? the ouput currently looks like this:
>   
> >  Thanks!
>   
> >  Michael
>   
>   
> Not sure I understood correctly, does below help?
>   
>   
> \version "2.23.2"
>   
>   
> {
>   
>\override TupletNumber.after-line-breaking =
>   
>#(lambda (grob)
>   
>  (if (not-first-broken-spanner? grob)
>   
>  (ly:grob-set-property! grob 'stencil '(
>   
>   
>\tuplet 1/1 {
>   
>b1
>   
>\break
>   
>b
>   
>b
>   
>}
>   
> }
>   
>   
> Cheers,
>   
>Harm
>   
>   
 

Re: Supress cross-system tuplet courtesy text?

2021-04-19 Thread Thomas Morley
Am Mo., 19. Apr. 2021 um 17:18 Uhr schrieb Michael Blankenship
:
>
> I'm wondering if anyone knows a way to stop the tuplet engraver from 
> reprinting the "number" (which in this case is really a string) when the 
> tuplet (which is really an analysis bracket) is split over a system break?
> It would very helpful to be able to use both horizontal brackets and tuplet 
> brackets with different formatting settings for parallel analysis.
> The tiny example of what I'm using now looks like this:gClass =
>
> #(define-music-function
>
>(string note)
>
>(string? ly:music?)
>
> #{
>
> \tweak TupletNumber.text #string
>
> \tuplet 1/1
>
> #note
>
> #})
>
> Anyone got any ideas? the ouput currently looks like this:
> Thanks!
> Michael

Not sure I understood correctly, does below help?

\version "2.23.2"

{
  \override TupletNumber.after-line-breaking =
  #(lambda (grob)
 (if (not-first-broken-spanner? grob)
 (ly:grob-set-property! grob 'stencil '(

  \tuplet 1/1 {
  b1
  \break
  b
  b
  }
}

Cheers,
  Harm



Re: lilypond-user Digest, Vol 221, Issue 56

2021-04-19 Thread Federico Sarudiansky
Dear Harm,

wow! I've never seen such display of sheer coding virtuosity! I can spend
years trying to understand what you have done. Thank you very much and
hope to see this implemented in some release soon. I will apply in my
typesettings and if something strange happens -I don't think so-, I'll
write to you.

Thanks again,

F.




> -- Forwarded message --
> From: Thomas Morley 
> To: Lukas-Fabian Moser 
> Cc: Federico Sarudiansky , lilypond-user <
> lilypond-user@gnu.org>
> Bcc:
> Date: Sun, 18 Apr 2021 17:53:09 +0200
> Subject: Re: Chromatic clashes
>
>
> Am Sa., 17. Apr. 2021 um 14:15 Uhr schrieb Lukas-Fabian Moser  >:
>
>> Hi Federico,
>> Am 17.04.21 um 01:10 schrieb Federico Sarudiansky:
>>
>> Hi,
>>
>> in addition to that, I've on occations had to engrave
>> [image: image.png]
>>
>> Yes, that would have been the follow-up to my question: This is even
>> worse, for LilyPond turns
>>
>> \version "2.22.0"
>>
>> {  }
>>
>> into
>>
>> But there are interesting snippets and postings for that:
>>
>>
>> https://lilypond.org/doc/v2.22/Documentation/snippets/chords.html#chords-displaying-complex-chords
>> https://lists.gnu.org/archive/html/lilypond-user/2012-07/msg00336.html
>> https://archiv.lilypondforum.de/index.php/topic,1176.msg6932.html#msg6932
>>
>> In particular, Harm's coding in the third link (although marked for
>> version 2.16.0) still compiles with 2.22
>>
>> Lukas
>>
>>
>> Somewhere on the list there might be a newer coding of mine.
> Anyway, I took the opportunity to rework it.
> See attached.
> I'm pretty sure there are still bugs in it, please report them here on the
> list.
>
> Cheers,
>   Harm
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


Re: Leadsheet for voice and ukulele

2021-04-19 Thread Valentin Petzel
Hello Helge,

First at all congratulations for your first score.

→ The no string for pitch warnings come from Lilypond not knowing you have an 
Ukulele. Lilypond takes the Fretboard configurations for a chord from a table, 
which by default has guitar chords. The error just says that there are notes 
for which no strings exist to play them. Use
\include "predefined-ukulele-fretboards.ly"
To include the default set of Ukulele chords, or create your own table.

→ The only real way to do the sus thing would be changing the 
chordNameFunction. It wouldn’t be particularly hard to change the current 
implementation to take a Context Property to specify this text.

→ For the distance: If you place the Lyrics into a Lyrics context, you can 
specify the padding to the related Staff (i.e. The staff that contains the 
melody) and unrelated Staves. So you can do a
 \new Lyrics \with {
\override VerticalAxisGroup.nonstaff-unrelatedstaff-spacing.padding = #4
 } \lyricsto "music" { \verseIII }

Note that for this to work you need to Name the Voice that contains the notes, 
so that the lyrics can be aligned to them.

→ You should use -- for hyphens in lyrics to get proper hyphenation. Use __ to 
get malisma lines.

Also your lyrics are distributed weirdly. I’ve modified your score a bit, but 
I do not know how the last stanza ist supposed to be distributed.

Cheers,
Valentin\version "2.22"

\include "deutsch.ly"

\include "predefined-ukulele-fretboards.ly"




\header {
  title = "SCARBOROUGH FAIR"
  composer = "Traditional"
}

global = {
  \key c \major
  \time 3/4
}

chordNames = \chordmode {
  \global
  d2.:m
  s
  c4. c8:sus4 c4
  d2:m c4:6
  d2:m c4:6

  f2.
  d:m
  s4 g s
  a2.
  s2 a4:sus4
  d2.:m
  f
  s
  c4 f c
  f c2
  d2.:m
  c2 c4:sus4
  a4:m a:sus4 a:m
  d2:m c4:6
  d2.:m
}

melody = \relative c' {
  \global
  \once \tieDashed
  \set melismaBusyProperties = #'()
  d4~ d d4 |
  \unset melismaBusyProperties
  a'4 4 4 |
  \set melismaBusyProperties = #'()
  \once\slurDashed
  e4.( f8) e4 |
  \unset melismaBusyProperties
  d2. ~
  d |
  \break
  r4 a' c |
  d2 c4 |
  a h g |
  a2. ~
  a2 d4 |
  \break
  d2 4 |
  c2 a4 |
  a g f |
  e8 d c2 ~ |
  c2. |
  \break
  d2 a'4 |
  g2 f4 |
  e d c |
  d2. ~ d
  \bar "|."

}

verse = \lyricmode {
  Are _ you go -- ing to
  Scar -- bo -- rough Fair? __
  Pars -- ley, sage, rose -- ma -- ry and thyme. __
  Re -- mem -- ber me to one who lives there, __ _ _
  she once was a true love of mine.
}

verseII = \lyricmode {
  
  Tell her to make me a cam -- _ bric shirt __
  Pars -- ley, sage, rose -- ma -- ry, and thyme. __
  With -- out no seams nor nee -- _ dle work, __ _ _
  then she'll be a true love of mine.
}

verseIII = \lyricmode {
  Tell her to find me an a -- cre of land __
  Pars -- ley, sage, rose -- ma -- ry and thyme. __
  Be -- tween the salt wa -- ter and the sea strands
  then she'll be a true love of mine.
}

rythm = {
  \improvisationOn
  \stemDown
  c4\downbow 8\downbow 8\upbow 8[\downbow 8]\upbow |
  4\downbow 8\downbow 8\upbow 4\downbow |
  4 8 8 4 |
  4 8 8 8[ 8] |
  4 8 8 8[ 8] |

  4 8 8 8[ 8] |
  4 8 8 4 |
  4 4 4 |
  4 8 8 8[ 8] |
  4 8 8 4 |

  4 8 8 8[ 8] |
  4 8 8 8[ 8] |
  4 4 4
  4 8 8 8[ 8] |
  4 4 4 |

  4 8 8 8[ 8] |
  4 8 8 8[ 8] |
  4 4 4 |
  4 8 8 8[ 8] |
  2.
}

leadSheetPart = <<
  \new ChordNames \chordNames
  \new FretBoards {
\set Staff.stringTunings = #ukulele-tuning\chordNames  }
  \new Staff \new Voice="music" { \melody }
  \addlyrics { \verse }
  \addlyrics { \verseII }
  \new Lyrics \with {
\override VerticalAxisGroup.nonstaff-unrelatedstaff-spacing.padding = #4
  } \lyricsto "music" { \verseIII }
  \new RhythmicStaff { \rythm }
>>

%%{
\score {
  <<
\leadSheetPart
  >>
  \layout { }
}
%}

%%{
\score {
  <<
\transpose d a, \leadSheetPart
  >>
  \layout { }
}
%}


signature.asc
Description: This is a digitally signed message part.


Re: Cross-staff slurs

2021-04-19 Thread Valentin Petzel
Hello Jacques,

Yes, this is possible. It’s just that Lilypond thinks that a slur of that 
shape would not look good in that place. You can change the scoring parameters 
Lilypond uses for determining how ugly a slur looks.

For example you can increase Slur.details.edge-attraction-factor to increase 
the penalty for edge points that are very far away from the anchor points. 
Note that this results in a rather ugly shape, so you’ll have to tweak other 
parameters of the slur.

I suggest using the height-limit property (determines how high the slur might 
be), the ratio property (determines how quickly that height is reached) and 
eccentricity (moves the highest point to left or to the right).

I’ve appended an example of values that might look good for your example.

Regards,
Valentin\version "2.22"

\new PianoStaff <<

  \new Staff = "right" {
\once\override Slur.details.edge-attraction-factor = #1000
\once\override Slur.eccentricity = #-3.5
\once\override Slur.height-limit = #7
\once\override Slur.ratio = #0.15
e'''2 (
\change Staff = "left"

a,,4 ) % this slur does not end in the second stave
\change Staff = "right"

b''8 r |
  }
  
  \new Staff = "left" {
\clef bass
s1
  }
  
>>


signature.asc
Description: This is a digitally signed message part.


Re: Cross-staff slurs

2021-04-19 Thread Jacques Menu
Hello Jean,

Thanks a lot!

JM

> Le 19 avr. 2021 à 08:59, Jean Abou Samra  a écrit :
> 
> 
> Le 19/04/2021 à 07:47, Jacques Menu a écrit :
>> Hello folks,
>> 
>> MusicXML has the concept of a slur to a note in another staff, and 
>> MusicScore provides this feature.
>> The simple attempt, first attached image, doesn’t produce a satisfactory 
>> result.
>> 
>> Is there a way to obtain such a slur in LilyPond without setting control 
>> points manually, as is shown in https://lsr.di.unimi.it/LSR/Item?id=134 
>> , second attached image?
>> 
>> Thanks for your help!
>> 
>> JM
> 
> Hi Jacques,
> 
> LilyPond does support cross-staff slurs. In your example, it thinks the slur 
> is going to look ugly if crossing the staves, and chooses a less steep option.
> 
> You can increase the demerit for slurs with end points too far from the note 
> heads to force it to span the total vertical interval between the heads:
> 
> \new PianoStaff <<
>   \new Staff = "right" {
> \override Slur.details.edge-attraction-factor = 1000
> e'''2(
> \change Staff = "left"
> a4)
> \change Staff = "right"
> b''8 r |
>   }
>   \new Staff = "left" {
> \clef bass
> s1
>   }
> >>
> 
> See:
> 
> http://lilypond.org/doc/v2.22/Documentation/internals/slur_002dinterface
> 
> Cheers,
> Jean
> 




Re: Center align Bar numbers to first note in first measures on new lines

2021-04-19 Thread Jean Abou Samra


Le 18/04/2021 à 20:16, F M a écrit :

Thank you
*Correction*​

Currently, I have bar numbers _aligned to the right of the key 
signatures_.


This is what I have at the moment:

MvmntIVoiceI = {
\override Score.BarNumber.font-size = #0.2
\override Score.BarNumber.font-series = #'bold
\override Score.BarNumber #'break-align-symbols = #'(key-signature 
staff-bar clef)

\override Score.Clef #'break-align-anchor-alignment = #RIGHT
\tempo "Allegro"
\stemUp

fis''4 r8 fis'' e'' fis'' g''4\AutoBarline
         fis'' r8 fis'' e'' fis'' g''4\AutoBarline
         fis'' r8 a'' b'' a'' d''' a''\AutoBarline
         b'' a'' d''' a'' g''4 fis''\AutoBarline
%5
         e'' r8<>  \p a''8 b'' a'' d''' a''\AutoBarline
         b'' a'' d''' a'' g''4 fis''\AutoBarline
         e'' \revert Stem.direction  r4 a''16 g'' fis'' e'' d'' cis'' 
b' a'\AutoBarline

         b'8 b' b' b' b''16 a'' g'' fis'' e'' d'' cis'' b'\AutoBarline
         cis''8 cis'' cis'' cis'' cis'''16 b'' a'' g'' fis'' e'' d'' 
cis'' \AutoEndMovementBarline}


Note, I am using Denemo software.



Hello,

Here is a potential way to achieve this layout:


\version "2.23.3"

#(define fake-musical-when-first
   (grob-transformer 'after-line-breaking
 (lambda (bar-number dummy)
   (let* ((sys (ly:grob-system bar-number))
  (columns (ly:grob-object sys 'columns))
  (break-alignment (ly:grob-parent bar-number X))
  (bar-number-column (ly:grob-parent break-alignment X))
  (first-column (ly:grob-array-ref columns 0))
  (first-musical-column (ly:grob-array-ref columns 1))
  (is-first (eq? bar-number-column first-column)))
 (if is-first
 (let ((refpoint (ly:grob-common-refpoint bar-number 
first-musical-column X)))

   (ly:grob-translate-axis!
 bar-number
 (- (ly:grob-relative-coordinate first-musical-column 
refpoint X)

    (ly:grob-relative-coordinate bar-number refpoint X))
 X)))

\layout {
  \context {
    \Score
    \override BarNumber.after-line-breaking = #fake-musical-when-first
    \override BarNumber.break-visibility = ##(#f #t #t)
    \override BarNumber.outside-staff-priority = 1000
  }
}


<<
  {
    c'1
    \break
    4^"Marcato" e' f' g'
    a' b' c' d'
    \break
    g' g' g' g'
  }
  {
    c'1
    1
    1
    1
  }
>>


Regards,
Jean



Re: Cross-staff slurs

2021-04-19 Thread Jean Abou Samra



Le 19/04/2021 à 07:47, Jacques Menu a écrit :

Hello folks,

MusicXML has the concept of a slur to a note in another staff, and 
MusicScore provides this feature.
The simple attempt, first attached image, doesn’t produce a 
satisfactory result.


Is there a way to obtain such a slur in LilyPond without setting 
control points manually, as is shown in 
https://lsr.di.unimi.it/LSR/Item?id=134 
, second attached image?


Thanks for your help!

JM


Hi Jacques,

LilyPond does support cross-staff slurs. In your example, it thinks the 
slur is going to look ugly if crossing the staves, and chooses a less 
steep option.


You can increase the demerit for slurs with end points too far from the 
note heads to force it to span the total vertical interval between the 
heads:


\new PianoStaff <<
  \new Staff = "right" {
    \override Slur.details.edge-attraction-factor = 1000
    e'''2(
    \change Staff = "left"
    a4)
    \change Staff = "right"
    b''8 r |
  }
  \new Staff = "left" {
    \clef bass
    s1
  }
>>

See:

http://lilypond.org/doc/v2.22/Documentation/internals/slur_002dinterface

Cheers,
Jean