Re: How to lengthen stems in beamed groups

2024-06-30 Thread Knute Snortum
On Sat, Jun 29, 2024 at 6:42 PM Flaming Hakama by Elaine <
ela...@flaminghakama.com> wrote:

>
>> Hi list,
>>
>> I'm hoping someone can give me insight into how to lengthen stems in
>> beamed groups globally.
>>
>> LilyPond usually makes good assumptions and has great defaults, but in
>> this situation it fails to create good stem lengths in beamed groups.  I've
>> attached some sample code that illustrates the problem.  With the following
>> line commented out, you can see that the stems are too short
>> (stem-too-short.png):
>>
>> \override Stem.details.beamed-lengths = #'(3.5 4.1)
>>
>> With the above line uncommented, the stem lengths are better, except the
>> second measure, right hand, third beat (stem-lengths-better.png).
>>
>> My questions are these: How do I tell LilyPond what length the shortest
>> stem in a beamed group should be? (I tried playing
>> with Stem.details.beamed-minimum-free-lengths, but its behavior seemed
>> chaotic.)  And is there a better way to control stem lengths in beamed
>> groups?
>>
>> --
>> Knute Snortum
>>
>
>
> This may be too broad of a brush, since it also affects non-beamed stems.
>
>   \override Stem.length-fraction = #(magstep 1.2)
>
> But this is what I use, and I don't mind the extra-long non-breamed stems.
>

Yes, that has its advantages, thanks!   It's weird that even \override
Stem.length-fraction = #(magstep 1.0) makes the non-beamed stems too long
and that 1.1 seems the same as 1.2.


--
Knute Snortum


Re: How to get C(add9)???

2024-06-30 Thread Knute Snortum
On Sun, Jun 30, 2024 at 4:42 AM Mats-Olof Liljegren  wrote:

> Hi!
>
> Lilypond version ”2.25.17” error(?):
> Using: 1-\markup { \super "add9" }
> Gives med C9 = C E G Bb D'
> Solution???
>

Attached is some code with a few examples  of creating chord exceptions.


--
Knute Snortum
\version "2.24.0"

chExceptionMusic = {
   1-\markup { m\super "sus4" } % Semi-advisable? :-)
   1-\markup { m\super "sus2" } % Semi-advisable? :-)

   1-\markup { m\super "add9" }
   1-\markup { m\super "add11" }
}

% Convert music to list and prepend to existing exceptions.
chExceptions = #(append
   (sequential-music-to-chord-exceptions chExceptionMusic #t)
   ignatzekExceptions)

exampleChords = \relative {
  
}

theMusic = {
   \mark "Standard"
   \exampleChords
   \bar "||"
   \set chordNameExceptions = #chExceptions
   \mark "Custom"
   \exampleChords
}

<<
\new ChordNames \theMusic
\new Voice \theMusic
>>

How to get C(add9)???

2024-06-30 Thread Mats-Olof Liljegren
Hi!

Lilypond version ”2.25.17” error(?):
Using: 1-\markup { \super "add9" }
Gives med C9 = C E G Bb D'
Solution???


Med vänlig hälsning / Kind regards
Mats-Olof Liljegren

e-pro
Oskarsvägen 11B
702 14 Örebro
Tel 070 360 19 19
e-post m...@e-pro.se
web: http://e-pro.se


Re: How to lengthen stems in beamed groups

2024-06-29 Thread Flaming Hakama by Elaine
> -- Forwarded message --
> From: Knute Snortum 
> To: lilypond-user@gnu.org
> Cc:
> Bcc:
> Date: Wed, 26 Jun 2024 09:46:29 -0700
> Subject: How to lengthen stems in beamed groups
> Hi list,
>
> I'm hoping someone can give me insight into how to lengthen stems in
> beamed groups globally.
>
> LilyPond usually makes good assumptions and has great defaults, but in
> this situation it fails to create good stem lengths in beamed groups.  I've
> attached some sample code that illustrates the problem.  With the following
> line commented out, you can see that the stems are too short
> (stem-too-short.png):
>
> \override Stem.details.beamed-lengths = #'(3.5 4.1)
>
> With the above line uncommented, the stem lengths are better, except the
> second measure, right hand, third beat (stem-lengths-better.png).
>
> My questions are these: How do I tell LilyPond what length the shortest
> stem in a beamed group should be? (I tried playing
> with Stem.details.beamed-minimum-free-lengths, but its behavior seemed
> chaotic.)  And is there a better way to control stem lengths in beamed
> groups?
>
> --
> Knute Snortum
>


This may be too broad of a brush, since it also affects non-beamed stems.

  \override Stem.length-fraction = #(magstep 1.2)

But this is what I use, and I don't mind the extra-long non-breamed stems.


\version "2.24.0"
\language "english"

global = {
  \time 12/8
  \key f \major
}

rightHand = \relative {
  \global
  d''4.~\startTrillSpan d16\stopTrillSpan c bf a g f  bf8 g' e!  c bf g' |
  \noBreak
  a,16 g f e f a  d, f d bf g e'  f bf, a g a c  f,4 r8 |
}

leftHand = \relative {
  \global
  \clef bass
  f16 d bf a bf d  f, bf d f e! d  e c bf a bf c  g bf e g f e |
  f8 a, d  bf8.\trill a32 bf c8  f,4 r8  r16 c' a c f,8 |
}

\score {
  \new PianoStaff <<
\new Staff {
  \override Stem.length-fraction = #(magstep 1.2)
  \rightHand
}
\new Staff {
  \override Stem.length-fraction = #(magstep 1.2)
  \leftHand
}
  >>
  \layout {
indent = 0
\context {
  \Score
  % defaults = #'(3.26 3.5 3.6)
  \override Stem.details.beamed-lengths = #'(3.5 4.1)
  % defaults = #'(1.83 1.5 1.25)
  %\override Stem.details.beamed-minimum-free-lengths = #'(1.83 3.33)
  % defaults = #'(1.0 0.5 0.25)
  %\override Stem.details.stem-shorten = #'(1.0 0.5 0.25)
}
  }
}


HTH,


Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
Producer ~ Composer ~ Instrumentalist ~ Educator
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


How to lengthen stems in beamed groups

2024-06-26 Thread Knute Snortum
Hi list,

I'm hoping someone can give me insight into how to lengthen stems in beamed
groups globally.

LilyPond usually makes good assumptions and has great defaults, but in this
situation it fails to create good stem lengths in beamed groups.  I've
attached some sample code that illustrates the problem.  With the following
line commented out, you can see that the stems are too short
(stem-too-short.png):

\override Stem.details.beamed-lengths = #'(3.5 4.1)

With the above line uncommented, the stem lengths are better, except the
second measure, right hand, third beat (stem-lengths-better.png).

My questions are these: How do I tell LilyPond what length the shortest
stem in a beamed group should be? (I tried playing
with Stem.details.beamed-minimum-free-lengths, but its behavior seemed
chaotic.)  And is there a better way to control stem lengths in beamed
groups?

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

global = {
  \time 12/8
  \key f \major
}

rightHand = \relative {
  \global 
  d''4.~\startTrillSpan d16\stopTrillSpan c bf a g f  bf8 g' e!  c bf g' | 
  \noBreak 
  a,16 g f e f a  d, f d bf g e'  f bf, a g a c  f,4 r8 |
}

leftHand = \relative {
  \global
  \clef bass
  f16 d bf a bf d  f, bf d f e! d  e c bf a bf c  g bf e g f e |
  f8 a, d  bf8.\trill a32 bf c8  f,4 r8  r16 c' a c f,8 |
}

\score {
  \new PianoStaff <<
\new Staff \rightHand
\new Staff \leftHand
  >>
  \layout {
indent = 0
\context {
  \Score
  % defaults = #'(3.26 3.5 3.6)
  \override Stem.details.beamed-lengths = #'(3.5 4.1)
  % defaults = #'(1.83 1.5 1.25)
  %\override Stem.details.beamed-minimum-free-lengths = #'(1.83 3.33)
  % defaults = #'(1.0 0.5 0.25)
  %\override Stem.details.stem-shorten = #'(1.0 0.5 0.25)
}
  }
}

Re: how to draw lines independent from the notes

2024-06-04 Thread Aaron Hill

On 2024-06-04 9:40 am, Paolo Prete wrote:

That's impressive, thanks!!

I encourage the maintainers of the code to replace the triangle shape 
in
native LilyPond with your code, given that the actual shape is pretty 
weird

and the gap with the segment is not nice to look at...



I had hoped to keep this private, but now I guess I have to share with 
the class.


My apologies for anyone who dares to read through the craziness.  It was 
never really intended to be shared broadly with the mailing list.  The 
PDFs will make absolutely no sense on their own.  The LY files are a 
mixture of code and comments, documenting my workflow.  The idea was to 
solve Paolo's problem but do it in a step-by-step way.  It gets pretty 
rambling here and there, so again I apologize for anyone who decides to 
dive in and look at it.  Ultimately, each stage of experimentation is 
there.  I did start to move faster in the Scheme approach, so there 
might be fewer stopping points.  I had to remember to work in smaller 
chunks to be able to document things.


The final iteration of code in draw-arrow-2.ly is pretty much the 
"solution" to the problem.


All that said, it was a pretty fun activity.  As a developer, we rarely 
show the dirty bits of the process.  We like to wait until everything is 
neatly wrapped in a bow and glitter, mainly to hide all our mistakes, 
wrong paths taken, etc.  :)



P.S. There might be one or two potentially disparaging comments aimed at 
LilyPond.  I must also apologize for them.  Hopefully, no LilyPond devs 
take them too harshly.  Again, this code was never really intended for 
public reveal.  I would have cleaned up such comments and written them 
with more tact if given the chance.


-- Aaron Hill\version "2.25.13"

%% First: See what Lilypond has built-in that we can leverage.
%%
%% \arrow-head is almost useable, but its shape options are not great.
%% \draw-line looks perfectly useable for the main part of our arrow.
%% \path is somewhat a brute-force tool, so let's call it last resort.
%% \polygon is better than \path in terms of usability.
%% \postscript is even worse than \path; too much power, little gain.
%% Ooh, \triangle.  That's almost exactly what we need.
%%
%% Okay, I think we have an initial plan.  Use \draw-line for the main
%% body of the arrow.  \triangle for the ends.  We may need to \scale
%% the arrow heads to lengthen them, unless we are okay with perfect
%% equilateral triangles.  Hmm, that could/should be an adjustable
%% parameter.

%% Let's try putting things together manually and see what is possible.

\paper { #(set-paper-size "a7") tagline = ##f }

\markup {
  \concat {
\triangle ##f % Keeping one side unfilled to tell them apart.
\draw-line #'(5 . 0)
\triangle ##t
  }
}

%% Interesting result.  At least we know the default thickness is the
%% same between the line and triangle (unfilled).  We need to rotate
%% those triangles and keep them aligned with the line.
%%
%% That's curious.  The \rotate command is organized in the text align-
%% ment section.  Does that mean it might not be suited for shapes?
%% Spidey-sense™ tingling.
%%
%% Maths: How far do we need to spin this triangle?  The right side of
%% the unfilled triangle is sitting 60 degrees up from the ground.
%% That means it is falling 30 degrees away from up-right.  We need to
%% spin it 30 degrees clockwise.  The example in the documentation
%% suggests rotations are counter-clockwise.  They also mention the
%% center of the stencil is the rotation point.

\markup {
  \concat {
\rotate #-30 \triangle ##f
\draw-line #'(5 . 0)
\triangle ##t
  }
}

%% Okay.  The documentation lied.  That was not from the center of the
%% object.  But I gather the center is being calculated from the bounds
%% of the stencil, which are rectangular.  We may need to provide our
%% own bounds.  On a positive note, we got the triangle pointing in the
%% right direction.  Let's celebrate and fix the filled triangle.

\markup {
  \concat {
\rotate #-30 \triangle ##f
\draw-line #'(5 . 0)
\rotate #30 \triangle ##t
  }
}

%% More maths: We know an equilateral sits perfectly in a circle.  And
%% that circle sits perfectly in a square.  The coordinates for the
%% three points of a triangle can be fairly easily calculated.  Let's
%% go with the orientation based on the \triangle command.
%%
%% Web search... height of triangle is root(3)/2 times its base.
%% Oh, dear.  The documentation does not specify how wide the shape
%% is expected to be rendered.  It also seems to change size based on
%% the extroversion parameter, which is used to adjust whether the ink
%% should favor being outside the bounds of the shape or to sit inside
%% the bounds.  Do we dig into the source code, or should we just play
%% around and gather empirical data?  I have a hunch the width is one.

\markup {
  \combine
\triangle ##f
\lower #0.2 \draw-line #'(1 . 0)
}

%% Drat.  No

Re: how to draw lines independent from the notes

2024-06-04 Thread Paolo Prete
That's impressive, thanks!!

I encourage the maintainers of the code to replace the triangle shape in
native LilyPond with your code, given that the actual shape is pretty weird
and the gap with the segment is not nice to look at...

On Tue, Jun 4, 2024 at 2:07 PM Aaron Hill  wrote:

> On 2024-06-03 10:56 am, Paolo Prete wrote:
> > Thanks Aaron, see the attached pdf as an example:
>
>
> I may have gone too far with this.  But I hope it helps.  I'm replying
> privately as I am not sure how best to present the material to the wider
> audience.  Basically, if you read each LY source file, it is a mixture
> of code and comments.  It is flow-of-conscience, as such it can appear
> rambling at times.  I wanted to leave in the some of the dirty bits,
> which you might find interesting.  The hope was to reveal a little of my
> workflow.  That way I am not just giving you the final answer but
> showing the steps along the way.
>
> Attached are two approaches.  The first was done using the built-in
> markup commands as much as possible.  It ran into several issues, so I
> quickly turned to the second approach to write everything from scratch
> in Scheme as a markup command.  By comparing the code from iteration to
> iteration, you should be able to see how the code evolves.
>
>
> P.S. I do not know how much time I have, so I might not be able to
> directly answer questions about the code.  The final iteration in
> draw-arrow-2 should be complete enough for production work if you just
> want to mess about with it.
>
>
> -- Aaron Hill


Re: how to draw lines independent from the notes

2024-06-04 Thread Silvain Dupertuis

To create a drawing in PostScript format,
one option would be to create the drawing with Inkscape and save as PostScript 
(*.ps).

Something to test... Inkscape can open and save Postscript format.
Then one can open the file with a text editor to copy and paste the relevant shape into a 
Lilypond file.


Le 03.06.24 à 19:56, Paolo Prete a écrit :

Thanks Aaron, see the attached pdf as an example:

On Mon, Jun 3, 2024 at 7:49 PM Aaron Hill  wrote:

On 2024-06-03 10:39 am, Paolo Prete wrote:
> On Mon, Jun 3, 2024 at 7:33 PM Aaron Hill 
> wrote:
>
>  so feel free to
>> reach out if this is not your area of expertise.
>>
>
> That's what I just did ;-)
>
> cheers


I must admit I have not followed this thread super closely. Do you have
a drawing of the type of arrow head you are interesting in.  I have time
today to futz around, so I can see about putting together something for
you, hopefully more in the style of "teaching a man to fish" rather than
just "giving a man a fish".


-- Aaron Hill



--
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org 

Re: how to draw lines independent from the notes

2024-06-03 Thread Paolo Prete
Thanks Aaron, see the attached pdf as an example:

On Mon, Jun 3, 2024 at 7:49 PM Aaron Hill  wrote:

> On 2024-06-03 10:39 am, Paolo Prete wrote:
> > On Mon, Jun 3, 2024 at 7:33 PM Aaron Hill 
> > wrote:
> >
> >  so feel free to
> >> reach out if this is not your area of expertise.
> >>
> >
> > That's what I just did ;-)
> >
> > cheers
>
>
> I must admit I have not followed this thread super closely.  Do you have
> a drawing of the type of arrow head you are interesting in.  I have time
> today to futz around, so I can see about putting together something for
> you, hopefully more in the style of "teaching a man to fish" rather than
> just "giving a man a fish".
>
>
> -- Aaron Hill
>


22-new.pdf
Description: Adobe PDF document


Re: how to draw lines independent from the notes

2024-06-03 Thread Aaron Hill

On 2024-06-03 10:39 am, Paolo Prete wrote:
On Mon, Jun 3, 2024 at 7:33 PM Aaron Hill  
wrote:


 so feel free to

reach out if this is not your area of expertise.



That's what I just did ;-)

cheers



I must admit I have not followed this thread super closely.  Do you have 
a drawing of the type of arrow head you are interesting in.  I have time 
today to futz around, so I can see about putting together something for 
you, hopefully more in the style of "teaching a man to fish" rather than 
just "giving a man a fish".



-- Aaron Hill



Re: how to draw lines independent from the notes

2024-06-03 Thread Aaron Hill

On 2024-06-03 10:33 am, Aaron Hill wrote:
But pretty much, once you are in a \markup context, the world's your 
oyster.  Start with the more primitive drawing commands and build up 
your own shapes.  Turn those into reusable markup-commands of your own. 
 Some of this may require some Scheme code to achieve, so feel free to 
reach out if this is not your area of expertise.



I should also mention that a good working knowledge of geometry and 
maths is helpful for building shapes programmatically.  I know some 
folks feel they have a maths phobia, although, I am convinced they just 
were taught poorly.  People who "hate" maths simply were set up to fail. 
 No fault on the student.  And sometimes no fault on the teacher.  Some 
teachers are so into maths that they have a tough time helping students 
find the passion.  Because it is true that some maths is tricky, but 
when you have passion, you have determination.  No problem will stand in 
your way.  In fact, you often seek out problems.  But that is tangent 
(no pun intended) that I will stop for now.  I guess once you have 
worked as a teacher, it is hard to stop educating.



-- Aaron Hill



Re: how to draw lines independent from the notes

2024-06-03 Thread Paolo Prete
On Mon, Jun 3, 2024 at 7:33 PM Aaron Hill  wrote:

> On 2024-06-03 10:25 am, Paolo Prete wrote:
> > Thanks, this is what I was searching for!
> >
> > Now, for an optimal refinement: is there a way to avoid these curved
> > sides
> > on the arrows and can the segment be attached to the arrows without
> > gaps?
>
>

 so feel free to
> reach out if this is not your area of expertise.
>

That's what I just did ;-)

cheers


Re: how to draw lines independent from the notes

2024-06-03 Thread Aaron Hill

On 2024-06-03 10:25 am, Paolo Prete wrote:

Thanks, this is what I was searching for!

Now, for an optimal refinement: is there a way to avoid these curved 
sides
on the arrows and can the segment be attached to the arrows without 
gaps?



Virtually anything is possible inside of LilyPond's \markup system.  
Some of the built-in commands could use some more styles and parameters, 
but that is the joy of open source.  All of the code for something like 
the \arrow-head command is right there.


But pretty much, once you are in a \markup context, the world's your 
oyster.  Start with the more primitive drawing commands and build up 
your own shapes.  Turn those into reusable markup-commands of your own.  
Some of this may require some Scheme code to achieve, so feel free to 
reach out if this is not your area of expertise.



-- Aaron Hill



Re: how to draw lines independent from the notes

2024-06-03 Thread Paolo Prete
Thanks, this is what I was searching for!

Now, for an optimal refinement: is there a way to avoid these curved sides
on the arrows and can the segment be attached to the arrows without gaps?

Cheers

On Mon, Jun 3, 2024 at 3:08 PM Leo Correia de Verdier <
leo.correia.de.verd...@gmail.com> wrote:

> Expanding on Werner’s example a bit, is this something like what you’re
> after?
>
> \version "2.25.12"
>
> \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
>   \translate #'(20 . -20)
>\center-column { example-text \concat { \arrow-head #X #LEFT ##t
> \draw-line #'(30 . 0) \arrow-head #X #RIGHT ##t }}}
>
> <<
>  { f'2 f' f' f' f'1 }
>  { d'2 d' d' d' d'1 }
> >>
>
> \paper {
>  markup-markup-spacing.basic-distance = 0
>  markup-markup-spacing.minimum-distance = 0
>  markup-markup-spacing.padding = 0
>
>  markup-system-spacing.basic-distance = 0
>  markup-system-spacing.minimum-distance = 0
>  markup-system-spacing.padding = 0
>
>  top-markup-spacing.basic-distance = 0
>  top-markup-spacing.minimum-distance = 0
>  top-markup-spacing.padding = 0
> }
>
>
> > 3 juni 2024 kl. 13:43 skrev Paolo Prete :
> >
> > Thanks to Torsten and Werner,
> >
> > I'm going to use the postscript approach.
> >
> > But what about the segment with arrows and centered text?
> >
> > I googled a bit, and I also queried ChtaGPT but could not find anything
> useful...
> >
> >
> > On Mon, Jun 3, 2024 at 11:46 AM Torsten Krueger 
> wrote:
> > Paolo Prete wrote on 02.06.2024:
> >
> > > How can I draw a vertical (or even diagonal) line independently
> positioned
> > > from the notes in the score, that can span across staves, as shown in
> the
> > > figure?
> >
> > For drawing lines independently from notes I do not use Lilypond
> > directly but postscript. For this purpose I have added a few lines of
> > code right at the beginning in the definition of bookTitleMarkup like
> > this (drawing two small horizontal lines in the page margins):
> >
> > --8<---cut here---start->8---
> >
> >   bookTitleMarkup = \markup {
> > \column {
> >\postscript #"
> > gsave
> > initmatrix
> > 1 setlinewidth 0 306 moveto 6 0 rlineto stroke
> > 1 setlinewidth 377 306 moveto 6 0 rlineto stroke
> > grestore"
> >\fill-line {
> > \fromproperty #'header:instrument
> > ...
> >
> > --8<---cut here---end--->8---
> >
> > Don't know if it helps in your case, but maybe gives you an idea of how
> > to proceed.
> >
> > Have fun
> > Torsten
> >
> >
>
>


Re: how to draw lines independent from the notes

2024-06-03 Thread Leo Correia de Verdier
Expanding on Werner’s example a bit, is this something like what you’re after?

\version "2.25.12"

\markup \with-dimensions #'(0 . 0) #'(0 . 0) {
  \translate #'(20 . -20)
   \center-column { example-text \concat { \arrow-head #X #LEFT ##t \draw-line 
#'(30 . 0) \arrow-head #X #RIGHT ##t }}}

<<
 { f'2 f' f' f' f'1 }
 { d'2 d' d' d' d'1 }
>>

\paper {
 markup-markup-spacing.basic-distance = 0
 markup-markup-spacing.minimum-distance = 0
 markup-markup-spacing.padding = 0

 markup-system-spacing.basic-distance = 0
 markup-system-spacing.minimum-distance = 0
 markup-system-spacing.padding = 0

 top-markup-spacing.basic-distance = 0
 top-markup-spacing.minimum-distance = 0
 top-markup-spacing.padding = 0
}


> 3 juni 2024 kl. 13:43 skrev Paolo Prete :
> 
> Thanks to Torsten and Werner,
> 
> I'm going to use the postscript approach.
> 
> But what about the segment with arrows and centered text?
> 
> I googled a bit, and I also queried ChtaGPT but could not find anything 
> useful...
> 
> 
> On Mon, Jun 3, 2024 at 11:46 AM Torsten Krueger  wrote:
> Paolo Prete wrote on 02.06.2024:
> 
> > How can I draw a vertical (or even diagonal) line independently positioned
> > from the notes in the score, that can span across staves, as shown in the
> > figure?
> 
> For drawing lines independently from notes I do not use Lilypond
> directly but postscript. For this purpose I have added a few lines of
> code right at the beginning in the definition of bookTitleMarkup like
> this (drawing two small horizontal lines in the page margins):
> 
> --8<---cut here---start->8---
> 
>   bookTitleMarkup = \markup {
> \column {
>\postscript #"
> gsave
> initmatrix
> 1 setlinewidth 0 306 moveto 6 0 rlineto stroke
> 1 setlinewidth 377 306 moveto 6 0 rlineto stroke
> grestore"
>\fill-line {
> \fromproperty #'header:instrument
>     ...
> 
> --8<---cut here---end--->8---
> 
> Don't know if it helps in your case, but maybe gives you an idea of how
> to proceed.
> 
> Have fun
> Torsten
> 
> 




Re: how to draw lines independent from the notes

2024-06-03 Thread Paolo Prete
Thanks to Torsten and Werner,

I'm going to use the postscript approach.

But what about the segment with arrows and centered text?

I googled a bit, and I also queried ChtaGPT but could not find anything
useful...


On Mon, Jun 3, 2024 at 11:46 AM Torsten Krueger  wrote:

> Paolo Prete wrote on 02.06.2024:
>
> > How can I draw a vertical (or even diagonal) line independently
> positioned
> > from the notes in the score, that can span across staves, as shown in the
> > figure?
>
> For drawing lines independently from notes I do not use Lilypond
> directly but postscript. For this purpose I have added a few lines of
> code right at the beginning in the definition of bookTitleMarkup like
> this (drawing two small horizontal lines in the page margins):
>
> --8<---cut here---start->8---
>
>   bookTitleMarkup = \markup {
> \column {
>\postscript #"
> gsave
> initmatrix
> 1 setlinewidth 0 306 moveto 6 0 rlineto stroke
> 1 setlinewidth 377 306 moveto 6 0 rlineto stroke
> grestore"
>\fill-line {
> \fromproperty #'header:instrument
> ...
>
> --8<---cut here-------end--->8---
>
> Don't know if it helps in your case, but maybe gives you an idea of how
> to proceed.
>
> Have fun
> Torsten
>
>
>


Re: how to draw lines independent from the notes

2024-06-03 Thread Torsten Krueger
Paolo Prete wrote on 02.06.2024:

> How can I draw a vertical (or even diagonal) line independently positioned
> from the notes in the score, that can span across staves, as shown in the
> figure?

For drawing lines independently from notes I do not use Lilypond
directly but postscript. For this purpose I have added a few lines of
code right at the beginning in the definition of bookTitleMarkup like
this (drawing two small horizontal lines in the page margins):

--8<---cut here---start->8---

  bookTitleMarkup = \markup {
\column {
   \postscript #"
gsave
initmatrix
1 setlinewidth 0 306 moveto 6 0 rlineto stroke
1 setlinewidth 377 306 moveto 6 0 rlineto stroke
grestore"
   \fill-line {
\fromproperty #'header:instrument
...

--8<---cut here---end--->8---

Don't know if it helps in your case, but maybe gives you an idea of how
to proceed.

Have fun
Torsten




Re: how to draw lines independent from the notes

2024-06-02 Thread Werner LEMBERG


> How can I draw a vertical (or even diagonal) line independently
> positioned from the notes in the score, that can span across staves,
> as shown in the figure?

The question is formulated in a very broad way.  Assuming that you
want to draw something completely independent of the score, you might
use a zero-dimension markup at the very beginning.  Together with
adjusting some paper variables, it shouldn't have an impact on
everything else.


Werner


==


\markup \with-dimensions #'(0 . 0) #'(0 . 0) foo

<<
  { f'2 f' f' f' f'1 }
  { d'2 d' d' d' d'1 }
>>

\paper {
  markup-markup-spacing.basic-distance = 0
  markup-markup-spacing.minimum-distance = 0
  markup-markup-spacing.padding = 0

  markup-system-spacing.basic-distance = 0
  markup-system-spacing.minimum-distance = 0
  markup-system-spacing.padding = 0

  top-markup-spacing.basic-distance = 0
  top-markup-spacing.minimum-distance = 0
  top-markup-spacing.padding = 0
}



how to draw lines independent from the notes

2024-06-02 Thread Paolo Prete
Hello,

How can I draw a vertical (or even diagonal) line independently positioned
from the notes in the score, that can span across staves, as shown in the
figure?

In addition, how can I draw a horizontal line with arrows on both sides and
centered text above it, always independent from the score?

(See the attached image)

Thanks for your help!
P


test.pdf
Description: Adobe PDF document


Re: how to draw lines independent from the notes

2024-06-02 Thread Paolo Prete
For the question 1), I just found this:

https://lsr.di.unimi.it/LSR/Snippet?id=253

Any idea about question 2? (arrows + centered text)

Thanks


On Sun, Jun 2, 2024 at 7:05 PM Paolo Prete  wrote:

> Hello,
>
> How can I draw a vertical (or even diagonal) line independently positioned
> from the notes in the score, that can span across staves, as shown in the
> figure?
>
> In addition, how can I draw a horizontal line with arrows on both sides
> and centered text above it, always independent from the score?
>
> (See the attached image)
>
> Thanks for your help!
> P
>


Re: How to transpose?

2024-05-27 Thread Wols Lists

On 25/05/2024 18:44, bobr...@centrum.is wrote:

Wol,

The bit about trombones in bass and Bb treble; I've only ever heard of 
Bb treble clef trombone in British brass band music.  What is the 
"American bass part" in Bb?  I've never heard of such a thing.  I know 
that Richard Strauß wrote tenor tuba parts in Bb bass clef.


I only remember me hitting it with one piece, but I got the vibes (on 
this list, iirc) that that this may be rare but certainly not unheard of.


This piece was printed with NO KEY SIGNATURE, and a bass clef part that 
had been transposed. Boy did it cause hell until we realised what was 
going on!!!


Cheers,
Wol



Re: how to remove marks automatically

2024-05-25 Thread Stefan Thomas
Dear Silvain,
thank You, this worked perfectly for me!
Providing you have juste one space as in the example,
in the part \mark \markup {
you can do a search and replace

\\mark.\\markup.{[^{]+{[^}]+}[^}]+}

with nothing

(I tested it in Geany on Ubuntu)

dot means one character
[^{]* means a non-empty sequence of characters without any { character
\ needs escaping
Your could add \s at the end to remove empty spaces or lines


Le 25.05.24 à 18:15, Stefan Thomas a écrit :

Dear community,
I would like to remove automatically all the "\mark \markup { \box { LETTER
} }" in the below quoted text. Can I do this with regex? Does someone know
how?
Thanks,
Stefan

\version "2.22.2"

violine =  {
\clef "treble" | % 1
R1*8 | % 9
\mark \markup { \box { A   } } R1*8 -\markup{ \tiny {Lija+Tambor} }
\mark \markup { \box { B   } }
 R1*8
\mark \markup { \box { C   } }
r4 2. \fermata :32
}



-- 
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org <https://perso.silvain-dupertuis.org>


Re: How to transpose?

2024-05-25 Thread bobr...@centrum.is
Wol, 

The bit about trombones in bass and Bb treble; I've only ever heard of Bb 
treble clef trombone in British brass band music. What is the "American bass 
part" in Bb? I've never heard of such a thing. I know that Richard Strauß wrote 
tenor tuba parts in Bb bass clef. 

-David 

> From: "Wols Lists" 
> To: "Lillypond Users Mailing List" 
> Sent: Friday, May 24, 2024 3:28:16 PM
> Subject: Re: How to transpose?

> On 23/05/2024 12:26, Kenneth Flak wrote:
> > Great, thanks to both of you! Very clarifying. \transposition is, thus,
> > going in the direction of instrument -> playback, whereas \transpose
> > goes in the opposite direction, if I understand it correctly.

> I do a lot of brass stuff. And as you've realised, it's \transpose not
> \transposition.

> I just think "\transpose for printed music, \transposition for midi".
> How accurate that is I don't know.

> The other trick I always use (given that a trombone plays both bass clef
> in C, and treble clef in Bb, and worse when you get an American bass
> part in Bb ?!?!?!), is I transpose on input as well as output.

> When copying a part IN to lilypond, I'll wrap it in "\transpose c c" or
> "\transpose bf c'" depending on whether it's a bass or treble part. So I
> know all my music fragments in lilypond are in C.

> Then I'll wrap them the other way on output to put them in the correct
> printed pitch. That way I never have to transpose in my head to make
> sure things are correct.

> Cheers,
> Wol


Re: How to transpose?

2024-05-25 Thread Kenneth Flak
Wols Lists, May 24, 2024 at 18:28:
> I do a lot of brass stuff. And as you've realised, it's \transpose not
> \transposition.
>
> I just think "\transpose for printed music, \transposition for midi".
> How accurate that is I don't know.
>
> The other trick I always use (given that a trombone plays both bass clef
> in C, and treble clef in Bb, and worse when you get an American bass
> part in Bb ?!?!?!), is I transpose on input as well as output.
>
> When copying a part IN to lilypond, I'll wrap it in "\transpose c c" or
> "\transpose bf c'" depending on whether it's a bass or treble part. So I
> know all my music fragments in lilypond are in C.
>
> Then I'll wrap them the other way on output to put them in the correct
> printed pitch. That way I never have to transpose in my head to make
> sure things are correct.
>
> Cheers,
> Wol

Sounds like a very good workflow! Will adopt this if/when I ever
get into a similar situation. I play trumpet myself, but I hardly ever
have to write for it :-) However, things can rapidly change...

Best,
Kenneth







Re: how to remove marks automatically

2024-05-25 Thread Knute Snortum
On Sat, May 25, 2024 at 9:16 AM Stefan Thomas 
wrote:

> Dear community,
> I would like to remove automatically all the "\mark \markup { \box {
> LETTER } }" in the below quoted text. Can I do this with regex? Does
> someone know how?
> Thanks,
> Stefan
>
> \version "2.22.2"
>
> violine =  {
> \clef "treble" | % 1
> R1*8 | % 9
> \mark \markup { \box { A   } } R1*8 -\markup{ \tiny {Lija+Tambor} }
> \mark \markup { \box { B   } }
>  R1*8
> \mark \markup { \box { C   } }
> r4 2. \fermata :32
> }
>
> You could try something like this:

/\\mark\s*\\markup\s*\{\s*\\box\s\{\s*\w+\s*\}\s*\}/gm



--
Knute Snortum


Re: how to remove marks automatically

2024-05-25 Thread Silvain Dupertuis

Providing you have juste one space as in the example,
in the part \mark \markup {
you can do a search and replace

\\mark.\\markup.{[^{]+{[^}]+}[^}]+}

with nothing

(I tested it in Geany on Ubuntu)

dot means one character
[^{]* means a non-empty sequence of characters without any { character
\ needs escaping
Your could add \s at the end to remove empty spaces or lines


Le 25.05.24 à 18:15, Stefan Thomas a écrit :

Dear community,
I would like to remove automatically all the "|\mark \markup { \box { LETTER } }|" in 
the below quoted text. Can I do this with regex? Does someone know how?

Thanks,
Stefan
|\version "2.22.2" violine = { \clef "treble" | % 1 R1*8 | % 9 \mark \markup { \box { A 
} } R1*8 -\markup{ \tiny {Lija+Tambor} } \mark \markup { \box { B } } R1*8 \mark \markup 
{ \box { C } } r4 2. \fermata :32 } |



--
Silvain Dupertuis
Route de Lausanne 335
1293 Bellevue (Switzerland)
tél. +41-(0)22-774.20.67
portable +41-(0)79-604.87.52
web: silvain-dupertuis.org <https://perso.silvain-dupertuis.org>

how to remove marks automatically

2024-05-25 Thread Stefan Thomas
Dear community,
I would like to remove automatically all the "\mark \markup { \box { LETTER
} }" in the below quoted text. Can I do this with regex? Does someone know
how?
Thanks,
Stefan

\version "2.22.2"

violine =  {
\clef "treble" | % 1
R1*8 | % 9
\mark \markup { \box { A   } } R1*8 -\markup{ \tiny {Lija+Tambor} }
\mark \markup { \box { B   } }
 R1*8
\mark \markup { \box { C   } }
r4 2. \fermata :32
}


Re: How to transpose?

2024-05-24 Thread Wols Lists

On 23/05/2024 12:26, Kenneth Flak wrote:

Great, thanks to both of you! Very clarifying. \transposition is, thus,
going in the direction of instrument -> playback, whereas \transpose
goes in the opposite direction, if I understand it correctly.


I do a lot of brass stuff. And as you've realised, it's \transpose not 
\transposition.


I just think "\transpose for printed music, \transposition for midi". 
How accurate that is I don't know.


The other trick I always use (given that a trombone plays both bass clef 
in C, and treble clef in Bb, and worse when you get an American bass 
part in Bb ?!?!?!), is I transpose on input as well as output.


When copying a part IN to lilypond, I'll wrap it in "\transpose c c" or 
"\transpose bf c'" depending on whether it's a bass or treble part. So I 
know all my music fragments in lilypond are in C.


Then I'll wrap them the other way on output to put them in the correct 
printed pitch. That way I never have to transpose in my head to make 
sure things are correct.


Cheers,
Wol



Re: How to transpose?

2024-05-23 Thread David Kastrup
Kenneth Flak  writes:

> Great, thanks to both of you! Very clarifying. \transposition is, thus,
> going in the direction of instrument -> playback,

More like display pitch -> concert pitch.

> whereas \transpose goes in the opposite direction, if I understand it
> correctly.

\transpose changes the display pitch.  It does not touch the relation
between display pitch and concert pitch.

So if you want to change the relation between display pitch and
instrument pitch after already having declared a \transposition, you get
into kind of a bind.

-- 
David Kastrup



Re: How to transpose?

2024-05-23 Thread Kenneth Flak
Timothy Lanfear, May 23, 2024 at 13:19:
> If you already have the music written in concert pitch, use the
> transpose
> function to change displayed pitch.
>
> \transpose bes, c { \clef treble \key c\major g' }
>
> If your brass players prefer not to have a key signature, omit the \key
> statement.
>
> On 23/05/2024 11:10, [1]bobr...@centrum.is wrote:
>
> Kenneth,
>
> If you look here:
> [2]https://lilypond.org/doc/v2.24/Documentation/notation/
> displaying-pitches#instrument-transpositions
>
> You will see that '\transposition' tells the MIDI and cue functions
> what's
> going on so that MIDI output and cues in other instruments are correct.
> It
> is still necessary to enter the notes at displayed pitch as shown in the
> example.
>
> -David
>

Great, thanks to both of you! Very clarifying. \transposition is, thus,
going in the direction of instrument -> playback, whereas \transpose
goes in the opposite direction, if I understand it correctly.

Best,
Kenneth




Re: How to transpose?

2024-05-23 Thread Timothy Lanfear
If you already have the music written in concert pitch, use the 
transpose function to change displayed pitch.


\transpose bes, c { \clef treble \key c\major g' }

If your brass players prefer not to have a key signature, omit the \key 
statement.


On 23/05/2024 11:10, bobr...@centrum.is wrote:

Kenneth,

If you look here: 
https://lilypond.org/doc/v2.24/Documentation/notation/displaying-pitches#instrument-transpositions


You will see that  '\transposition' tells the MIDI and cue functions 
what's going on so that MIDI output and cues in other instruments are 
correct.  It is still necessary to enter the notes at displayed pitch 
as shown in the example.


-David



*From: *"Kenneth Flak" 
*To: *"Lillypond Users Mailing List" 
*Sent: *Thursday, May 23, 2024 6:55:45 AM
*Subject: *How to transpose?

Hi,

Trying my hands on transposing from concert pitch to Trumpet in Bf
and french horn in F, but the displayed notes are still in concert
pitch... How do I make these display the notes I would like the
players to see?


    \new Staff = "trumpet" \with {
      instrumentName = "Trp"
    }
    {
      \clef treble
      \key c \major
      \transposition bf
      g'
    }
    \new Staff = "french horn" \with {
      instrumentName = "Horn"
    }{
      \clef treble
      \key c \major
      \transposition f
      cs'
    }

Best,
Kenneth

-- 
Roosna & Flak - Contemporary Dance & Music

Web: roosnaflak.com
Code: {github,gitlab}.com/kflak
Mastodon: @k...@sonomu.club


--
Timothy Lanfear, Bristol, UK.


Re: How to transpose?

2024-05-23 Thread bobr...@centrum.is
Kenneth, 

If you look here: [ 
https://lilypond.org/doc/v2.24/Documentation/notation/displaying-pitches#instrument-transpositions
 | 
https://lilypond.org/doc/v2.24/Documentation/notation/displaying-pitches#instrument-transpositions
 ] 

You will see that '\transposition' tells the MIDI and cue functions what's 
going on so that MIDI output and cues in other instruments are correct. It is 
still necessary to enter the notes at displayed pitch as shown in the example. 

-David 

> From: "Kenneth Flak" 
> To: "Lillypond Users Mailing List" 
> Sent: Thursday, May 23, 2024 6:55:45 AM
> Subject: How to transpose?

> Hi,

> Trying my hands on transposing from concert pitch to Trumpet in Bf and french
> horn in F, but the displayed notes are still in concert pitch... How do I make
> these display the notes I would like the players to see?

> \new Staff = "trumpet" \with {
> instrumentName = "Trp"
> }
> {
> \clef treble
> \key c \major
> \transposition bf
> g'
> }
> \new Staff = "french horn" \with {
> instrumentName = "Horn"
> }{
> \clef treble
> \key c \major
> \transposition f
> cs'
> }

> Best,
> Kenneth

> --
> Roosna & Flak - Contemporary Dance & Music
> Web: roosnaflak.com
> Code: {github,gitlab}.com/kflak
> Mastodon: @k...@sonomu.club


How to transpose?

2024-05-23 Thread Kenneth Flak
Hi,

Trying my hands on transposing from concert pitch to Trumpet in Bf and french 
horn in F, but the displayed notes are still in concert pitch... How do I make 
these display the notes I would like the players to see?


\new Staff = "trumpet" \with {
  instrumentName = "Trp"
}
{
  \clef treble
  \key c \major
  \transposition bf
  g' 
}
\new Staff = "french horn" \with {
  instrumentName = "Horn"
}{
  \clef treble
  \key c \major
  \transposition f
  cs'
}

Best,
Kenneth

-- 
Roosna & Flak - Contemporary Dance & Music
Web: roosnaflak.com
Code: {github,gitlab}.com/kflak
Mastodon: @k...@sonomu.club




Re: [basic question] how to disable text spanners for the lower staff of a PianoStaff

2024-05-10 Thread James Harkins
 On Fri, 10 May 2024 15:07:33 +0800  Mark Knoop  wrote --- 
> Haven't tested, but I think Text_spanner_engraver lives in Voice, rather than 
> Staff. Try removing from the \global Voice, otherwise send a WME.

Ah... indeed. That does take care of it.

  \new PianoStaff \with {
instrumentName = "古筝"
shortInstrumentName = "古筝"
  } <<
\new Staff = "up" << \global \zhengR >>
\new Staff = "down" % \with { \remove Text_spanner_engraver }
<<
  \clef bass
  \new Voice \with { \remove Text_spanner_engraver } { \global }
  \zhengL
>>
  >>

Kieren's solution also works, with a bit less syntax.

Thanks to both!

hjh



Re: [basic question] how to disable text spanners for the lower staff of a PianoStaff

2024-05-10 Thread Kieren MacMillan
Hi James,

> I've got a piano staff (for guzheng, just notating on two staves), and an 
> "accel." text spanner in a \global var.

Don’t forget to post MWEs, so people who want to help don’t have to conjure 
code themselves.  :)

> Some magic incantation I'm missing...

Not sure why your incantation doesn’t work, but this seems to:

%%%  SNIPPET BEGINS
\version "2.25.11"

global = {
  \override TextSpanner.bound-details.left.text = \markup { \upright "rit." }
  s1\startTextSpan
  s1\stopTextSpan
}
zhengR = { c'1 1 }
zhengL = { c1 c }

 \new PianoStaff \with {
   instrumentName = "古筝"
   shortInstrumentName = "古筝"
 } <<
   \new Staff = "up" << \global \zhengR >>
   \new Staff = "down" \with { \omit TextSpanner } << \clef bass \global 
\zhengL >>
 >>
%%%  SNIPPET ENDS

Hope that helps!
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




[basic question] how to disable text spanners for the lower staff of a PianoStaff

2024-05-09 Thread James Harkins
I've got a piano staff (for guzheng, just notating on two staves), and an 
"accel." text spanner in a \global var.

The accel is printed in both staves of the piano staff.

I'd thought this would hide it from the lower staff:

  \new PianoStaff \with {
instrumentName = "古筝"
shortInstrumentName = "古筝"
  } <<
\new Staff = "up" << \global \zhengR >>
\new Staff = "down" \with { \remove Text_spanner_engraver }
<< \clef bass \global \zhengL >>
  >>

But it still appears.

Some magic incantation I'm missing... can anyone advise? Thanks.

hjh



Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-06 Thread Kieren MacMillan
Hi all,

I found something that seems to work!!
Hope this helps someone else.

Best,
Kieren.

%%%  SNIPPET BEGINS
\version "2.25.11"
\language "english"

\layout {
  line-width = 3.5\in
  ragged-right = ##f
}

accidentalNoWidth = \tweak Accidental.extra-spacing-width #empty-interval \etc

\markup "No accidentals:"
\new Staff \with { \remove Accidental_engraver } <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f g! f f f f a }  \\
{ bf,8 f e-\tweak extra-offset #'(0.05 . 0) _\markup \with-color #red 
\with-dimensions-from \null \draw-line #'(0 . -38) ef d c bf, c }
  >>
>>

\markup "No tweaks:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f g! f f f f a }  \\
{ bf,8 f e ef d c bf, c }
  >>
>>

\markup "Using \accidentalNoWidth:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f \accidentalNoWidth g! f f f f a }  \\
{ bf,8 f \accidentalNoWidth e! \accidentalNoWidth ef d c bf, c }
  >>
>>
%%%  SNIPPET ENDS
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-05 Thread Kieren MacMillan
Hi Valentin,

> if you want you could tell Lilypond to ignore Accidentals in spacing

In concept, I love this idea… However it doesn’t work 100%:

%%%  SNIPPET BEGINS
\version "2.25.11"
\language "english"

\layout {
  line-width = 3.5\in
  ragged-right = ##f
}

ignoreH =
   \propertyTweak horizontal-skylines ##f
   \propertyTweak extra-spacing-width #empty-interval
   \etc

ignoreV =
   \propertyTweak vertical-skylines ##f
   \propertyTweak extra-spacing-height #empty-interval
   \etc

ignore = \ignoreH \ignoreV \etc

accidentalNoWidth =
\override Accidental.extra-spacing-width =
#(lambda (grob)
  (let ((ext (ly:grob-property grob 'X-extent)))
(display ext)
(cons (interval-length ext) 0)))

\markup "No accidentals:"
\new Staff \with { \remove Accidental_engraver } <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f g! f f f f a }  \\
{ bf,8 f e-\tweak extra-offset #'(0.05 . 0) _\markup \with-color #red 
\with-dimensions-from \null \draw-line #'(0 . -48) ef d c bf, c }
  >>
>>

\markup "No tweaks:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f g! f f f f a }  \\
{ bf,8 f e ef d c bf, c }
  >>
>>

\markup "Using \accidentalNoWidth:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f \once\accidentalNoWidth g! f f f f a }  \\
{ bf,8 f \once\accidentalNoWidth e! \once\accidentalNoWidth ef d c bf, c }
  >>
>>

\markup "Using \ignore:"
\new Staff <<
  \clef bass \key bf \major
  \voices 1,2 <<
{ f8 f \once \ignore Accidental g! f f f f a }  \\
{ bf,8 f \once \ignore Accidental e! \once \ignore Accidental ef d c bf, c }
  >>
>>
%%%  SNIPPET BEGINS

As you can see:

1. \accidentalNoWidth doesn’t allow the notes to obtain “no accidental” 
spacing, but at least keeps the accidentals uncrushed

2. \ignore allows the notes to obtain “no accidental” spacing, but everything 
gets crushed requiring manual tweaking to reposition;

Is there a way to get the best of both worlds?

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-05 Thread Valentin Petzel
Hi Kieren,

if you want you could tell Lilypond to ignore Accidentals in spacing (N.B.: 
This can lead to collision with the previous head!):

accidentalNoWidth =
\override Accidental.extra-spacing-width =
#(lambda (grob)
   (let ((ext (ly:grob-property grob 'X-extent)))
 (display ext)
 (cons (interval-length ext) 0)))

baritoneNotes = { f8 f \once\accidentalNoWidth g! f f f f a }
bassNotes =
{ bf,8 f \once\accidentalNoWidth e \once\accidentalNoWidth ef d c bf, c }

Cheers,
Valentin

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


Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-05 Thread Kieren MacMillan
Hi Jean,

> There might be ways to reduce the importance
> of accidentals in the spacing problem

I’ve tried a couple of different ways, but they are all pretty “destructive” 
(e.g., the accidentals are ignored entirely, so they end up on top of each 
other and the noteheads). Hopefully I can find a way!

> It's interesting though that adding
>  \override Score.SpacingSpanner.spacing-increment = 5
> in \layout evens out the spacing a lot.

Yes, it does!

> it might be worth trying to flank that measure with \newSpacingSection
> and give it a different spacing-increment.

That goes a long way towards a solution, but (a) the notes still aren’t 
perfectly even, and (b) I prefer the tighter spacing of the original layout.

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-04 Thread Jean Abou Samra

> > If you look at the first measure of the third system, you can see
> > that the note spacing is distorted by various things (lyrics,
> > accidentals, etc.). But clearly there’s more than enough horizontal
> > room to make those eighth notes absolutely even — in fact, that kind
> > of thing is what the majority of my post-data-entry tweak time is
> > dedicated to. [Again: When I used Finale , it took hours or
> > even days to get from “the data is all in” to looking like this
> > already looks… so I’m not complaining!]
> 
> You are aware of https://lsr.di.unimi.it/LSR/Item?id=1154 ?


It looks like the spacing is not really distorted by the lyrics here
but rather by the accidentals, so that snippet won't help much (what
it does is basically making the spacing engine forget about lyrics,
then space them itself). There might be ways to reduce the importance
of accidentals in the spacing problem, but I don't really recall this,
it's been a long time. It's interesting though that adding

  \override Score.SpacingSpanner.spacing-increment = 5

in \layout evens out the spacing a lot. Of course, for a longer score,
this will spread out the music, so it's not really a solution, but
it might be worth trying to flank that measure with \newSpacingSection
and give it a different spacing-increment.

Jean



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


Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-04 Thread Werner LEMBERG

>> You are aware of https://lsr.di.unimi.it/LSR/Item?id=1154 ?
> 
> Oh! I vaguely recall that. Thanks for the reminder.
> 
> I believe I applied it to my score, but it didn‘t make a change in
> m7. It might be because of the accidentals…? (See modified snippet
> acting as MWE, below.) Unfortunately modifying the snippet to take
> accidentals into account is WAY above my pay grade.

Well, the lyrics don't make any difference in spacing, see attached
image.  This means that LilyPond itself does the wider spacing...
Maybe you can play around with the spacing parameters of accidentals
and note heads to reduce the horizontal space.


Werner


Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-04 Thread Kieren MacMillan
Hi Werner,

> You are aware of https://lsr.di.unimi.it/LSR/Item?id=1154 ?

Oh! I vaguely recall that. Thanks for the reminder.

I believe I applied it to my score, but it didn‘t make a change in m7. It might 
be because of the accidentals…? (See modified snippet acting as MWE, below.) 
Unfortunately modifying the snippet to take accidentals into account is WAY 
above my pay grade.

Thanks,
Kieren.

%%%  SNIPPET BEGINS  %%%
\version "2.25.11"
\language "english"

% Snippet author: Jean Abou Samra 
% Original thread: 
https://lists.gnu.org/archive/html/lilypond-user/2022-11/msg00087.html
%
% This snippet gets rid of uglinesses in note spacing caused by lyrics.
% By default, LilyPond always puts a lyric word exactly centered under
% the note it attaches to. When there is a long lyric word, LilyPond reserves
% space between notes so that there will be no collisions in the lyrics.
% However, this can lead to uneven note spacing. This snippet completely
% removes the presence of lyrics in note spacing so that it is natural
% according to the note lengths, and uses a spacing algorithm that shifts
% lyrics automatically in order to avoid collisions.
%
% Some technical comments follow.
%
% The spacing problem is set up as a quadratic optimization problem. Each
% lyric word has a strength value (by default, all words have a strength
% of 1.0). The demerit associated to a lyric word is s(x-p)², where s
% is the strength, x is the X coordinate and p is the ideal X coordinate
% where the lyric word would be centered on its associated note. An
% acceptable solution is a solution where no lyric words collide. The
% weight of a solution is the sum of the demerits for each of the words.
% Solving the lyric spacing problem means finding an acceptable solution
% of minimal weight.
%
% In practice, words should not touch each other, but maintain a minimum
% distance between each other (controlled by LyricSpace.minimum-distance
% and LyricHyphen.minimum-distance). This is reduced to the form above
% by widening one of the two words for each LyricSpace or LyricHyphen
% grob, by the amount given by the minimum-space property.
%
% The algorithm to solve the lyric spacing problem uses dynamic programming
% and runs in linear time. We add words one by one from left to right. After
% adding each word, the problem given by the words added so far is solved.
% The base case (zero words) is trivial. To add a word, it is very intuitive,
% and not hard to prove, that the following technique works: if adding
% the word at its optimal position produces no collision, then keep it
% there; else, make this word 'push' on its left neighbor and move these
% two words simultaneously to the left until the optimal position for
% these two words together is reached; if this still produces a collision
% then add the third word and consider the three words stuck together, etc.
% Note that once two words have been stuck together, they won't need
% to be taken apart again: they will be adjacent ("stuck") in the final
% configuration.
%
% Written in this form, this algorithm looks quadratic. While probably
% acceptable in usual scores, this might become a problem with 
ly:one-line-breaking.
% However, with a bit of simple algebra, you can see that optimizing for two
% words stuck together (and, by extension, any finite number of words stuck
% together) is equivalent to optimizing for one single (imaginary) combined
% word, of which the length is the sum of the two lengths, the strength is
% the sum of the strengths, and the optimal coordinate is given by a simple
% formula (see the code). Therefore, instead of simultaneously considering
% two words stuck together, you can replace them with just one fresh problem
% variable. At each word added during the algorithm, there is a constant 
processing
% overhead, plus an overhead linear in the number of times a word is newly
% stuck to a group, forming a new group. If you imagine that all words start
% out black, and every word becomes white as soon as its group is stuck to
% the group on the left, it is clear that the total number of "add to group"
% operations is linear in the number of words. At the end, there is a
% step to compute the offset of each word from that of its group, which
% is made linear by caching the offset of a group as soon as it is
% visited. In this way, the total number of operations is linear.
%

% #(ly:set-option 'compile-scheme-code)

#(use-modules (ice-9 match)
  (ice-9 hash-table)
  (oop goops))

%% convenience stuff:

#(define-syntax-rule (transform! lval proc)
   (set! lval (proc lval)))

#(define ->
   (make-procedure-with-setter
(lambda (instance . path)
  (let loop ((instance instance) (path path))
(match path
  ((slot)
   (slot-ref instance slot))
  ((slot . rest)
   (loop (slot-ref instance slot)
 rest)
(lambda (instance . args)
  (let loop ((instance instance) (args args))
 

Re: how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-04 Thread Werner LEMBERG

> If you look at the first measure of the third system, you can see
> that the note spacing is distorted by various things (lyrics,
> accidentals, etc.). But clearly there’s more than enough horizontal
> room to make those eighth notes absolutely even — in fact, that kind
> of thing is what the majority of my post-data-entry tweak time is
> dedicated to. [Again: When I used Finale , it took hours or
> even days to get from “the data is all in” to looking like this
> already looks… so I’m not complaining!]

You are aware of https://lsr.di.unimi.it/LSR/Item?id=1154 ?


Werner


how difficult would it be to have “auto-correct spacing” (even for just a single measure)?

2024-05-04 Thread Kieren MacMillan
Hi all,

It is difficult to put into words how happy I am using Lilypond. I had to use 
Sibelius for a project last year, and it was pure torture. As the old saying 
[almost] goes: “They’ll have to pry Lilypond out of my cold, dead hands!”

Exhibit A: I’m in data-entry mode (i.e., not concerned about visuals/tweaking 
*at all*), and the screenshot attached is what the top half of the page of my 
octavo score looks like at this moment. Incredible! There are zero [!!] manual 
tweaks on that page — what you see is what comes out “automagically”, based 
solely on Lilypond’s amazing layout engine and my stylesheets.

So obviously what follows is a “first world problem” of the highest order…

If you look at the first measure of the third system, you can see that the note 
spacing is distorted by various things (lyrics, accidentals, etc.). But clearly 
there’s more than enough horizontal room to make those eighth notes absolutely 
even — in fact, that kind of thing is what the majority of my post-data-entry 
tweak time is dedicated to. [Again: When I used Finale , it took hours 
or even days to get from “the data is all in” to looking like this already 
looks… so I’m not complaining!]

I would love to be able to say “Dear Specialized Scheme Engraver: Please take 
measure 7, even out the note-spacing, and make the ‘obvious’ necessary 
adjustments so that everything looks amazing.”

How difficult would such a function/engraver be to design?

Thanks,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.



Re: How to manually set MIDI channel # for a staff?

2024-04-29 Thread David Kastrup
Jean Abou Samra  writes:

> Le lundi 29 avril 2024 à 06:31 -0500, Jason Yip a écrit :
>> Hi,
>> 
>> Does anyone know how to manually set the midi channel # for a staff to 
>> something other than the default of channel 0/1? Without having to 
>> create dummy staffs with just `s256` as the voice content preceding the 
>> desired staff? The staff in question usually only has one voice, so I 
>> modified the midi context as shown below simply made a bunch of dummy 
>> voices with only `s256` as the content so that they don't at least 
>> affect the graphical output:
>> 
>> ```
>>   \midi {
>>    \context {
>>  \Staff
>>  \remove "Staff_performer"
>>    }
>>    \context {
>>  \Voice
>>  \consists "Staff_performer"
>>    }
>>  }
>> ```
>
>
> You can do \set Score.midiChannelMapping = #'voice as an alternative to that.

We really need a plain simple way to set a fixed channel.  There is
enough hardware around using dedicated channels.

-- 
David Kastrup



Re: How to manually set MIDI channel # for a staff?

2024-04-29 Thread Jason Yip

On 2024-04-29 06:48, Jean Abou Samra - jean(a)abou-samra.fr wrote:

You can do \set Score.midiChannelMapping = #'voice as an alternative to that.
Also \new Voice { } should work (untested) instead of \new Voice { s256 }.
I don't think there's a better way.


Setting midiChannelMapping property didn't deliver my desired results. 
My way worked apparently.


Removing the s256 doesn't also deliver my desired results.




Re: How to manually set MIDI channel # for a staff?

2024-04-29 Thread Jean Abou Samra
Le lundi 29 avril 2024 à 06:31 -0500, Jason Yip a écrit :
> Hi,
> 
> Does anyone know how to manually set the midi channel # for a staff to 
> something other than the default of channel 0/1? Without having to 
> create dummy staffs with just `s256` as the voice content preceding the 
> desired staff? The staff in question usually only has one voice, so I 
> modified the midi context as shown below simply made a bunch of dummy 
> voices with only `s256` as the content so that they don't at least 
> affect the graphical output:
> 
> ```
>   \midi {
>    \context {
>  \Staff
>  \remove "Staff_performer"
>    }
>    \context {
>  \Voice
>  \consists "Staff_performer"
>    }
>  }
> ```


You can do \set Score.midiChannelMapping = #'voice as an alternative to that.
Also \new Voice { } should work (untested) instead of \new Voice { s256 }.
I don't think there's a better way.



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


How to manually set MIDI channel # for a staff?

2024-04-29 Thread Jason Yip

Hi,

Does anyone know how to manually set the midi channel # for a staff to 
something other than the default of channel 0/1? Without having to 
create dummy staffs with just `s256` as the voice content preceding the 
desired staff? The staff in question usually only has one voice, so I 
modified the midi context as shown below simply made a bunch of dummy 
voices with only `s256` as the content so that they don't at least 
affect the graphical output:


```
 \midi {
  \context {
\Staff
\remove "Staff_performer"
  }
  \context {
\Voice
\consists "Staff_performer"
  }
}
```

It's definitely a hacky solution, especially given that my program that 
automatically generates lilypond code has to output `\new Voice { s256 
}\n` n - 1 times before the actual content then wrap the voices with << 
>>. If this is the only way to do it, is there some sort of way to 
substitute `s256` with something else that doesn't occupy length but at 
least lets the performer still assign a channel to the dummy staff/voices?


Thanks!




How apply \magnifyStaff to full StaffGroup?

2024-04-07 Thread Mats Bengtsson


  
  
Hi,
In the piano scores for piano quartets, and similarly, I haven't
  managed to find a way to apply \magnifyStaff to all the staves of
  the remaining instruments, using a single \with statement on the
  StaffGroup level. I can achieve what I want, using a \with{...}
  statement for each separate Staff, but the .ly file would look
  nicer and it would save some typing (well, some copy/pasting) to
  be able to apply the settings to the full StaffGroup at once. 

Trying the most obvious thing, results in an ugly error message
  ===
/home/matben/lilypond-2.25.13/share/lilypond/2.25.13/ly/init.ly:66:2:
  error: Guile signaled an error for the _expression_ beginning here
  #
   (let ((book-handler (if (defined? 'default-toplevel-book-handler)
  In procedure ly:context-property: Wrong type argument in position
  1 (expecting Context): #f
  ===
Here's an example file, showing my failed attempt that gave the
  above error message, as well as the more verbose code that gives
  the desired output:
\version "2.25.12"
  
  v = \fixed c' {
    c4 d e f
  }
  
  LH = \fixed c' {
    1
  }
  
  RH = \fixed c {
    \clef bass
    c1
  }
  
  
  % Gives error message:
  \score{
  <<
    \new StaffGroup \with{ \magnifyStaff #5/7 }
    <<
      \new Staff \v
      \new Staff \v
      \new Staff \v
    >>
    \new PianoStaff <<
      \new Staff \LH
      \new Staff \RH
    >>
  >>
  }
  
  % Desired layout:
  \score{
  <<
    \new StaffGroup <<
      \new Staff \with{ \magnifyStaff #5/7 } \v
      \new Staff \with{ \magnifyStaff #5/7 } \v
      \new Staff \with{ \magnifyStaff #5/7 } \v
    >>
    \new PianoStaff <<
      \new Staff \LH
      \new Staff \RH
    >>
  >>
  }

Any suggestions? In the full score, I will also need to include
  the workaround mentioned at the bottom of
https://lilypond.org/doc/v2.25/Documentation/notation/setting-the-staff-size,
  which makes the verbose version of the .ly code even more verbose
  and repetitive.

    /Mats

  




Re: How to use define-music-function?

2024-03-20 Thread Aaron Hill

On 2024-03-20 8:53 am, enejati--- via LilyPond user discussion wrote:

Hello,
I'm a new lilypond user. I want to create multiple scores in a single
file. These scores have some values on common. So I want to use
`define-music-function` in order to avoid repetition.

[ . . . ]



A few things.  Firstly, you must prefix make-score with a slash, just 
like any other music function.  Secondly, define-music-function is not 
structured the same as Scheme's define.  The procedure name will go 
outside:



myFunction = #(define-music-function (arg1 arg2) (type? type?) ...)


Lastly, a music function must return what LilyPond considers music.  
Top-level things like a \score or \book will not count.  Instead, what 
you will need is define-void-function, which does not return anything.  
Within this function, you can call the internal functions for processing 
scores and books directly:



make-score =
#(define-void-function
  (instrumentName bookSuffix musicContent)
  (string? string? ly:music?)
  (toplevel-score-handler #{
\score {
  \new Staff \with {
instrumentName = #instrumentName
  } { #musicContent }
  \layout { }
}
  #})
  (toplevel-book-handler #{
\book {
  \bookOutputSuffix #bookSuffix
  \score {
\new Staff \with {
  midiInstrument = "piccolo"
} { #musicContent }
\midi {
  \tempo 4 = 80
}
  }
}
  #}))

% Usage
\make-score "۱" "1" { b'4 4 2 }
\make-score "۲" "2" { b'4 4 2 }
\make-score "3" "3" { b'4 4 2 }




-- Aaron Hill



How to use define-music-function?

2024-03-20 Thread enejati--- via LilyPond user discussion
Hello,
I'm a new lilypond user. I want to create multiple scores in a single
file. These scores have some values on common. So I want to use
`define-music-function` in order to avoid repetition.

Here is my code now:
\score {
  \new Staff \with {
instrumentName = "۱"
  } \one
  \layout { }
}


\book {
  \bookOutputSuffix "1"
  \score {
\new Staff \with {
  midiInstrument = "piccolo"
} \one
\layout { }
\midi {
  \tempo 4=80
}
  }
}

\score {
  \new Staff \with {
instrumentName = "۲"
  } \two
  \layout { }
}

\book {
  \bookOutputSuffix "2"
  \score {
\new Staff \with {
  midiInstrument = "piccolo"
} \two
\midi {
  \tempo 4=80
}
  }
}

\score {
  \new Staff \with {
instrumentName = "۳"
  } \three
  \layout { }
}

\book {
  \bookOutputSuffix "3"
  \score {
\new Staff \with {
  midiInstrument = "piccolo"
} \three
\midi {
  \tempo 4=80
}
  }
}

I tried to make a generator function something like this:
#(define-music-function (make-score instrumentName bookSuffix musicContent) 
(string? string? ly:music?)
   #{
 \score {
  \new Staff \with {
instrumentName = $instrumentName
  } $musicContent
  \layout { }
}

\book {
  \bookOutputSuffix $bookSuffix
  \score {
\new Staff \with {
  midiInstrument = "piccolo"
} $musicContent
\midi {
  \tempo 4=80
}
  }
}
   #})

% Usage
make-score "۱" "1" \one
make-score "۲" "2" \two
make-score "3" "3" \three



However I stumbled upon the following error which I can't make a sense
of:
error: syntax error, unexpected STRING, expecting '.' or '='
make-score "۱
 " "1" \one

-- 
Ebrahim Nejati

https://nejati.net
Key: rsa4096/0xDB2CBC2428686000



Re: How to align second repeat verse against second voice

2024-02-26 Thread Andy Bradford
> Reading the rhythm  would be easier if you replaced  two of the dotted
> quarter notes with an eighth note tied to the following quarter note.

Yes,  that's a  great suggestion  too  and in  fact I  had already  been
considering that very modification.

Thanks,

Andy




Re: How to align second repeat verse against second voice

2024-02-26 Thread Jiří Hon

Hi Andy,

Aaron has already answered your question, but I'd like to suggest one more 
adjustment. Reading the rhythm would be easier if you replaced two of the 
dotted quarter notes with an eighth note tied to the following quarter note. 
Here is the modified code:

\version "2.18.2"

\paper {
  #(set-paper-size "letter")
}

\score {
  <<
\new ChoirStaff {
  <<
\new Staff {
  <<
\key c \major
\time 4/4
\new Voice = "first" {
  \relative c' {
\partial 4
c8 c
\repeat volta 2 {
  a b8~ b4 r4 a8 c
  << % maybe there is a better way?
{ \voiceOne c4. d8 d8. }
\new Voice = "second" {
  \voiceTwo \tiny c4 c8 d8 \normalsize }
  >> \oneVoice e16 f8 c
  a c4 c8~ c4 d8 e
}
\alternative {
  { f4 r2 c8 c }
  { f2( d4) c8 c }
}
f1 \bar "|."
  }
}
  >>
}
\new Lyrics \lyricsto "first" {
  lo lo |
  la -- la la -- la |
  la, la la la la la --
  la la. la la la |
  lu mo mo
  mo __ mi me
  ru
}
\new Lyrics \lyricsto "first" {
  \repeat unfold 2 { \skip 1 }
  mo -- mu. mi me |
  \repeat unfold 2 { \skip 1 } ma ma mi me |
  mu -- mo.  ma mi -- mi
}
\new Lyrics \lyricsto "second" {
  ma -- mo mu % this ends up shifted down below the second verse
}
  >>
}
  >>
  \layout {
\context {
  \Score
  proportionalNotationDuration = #(ly:make-moment 1/8)
}
  }
}

Best,
Jiri

On 25. 02. 24 16:24, Andy Bradford wrote:

Thus said Aaron Hill on Sat, 24 Feb 2024 20:51:44 -0800:


Probably  the  easiest  the  option  is  to  \set  associatedVoice  to
temporarily align  your lyrics to  the alternate notes.  The important
quirk of associatedVoice  is that you must make the  change a syllable
ahead of when you need it:


I see,  yes, this works  quite well, thank you.  It also cleans  up some
other tricks I had employed to try to get the text aligned (specifically
I had  some manual  \break and  also extended the  voice longer  than it
needed to be).

Thanks,

Andy






Re: How to align second repeat verse against second voice

2024-02-25 Thread Andy Bradford
Thus said Aaron Hill on Sat, 24 Feb 2024 20:51:44 -0800:

> Probably  the  easiest  the  option  is  to  \set  associatedVoice  to
> temporarily align  your lyrics to  the alternate notes.  The important
> quirk of associatedVoice  is that you must make the  change a syllable
> ahead of when you need it:

I see,  yes, this works  quite well, thank you.  It also cleans  up some
other tricks I had employed to try to get the text aligned (specifically
I had  some manual  \break and  also extended the  voice longer  than it
needed to be).

Thanks,

Andy




Re: How to align second repeat verse against second voice

2024-02-24 Thread Aaron Hill

On 2024-02-24 4:04 pm, Andy Bradford wrote:

Hello,

I have  a piece  with two verses  in a repeat.  The second  time 
through
there  is  a  slight  alteration  in one  of  the  measures  which  
adds
additional notes.  I've been able  to accomplish this using  a 
temporary
voice, but I'm  not sure if this is  the best way as the words  "ma - 
mo
mu" end up shifted down another  line. Here is the smallest section 
that

I could provide, but I wonder if I can align the text better?

[ . . . ]


Each new Lyrics context will appear on its own line.  This is sometimes 
desirable, but if you need to keep lyrics on the same line, they will 
have to share the same Lyrics context.


Probably the easiest the option is to \set associatedVoice to 
temporarily align your lyrics to the alternate notes.  The important 
quirk of associatedVoice is that you must make the change a syllable 
ahead of when you need it:



<<
  \new Voice = melody \relative {
  | c'4 d
<<
  \once \voiceOne e2
  \new Voice = alt \magnifyMusic #0.618 {
\voiceTwo
e8 f e4
  }
>>
  | g1
  }
  \new Lyrics \lyricsto melody { a i u o }
  \new Lyrics \lyricsto melody {
% a i u e u o
%  ↑ │   ↑ │  We switch voices one syllable earlier.
%  └─┘   └─┘

a \set associatedVoice = alt
i u e \unset associatedVoice
u o
  }
>>



-- Aaron Hill

How to align second repeat verse against second voice

2024-02-24 Thread Andy Bradford
Hello,

I have  a piece  with two verses  in a repeat.  The second  time through
there  is  a  slight  alteration  in one  of  the  measures  which  adds
additional notes.  I've been able  to accomplish this using  a temporary
voice, but I'm  not sure if this is  the best way as the words  "ma - mo
mu" end up shifted down another  line. Here is the smallest section that
I could provide, but I wonder if I can align the text better?


\version "2.18.2"

\paper {
  #(set-paper-size "letter")
}

\score {
  <<
\new ChoirStaff {
  <<
\new Staff {
  <<
\key c \major
\time 4/4
\new Voice = "first" {
  \relative c' {
\partial 4
c8 c
\repeat volta 2 {
  a b4. r4 a8 c
  << % maybe there is a better way?
{ \voiceOne c4. d8 d8. }
\new Voice = "second" {
  \voiceTwo \tiny c4 c8 d8 \normalsize }
  >> \oneVoice e16 f8 c
  a c4 c4. d8 e
}
\alternative {
  { f4 r2 c8 c }
  { f2( d4) c8 c }
}
f1 \bar "|."
  }
}
  >>
}
\new Lyrics \lyricsto "first" {
  lo lo |
  la -- la la -- la |
  la, la la la la la --
  la la. la la la |
  lu mo mo
  mo __ mi me
  ru
}
\new Lyrics \lyricsto "first" {
  \repeat unfold 2 { \skip 1 }
  mo -- mu. mi me |
  \repeat unfold 2 { \skip 1 } ma ma mi me |
  mu -- mo.  ma mi -- mi
}
\new Lyrics \lyricsto "second" {
  ma -- mo mu % this ends up shifted down below the second verse
}
  >>
}
  >>
  \layout {
\context {
  \Score
  proportionalNotationDuration = #(ly:make-moment 1/8)
}
  }
}



Re: How to get more accidentials?

2024-02-22 Thread Thomas Richter


Am 21.02.2024 um 17:14 schrieb Johannes Koch:

Hi,

I was trying to extend the example at



.. The emmentaler font currently contains single-arrowed 
flat/natural/sharp accidentials. I'd like to use more accidentials, 
like the double/triple arrow flat/natural/sharp accidentials shown in




.. Is there a way to "extend" the font? Or put the SVGs for the 
missing glphs in a separate file so I can reference them somehow?




you could use ekmelily 
 . I extended it now 
with a new file "ly/ekmel-he.ily" for JI in HE notation as described in 
the LSR example  . It requires a 
SMuFL compliant font like Ekmelos 
 or Bravura 
 and the main include file 
"ly/ekmel-main.ily"; e.g.



\version "2.24.0"
\include "ekmel-he.ily"

\fixed c'' {
  c cih cihh cihhh cisehhh cisehh ciseh cis %...
}


See "samples/he.ly" for all c... notenames (the other names are equivalent).

This is a first attempt to support JI in ekmelily with solely "he" 
notation and a single set of notenames (Dutch), and alias names like 
"es" are missing yet.


--
Thomas



How to get more accidentials?

2024-02-21 Thread Johannes Koch

Hi,

I was trying to extend the example at



. The emmentaler font currently contains single-arrowed 
flat/natural/sharp accidentials. I'd like to use more accidentials, like 
the double/triple arrow flat/natural/sharp accidentials shown in




. Is there a way to "extend" the font? Or put the SVGs for the missing 
glphs in a separate file so I can reference them somehow?


--
Johannes Koch



Re: How to to a Lyrics extender line?

2024-02-14 Thread Michael Gerdau

> Why not
>
> verseC = \lyricmode { \repeat unfold 4 { \skip 8 } lu __ _
>\markup \null \repeat unfold 3 { \skip 8 } lu 
__ _ }


Thanks Kieren, that's kind of what I was looking for :)

Kind regards,
Michael
--
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver



Re: How to to a Lyrics extender line?

2024-02-14 Thread Kieren MacMillan
Hi Michael,

Why not

verseC = \lyricmode { \repeat unfold 4 { \skip 8 } lu __ _
  \markup \null \repeat unfold 3 { \skip 8 } lu __ _ }

?

Hope that helps!
Kieren
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.




Re: How to to a Lyrics extender line?

2024-02-14 Thread Michael Gerdau
I‘d read that. Different but hacky as well and ruins MIDI.

Thank you for pointing that out.

Kind regards,
Michael 
Mobil gesendet

> Am 14.02.2024 um 10:55 schrieb Hans Aikema :
> 
> 
> 
> 
>>> On 14 Feb 2024, at 10:17, Michael Gerdau  wrote:
>>> 
>> Hi list,
>> 
>> I often come across a problem like in the attached example where I want an 
>> extender line to stop (in the example upper system before bar 3).
>> 
>> I can achieve something like it by adding e.g. a "." to the Lyrics and 
>> change the colour to white or something similar (see example lower system 
>> bar 3) but that seems somewhat hacky and I'd like to have a better way.
>> 
>> Is there a better way?
> 
> Only a few days back there was a similar inquiry where I provided a way to do 
> it using a hidden scaled-duration note just before the barline
> 
> https://lists.gnu.org/archive/html/lilypond-user/2024-02/msg00033.html
> 
>> 
>> Kind regards,
>> Michael
>> --
>> Michael Gerdau   email: m...@qata.de
>> GPG-keys available on request or at public keyserver
>> 
>> 


Re: How to to a Lyrics extender line?

2024-02-14 Thread Hans Aikema


> On 14 Feb 2024, at 10:17, Michael Gerdau  wrote:
> 
> Hi list,
> 
> I often come across a problem like in the attached example where I want an 
> extender line to stop (in the example upper system before bar 3).
> 
> I can achieve something like it by adding e.g. a "." to the Lyrics and change 
> the colour to white or something similar (see example lower system bar 3) but 
> that seems somewhat hacky and I'd like to have a better way.
> 
> Is there a better way?

Only a few days back there was a similar inquiry where I provided a way to do 
it using a hidden scaled-duration note just before the barline

https://lists.gnu.org/archive/html/lilypond-user/2024-02/msg00033.html

> 
> Kind regards,
> Michael
> --
> Michael Gerdau   email: m...@qata.de
> GPG-keys available on request or at public keyserver
> 
> 


How to to a Lyrics extender line?

2024-02-14 Thread Michael Gerdau

Hi list,

I often come across a problem like in the attached example where I want 
an extender line to stop (in the example upper system before bar 3).


I can achieve something like it by adding e.g. a "." to the Lyrics and 
change the colour to white or something similar (see example lower 
system bar 3) but that seems somewhat hacky and I'd like to have a 
better way.


Is there a better way?

Kind regards,
Michael
--
 Michael Gerdau   email: m...@qata.de
 GPG-keys available on request or at public keyserver\version "2.25.13"

musicA = { \repeat unfold 2 { c''4 c'' c'' c'' | c''2 c'' } }
musicB = { \repeat unfold 16 { c'4 } }

verseA = \lyricmode { \repeat unfold 4 { \skip 8 } lu __ _
  \repeat unfold 4 { \skip 8 } lu __ _ }
verseC = \lyricmode { \repeat unfold 4 { \skip 8 } lu __ _
  \once \override LyricText.color = #white "." \repeat 
unfold 3 { \skip 8 } lu __ _ }
verseB = \lyricmode { \repeat unfold 16 { la } }

\score {
  <<
\new Staff = "a" <<
  \new Voice = "a1" { \voiceOne \musicA }
  \new Voice = "a2" { \voiceTwo \musicB }
>>
\new Lyrics \with {
  alignAboveContext = "a"
} \lyricsto "a1" { \verseA }
\new Lyrics \lyricsto "a2" { \verseB }
\new Staff = "b" <<
  \new Voice = "b1" { \voiceOne \musicA }
  \new Voice = "b2" { \voiceTwo \musicB }
>>
\new Lyrics \with {
  alignAboveContext = "b"
} \lyricsto "b1" { \verseC }
\new Lyrics \lyricsto "b2" { \verseB }
  >>
  \layout {}
}

stop-lyrics-extender.pdf
Description: Adobe PDF document


Re: How do I force chord names to top of stave when using multiple voices?

2024-02-05 Thread Valentin Petzel
Hello Marcus,

essentially what you have here is
<< chordNames voiceI \\ voiceII >>

If you only had << chordNames voiceI >> this would work out, because Lilypond 
would first see the chord names, which creates a new ChordNames context, and 
then the music, for which Lilypond does implicitely create a new Staff.

Now, when Lilypond encounters \\ as element of a music expression it will 
split the elements along these and create individual voices. So

<< chordNames voiceI \\ voiceII >>

becomes

<< \new Voice { \voiceOne << chordNames voiceI >> } \new Voice { \voiceTwo 
voiceII >>

So Lilypond will first encounter a new Voice, which requires it to implicitely 
create a new Staff, and only then encounter the chord names.

This is why in your case the chord names are below the Staff. To fix this do 
instead of

<< chordNames \new Staff << voiceI \\ voiceII >> >>

so do

\language "english"

<<
  \chords {
e1:maj
  }
  \new Staff <<
\relative c''
{
  \key e \major
  e1 |
}
\\
\relative c'
{
  1 |
}
  >>
>>

Cheers,
Valentin

Am Montag, 5. Februar 2024, 02:33:55 CET schrieb Marcus Mayo:
> Hi all,
> 
> I'm using lilypond to practice my voice leading. I want to keep the harmony
> as a separate voice for the sake of tidiness. However, when I add a second
> voice, the chords appear underneath the staff as opposed to above it. How
> do I fix this?
> 
> Example:
> 
> \version "2.25.11"
> 
> \language "english"
> 
> <<
> \chords {
> e1:maj
> }
> 
> \relative c''
> {
> \key e \major
> e1 |
> }
> \\
> % Chords show above staff until I add second voice, how do I fix?
> \relative c'
> {
> 1 |
> }
> 
> 
> Thanks in advance!



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


How do I force chord names to top of stave when using multiple voices?

2024-02-04 Thread Marcus Mayo
Hi all,

I'm using lilypond to practice my voice leading. I want to keep the harmony
as a separate voice for the sake of tidiness. However, when I add a second
voice, the chords appear underneath the staff as opposed to above it. How
do I fix this?

Example:

\version "2.25.11"

\language "english"

<<
\chords {
e1:maj
}

\relative c''
{
\key e \major
e1 |
}
\\
% Chords show above staff until I add second voice, how do I fix?
\relative c'
{
1 |
}
>>

Thanks in advance!


Re: How to

2024-02-01 Thread François Bastien
Thank you for your explanation and your links, now it works!

Le jeu. 1 févr. 2024, 12:05, Jean Abou Samra  a écrit :

> Try
>
> #(define (should-not-print-arranger layout props)
>(equal? "" (chain-assoc-get 'header:arranger props)))
>
> For one thing, 'header:arranger just gives a symbol
> , it doesn't
> look up the arranger. A symbol is never equal to a string. For another,
> eq? is the wrong test; it checks object identity
> 
> but you could have two empty strings which are equal but not the same
> object (unlike symbols). The links should provide more information.
>
> Best,
>
> Jean
>


Re: How to

2024-02-01 Thread Jean Abou Samra
Try

```
#(define (should-not-print-arranger layout props)  
   (equal? "" (chain-assoc-get 'header:arranger props)))
```

For one thing, `'header:arranger` just gives a 
[symbol](https://extending-lilypond.gitlab.io/en/scheme/quoting.html), it 
doesn't look up the arranger. A symbol is never equal to a string. For another, 
`eq?` is the wrong test; it checks [object 
identity](https://extending-lilypond.gitlab.io/en/scheme/quoting.html#identity-of-symbols)
 but you could have two empty strings which are equal but not the same object 
(unlike symbols). The links should provide more information.

Best,

Jean




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


How to

2024-02-01 Thread François Bastien
Hello,

I make some tweaks to the default layout, and I would want to
conditionally  add an `arr.` before the arranger name on one of my custom
layout. This is used to produce two music sheets, one compact and one
large, the large containing the `arr. Somebody`, and the compact containing
`Somebody`

I tried this:
```
\version "2.24.1"
\header {
  arranger = "" % or arranger = "Somebody"
}

%something

#(define (should-not-print-arranger layout props) (eq? "" 'header:arranger))

% something else

% in the large.ly file:
\unless \should-not-print-arranger
   \smaller \italic \line {
"arr."
\fromproperty  #'header:arranger
  }
```
but this dont work.

It works if I use `should-print-all-headers` in the `\unless` block.

I have a thousand browser tabs open on different parts of the lilypond /
guile documentation and source code, but I can't find what is my error, any
help would be greatly appreciated.

Thanks
-- 
François Bastien


Re: how to install lilypond version on linux (ubuntu 22.04)

2024-01-05 Thread Werner LEMBERG

> I managed to build a specific stable lilypond version for my linux
> distro (Ubuntu 22.04).  Because I can not find the wright
> documentation on this subject, I like to know how can I install the
> generated build files from my build directory on my linux distro.
> When I try to install my build with “sudo make install” I get a
> error about missing about a target rule.  How can I install my build
> manually?

The complete compilation and installation instructions can be found at

  https://lilypond.org/doc/v2.24/Documentation/contributor/compiling


Werner


how to install lilypond version on linux (ubuntu 22.04)

2024-01-05 Thread CX
I managed to build a specific stable lilypond version for my linux distro
(Ubuntu 22.04). Because I can not find the wright documentation on this
subject, I like to know how can I install the generated build files from my
build directory on my linux distro. When I try to install my build with
“sudo make install” I get a error about missing about a target rule. How
can I install my build manually?
Please help.
Best regards
Claude


Re: How to move an ornament vertically

2024-01-02 Thread Valentin Petzel
Hello Hajo,

> I wonder how you can "talk" LilyPond into moving a dashPlus symbol
> above a slur. Without any tweaking it always puts the dashPlus under a
> slur, whereas if you replace the dashPlus by a \trill command, the
> trill symbol is always placed above the slur.

This can be done using the `avoid-slur` property:

{
  c''( d''-\tweak avoid-slur #'outside -+ e'')
}

Cheers,
Valentin

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


How to move an ornament vertically

2024-01-02 Thread Hajo Baess
Dear all,

I wonder how you can "talk" LilyPond into moving a dashPlus symbol
above a slur. Without any tweaking it always puts the dashPlus under a
slur, whereas if you replace the dashPlus by a \trill command, the
trill symbol is always placed above the slur.
If I move around the slur like this:

\override Slur.positions = #'(2 . 2)

there is a collision between the beginning of the slur and the
dashPlus. I am sure there is a way to fix this, but I have not been
able to find it.

Hopefully there will be someone here who can show me the solution.
Thank you in advance for taking the time...

Hajo



Re: How to put a big number in the upper left or right corner of a score?

2023-12-28 Thread billhunker
On some projects,  I use this method:Make the number a rehearsal mark. In the 
layout block:\override Score.RehearsalMark.X-extent = ##f\override 
Score.RehearsalMark.Y-extent = ##f\override Score.RehearsalMark.X-offset= 
#?\override Score.RehearsalMark.Y-offset= #?Create a scheme music definition 
for each page (useful for slides) which includes the rehearsal mark. The 
result,  for me, is a number that prints on every page and immune from pushing 
around, or being pushed around by...other grobs.  Sorry, away from my computer 
now, can't send an actual example.  Sent from my Verizon, Samsung Galaxy 
smartphone
 Original message From: Michael Werner  
Date: 12/28/23  6:15 AM  (GMT-06:00) To: Kris Van Bruwaene  
Cc: lilypond-user@gnu.org Subject: Re: How to put a big number in the upper 
left or right corner of a score? Hi Kris,On Mon, Aug 28, 2023 at 4:44 AM Kris 
Van Bruwaene  wrote:(Lilypond version 2.24.1, Guile 2.2). 

What is the easiest way to put a big number (e.g. font size 4 bold)  
in the upper left or right corner of a score? In previous versions I 
used to manage this with a double header, one in \book and one in 
\score, and faking a second "poet" (left corner) or "composer" (right 
corner), but this does not seem to work any more, at least not the way 
it used to. Moreover it isn't a very "clean" solution. Something like a regular 
(but huge) page number would be better.If this is something you'll want on a 
regular basis I'd do a custom header. They're pretty simple to define - I've 
got one I use for a score version. I used to use either subtitle or 
subsubtitle, but ran into enough cases where I actually had need of both that I 
finally just defined my own header to use.  It goes into a \paper block, 
defined before the \header block where you want to use it. For the docs 
seehttps://lilypond.org/doc/v2.24/Documentation/notation/custom-titles-headers-and-footersThe
 part about defining your own is about half way down. The entry in the \paper 
block for this would be something like:bookTitleMarkup = \markup {   \sans {    
\override #'(baseline-skip . 3.5)    \column {      \fill-line { \null \null 
\fontsize #4 \bold \fromproperty #'header:bignumber }      \fill-line { 
\fromproperty #'header:dedication }      \override #'(baseline-skip . 3) % 
default 3.5      \column {        \fill-line {          \huge \larger \larger 
\bold          \fromproperty #'header:title        }        \fill-line {        
  \large \bold          \fromproperty #'header:subtitle        }        
\fill-line {          \smaller \bold          \fromproperty 
#'header:subsubtitle        }        \fill-line {          { \smaller 
\fromproperty #'header:poet }          { \bold \fromproperty 
#'header:myscoreversion }          { \smaller \fromproperty #'header:composer } 
       }        \fill-line {          { \smaller \fromproperty #'header:meter } 
         { \large \bold \fromproperty #'header:instrument }          { \smaller 
\fromproperty #'header:arranger }        }      }    }  }}In this case a new 
header field called bignumber is defined on the fifth line, placed at the very 
top of the header block, in the top right corner.  If you want it in the top 
left corner, change that line to:\fill-line { \fontsize #4 \bold \fromproperty 
#'header:bignumber \null \null }(BTW, Lilypond's default for this block is in 
titling-init.ly)  In this block you can adjust the order and placement of all 
the headers, not just your own custom ones. In this example, I've also added 
myscoreversion (the one I mentioned earlier), put it where the instrument 
header used to be, and moved instrument down a line centered between meter and 
arranger (a spot left blank in the default).To use your newly defined custom 
header, you set it just like any other header:\header {  title = "Title Goes 
Here"  bignumber = "42"  composer = "Written by Somebody"  subtitle = "Random 
subtitle"}Also, as this is now a defined header entry, it can be used just like 
any other header entry, such as in subsequent page headers:oddHeaderMarkup = 
\markup \sans {  \fill-line {    \unless \on-first-page    \fontsize #4 \bold 
\fromproperty #'header:bignumber    \unless \on-first-page    \fromproperty 
#'header:title    \unless \on-first-page    \fromproperty 
#'page:page-number-string  }}Granted, this all winds up being a fair sized 
chunk of code. But it's easy enough to just save it all off into an include 
file, where it's out of the way but accessible.-- Michael


Re: How to achieve minimum horizontal spacing between notes

2023-12-28 Thread Jiří Hon

After some trial and error, the simplest workaround was to override the stencil 
of NoteHead so it draws the missing ledger line. I conditionally set 
NoteHead.stencil to ly:text-interface::print and set NoteHead.text to custom 
markup function.

\override NoteHead.stencil =
#(lambda (grob)
   (let ((pos (ly:grob-property grob 'staff-position)))
 (begin
   (if (< pos -7) (display "ERROR: Lower brevis then expected\n") (display 
""))
   (if (<= pos -6) ly:text-interface::print ly:note-head::print

\override NoteHead.text =
  #(lambda (grob)
 (let ((pos (ly:grob-property grob 'staff-position)))
   #{\markup {
 \combine
\halign #-0.55 \raise #(if (= pos -6) 0 0.5) \override #'(thickness 
. 2) \draw-line #'(3.2 . 0)
\musicglyph "noteheads.sM1"
}#}))

It is very basic ledger line code that is valid only for staff positions -6 and 
-7, but this is all I need for the psalms.

Even though my question didn't get any attention, I hope this workaround might 
help someone in the future.

Many thanks to all the developers of LilyPond for creating such a highly 
customizable music engraving tool. I can't imagine creating this project 
without LilyPond.

Kind regards,
Jiri Hon


On 15. 12. 23 13:19, Jiří Hon wrote:

Dear LilyPond community,

I'm working on an web psalter https://www.zaltar.cz (in Czech language) with 
responsive music notation based on LilyPond. For example, take a look at 
https://www.zaltar.cz/OL1.html and try changing the width of the browser. The 
notation is pre-engraved at 9 different sizes and the correct size is 
automatically selected using CSS rules. The LilyPond code used to create the 
notation is linked at the bottom of each page.

In order to make the notation work at so many different sizes, I have used the 
excellent work of Thomas Morley 
(https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html), Jean 
Abou Samra and Werner Lemberg 
(https://www.mail-archive.com/lilypond-user@gnu.org/msg149350.html). Thank you 
very much! Their code handles automatic wrapping of long breves and snapping 
syllables so that they appear as one text on each breve.

However, I would like to take musical notation even further. Right now, there's 
a lot of extra space behind the breve because of those invisible notes that are 
evenly spaced.

My question is: Is it possible to reduce the spacing between those invisible 
breves? I tried using \override NoteHead.X-extent = #'(0 . 0). This almost does 
what I want. The notes can overlap and the spacing is dictated by the text 
only, which is great for my purpose. However, there is serious drawback to 
this. The ledger lines stop working. This is understandable, since they need 
the X-extent of note heads to calculate the length. So, please, is there any 
other way to a achieve similar spacing, but without interfering with the ledger 
lines?

Below is some kind of MWE. I would like to achieve the same spacing as in the 
MWE, but with working ledger lines:

\version "2.24.0"

\header {
   tagline = ""
}

\paper {
   indent = 0\cm
   top-margin = 0\cm
   right-margin = 0\cm
   bottom-margin = 0\cm
   left-margin = 0\cm
   paper-width = 15\cm
   page-breaking = #ly:one-page-breaking
}

hideNotes = {
   % logic for hiding notes based on Thomas Morley's work
   % https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html
}
unHideNotes = {
   % logic for hiding notes based on Thomas Morley's work
   % https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html
}

squashNotes = {
   \override NoteHead.X-extent = #'(0 . 0)
}
unSquashNotes = {
   \revert NoteHead.X-extent
}

\score {
   <<
     \new Voice = "melody" {
   \cadenzaOn \key c \major \relative {
     c'\breve*1/16 \squashNotes \hideNotes \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 
\bar "" \breve*1/16 \bar ""
     \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 \bar "" 
\breve*1/16 \breve*1/16 \bar ""
     \unHideNotes \unSquashNotes \bar "" f8 e d d4 r \bar "|"
     d\breve*1/16 \squashNotes \hideNotes \breve*1/16 \breve*1/16 \bar "" 
\unHideNotes \unSquashNotes \bar ""
     g8[( f)] e e2 \bar "||" \break
   }
     }
     \new Lyrics \lyricsto "melody" {
   \lyricmode {
     \set stanza = "3."
     Bu -- deš-li u -- cho -- vá -- vat "v pa" -- mě -- ti vi -- ny, Ho -- 
spo -- di -- ne,
     Pa -- ne, kdo ob -- sto -- jí?
   }
     }
   >>
}

Thank you very much for your time and effort,
Jiri Hon




Re: How to put a big number in the upper left or right corner of a score?

2023-12-28 Thread Michael Werner
Hi Kris,

On Mon, Aug 28, 2023 at 4:44 AM Kris Van Bruwaene  wrote:

> (Lilypond version 2.24.1, Guile 2.2).
>
> What is the easiest way to put a big number (e.g. font size 4 bold)  in
> the upper left or right corner of a score? In previous versions I used to
> manage this with a double header, one in \book and one in \score, and
> faking a second "poet" (left corner) or "composer" (right corner), but this
> does not seem to work any more, at least not the way it used to. Moreover
> it isn't a very "clean" solution. Something like a regular (but huge) page
> number would be better.
>

If this is something you'll want on a regular basis I'd do a custom header.
They're pretty simple to define - I've got one I use for a score version. I
used to use either subtitle or subsubtitle, but ran into enough cases where
I actually had need of both that I finally just defined my own header to
use.  It goes into a \paper block, defined before the \header block where
you want to use it. For the docs see
https://lilypond.org/doc/v2.24/Documentation/notation/custom-titles-headers-and-footers
The part about defining your own is about half way down. The entry in the
\paper block for this would be something like:

bookTitleMarkup = \markup {
  \sans {
\override #'(baseline-skip . 3.5)
\column {
  \fill-line { \null \null \fontsize #4 \bold \fromproperty
#'header:bignumber }
  \fill-line { \fromproperty #'header:dedication }
  \override #'(baseline-skip . 3) % default 3.5
  \column {
\fill-line {
  \huge \larger \larger \bold
  \fromproperty #'header:title
}
\fill-line {
  \large \bold
  \fromproperty #'header:subtitle
}
\fill-line {
  \smaller \bold
  \fromproperty #'header:subsubtitle
}
\fill-line {
  { \smaller \fromproperty #'header:poet }
  { \bold \fromproperty #'header:myscoreversion }
  { \smaller \fromproperty #'header:composer }
}
\fill-line {
  { \smaller \fromproperty #'header:meter }
  { \large \bold \fromproperty #'header:instrument }
  { \smaller \fromproperty #'header:arranger }
}
  }
}
  }
}

In this case a new header field called bignumber is defined on the fifth
line, placed at the very top of the header block, in the top right corner.
If you want it in the top left corner, change that line to:
\fill-line { \fontsize #4 \bold \fromproperty #'header:bignumber \null
\null }
(BTW, Lilypond's default for this block is in titling-init.ly)  In this
block you can adjust the order and placement of all the headers, not just
your own custom ones. In this example, I've also added myscoreversion (the
one I mentioned earlier), put it where the instrument header used to be,
and moved instrument down a line centered between meter and arranger (a
spot left blank in the default).

To use your newly defined custom header, you set it just like any other
header:

\header {
  title = "Title Goes Here"
  bignumber = "42"
  composer = "Written by Somebody"
  subtitle = "Random subtitle"
}

Also, as this is now a defined header entry, it can be used just like any
other header entry, such as in subsequent page headers:

oddHeaderMarkup = \markup \sans {
  \fill-line {
\unless \on-first-page
\fontsize #4 \bold \fromproperty #'header:bignumber
\unless \on-first-page
\fromproperty #'header:title
\unless \on-first-page
\fromproperty #'page:page-number-string
  }
}

Granted, this all winds up being a fair sized chunk of code. But it's easy
enough to just save it all off into an include file, where it's out of the
way but accessible.
-- 
Michael


Re: How to put a big number in the upper left or right corner of a score?

2023-12-28 Thread Jean Abou Samra
Hi,


> Thank you Jean. I just now wanted to apply your tip, but it's not quite what 
> I expected. If I copy your script litterally, the number overlaps with the 
> \header (piece title, composer etc.). If I delete the \with-outline the 
> overlap is gone, but the number appears below the header, but I would like it 
> in the TOP corner, above the header. Is that possible?



Sorry for the very late reply. It's best to reply to the list also, this shares 
the burden of helping (I've added back in CC).

You could increase the distance from the top of the page to the header, as in, 
e.g.,

```
\version "2.24.2"

\paper {
  top-markup-spacing.minimum-distance = 10
}
\header {
  title = "ABC"
}
{ c' }
```


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


How to achieve minimum horizontal spacing between notes

2023-12-15 Thread Jiří Hon

Dear LilyPond community,

I'm working on an web psalter https://www.zaltar.cz (in Czech language) with 
responsive music notation based on LilyPond. For example, take a look at 
https://www.zaltar.cz/OL1.html and try changing the width of the browser. The 
notation is pre-engraved at 9 different sizes and the correct size is 
automatically selected using CSS rules. The LilyPond code used to create the 
notation is linked at the bottom of each page.

In order to make the notation work at so many different sizes, I have used the 
excellent work of Thomas Morley 
(https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html), Jean 
Abou Samra and Werner Lemberg 
(https://www.mail-archive.com/lilypond-user@gnu.org/msg149350.html). Thank you 
very much! Their code handles automatic wrapping of long breves and snapping 
syllables so that they appear as one text on each breve.

However, I would like to take musical notation even further. Right now, there's 
a lot of extra space behind the breve because of those invisible notes that are 
evenly spaced.

My question is: Is it possible to reduce the spacing between those invisible 
breves? I tried using \override NoteHead.X-extent = #'(0 . 0). This almost does 
what I want. The notes can overlap and the spacing is dictated by the text 
only, which is great for my purpose. However, there is serious drawback to 
this. The ledger lines stop working. This is understandable, since they need 
the X-extent of note heads to calculate the length. So, please, is there any 
other way to a achieve similar spacing, but without interfering with the ledger 
lines?

Below is some kind of MWE. I would like to achieve the same spacing as in the 
MWE, but with working ledger lines:

\version "2.24.0"

\header {
  tagline = ""
}

\paper {
  indent = 0\cm
  top-margin = 0\cm
  right-margin = 0\cm
  bottom-margin = 0\cm
  left-margin = 0\cm
  paper-width = 15\cm
  page-breaking = #ly:one-page-breaking
}

hideNotes = {
  % logic for hiding notes based on Thomas Morley's work
  % https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html
}
unHideNotes = {
  % logic for hiding notes based on Thomas Morley's work
  % https://lists.gnu.org/archive/html/lilypond-user/2020-05/msg2.html
}

squashNotes = {
  \override NoteHead.X-extent = #'(0 . 0)
}
unSquashNotes = {
  \revert NoteHead.X-extent
}

\score {
  <<
\new Voice = "melody" {
  \cadenzaOn \key c \major \relative {
c'\breve*1/16 \squashNotes \hideNotes \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 
\bar "" \breve*1/16 \bar ""
\breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 \bar "" \breve*1/16 \bar "" 
\breve*1/16 \breve*1/16 \bar ""
\unHideNotes \unSquashNotes \bar "" f8 e d d4 r \bar "|"

d\breve*1/16 \squashNotes \hideNotes \breve*1/16 \breve*1/16 \bar "" \unHideNotes \unSquashNotes \bar ""

g8[( f)] e e2 \bar "||" \break
  }
}
\new Lyrics \lyricsto "melody" {
  \lyricmode {
\set stanza = "3."
Bu -- deš-li u -- cho -- vá -- vat "v pa" -- mě -- ti vi -- ny, Ho -- 
spo -- di -- ne,
Pa -- ne, kdo ob -- sto -- jí?
  }
}
  >>
}

Thank you very much for your time and effort,
Jiri Hon



Re: How to force score/bookpart to start after page turn?

2023-11-30 Thread Nikolai Hedler
I should mention - the \pageTurn function does not appear to be useful
here, as it either a) separates the headers from the score if placed within
the bookpart but before the score, b) adds stray headers if placed between
bookparts, or c) does nothing if placed at the end of the bookpart.

- Nikolai


On Thu, Nov 30, 2023 at 3:15 PM Nikolai Hedler  wrote:

> I have a book of scores and parts and would like to ensure that two-page
> parts are always printed on opposite pages, so there's no page turn. Is
> there a straightforward way to automatically add a blank page if the
> previous part/score ends on a left page?
>
> - Nikolai
>


How to force score/bookpart to start after page turn?

2023-11-30 Thread Nikolai Hedler
I have a book of scores and parts and would like to ensure that two-page
parts are always printed on opposite pages, so there's no page turn. Is
there a straightforward way to automatically add a blank page if the
previous part/score ends on a left page?

- Nikolai


Re: How do I shift notes in one voice w/o shifting the other?

2023-11-29 Thread Kevin Cole
On Wed, Nov 29, 2023 at 4:05 PM Knute Snortum  wrote:

> The original is odd.  It has a half note where a quarter note should be.  But 
> if you want to reproduce it exactly, see my code below.  No need for 
> temporary voices.

Another wrote to me privately suggesting that the original that I'm
copying from was more than likely just plain wrong, saying essentially
what you've just said. That hadn't occurred to me, but after it was
pointed out, my wee brain said "O. That makes sense." Not being a
music reader, I am slow to pick up on such things, and only know upon
MIDI playback that something sounds off. So, now with two votes for
"half-notes there are wrong / odd" I'm going to transcribe it with
quarter-notes there, listen to the MIDI and, if it sounds okay, leave
them as quarter-notes.

Thanks!



Re: How do I shift notes in one voice w/o shifting the other?

2023-11-29 Thread Knute Snortum
On Wed, Nov 29, 2023 at 11:54 AM Kevin Cole  wrote:

> On Wed, Nov 29, 2023 at 10:04 AM Knute Snortum  wrote:
>
> Thanks.
>
> > I'm not sure what you want to do makes musical sense, that is, the  d'>2 and the d'8 should be on the same beat, so why do you want the half
> note to the right?
>
> I'm simply copying what's written in the original.
>

The original is odd.  It has a half note where a quarter note should be.
But if you want to reproduce it exactly, see my code below.  No need for
temporary voices.


>
> > (BTW, it's better to provide a working example as the above does not
> compile without the language statement):
>
> I often err on the side of providing too much. So, I tried to provide
> as little as possible that I thought would get the problem across.
> I'll try to remember to include at least version, language, and maybe
> time signature next time.
>

Well, the code you provide should at least compile, or produce the error
you're talking about.  Otherwise, yes, pare it down as much as you can.


\version "2.24.3"
\language "english"

upper = \relative {
  d''8 b 2*1/2~ | % or just 4
  q4\fermata d' |
}

lower = \relative {
  \clef bass
  b8 b16 cs d8 a |
  d,4\fermata r |
}

\score {
  \new PianoStaff <<
\time 2/4
\new Staff \upper
\new Staff \lower
  >>
}


--
Knute Snortum


Re: How do I shift notes in one voice w/o shifting the other?

2023-11-29 Thread Knute Snortum
--
Knute Snortum



On Tue, Nov 28, 2023 at 6:32 PM Kevin Cole  wrote:

> I searched for a way to shift notes horizontally but when I shift the
> half-note chord in the first voice below, it shifts the second eighth-note
> in the second voice, forcing it to stay to the right of the half-note. When
> I tried adding something to shift the beamed eight-notes to the left, it
> shifted only the first eighth-note, continuing to anchor the second to the
> right of the half-note.
>
> What I want is for the two eighth-notes to stay to the left, and for the
> half-note to appear to the right of it.
>
> This is what I have at the moment, with the shift commented out. (The
> "#10" is just an experiment, not necessarily the final value.)
>
> %%%
>   <<
> {
> % \once \override NoteColumn.force-hshift = #10
>   2~|
>   4\fermata s4   |
> }
> \\
> {
>   d'8[ b8] s4   |
>   s4 d4 |
> }
>   >>
>   \bar "|."
> %%%
>

I'm not sure what you want to do makes musical sense, that is, the 2
and the d'8 should be on the same beat, so why do you want the half note to
the right?  But if you really want to do that, you could try the below
(BTW, it's better to provide a working example as the above does not
compile without the language statement):

\version "2.24.3"
\language "english"

\relative c'' {
  \time 2/4
  <<
{
  s8 2*3/4~|
  4\fermata s4   |
}
\\
{
  d'8[ b8] s4   |
  s4 d4 |
}
  >>
  \bar "|."
}


How do I shift notes in one voice w/o shifting the other?

2023-11-28 Thread Kevin Cole
I searched for a way to shift notes horizontally but when I shift the
half-note chord in the first voice below, it shifts the second eighth-note
in the second voice, forcing it to stay to the right of the half-note. When
I tried adding something to shift the beamed eight-notes to the left, it
shifted only the first eighth-note, continuing to anchor the second to the
right of the half-note.

What I want is for the two eighth-notes to stay to the left, and for the
half-note to appear to the right of it.

This is what I have at the moment, with the shift commented out. (The "#10"
is just an experiment, not necessarily the final value.)

%%%
  <<
{
% \once \override NoteColumn.force-hshift = #10
  2~|
  4\fermata s4   |
}
\\
{
  d'8[ b8] s4   |
  s4 d4 |
}
  >>
  \bar "|."
%%%


Re: solved; how to get system separator on both sides

2023-11-28 Thread Jean Abou Samra

> Yes thank you that works.  perhaps could be put in snippet respository?

[https://lsr.di.unimi.it/LSR/Item?id=1176](https://lsr.di.unimi.it/LSR/Item?id=1176)





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


solved; how to get system separator on both sides

2023-11-28 Thread jh



Yes thank you that works.  perhaps could be put in snippet respository?

On 2023-11-28 02:09, Jean Abou Samra wrote:


I don't think it's in a snippet, but you can do

\version "2.24.2"

\paper {
system-separator-markup = \markup \fill-line { \slashSeparator 
\slashSeparator }

}

{ c' \break c' }

Re: forgotten how to get system separator on both sides

2023-11-28 Thread Jean Abou Samra
I don't think it's in a snippet, but you can do

```
\version "2.24.2"

\paper {
  system-separator-markup = \markup \fill-line { \slashSeparator 
\slashSeparator }
}

{ c' \break c' }
```


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


forgotten how to get system separator on both sides

2023-11-27 Thread jh



Long ago I was an active user but it's gotten so far away that I use an 
older version 2.22.1  longer ago my conductor (at the time) wanted 
slash separators on both sides of the system that was for 1.16.x I 
think.


But is this possible again?  If so please either direct me to the 
snippet or page in the manuals.


thanks

Sam

--
Thank you

Sound & Silence

1814 Lake Washington Blvd. So., Seattle, Wa. 98144

_206-328-7694 or messages at 206-308-8189_

_www.soundand.com_

Re: How do I arpeggiate across voices?

2023-11-27 Thread Kevin Cole
On Mon, Nov 27, 2023 at 11:16 AM Michael Werner  wrote:

> On Mon, Nov 27, 2023 at 7:43 AM Kevin Cole  wrote:
>
>> Thanks. Not sure how I missed that in my search... That seems the best
>> answer -- though, alas, the MIDI arpeggiator cannot take advantage of it.
>> (I may be able to suss that out "the hard way" manually though.)
>>
>
> Sorry, but MIDI is an area I know almost nothing about, as I almost never
> use it. My main focus is hardcopy.  Best I can come up with is to do
> something a little like what is shown in
>
>
>> MIDI arpeggiator:
>> https://lists.gnu.org/archive/html/lilypond-user/2020-12/msg00036.html
>>
>
> It would involve basically making a parallel version of your music that,
> while not looking like what you want the printed output to look like, will
> sound right (or close to it) once run through the MIDI system.
>

That's essentially the direction I've gone. (I already regularly split /
duplicate the score into a print layout version and a MIDI version. It's
just a matter of figuring out what, if anything, will sound "right" to
my amateur ear.)


Re: How do I arpeggiate across voices?

2023-11-27 Thread Michael Werner
Hi Kevin,

On Mon, Nov 27, 2023 at 7:43 AM Kevin Cole  wrote:

> Thanks. Not sure how I missed that in my search... That seems the best
> answer -- though, alas, the MIDI arpeggiator cannot take advantage of it.
> (I may be able to suss that out "the hard way" manually though.)
>

Sorry, but MIDI is an area I know almost nothing about, as I almost never
use it. My main focus is hardcopy.  Best I can come up with is to do
something a little like what is shown in


> MIDI arpeggiator:
> https://lists.gnu.org/archive/html/lilypond-user/2020-12/msg00036.html
>

It would involve basically making a parallel version of your music that,
while not looking like what you want the printed output to look like, will
sound right (or close to it) once run through the MIDI system. The two
versions would then be decided on via the tags as shown in the
linked example. It'll be a bit of a tedious PITA, but it'll get the job
done. Sorta kinda. Anyway, something like:

\version "2.25.10"
\language "english"

\include "../include/arpeggioMIDI.ly"

music = \relative c' {
  \set Staff.connectArpeggios = ##t % Need to tell Lilypond to play connect
the dots with the arpeggios
  e4 e e
  \tag #'layout {
<<
  { e4\arpeggio e4 b4 | e2 b8[ b8] | }
  \\
  { 2.\arpeggio | \stemUp gs2 \stemNeutral s4 | }
>>
  }
  \tag #'midi {
<<
  { \midiArpeggio 12 4 e b | e2 b8 b }
  \\
  { 2. | gs2 s4 }
>>
  }
  d'4 d d
}

\score {
  \new Staff \with {
\consists "Span_arpeggio_engraver" % Could also be done in a layout
block
  } {
\time 3/4
\new Voice {
  \removeWithTag #'midi \music
}
  }
  \layout {}
}

\score {  % Added this one out of curiosity - wanted to see what it would
look like.
  \new Staff \with {
\consists "Span_arpeggio_engraver" % Could also be done in a layout
block
  } {
\time 3/4
\new Voice {
  \removeWithTag #'layout \music
}
  }
  \layout {}
}

\score {
  \new Staff {
\time 3/4
\new Voice {
  \removeWithTag #'layout \music
}
  }
  \midi {}
}

That's the rough approach. And I'm not real sure just how close that MIDI
output sounds compared to what it should be. There's bound to be a better
way to do this. I just don't know what that better way might be.
-- 
Michael


Re: How do I arpeggiate across voices?

2023-11-27 Thread Kevin Cole
On Mon, Nov 27, 2023 at 12:33 AM Michael Werner  wrote:

> Hi Kevin,
>
> On Sun, Nov 26, 2023 at 7:38 PM Kevin Cole  wrote:
>
>> I'm looking at a pice of music that shows an arpeggio between two
>> dotted half-notes in one voice and a quarter-note in the other voice.
>> Specifically, in the wee snippet below, the first e4 in the first
>> voice is at the top of the arpeggio above the 2 in the second
>> voice.
>>
>
> Having a look at
> http://lilypond.org/doc/v2.25/Documentation/notation/arpeggio#index-arpeggio_002c-cross_002dvoice
> it turns out there's a Span_arpeggio_engraver you can add to take care of
> this. Also, a Staff.connectArpeggios property to set. Adding those in, your
> example becomes:
>
Thanks. Not sure how I missed that in my search... That seems the best
answer -- though, alas, the MIDI arpeggiator cannot take advantage of it.
(I may be able to suss that out "the hard way" manually though.)

MIDI arpeggiator:
https://lists.gnu.org/archive/html/lilypond-user/2020-12/msg00036.html
https://lists.gnu.org/archive/html/lilypond-user/2020-12/msg00039.html


Re: How do I arpeggiate across voices?

2023-11-26 Thread Michael Werner
Hi Kevin,

On Sun, Nov 26, 2023 at 7:38 PM Kevin Cole  wrote:

> I'm looking at a pice of music that shows an arpeggio between two
> dotted half-notes in one voice and a quarter-note in the other voice.
> Specifically, in the wee snippet below, the first e4 in the first
> voice is at the top of the arpeggio above the 2 in the second
> voice.
>

Having a look at
http://lilypond.org/doc/v2.25/Documentation/notation/arpeggio#index-arpeggio_002c-cross_002dvoice
it turns out there's a Span_arpeggio_engraver you can add to take care of
this. Also, a Staff.connectArpeggios property to set. Adding those in, your
example becomes:

\version "2.25.10"
\language "english"

music = \relative c' {
  \set Staff.connectArpeggios = ##t % Need to tell Lilypond to play connect
the dots with the arpeggios
  <<
{
  e4\arpeggio e4 b4  | %  1 - Need to mark both top and bottom of
connected arpeggios
  e2 b8[ b8]  | %  2
}
\\
{
  2.\arpeggio | %  1 - Need to mark both top and bottom of
connected arpeggios
  \stemUp gs2 \stemNeutral s4 | %  2
}
  >>
}

\new Staff \with {
  \consists "Span_arpeggio_engraver" % Could also be done in a layout block
} {
  \time 3/4 % Just a guess? Fixes the barcheck error
  \new Voice {
\music
  }
}
-- 
Michael


Re: How do I arpeggiate across voices?

2023-11-26 Thread Knute Snortum
On Sun, Nov 26, 2023 at 4:38 PM Kevin Cole  wrote:

> I'm looking at a pice of music that shows an arpeggio between two
> dotted half-notes in one voice and a quarter-note in the other voice.
> Specifically, in the wee snippet below, the first e4 in the first
> voice is at the top of the arpeggio above the 2 in the second
> voice.
>
> %%
>   <<
> {
>   e4 e4 b4   | %  1
>   e2 b8[ b8] | %  2
> }
> \\
> {
>   2.\arpeggio | %  1
>   \stemUp gs2 \stemNeutral s4| %  2
> }
>   >>
> %%
>

The way I do it is to fiddle with the arpeggio positions property:

\version "2.24.3"
\language "english"

\relative c' {
  \time 3/4
  <<
  {
e4 e4 b4   | %  1
e2 b8[ b8] | %  2
  }
  \\
  {
\once \override  Arpeggio.positions = #'(-5 . -1) 2.\arpeggio | %  1
\stemUp gs2 \stemNeutral s4| %  2
  }
  >>
}


--
Knute Snortum


How do I arpeggiate across voices?

2023-11-26 Thread Kevin Cole
I'm looking at a pice of music that shows an arpeggio between two
dotted half-notes in one voice and a quarter-note in the other voice.
Specifically, in the wee snippet below, the first e4 in the first
voice is at the top of the arpeggio above the 2 in the second
voice.

%%
  <<
{
  e4 e4 b4   | %  1
  e2 b8[ b8] | %  2
}
\\
{
  2.\arpeggio | %  1
  \stemUp gs2 \stemNeutral s4| %  2
}
  >>
%%



Re: How to "guarantee" Lilypond pdf (letter) output with sufficient margins for 3-hole punch?

2023-10-23 Thread Kenneth Wolcott
Hi Knute;

  Thanks for the tips.

  I'm in the midst of engraving a one-page sheet of music now using
your suggestions, hopefully it will be correct for three-hole-punching
or easy for me to fiddle with the values of the settings.

Thanks,
Ken

On Mon, Oct 23, 2023 at 1:30 PM Knute Snortum  wrote:
>
>
> On Mon, Oct 23, 2023 at 11:09 AM Kenneth Wolcott  
> wrote:
>>
>> Hi;
>>
>>   How to "guarantee" Lilypond pdf (letter) output with sufficient
>> margins for 3-hole punch?
>
>
> It's no guarantee, but I put the following in my paper block:
>
>   two-sided = ##t
>   inner-margin = 12\mm
>   outer-margin = 8\mm
>
> --
> Knute Snortum
>
>



Re: How to "guarantee" Lilypond pdf (letter) output with sufficient margins for 3-hole punch?

2023-10-23 Thread Knute Snortum
On Mon, Oct 23, 2023 at 11:09 AM Kenneth Wolcott 
wrote:

> Hi;
>
>   How to "guarantee" Lilypond pdf (letter) output with sufficient
> margins for 3-hole punch?
>

It's no guarantee, but I put the following in my paper block:

  two-sided = ##t
  inner-margin = 12\mm
  outer-margin = 8\mm

--
Knute Snortum


How to "guarantee" Lilypond pdf (letter) output with sufficient margins for 3-hole punch?

2023-10-23 Thread Kenneth Wolcott
Hi;

  How to "guarantee" Lilypond pdf (letter) output with sufficient
margins for 3-hole punch?

  I'm looking forward to having a method of "guaranteeing" Lilypond
pdf output for letter (not a4) of my engravings such that the
resulting printout can be three-hole punched (on both sides
potentially) without making adversely affecting the visibility of the
pdf.

  This "procedure" or "process" might be needed retroactively as well
as for a new engraving project.

  I know that this might be a proportionate value so I'd have to
adjust it if I specified (or changed) a global font size.

  I guess what I'm looking for is the equivalent of "indent" but for
every system.

  I'll look again to see if I understand "margin"-related settings...

Thanks for hints...

Ken Wolcott



Re: how to modify footnote numbered mark line length

2023-10-15 Thread Werner LEMBERG

> Here is the example.

The line between the grob and the footnote number is controlled by the
number's position, i.e., the first argument to the `\footnote`
command.

```
\version "2.24.2"

{
  \footnote #'(-1 . 3) "A note." a'4
  a'4
  \footnote #'(-5 . -5) "Another note." a'4
  a'4
}
```


Werner


Re: how to modify footnote numbered mark line length

2023-10-15 Thread Paolo Cantamessa
Here is the example.

Many thanks.

Il dom 15 ott 2023, 16:02 Werner LEMBERG  ha scritto:

>
> > someone know how to modify line length footnote between number and
> > music object?
>
> Please show images that explain what you want to do.
>
>
> Werner
>


Re: how to modify footnote numbered mark line length

2023-10-15 Thread Werner LEMBERG


> someone know how to modify line length footnote between number and
> music object?

Please show images that explain what you want to do.


Werner



  1   2   3   4   5   6   7   8   9   10   >