Re: Font kerning

2022-02-15 Thread Joel C. Salomon

On 2/14/22 11:57, Francesco Napoleoni wrote:

In data lunedì 14 febbraio 2022 00:19:11 CET, Joel C. Salomon ha scritto:

I wonder whether you’re using the wrong symbol, and using the correct
one might help a little.  Your code is using the degree sign “°” U+B0,
when by context this should probably be the masculine ordinal indicator
“º” U+BA.


Yes, I know that there are more appropriate symbols, but I have to conform as
much as possible to the original layout, which uses superscript “o”
everywhere. Indeed this makes sense since the little “o” is the last letter of
every abbreviated word: “Violin_o_ prim_o_” and “Violin_o_ second_o_”, so I
ended up writing something like this (inside \markup):

\concat { "V." \hspace #-0.4 \normal-size-super o "I." \hspace #-0.6 \normal-
size-super o }

which produces an output very similar to the original.


Of course, what it means to “conform as much as possible to the original 
layout” is the question at hand.  If purely visual, your code is 
correct; if purely semantic, “vº1º”/“vº2º” is correct (however the font 
displays that); if both together, then a font with appropriate letter 
and numeral forms is needed.


―Joel




Improving this "Markup anywhere" snippet

2022-02-15 Thread Colin Baguley
I wonder whether any of you Lilypond wizards could help me work out how to
improve my Lilypond scores.
Most of my embellishments come from reading/copying bits of code from this
forum - but I admit I don't always fully understand why things work.
However, I have this 'snippet' which I call "Markup anywhere", which
basically allows a markup to be added without disrupting any of the
positioning of other items.
What I would like is to know how it can be improved - so that I can use it
without copying large chunks of code whenever it is required. The amended
markup is demonstrated here:-

c1^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)
\translate #'(-10.0 . -4.0)
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "LimeGreen")
\box \box \whiteout
  "Put your text here"

Could this be streamlined and generalised somehow, and yet still be able to
accept various variable to alter position/colour etc

I've attached a lilypond file which demonstrates what I mean.

Just as a side note - why does the \whiteout not work perfectly?

Thank you for reading this and I appreciate any thoughts, amendments, and
suggestions.

Colin Baguley
\version "2.22.1"

\header {
  title = "Please improve this"
}
global = {
  \time 4/4
  \key c \major
}

melody = \relative c'' {
  \global
c4 d e 
f^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)  
\translate #'(-10.0 . -4.0)% LEFT/RIGHT  UP/DOWN 
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "LimeGreen")
\box \box \whiteout
  "This markup can be placed anywhere without affecting any other placement" }
| g f e d | c b a2 | c4 d e f | g f e d | c b 
a2^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)  
\translate #'(0.0 . -4.5)% LEFT/RIGHT  UP/DOWN 
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "red")
\box \whiteout
  "But I'm sure the code be improved - and yet still allow variables in position/colour etc" }
c4 d e f | g f e d | c b a2  c4 d e f | g f e d
 c^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)  
\translate #'(-10.0 . -6.0)% LEFT/RIGHT  UP/DOWN 
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "Blue")
   \whiteout
  "you can see I'm copy & pasting big chunks of code, and altering it a bit"}
b a2 c4 d e f | g f e d | 
c_\markup {\italic \bold \box {\column
	  {
	  \line {an ordinary markup}
	  \line {pushes my lyric line}
	  \line {down}
	  } } }
b a2 c4 d 
e^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)  
\translate #'(-10.0 . -8.0)% LEFT/RIGHT  UP/DOWN 
\override #'(font-name ."Tahoma bold italic")
\fontsize #-2 \with-color #(x11-color "brown")
   \whiteout
  "but this allows me to put odd comments in without moving anything else"} 
\f f,  \p g f e d | c \ff b \ppp a2 
}

words = \lyricmode {
  \repeat unfold 6 { one two three four five six se -- ven eight nine ten}
}

\score {
  <<
\new Staff { \melody }
\addlyrics { \words }
  >>
  \layout { }
}


Re: Improving this "Markup anywhere" snippet

2022-02-15 Thread Lukas-Fabian Moser

Hi Colin,

I wonder whether any of you Lilypond wizards could help me work out 
how to improve my Lilypond scores.
Most of my embellishments come from reading/copying bits of code from 
this forum - but I admit I don't always fully understand why things 
work. However, I have this 'snippet' which I call "Markup anywhere", 
which basically allows a markup to be added without disrupting any of 
the positioning of other items.
What I would like is to know how it can be improved - so that I can 
use it without copying large chunks of code whenever it is required. 
The amended markup is demonstrated here:-


c1^\markup { \null \with-dimensions #'(0 . 0) #'(0 . 0)
                \translate #'(-10.0 . -4.0)
                \override #'(font-name ."Tahoma bold italic")
                \fontsize #-2 \with-color #(x11-color "LimeGreen")
                \box \box \whiteout
              "Put your text here"

Could this be streamlined and generalised somehow, and yet still be 
able to accept various variable to alter position/colour etc
\null \with-dimensions ... seems strange: \null produces an empty 
markup, and _then_ the actual command begins. So you can simplify to


\markup \with-dimensions-from \null \translate .


Just as a side note - why does the \whiteout not work perfectly?


For the whiteout, try specyfing

\override TextScript.layer = 1000

in the music or in the \layout { } block to make sure that text scripts 
are put in the foreground and do not lie under other layout objects.


Does this help already?

Lukas





Re: Gracenote accidental placement in strict-note-spacing

2022-02-15 Thread Jean Abou Samra

Le 15/02/2022 à 02:33, Knute Snortum a écrit :

I have come across what may be a bug.

Below is a tinyish example of gracenotes with strict-note-spacing.
The problem is the fis accidental.  There's not enough space for it.
(See attached picture.)

%%%
\version "2.23.6"

rightHand = \relative {
   \override Score.SpacingSpanner.strict-note-spacing = ##t
   \newSpacingSection
   g''4 \grace { a8 g fis g } a4 f
}

leftHand = \relative {
   \clef bass
   g16 16 16 16 fis16 16 16 16 f16 16 16 16
}

\score {
   \new PianoStaff <<
 \new Staff \rightHand
 \new Staff \leftHand
   >>
}
%%%

Is it a bug?  A known problem?  (I did search issues and found
nothing.)  Maybe I'm doing something incorrectly.

--
Knute Snortum




Unfortunately, SpacingSpanner options are quite buggy currently.

https://gitlab.com/lilypond/lilypond/-/issues/2630
https://gitlab.com/lilypond/lilypond/-/issues/4493
https://gitlab.com/lilypond/lilypond/-/issues/4499

There is always the good old hack of inserting
"s16" before the altered note to avoid the collision.

Best,
Jean




skip-of-length and \unfoldRepeats

2022-02-15 Thread Joel C. Salomon

… seem not to play nicely together.

―Joel

\version "2.23.6"

musicA = \fixed c'' \repeat volta 2 { c d }
musicB = \fixed c { a b }

music = {
  \musicA
  \musicB
}

dynamics = {
  <>\f
  #(skip-of-length musicA)
  <>\p
  #(skip-of-length musicB)
  %\fine
}

\score {
  \new Staff <<
  \unfoldRepeats  \music
  \unfoldRepeats  \dynamics
  >>
}



Re: skip-of-length and \unfoldRepeats

2022-02-15 Thread Valentin Petzel
Well, how should they? At the point the skip-of-length is evaluated the repeats 
are not yet unfolded. To achieve what you want we could have some mechanics 
where skip events could have an element property, and have the handling be done 
by the engraver.

Valentin

15.02.2022 20:20:02 Joel C. Salomon :

> … seem not to play nicely together.
> 
> ―Joel
> 
> \version "2.23.6"
> 
> musicA = \fixed c'' \repeat volta 2 { c d }
> musicB = \fixed c { a b }
> 
> music = {
>    \musicA
>    \musicB
> }
> 
> dynamics = {
>    <>\f
>    #(skip-of-length musicA)
>    <>\p
>    #(skip-of-length musicB)
>    %\fine
> }
> 
> \score {
>    \new Staff <<
>    \unfoldRepeats  \music
>    \unfoldRepeats  \dynamics
>    >>
> }



Re: skip-of-length and \unfoldRepeats

2022-02-15 Thread Jean Abou Samra




Le 15/02/2022 à 20:19, Joel C. Salomon a écrit :

… seem not to play nicely together.

―Joel

\version "2.23.6"

musicA = \fixed c'' \repeat volta 2 { c d }
musicB = \fixed c { a b }

music = {
  \musicA
  \musicB
}

dynamics = {
  <>\f
  #(skip-of-length musicA)
  <>\p
  #(skip-of-length musicB)
  %\fine
}

\score {
  \new Staff <<
  \unfoldRepeats  \music
  \unfoldRepeats  \dynamics
  >>
}




In recent versions, like version 2.23.6 which you are using, you can use

\skip \musicA

which is nicer syntax-wise and plays well with \unfoldRepeats.

Best,
Jean




Re: Gracenote accidental placement in strict-note-spacing

2022-02-15 Thread Knute Snortum
On Tue, Feb 15, 2022 at 10:58 AM Jean Abou Samra  wrote:
> Unfortunately, SpacingSpanner options are quite buggy currently.
>
> https://gitlab.com/lilypond/lilypond/-/issues/2630
> https://gitlab.com/lilypond/lilypond/-/issues/4493
> https://gitlab.com/lilypond/lilypond/-/issues/4499
>
> There is always the good old hack of inserting
> "s16" before the altered note to avoid the collision.

That's much better than my hack, which involved a few X-offsets.  Thanks!



Complex three-voice left hand

2022-02-15 Thread Knute Snortum
Hello again.

I am having difficulties engraving a complex three-voice lefthand
measure.  Chopin (bless his heart!) has written some "impossible" note
lengths.  I have two ways that get close to engraving the measure as
Chopin wrote it, but not quite.

Attached is the measure I want to engrave, then my two attempts, then
the input file that created the two attempts.  Any suggestions would
be appreciated.

--
Knute Snortum
\version "2.22.1"
\language "english"

voiceSix = #(context-spec-music (make-voice-props-set 5) 'Voice)

% df' doesn't connect with g
\relative {
  \time 3/4
  \key f \major
  \clef bass
  <<
{ \voiceThree df'2 * 1/2 g,4  | }
\\
{ 
  \voiceFour \override Beam.details.collision-padding = 0 
\scaleDurations 2/3 { g8 bf bf g bf bf gf a a } | 
}
\\ 
{ \voiceSix \override NoteColumn.force-hshift = 0.5 ef2 ef4 | }
  >>
}

% g is headed as a half note instead of quarter note
\relative {
  \time 3/4
  \key f \major
  \clef bass
  \mergeDifferentlyHeadedOn
  <<
{ \voiceThree 2 * 1/2 g4  | }
\\
{ 
  \voiceFour \override Beam.details.collision-padding = 0 
\scaleDurations 2/3 { g8 bf bf g bf bf gf a a } | 
}
\\ 
{ \voiceSix \override NoteColumn.force-hshift = 0.5 ef2 ef4 | }
  >>
}

Re: Complex three-voice left hand

2022-02-15 Thread Leo Correia de Verdier
You were almost there:
%%%
\relative {
  \time 3/4
  \key f \major
  \clef bass
  \mergeDifferentlyHeadedOn
  <<
{ \voiceThree <\tweak duration-log #2 g df'>2 * 1/2 g4  | }
\\
{ 
  \voiceFour \override Beam.details.collision-padding = 0 
\scaleDurations 2/3 { g8 bf bf g bf bf gf a a } | 
}
\\ 
{ \voiceSix \override NoteColumn.force-hshift = 0.5 ef2 ef4 | }
  >>
}
%
> 15 feb. 2022 kl. 21:09 skrev Knute Snortum :
> 
> Hello again.
> 
> I am having difficulties engraving a complex three-voice lefthand
> measure.  Chopin (bless his heart!) has written some "impossible" note
> lengths.  I have two ways that get close to engraving the measure as
> Chopin wrote it, but not quite.
> 
> Attached is the measure I want to engrave, then my two attempts, then
> the input file that created the two attempts.  Any suggestions would
> be appreciated.
> 
> --
> Knute Snortum
\version "2.22.1"
\language "english"

voiceSix = #(context-spec-music (make-voice-props-set 5) 'Voice)

% df' doesn't connect with g
\relative {
  \time 3/4
  \key f \major
  \clef bass
  <<
{ \voiceThree df'2 * 1/2 g,4  | }
\\
{ 
  \voiceFour \override Beam.details.collision-padding = 0 
\scaleDurations 2/3 { g8 bf bf g bf bf gf a a } | 
}
\\ 
{ \voiceSix \override NoteColumn.force-hshift = 0.5 ef2 ef4 | }
  >>
}

% g is headed as a half note instead of quarter note
\relative {
  \time 3/4
  \key f \major
  \clef bass
  \mergeDifferentlyHeadedOn
  <<
{ \voiceThree 2 * 1/2 g4  | }
\\
{ 
  \voiceFour \override Beam.details.collision-padding = 0 
\scaleDurations 2/3 { g8 bf bf g bf bf gf a a } | 
}
\\ 
{ \voiceSix \override NoteColumn.force-hshift = 0.5 ef2 ef4 | }
  >>
}> 



Re: skip-of-length and \unfoldRepeats

2022-02-15 Thread Joel C. Salomon

On 2/15/22 14:38, Valentin Petzel wrote:

15.02.2022 20:20:02 Joel C. Salomon :


… seem not to play nicely together.


Well, how should they? At the point the skip-of-length is evaluated the repeats 
are not yet unfolded. To achieve what you want we could have some mechanics 
where skip events could have an element property, and have the handling be done 
by the engraver.


In hindsight, this *is* obvious.  But I’m still only a casual user of 
the program, and have very limited experience at the Scheme level, so 
this was surprising.


―Joel



Re: skip-of-length and \unfoldRepeats

2022-02-15 Thread Joel C. Salomon

On 2/15/22 14:22, Jean Abou Samra wrote:

Le 15/02/2022 à 20:19, Joel C. Salomon a écrit :

… seem not to play nicely together.


In recent versions, like version 2.23.6 which you are using, you can use

\skip \musicA

which is nicer syntax-wise and plays well with \unfoldRepeats.


Thank you; this works.

—Joel




Re: Complex three-voice left hand

2022-02-15 Thread Valentin Petzel
Hello Knute,

the thing is that you do not have three voices, but four:
The bass, going ef2 ef4, the treble going df2 df4, the tenor going g4 g gf and 
the alto having that eigth note pattern.

See the appended file for how I’d do it (using forced hshifts, because I do not 
want to bother with finding the correct voice configuration to get some 
offsets).

Cheers,
Valentin

Am Dienstag, 15. Februar 2022, 21:09:25 CET schrieb Knute Snortum:
> Hello again.
> 
> I am having difficulties engraving a complex three-voice lefthand
> measure.  Chopin (bless his heart!) has written some "impossible" note
> lengths.  I have two ways that get close to engraving the measure as
> Chopin wrote it, but not quite.
> 
> Attached is the measure I want to engrave, then my two attempts, then
> the input file that created the two attempts.  Any suggestions would
> be appreciated.
> 
> --
> Knute Snortum

\version "2.22.1"
\language "english"

voiceSix = #(context-spec-music (make-voice-props-set 5) 'Voice)

% df' doesn't connect with g
\relative {
  \time 3/4
  \key f \major
  \clef bass
  <<
{ \voiceThree df'2 * 1/2 g,4  | }
\\
{ 
  \voiceFour \override Beam.details.collision-padding = 0 
\scaleDurations 2/3 { g8 bf bf g bf bf gf a a } | 
}
\\ 
{ \voiceSix \override NoteColumn.force-hshift = 0.5 ef2 ef4 | }
  >>
}

% g is headed as a half note instead of quarter note
\relative {
  \time 3/4
  \key f \major
  \clef bass
  \mergeDifferentlyHeadedOn
  <<
{ \voiceThree 2 * 1/2 g4  | }
\\
{ 
  \voiceFour \override Beam.details.collision-padding = 0 
\scaleDurations 2/3 { g8 bf bf g bf bf gf a a } | 
}
\\ 
{ \voiceSix \override NoteColumn.force-hshift = 0.5 ef2 ef4 | }
  >>
}

% my version
\relative {
  \time 3/4
  \key f \major
  \clef bass
  \mergeDifferentlyHeadedOn
  <<
{ \tweak NoteColumn.force-hshift #-0.057 df'2 }
\\
{ \offset Beam.positions #'(3 . 3) g,8*2/3 bf bf g bf bf \offset Beam.positions #'(3 . 3) gf a a }
\\
{ \tweak NoteColumn.force-hshift #0 g4 g  }
\\
{ \tweak NoteColumn.force-hshift #0.4 ef2 \tweak NoteColumn.force-hshift #0.4 ef4 }
  >>
}

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


Re: skip-of-length and \unfoldRepeats

2022-02-15 Thread Valentin Petzel
I’m sorry if this has come across in the wrong way. English is not my native 
language, so sometime I do not get the tone right and sound ruder than I 
intended. I did by no means indent to reprimand you for your legitimate 
question.

With the amazing Jean’s comment #skip-of-length should probably loose all use 
from a users perspective, as the \skip \music command is easier to use and 
more stable (this one basically does exactly what I said previously: It 
creates a SkipMusic event which takes the provided music as it’s element. Thus 
music functions like unfoldRepeats can still access this music as the skip is 
only created during translation (at which point all music functions are 
already evaluated)).

Cheers,
Valentin

Am Dienstag, 15. Februar 2022, 21:26:38 CET schrieb Joel C. Salomon:
> On 2/15/22 14:38, Valentin Petzel wrote:
> > 15.02.2022 20:20:02 Joel C. Salomon :
> >> … seem not to play nicely together.
> > 
> > Well, how should they? At the point the skip-of-length is evaluated the
> > repeats are not yet unfolded. To achieve what you want we could have some
> > mechanics where skip events could have an element property, and have the
> > handling be done by the engraver.
> In hindsight, this *is* obvious.  But I’m still only a casual user of
> the program, and have very limited experience at the Scheme level, so
> this was surprising.
> 
> ―Joel



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


Re: Complex three-voice left hand

2022-02-15 Thread Knute Snortum
On Tue, Feb 15, 2022 at 12:17 PM Leo Correia de Verdier
 wrote:
>
> You were almost there:
> %%%
> \relative {
>   \time 3/4
>   \key f \major
>   \clef bass
>   \mergeDifferentlyHeadedOn
>   <<
> { \voiceThree <\tweak duration-log #2 g df'>2 * 1/2 g4  | }
> \\
> {
>   \voiceFour \override Beam.details.collision-padding = 0
> \scaleDurations 2/3 { g8 bf bf g bf bf gf a a } |
> }
> \\
> { \voiceSix \override NoteColumn.force-hshift = 0.5 ef2 ef4 | }
>   >>
> }
> %

Wow, that works great and I learned something new!  Thanks!

--
Knute Snortum



Re: Complex three-voice left hand

2022-02-15 Thread Knute Snortum
Another good way to do it.  Thanks!

--
Knute Snortum


On Tue, Feb 15, 2022 at 12:44 PM Valentin Petzel  wrote:
>
> Hello Knute,
>
> the thing is that you do not have three voices, but four:
> The bass, going ef2 ef4, the treble going df2 df4, the tenor going g4 g gf and
> the alto having that eigth note pattern.
>
> See the appended file for how I’d do it (using forced hshifts, because I do 
> not
> want to bother with finding the correct voice configuration to get some 
> offsets).
>
> Cheers,
> Valentin
>
> Am Dienstag, 15. Februar 2022, 21:09:25 CET schrieb Knute Snortum:
> > Hello again.
> >
> > I am having difficulties engraving a complex three-voice lefthand
> > measure.  Chopin (bless his heart!) has written some "impossible" note
> > lengths.  I have two ways that get close to engraving the measure as
> > Chopin wrote it, but not quite.
> >
> > Attached is the measure I want to engrave, then my two attempts, then
> > the input file that created the two attempts.  Any suggestions would
> > be appreciated.
> >
> > --
> > Knute Snortum
>



Re: skip-of-length and \unfoldRepeats

2022-02-15 Thread Joel C. Salomon

On 2/15/22 14:22, Jean Abou Samra wrote:

In recent versions, like version 2.23.6 which you are using, you can use

\skip \musicA

which is nicer syntax-wise and plays well with \unfoldRepeats.


Now that I know to look for it, the definition of `\skip` in 
 
—



\skip [music] - arg (duration-or-music)
Skip over arg, which may be music or a duration.


—does describe this behavior.  But I would never have found this on my 
own.  Thank you!


—Joel



Re: skip-of-length and \unfoldRepeats

2022-02-15 Thread Werner LEMBERG


>> In recent versions, like version 2.23.6 which you are using, you
>> can use
>>
>>   \skip \musicA
>>
>> which is nicer syntax-wise and plays well with \unfoldRepeats.
> 
> Now that I know to look for it, the definition of `\skip` in
> 
> does describe this behavior.  But I would never have found this on
> my own.

OK, how did you search exactly?  Where did you look?  What have you
missed?  What did you assume?  If you can give those details it might
be possible to improve the documentation accordingly.


Werner



Re: skip-of-length and \unfoldRepeats

2022-02-15 Thread Jean Abou Samra

Le 16/02/2022 à 06:04, Werner LEMBERG a écrit :

In recent versions, like version 2.23.6 which you are using, you
can use

   \skip \musicA

which is nicer syntax-wise and plays well with \unfoldRepeats.

Now that I know to look for it, the definition of `\skip` in

does describe this behavior.  But I would never have found this on
my own.

OK, how did you search exactly?  Where did you look?  What have you
missed?  What did you assume?  If you can give those details it might
be possible to improve the documentation accordingly.



Werner, the documentation of \skip on music is a ticket
at the moment.

https://gitlab.com/lilypond/lilypond/-/issues/6245

Given that I am not surprised if people don't find it.
A docstring is not easy-to-find nor sufficient documentation.
It's just that in unstable releases it happens to
have undocumented features like that -- of course,
they should get documented before the stable release.

Jean