Re: LSR down?

2024-06-24 Thread Werner LEMBERG


>> The LSR looks like it's down.  I don't know who is responsible for
>> it so I thought I'd just post here.
> 
> Thanks.  I've written an e-mail to Sebastiano.

And its online again.


Werner



Re: LSR down?

2024-06-23 Thread Werner LEMBERG


> The LSR looks like it's down.  I don't know who is responsible for
> it so I thought I'd just post here.

Thanks.  I've written an e-mail to Sebastiano.


Werner



Re: markup function accepting either markup or markup list as argument

2024-06-22 Thread Werner LEMBERG

>> I want to write a user-friendly markup command that can accept either
>> a markup or a markup list as arguments.  Example:
>>
>> ```
>> % \ornament   
>> \markup \ornament \number ♭
>>   \musicglyph "scripts.turn"
>>   \number ♮
>> \markup \ornament { \number ♭ \number ♭ }
>>   \musicglyph "scripts.turn"
>>   \number ♮
>> ```
> 
> So if you give a markup list here, is this supposed to be stacked
> horizontally or vertically?

Vertically.

> If horizontally, adding \line does not seem all that terrible.

Yep.

> And it will be hard to explain what
> 
> \markup \ornament \with-color #red { \number ♭ \number ♭ } ...
> 
> is supposed to do: is \with-color #red applied to the numbers or to
> the whole list?

I would rather write either

  \markup \with-color #red \ornament { \number ♭ \number ♭ } ...

or 

  \markup \ornament { \with-color #red \number ♭
  \with-color #red \number ♭ } ...

so I don't mind if

  \markup \ornament \with-color #red { \number ♭ \number ♭ } ...

is probably not well defined.


Werner


Re: markup function accepting either markup or markup list as argument

2024-06-22 Thread Werner LEMBERG

> The documentation clearly states:
> 
> 
> 
>Arguments are distinguished according to their type:
>• a markup, corresponding to type predicate ‘markup?’;
>• a list of markups, corresponding to type predicate
>  ‘markup-list?’;
>• any other scheme object, corresponding to type predicates such
>  as ‘list?’, ‘number?’, ‘boolean?’, etc.
>
> You use a predicate other than markup? or markup-list?, so this
> counts as any other scheme object.

OK.

> The real question is what you actually are trying to achieve here.

I want to write a user-friendly markup command that can accept either
a markup or a markup list as arguments.  Example:

```
% \ornament   
\markup \ornament \number ♭
  \musicglyph "scripts.turn"
  \number ♮
\markup \ornament { \number ♭ \number ♭ }
  \musicglyph "scripts.turn"
  \number ♮
```


Werner


markup function accepting either markup or markup list as argument

2024-06-22 Thread Werner LEMBERG


Folks,


I would like to write a markup function that can either accept a
markup or a markup list as an argument.  The code below works fine,
reporting

```
bar: (#)
baz: 1
bar: ((#)
  (#))
baz: 1
```

as expected.  (The `baz` argument is inserted in the demo code to
avoid interference with LilyPond's special handling of a markup
function's last argument, which can be either a markup or a markup
list, for example, `\bold foo` or `\bold { foo bar }`.)

However, if I activate the commented-out code, LilyPond aborts with

```
error: syntax error, unexpected MARKUP_FUNCTION
\markup \fooEither 
   \flat #1
```

It seems to me that this is a limitation built into LilyPond's parser,
and it is not possible to do what I would like to achieve, probably
due to the above-mentioned special handling of the last argument.  Has
someone more insight?


Werner


==


\version "2.24.0"

#(define-markup-command (foo layout props bar baz)
   (markup? number?)
   (ly:message "bar: ~a" bar)
   (ly:message "baz: ~a" baz)
   (interpret-markup layout props bar))

\markup \foo \flat #1


#(define-markup-command (fooList layout props bar baz)
   (markup-list? number?)
   (ly:message "bar: ~a" bar)
   (ly:message "baz: ~a" baz)
   (interpret-markup layout props (car bar)))

\markup \fooList { \sharp \sharp } #1


% #(define (markup-or-markup-list? x)
%(or (markup? x) (markup-list? x)))
%
% #(define-markup-command (fooEither layout props bar baz)
%(markup-or-markup-list? number?)
%(ly:message "bar: ~a" bar)
%(ly:message "baz: ~a" baz)
%(interpret-markup layout props (if (markup-list? bar) (car bar) bar)))
%
% \markup \fooEither \flat #1
% \markup \fooEither { \sharp \sharp } #1



Re: accessing markup properties via \tweak?

2024-06-20 Thread Werner LEMBERG


>> Ah, yes, I forgot that it is possible to extend the `props` alist.
>> Thanks a lot!
> 
> This is not exactly extending the probs, but passing additional
> parameters in details.

Yep, I answered too quickly and was too lazy to correct myself :-)

> It would be great to generally have a grob property like
> grob.default-properties or something, and add that to props in
> grob_interpret_markup.  [...]

Please check our issues whether there is something already available,
otherwise I suggest to open an issue.


Werner



Re: accessing markup properties via \tweak?

2024-06-20 Thread Werner LEMBERG
>> In the example below, I want to set the markup property `bar` as a
>> tweak to influence `\foo`.
> 
> you could of course do something like
> 
> %%%
> #(define-markup-command (foo-markup layout props) ()
>#:properties ((bar #f) (details '()))
>(interpret-markup
> layout props
> #{
>   \markup \fontsize #(or bar (assoc-get 'bar (assoc-get 'props details 
> '()) 10)) \natural
> #}))
> 
> foo =
> #(define-music-function () ()
>#{
>  \tweak parent-alignment-X #CENTER
>  \tweak self-alignment-X #CENTER
>  -\markup \foo-markup
>#})
> 
> {
>   f'2-\foo
>   f'2-\tweak details.props.bar #5 \foo
> }
> %%%

Ah, yes, I forgot that it is possible to extend the `props` alist.
Thanks a lot!


Werner



Re: accessing markup properties via \tweak?

2024-06-20 Thread Werner LEMBERG


Hello David,


>> is it possible to access markup properties like `baseline-skip` via
>> \tweak?
> 
> Have you tried?

Well, yes, but ...

> Check out the following example where I just add a few lines in
> front of what you wrote:

... it didn't occur to me to go this route.  Thanks a lot!

Regarding `define-grob-property`: What do you think of making this a
public function?  Of course, the documentation should mention "that
such additions are not limited in scope and will persist beyond the
currently processed file." (as you write in
https://lists.gnu.org/archive/html/lilypond-devel/2016-09/msg00116.html)


Werner


PS: If you have some time please have a look at issue #6721.



accessing markup properties via \tweak?

2024-06-19 Thread Werner LEMBERG

Folks,


is it possible to access markup properties like `baseline-skip` via
\tweak?  It is often necessary to define a markup command that gets in
turn wrapped into a music function, and for such situations a
tweak-like command would be quite handy.

In the example below, I want to set the markup property `bar` as a
tweak to influence `\foo`.

[I know about an alternative solution to define an optional argument
 for function `foo`.  I also know about another solution by simply
 defining, say, function `foox` that explicitly adds `\override` right
 after `\markup`.]


Werner


==


```
#(define-markup-command (foo-markup layout props) ()
   #:properties ((bar 10))
   (interpret-markup
layout props
#{
  \markup \fontsize #bar \natural
#}))

foo =
#(define-music-function () ()
   #{
 \tweak parent-alignment-X #CENTER
 \tweak self-alignment-X #CENTER
 -\markup \foo-markup
   #})

{
  f'2-\foo
  f'2-\tweak bar #5 \foo % This tweak (expectedly) fails.
}
```


Re: Spanner start and end in different voices or hack

2024-06-13 Thread Werner LEMBERG

> I’d like for the bracket to extend to the end of the bar.  [...]

If you use `<< { } // { } >>`, the voices are using names '0', '1',
etc.  However, if you use `<< { } \new Voice { } >>`, the name of the
first voice in `<<>>` doesn't change.  This might lead to the
following solution.

```
\version "2.24.3"
\layout {
  \context {
\Voice
\consists Horizontal_bracket_engraver
  }
}

\relative c'' {
  a8 a b\startGroup b
<< { \stemUp c4 d\stopGroup }
   \new Voice { \stemDown a2 } >>
}
```


Werner


Re: hairpin over bar line and over end of line

2024-06-11 Thread Werner LEMBERG


> >> It's in the "expressive marks" snippets, though I admit I
> >> couldn't have found it myself without searching the docs source
> >> code.
> > 
> > Could you suggest index entries that I can add to the NR?
>
> Thank you for following up on this.

Paul, the question is addressed to you, too :-)


Werner



Re: hairpin over bar line and over end of line

2024-06-11 Thread Werner LEMBERG


>> How would I have found that in the documentation?
> 
> It's in the "expressive marks" snippets, though I admit I couldn't
> have found it myself without searching the docs source code.

Could you suggest index entries that I can add to the NR?


Werner



Re: search term

2024-06-10 Thread Werner LEMBERG


> Which term in the notation index would take me to instructions for
> 
> Cresc. - - -- --  ff 

Have you *really* tried to search in the index of the Notation
Reference?  There is an entry for a keyword called `\cresc` (properly
sorted as 'cresc').  If you follow that link, you will see an image
for

  cresc. -   -   -  mf

I don't think this can be improved.


Werner



Re: color text in markup

2024-06-10 Thread Werner LEMBERG


> I really need to be able to make the first syllable of a word, the
> beginning of a sentence of a song or a romance or a psalm in red or
> any other color for my next sets of notes. It is very much requested
> that you teach me how to do this. As the specificity of my set will
> often meet with such phenomenon as, "red first letter of a
> syllable".

Combine my previous example with the code from this LSR snippet:

  https://lsr.di.unimi.it/LSR/Item?id=373

If you have problems please post a (failing) example that we can help
you improve.


Werner



Re: color text in markup

2024-06-09 Thread Werner LEMBERG

> Tell me how to make the first letter in the \markup department red.
>
>   d4^\markup {  "Tell me how to make" } d4

Try

```
{
  d'4^\markup \concat { \with-color #red T ell " me how to make" }
  d'4
}
```


Werner


Re: Regular Polygons

2024-06-08 Thread Werner LEMBERG


> Thankfully, it should be trivial to make the changes.  The question
> now is what reference glyph is the best?

If you have an argument, the shape should enclose it symmetrically
(more or less) – it is up to you how sophisticated the algorithm is to
do that in the visually most pleasing way (i.e., how near the
polygon's shape comes to the argument's bounding box).  If there is an
empty argument I suggest that you select a size that fits well with
surrounding text, again to your liking.  As soon as you provide a
Merge Request (and I really hope that you submit one!) we will most
certainly tell you whether the size are OK :-)


Werner


Re: Regular Polygons

2024-06-08 Thread Werner LEMBERG


> I was playing around with drawing regular polygons, which led to
> creating a new markup command with several configurable options.
> (Some of these options are inherited via the built-in \polygon
> command.)
> 
> There might be a few things to tighten up, but I believe it is in a
> pretty workable state.  I wish optional parameters existed for
> markup commands.  If they did, then a user could just specify the
> number of sides and omit the size.  The default size would be
> something that matches the font height, so the shape would naturally
> fit in with the surrounding text.

Very nice!  The MusicXML standard supports an `enclosure-shape` attribute:

  
https://www.w3.org/2021/06/musicxml40/musicxml-reference/data-types/enclosure-shape/

It would be very helpful to have a function that makes the polygon
enclose a text string, similar to the `\box` markup command.

And I agree with Valentin that you should completely drop the size
argument, relying on the available markup scaling commands instead.


Werner



Re: Position of nested tuplet brackets

2024-06-03 Thread Werner LEMBERG
> It seems that the positions of nested tuplet brackets can only be changed
> separately if the inner n-tuplet brackets do not start on the downbeat.
> 
> Take this as an example:
> 
> \version "2.25.2"
> 
> {
>   \once \override TupletBracket.positions = #'(6 . 6)
>   \tuplet 5/4 { c'4 c' c' c' c' }
> 
>   \once \override TupletBracket.positions = #'(6 . 6)
>   \tuplet 5/4 { c'4
>   \once \override TupletBracket.positions = #'(3 . 3)
>   \tuplet 5/4 { c' c' c' c' c' } }
> 
>   \once \override TupletBracket.positions = #'(6 . 6)
>   \tuplet 5/4 {
>   \once \override TupletBracket.positions = #'(3 . 3)
>   \tuplet 5/4 { c' c' c' c' c' } c' }
> }
> 
> What is the reason for this and how can it be changed?

Replace `\once \override foo = bar ` with `\tweak bar`.


Werner



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
}



Re: Graphical markup between objects?

2024-05-29 Thread Werner LEMBERG


> I was looking for something like "shift line" or "line between
> fingerings", the latter of which seems to point to the correct page.

https://gitlab.com/lilypond/lilypond/-/merge_requests/2357


Werner



Re: Graphical markup between objects?

2024-05-28 Thread Werner LEMBERG


> > Before you go create something yourself, have you looked at what
> > LilyPond supports [1]?  There are built-in options to change the
> > style of the FingerGlideSpanner.  Your "V"-bend shape probably
> > could be added as a new style.
>
> This is exactly what I was looking for! I was unaware that this
> existed; I would have never thought to look for glide.

It seems we have a documentation buglet in the Notation Reference.
Can you suggest one or more index entries that would have helped you
find the proper place in the manual?


Werner



Re: Removing the change clef in a first ending (volta 1)

2024-05-21 Thread Werner LEMBERG

>> This information should probably be added to the NR, together with
>> an example.  Can you prepare a patch (or even an MR) or formulate
>> something that I can then massage accordingly?
> 
> Actually this is already in NR 1.1.3 Clef (not specific to volta,
> but actually Lily's default kind of makes sense too in this case)

Mhmm, I think it's hard for beginners to see the connection.  I still
think this deserves either an explicit example in the NR – or an LSR
snippet, maybe a sibling to

  https://lsr.di.unimi.it/LSR/Item?id=1119


 Werner


Re: Removing the change clef in a first ending (volta 1)

2024-05-21 Thread Werner LEMBERG


> > is there a way to get rid of the bass change clef indicator in the
> > first ending?
> 
> \once \set Staff.explicitClefVisibility = #end-of-line-invisible
> before your \break at the end of volta 1.

This information should probably be added to the NR, together with an
example.  Can you prepare a patch (or even an MR) or formulate
something that I can then massage accordingly?


Werner



Re: vertical spacing between systems for only part of a score

2024-05-21 Thread Werner LEMBERG

[Please always use 'reply to all'; I've now CCed the mailing list again.]


> >>> Here, I want to make 7 lines spread out to fill the entire last
> >>> page, but leave the other pages alone.
> >
> > Ah, I missed 'last page'.  Perhaps all you need is
> >
> > ```
> > \paper {
> >   ragged-last-bottom = ##f
> > }
> > ```
>
> the ragged-last-bottom = ##f does work in this case.

Good.

> I can see other uses for adjustable vertical spacing.  Is there any
> other way to do it, on a "one system at a time" basis?

No, as mentioned in the thread.  You should also look up the mentioned
issue to get more information.  I also recommend to do some searching
in the 'lilypond-user' mailing list archive, which collects LilyPond
wisdom for more than 20 years...

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

> Any workarounds that you can think of?

The issue gives a work-around; there are certainly more available.

However, in general, it is a rather uncommon request – you shalt not
question LilyPond's vertical spacing decisions :-) To be serious: what
is your exact use case?  In most cases it looks weird if the vertical
spacing suddenly changes.


Werner


Re: Stem disappearing

2024-05-21 Thread Werner LEMBERG

>> I am typesetting a piece and the stem in the first e quarter note
>> disappears when I add \slurUp upper notes.  Is this a bug?
> 
> This is the default behaviour of LilyPond: unify stems.  What you need
> to do is to tell LilyPond not to use `\voiceOne` (up) and `\voiceTwo`
> (down) but rather `\voiceTwo` (down) and `\voiceFour` (down).

I think I've misunderstood what you want to do.  See code below: You
should use a `\relative` block to enclose everything and `\voiceXXX`
inside to select the voice you need.


Werner


```
\version "2.24.2"

\new PianoStaff <<
  \new Staff <<
\time 4/4
\key a \major

 \new Voice \relative c' {
   \voiceOne
   e4-1\mf( a8.-3 b16 gis4) r8 \slurUp a-3
 }

 \new Voice \relative c' {
   \voiceTwo
   e2 e
 }
  >>
>>
```


Re: Stem disappearing

2024-05-21 Thread Werner LEMBERG

> I am typesetting a piece and the stem in the first e quarter note
> disappears when I add \slurUp upper notes.  Is this a bug?

This is the default behaviour of LilyPond: unify stems.  What you need
to do is to tell LilyPond not to use `\voiceOne` (up) and `\voiceTwo`
(down) but rather `\voiceTwo` (down) and `\voiceFour` (down).


Werner


```
\version "2.24.2"

\new PianoStaff <<
  \new Staff <<
\time 4/4
\key a \major

 \new Voice \relative c' {
   \voiceFour
   e4-1\mf( a8.-3 b16 gis4) r8 \slurUp a-3
 }

 \new Voice \relative c' {
   \voiceTwo
   e2 e
 }
  >>
>>
```



Re: vertical spacing between systems for only part of a score

2024-05-21 Thread Werner LEMBERG


>> Here, I want to make 7 lines spread out to fill the entire last
>> page, but leave the other pages alone.

Ah, I missed 'last page'.  Perhaps all you need is

```
\paper {
  ragged-last-bottom = ##f
}
```


Werner



Re: vertical spacing between systems for only part of a score

2024-05-21 Thread Werner LEMBERG


> I would like to increase the vertical distance between systems for a
> specific area in a score.
> 
> I know how to change vertical distance by using the \paper
> {system-system etc... route, but that governs the entire score.  Here,
> I want to make 7 lines spread out to fill the entire last page, but
> leave the other pages alone.
> 
> Is there an "override" command i can use, or a way to add padding by
> typing it into the appropriate spot in one of the voices?  (BTW, i
> have a separate "spacing voice" in my score)

This has been discussed recently; see

  https://lists.gnu.org/archive/html/lilypond-user/2024-05/msg00293.html


 Werner



Re: Moving dynamics onto the staff

2024-05-21 Thread Werner LEMBERG


> Interestingly, the following does *not* work, [...]

It's not clear to me how the end result should look like.

> The dynamics context doesn't know that there's a staff above it
> and/ot the piano staff forbids the dynamics from encroaching on the
> staff above.

You want to position the 'f' sign into the staff lines of the upper
staff?  If yes, then it doesn't fit with the concept of a a `Dynamics`
context *between* the staves IMHO.  Instead, I would attach the 'f'
sign to the upper staff, since it clearly belongs to that staff.


Werner



Re: Moving dynamics onto the staff

2024-05-20 Thread Werner LEMBERG

>> > So why would overriding the dynamic line spanner's
>> > outside-staff-priority change where the forte goes?  Isn't it
>> > DynamicText?  If anyone can clear this up for me, I would be very
>> > appreciative.
>>
>> When there are consecutive dynamics like \p \< ... \f \> ... \pp,
>> they need to be all vertically aligned. LilyPond achieves that by
>> grouping them into a same DynamicLineSpanner, so it's that object
>> which is responsible for the vertical placement of dynamics. In
>> this case, there's only one dynamic in the DynamicLineSpanner, but
>> this still applies.
> 
> Thank you for taking the time to explain that to me.

Since version 2.25.13 the NR contains the attached warning box.


Werner


Re: Scoop (jazz notation)

2024-05-14 Thread Werner LEMBERG

> I agree with Tim.  It's one of those frequently used jazz-isms that
> lilypond doesn't handle very elegantly.  What's the procedure for
> submitting a feature request like this?

You might expand

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

with comments – and images of professionally typeset scores! –
regarding its usage in jazz music.


Werner


Re: strange chord

2024-05-12 Thread Werner LEMBERG

> I mean… technically, it’s correct…

Thanks.

> but yuck.

:-)


> If I were customizing the name, I would probably have it say
> Em(addb4).  At the very least it should say Emsusb4.

As chord names noob I have no opinion to that.  I just wanted to
ensure that MR !2335 produces correct results, even if they are
sometimes bizarre, apparently.


Werner


Re: strange chord

2024-05-12 Thread Werner LEMBERG

> I tried the following
>
> ```
> \version "2.25.16"
>
> chord = \chordmode { c4:6-^1 }
>
> <<
>   \new ChordNames \chord
>   \chordmode { \chord }
> >>
> ```
>
> and got the attached result.  The displayed chord name looks weird
> to me, but I'm no expert for Jazz chords...  Is it correct?  If not,
> how should it be displayed?

Oops, now attached.


Werner


strange chord

2024-05-12 Thread Werner LEMBERG


I tried the following

```
\version "2.25.16"

chord = \chordmode { c4:6-^1 }

<<
  \new ChordNames \chord
  \chordmode { \chord }
>>
```

and got the attached result.  The displayed chord name looks weird to
me, but I'm no expert for Jazz chords...  Is it correct?  If not, how
should it be displayed?


Werner



Re: Tie between staves of a PianoStaff

2024-05-09 Thread Werner LEMBERG


> Thanks for your contributions. They inspired me to an easy bypass:
> ties may not work between staves, but slurs do, and the difference
> is not really conspicuous.  [...]

By the way, the original problem is an ooold bug:

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


 Werner



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 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


Re: Frescobaldi... panic alternatives?

2024-05-01 Thread Werner LEMBERG


>> Maybe one of you two can provide some text for
>>
>>https://lilypond.org/doc/v2.24/Documentation/web/easier-editing
> 
> It happens that my first contribution to the Lilypond documentation
> was a rewrite of the Easier Editing section, some 14 years ago or
> so.

Aaah :-)

> If either or both care to send me their thoughts and comments, I'll
> be glad to turn it into a patch.

This would be great!  Thanks for the offer.


Werner



Re: Frescobaldi... panic alternatives?

2024-05-01 Thread Werner LEMBERG


> Yes, I also use that combo. It's fantastic, but you'd have to be
> willing to invest some time to climb the admittedly steep learning
> curve of (neo)vim. However, it's a time investment that pays off
> massively, so I recommend it heartily!

Maybe one of you two can provide some text for

  https://lilypond.org/doc/v2.24/Documentation/web/easier-editing

?


 Werner



Re: Frescobaldi ... panic alternatives?

2024-04-29 Thread Werner LEMBERG


> With not too much work, you could get emacs to do all of that I
> think.

Well, it would be great if someone could convert the LilyPond mode of
Emacs so that it uses the new 'tree-sitter' interface:

  https://tree-sitter.github.io/tree-sitter/

(look at the 'Playground' link to get a feeling what this tool is good
for).  This would allow seamless support of both Scheme and LilyPond
syntax simultaneously...

While there already is tree-sitter syntax support for Scheme
(https://github.com/6cdh/tree-sitter-scheme, including some Guile
extensions), no such thing exists yet for LilyPond syntax, which makes
the conversion a larger undertaking, unfortunately.


Werner



Re: Transparent box around notes

2024-04-29 Thread Werner LEMBERG


> [...] the snippet is _very_ useful, and certainly much easier to use
> than the lsr snippet.

Please submit the example as a new LSR snippet.

Note that we already have a (slightly different) issue for that:

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

It would certainly help if you could add more information to the
issue, for example, where to find the latest working example.

> I strongly encourage the community to add it to the repository,
> because the trial and error method is inaccurate and time consuming.

Are you willing to work on that?  It would need extensive tests (for
example, to add other grobs like trill spanners to the box),
documentation, and one or more regression tests.


Werner



Re: PianoPedalBracket.to-barline doesn't always work as expected

2024-04-12 Thread Werner LEMBERG

> Might I suggest that “to-barline” is potentially
> misleading/confusing…?
> 
> On the other hand:
>
> end-at-barline, for a pedal coded for release on a note **just
> after** a barline, might be more clearly descriptive of the
> current behaviour; and
>
> extend-to-barline, for a pedal coded for release on a note
> **just before** a barline, might be more suggestive of the
> behaviour Maurits was expecting.
> 
> Is there any technical reason both of these different-but-related
> properties can’t/shouldn’t be made available?

I suggest you file an issue.


Werner


Re: Overriding default text of \f, \p, etc.

2024-04-12 Thread Werner LEMBERG


> However, trying to define f = #(make-dynamic-script ...) doesn't work
> because Lilypond interprets f as a note-name.

Try

```
"f" = #(make-dynamic-script ...)
```


Werner



Re: Installing 2.24.1

2024-04-07 Thread Werner LEMBERG


>> There is a web page that deals with command-line installation, if
>> that's what you want:
>>
>> https://lilypond.org/doc/v2.24/Documentation/learning/command-line-setup
>>
> Thanks. So basically "yes", I guessed as much.
> 
> I just need to re-associate the new version of lilypond with .ly
> files...

If you have a chance please check these instructions for correctness;
I'm not a regular Windows user, and there might be errors and/or
problems due to my clumsy testing.


Werner



Re: tremoli under beam

2024-03-30 Thread Werner LEMBERG


 Don't you want "\repeat tremolo 2" instead of 4?
>>
>> Thanks, yes, of course, but the result is still not correct, as
>> you've found out.
> 
> Very much not correct!  This seems like a bug, no?

Let's say it's not supported right now.  Filed as

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


Werner



Re: tremoli under beam

2024-03-30 Thread Werner LEMBERG
>>>   \repeat tremolo 4 { e32[ c! }
>>
>>
>> Don't you want "\repeat tremolo 2" instead of 4?

Thanks, yes, of course, but the result is still not correct, as you've
found out.


Werner



tremoli under beam

2024-03-30 Thread Werner LEMBERG

Please have a look at the attached image (from the full score of
Stravinsky's Firebird, after rehearsal number 32).  How do I correctly
notate this in LilyPond?  AFAICS, there is no real support for that –
at least the 'most natural' way to notate it fails with warnings.  I
could only manage to write a work-around by not using tremoli.  It
seems that the `Chord_tremolo_engraver` is highjacking beams
completely...


Werner


```
\markup "doesn't work"
\relative c''' {
  \repeat tremolo 4 { e32[ c! }
  \repeat tremolo 4 { es c }
  \repeat tremolo 4 { d b] }
}

\markup "work-around"
\relative c''' {
  \set subdivideBeams = ##t
  \set minimumBeamSubdivisionInterval = \musicLength 8
  \override Beam.gap-count = 2
  e32*2[ c! es c d b]
}
```


Re: a small correction in arithmetic expressions

2024-03-28 Thread Werner LEMBERG


> Here is a small correction in the documentation which does not affect
> the use of Lilypond, just for the sake of correctness of the
> formulas... [...]

Thanks, this is now part of a merge request, see

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2291


 Werner



Re: nested \set ?

2024-03-26 Thread Werner LEMBERG


Dear Valentin and Aaron,


> properties handle this by having internally not a single value, but
> a list of values, and temporary overriding simply means adding to
> that list. Context properties do currently not allow for this
> mechanic, but we could simulate it ourselves: [...]

Both of your code snippets look very nice, thanks a lot!  However, for
integration into the core of LilyPond I think Valentin's approach is
more suitable.

I've now created a MR; please have a look and comment!


Werner



Re: nested \set ?

2024-03-25 Thread Werner LEMBERG

>> LilyPond provides `\temporary` and `\revert` to set a grob property
>> temporarily, and afterwards the value of the grob property is the
>> same as before.
>> 

>> Is there a similar possiblity for `\set` (or something usable in
>> Scheme)?  I guess not, but I couldn't find this documented
>> somewhere...
> 
> No, this doesn't exist OOTB. It could be implemented with a Scheme
> engraver, but that would probably be overkill, unless for some
> reason it's really important for what you're trying to do?

I was wondering whether there exists a solution to issue #4651 – the
suggested code there doesn't work, unfortunately – removing the beam
stencil might lead to missing flags if auto-beaming is active.

Perhaps I could iterate over the music, emitting `\once \autoBeamOn`
for every element?


Werner


Re: nested \set ?

2024-03-25 Thread Werner LEMBERG
> > Yes, thanks, but this is not what I'm looking after: At the start
> > of my function (created with `define-music-function`),
> > `\autoBeamOff` gets called (i.e., the `autoBeaming` context
> > variable is set to `##t`), and after the function returns the
> > previous value of `autoBeaming` should be restored.
> > 
> >> Not sure why \temporary wouldn’t/shouldn’t, although I must admit
> >> I couldn’t find the right incantation…
> > 
> > It doesn't work, I've tested it.  Maybe I made a mistake,
> > though...
>
> My Lilypond knowledge is small but have you tried the "\unset"
> command ??

`\unset` restores the default value of a context property, it doesn't
revert a set value.

Example:

```
\relative c'' {
  \set autoBeaming = ##f
  c8 c c c
  \set autoBeaming = ##t
  c8 c c c
  \unset autoBeaming
  c8 c c c
}
```


Werner


Re: nested \set ?

2024-03-25 Thread Werner LEMBERG

>> LilyPond provides `\temporary` and `\revert` to set a grob property
>> temporarily, and afterwards the value of the grob property is the
>> same as before.
>> 
>> Is there a similar possiblity for `\set` (or something usable in
>> Scheme)?  I guess not, but I couldn't find this documented
>> somewhere...
> 
> \once certainly works: [...]

Yes, thanks, but this is not what I'm looking after: At the start of
my function (created with `define-music-function`), `\autoBeamOff`
gets called (i.e., the `autoBeaming` context variable is set to
`##t`), and after the function returns the previous value of
`autoBeaming` should be restored.

> Not sure why \temporary wouldn’t/shouldn’t, although I must admit I
> couldn’t find the right incantation…

It doesn't work, I've tested it.  Maybe I made a mistake, though...


Werner


nested \set ?

2024-03-25 Thread Werner LEMBERG


LilyPond provides `\temporary` and `\revert` to set a grob property
temporarily, and afterwards the value of the grob property is the same
as before.

Is there a similar possiblity for `\set` (or something usable in
Scheme)?  I guess not, but I couldn't find this documented
somewhere...


Werner



Re: Compress Long Rest in Jianpu.

2024-03-24 Thread Werner LEMBERG


[Please always reply to the list!]

> Sure, it looks like this
> [image: image.png]
> and this
> [image: image.png]
> 
> seems like it just copies the staff style and removes staff lines.

OK, thanks.  The un-compression of MM rests is an intentional feature
of `jianpu10a.ly`.  You should contact the author to add a command
that switches compression of MM rests on and off.

Below is a trivial patch to enable MM compression.  Note, however,
that this also disables conversion of `R1` to '0 0 0 0', which is
probably not wanted.  In other words, I suspect that more tinkering is
necessary to get a solution that really fits current jianpu usage.


Werner


==


--- jianpu10a-old.ly2024-03-23 18:20:24.923336345 +0100
+++ jianpu10a.ly2024-03-24 07:18:42.382334806 +0100
@@ -84,8 +84,7 @@
))
 
  ;; REST AND MULTI-MEASURE REST
- ((or (music-is-of-type? m 'rest-event)
-  (music-is-of-type? m 'multi-measure-rest))
+ ((music-is-of-type? m 'rest-event)
   (let ((dur (ly:moment-main (ly:music-duration-length m
 (if (>= dur 1/2)
 ;; split whole and half rests into quarter notes



Fw: Compress Long Rest in Jianpu.

2024-03-24 Thread Werner LEMBERG

[Forwarding private message to have the whole conversation in the
archive.]
--- Begin Message ---
Sure, it looks like this
[image: image.png]
and this
[image: image.png]

seems like it just copies the staff style and removes staff lines.


Windy

Werner LEMBERG  于2024年3月24日周日 01:23写道:

>
> > I want to display both staff and jianpu, but if I enable
> > \compressMMRests function, the long rests are not compressed when
> > engraving with jianpu.
> >
> > Jianpu support for Lilypond is from file jiapu10a.ly on
> > https://github.com/nybbs2003/lilypond-Jianpu . Is there any way to
> > patch the file or something to make it support \compressMMRests?
> >
> > MWE is in the attachment.
>
> Do you have a real-world example how compressed rests look like in
> Jianpu notation?  I guess the author hasn't thought of that...
>
>
> Werner
>
--- End Message ---


Re: Compress Long Rest in Jianpu.

2024-03-23 Thread Werner LEMBERG


> I want to display both staff and jianpu, but if I enable
> \compressMMRests function, the long rests are not compressed when
> engraving with jianpu.
> 
> Jianpu support for Lilypond is from file jiapu10a.ly on
> https://github.com/nybbs2003/lilypond-Jianpu . Is there any way to
> patch the file or something to make it support \compressMMRests?
> 
> MWE is in the attachment.

Do you have a real-world example how compressed rests look like in
Jianpu notation?  I guess the author hasn't thought of that...


Werner



Re: Control breaks in staff that I get from a variable?

2024-03-10 Thread Werner LEMBERG
>> The classic fix is
>>
>> <<
>>   \new Devnull { s1*5 \break }
>>   \staffIGot
>
> This was exactly what I was after. It’s nice and simple and works
> well. Thank you.
> 
> I might wish for it being better documented.  I see Devnull
> documented well in the Internals Reference, but I didn’t readily see
> it mentioned in the Notation Reference.  Not that I know exactly
> where it would fit well.  I needed it in the context of
> https://lilypond.org/doc/v2.24/Documentation/notation/different-editions-from-one-source.
> It might not be the right place.

Can you provide some additional sentence or sentences for the
documentation so that we have something to start with?


Werner


Re: Best way to center beam between upper/lower staff?

2024-03-08 Thread Werner LEMBERG

> I'm trying to have some notes cross from the lower staff to the
> upper staff but want the beam to automatically center.  In my
> example this is accomplished in measure 3 with much manual work.  Is
> there a better way?

No, there isn't – in general, how shall LilyPond know which note
belongs to which staff?  However, you can define shortcuts to reduce
typing, for example

```
U = \change Staff = "up"
D = \change Staff = "down"

{
  ...
  r8 a \U c \D a \U d ...
}
```

[Of course, our Scheme wizards may produce a solution to automatically
 split notes between the upper and lower staff depending on a pitch
 threshold; this might be nice for simple cases.]


Werner


Re: Using old definition of bass figures for 6\\, 7\\, 9\\ ...

2024-03-06 Thread Werner LEMBERG

> adapted sample from
> https://lilypond.org/doc/v2.24/Documentation/bd/lily-a6a3b6ba.ly:
> 
> \paper{
>   #(define fonts
>  (set-global-fonts
>   #:music "paganini"
>   ))
> }
> \figures {
>   \set figuredBassPlusDirection = #RIGHT
>   <7\\ 6 4 2\+> <4\+ _-> <3 5\+ 3 > <6\\ 4 3> <9\\>
> }

Please try the attached solution.


Werner
\version "2.24.0"

\paper{
  #(define fonts (set-global-fonts #:music "paganini"))

  #(add-text-replacements!
`(("♭" . ,#{ \markup { \hspace #0.4 \raise #0.4 \smaller \smaller \flat } 
#})
  ; add more entries here
  ))
}

\figures {
  \set figuredBassPlusDirection = #RIGHT
  <7\\ 6 4 2\+> <4\+ _-> <3 5\+ 3 > <6\\ 4 3> <9\\>
}

\layout {
  \context {
\Score
figuredBassPlusStrokedAlist = #'()
  }
}


Re: Using old definition of bass figures for 6\\, 7\\, 9\\ ...

2024-03-06 Thread Werner LEMBERG


> The special font figures introduced with 2.24 breaks old typesets
> using fonts provided by https://github.com/OpenLilyPondFonts
> 
> Is there a way to switch to the old behaviour?

Please provide a (small, working) example of the problem you
encounter.


Werner



Re: tied sharps after line break

2024-03-03 Thread Werner LEMBERG


> 2. LilyPond's default behaviour in this situation is (in my opinion)
> sub-optimal.

It's a bug known since 15 years...

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


Werner



Re: Make D.S. and Coda objects RED

2024-02-29 Thread Werner LEMBERG


> I found how to color certain objects, such as with:
> 
>   \override Staff.TimeSignature.color = #(rgb-color 1 0 0)
> 
> but I have yet to find the names of the objects I'm hoping to change.

Have a look at

  https://lilypond.org/doc/v2.25/Documentation/ly-examples/visualindex.pdf


Werner



Re: bookOutputName seems broken in 2.25.12

2024-02-29 Thread Werner LEMBERG

> I've tried both of the methods of naming an output file in the book
> environment.  \bookOutputSuffix works fine.

Please give complete examples – I can't reproduce the issue (with
current git).  I've tried

```
\book {
  \bookOutputName "Comin-Home-Baby_Tenor-1"

  { c'4 }
}
```

and

```
\book {
  \paper {
output-filename = "Comin-Home-Baby_Tenor-1"
  }

  { c'4 }
}
```

Both snippets produce file `Comin-Home-Baby_Tenor-1.pdf`, as expected.


Werner


Re: slur to middle of triplet causes warning

2024-02-02 Thread Werner LEMBERG


> I am trying to slur to the middle of a triplet, which engraves
> correclty , but gives a warning. I'd like to get rid of the warning
> for a clean build.
>
> Any solution?
> 
>(e4 d e d |
>   \tuplet 3/2 {e8 d) b~} b4 r2 |

Wrong syntax: Not `(e4` but `e4(`.


Werner



Re: Incipit with default noteheads possible?

2024-01-24 Thread Werner LEMBERG


>> This works for the note heads, but if there happen to be
>> accidentals around (in my project this is the case), they remain
>> mensural style. Is there another override for this, too?
> 
> How about this?

Nice!  David, what do you think about converting this code into a
proper MR?


Werner



Re: Footnote separator line

2024-01-23 Thread Werner LEMBERG

>> Simply removing \fill-line will shift the line to the left margin,
>> leaving the length the same.
> 
> To my eye that looks a lot better.

It's really a matter of style.  For example,
https://tex.stackexchange.com/questions/214644/how-to-add-a-footnote-separator-rule
shows a footnote rule exactly as formatted by LilyPond (see attached
image) – this is for the scientific magazine 'IEEE transactions'.


Werner


Re: { } not sounding right.

2024-01-21 Thread Werner LEMBERG

> I rather thought about Lilypond being able to "look ahead|behind"
> like (I imagine is working) the "Melody_Engraver" to harmonise (no
> pun intended) the pitch shift up or down decision.
> 
> \language "english"
> 
> In my use case  :
> - the gqs is the note g pitched upward.
> - the bqf is the note b pitched downward.
> 
> To homogenise the output, I think the MIDI output should transform :
>  → 
> or equivalently
>  → 

This is a nice idea and should be rather easy to implement!  While not
working in general for micro-tones, it seems to be a good solution for
quarter tones.

Please open an issue at

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

and tag it as an enhancement.


 Werner


Re: { } not sounding right.

2024-01-19 Thread Werner LEMBERG


> I have a branch (from a few years ago) where I changed LilyPond's MIDI
> microtonality from using Pitch Bends (which is a bad idea when using
> chords) to using MIDI 1.0 tuning information. This works fine IIRC as
> long as you don't construct chords containing really close notes
> (e.g. c and c+5 cents).

Sounds great.  Given that MIDI 2.0 is still rather new it probably
makes sense to go this route.


Werner



Re: { } not sounding right.

2024-01-18 Thread Werner LEMBERG


> Try this with and without the \new Voice commented.
>
> \version "2.25.12"
>
> \language "english"
>
> \score {
>   %\new Voice
>   <<
> {bf bqf bf}
> {g gqs g}
>   >>
>   \layout {}
>   \midi {}
> }
>
> Obviously you would need to listen to the MIDI output.

This is a limitation of MIDI: You can only have a single pitch bend
per time step per channel.  LilyPond's rather primitive MIDI 1.0
output provides no means to circumvent this limitation.

Looking into MIDI 2.0 I see that there exists a 'per-note pitch bend'
feature, so maybe someone is going to implement that in LilyPond.


Werner



Re: Setting the emoji font

2024-01-16 Thread Werner LEMBERG

> I want to use emoji within markup, and I can see in the output log
> that Lilypond can't find a character in its default emoji font
> (Symbola). I can't figure out how to override the default font.

LilyPond does *not* have a default emoji font!  It is Pango and
FontConfig which choose the font.

Emojis are an especially nasty thing to select.  Or to be more
precise, you actually can't select them at all within LilyPond, since
any setting of a font for an Emoji character is completely ignored.
This is due to a Pango problem:

  https://gitlab.gnome.org/GNOME/pango/-/issues/289

It is necessary to modify the FontConfig setup files (usually in
`/etc/fonts/conf.d` or something similarly named) to enforce a certain
Emoji font.

BTW, I can reproduce your problem, and it is due to `Symbola.ttf`
being buggy: (Almost) all of its glyph names are empty – this is
technically valid[*] but doesn't work for us: Contrary to many
applications, LilyPond selects a glyph by its name if such a name is
available.  Since this font effectively lies to the application, i.e.,
providing incorrect glyph names, it fails.

Fortunately, it's easy to fix:

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2235


Werner


[*] For TrueType fonts it is normally expected to access glyphs by
character code only; glyph names are considered a bonus
information.


Re: Tempo marking doesn't avoid cross-staff slur

2024-01-11 Thread Werner LEMBERG


>> This issue belongs into the group of the many cross-staff problems.
>> AFAICS, we don't have this particular case covered, so please file
>> an issue in the LilyPond tracker.
> 
> For reference, it's : https://gitlab.com/lilypond/lilypond/-/issues/6688

Thanks!


Werner



Re: Tempo marking doesn't avoid cross-staff slur

2024-01-11 Thread Werner LEMBERG


> I found a weird behavior -- I don't know if it's worthy of an issue
> or not, but here it is:
> 
> The tempo marking will not avoid a slur that goes from staff to
> staff.  Here is a snippet that shows the problem, and I've attached
> an image of it: [...]

This issue belongs into the group of the many cross-staff problems.
AFAICS, we don't have this particular case covered, so please file an
issue in the LilyPond tracker.


Werner



Re: Question about \include options

2024-01-08 Thread Werner LEMBERG


> It's true that special characters can cause inconsistent results in
> almost anything but if you're searching Documentation for a command
> that includes them, you expect the search to be 'complete'; i.e.,
> encompassing all possibities.

The thing is that `#f` and `#t` are nothing special; they are part of
Scheme, and you learn them in lesson one, so to say.  However, the
Notation Reference isn't an introduction to Scheme, thus it is not
feasible to really document such fundamental elements.

Anyway, I've added index entries to the Notation Reference and the
Learning Manual for `#f` and `#t`.

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2230


 Werner



Re: Question about \include options

2024-01-08 Thread Werner LEMBERG


> See for example http://lilypond.org/notation.html, which you reach
> by clicking on "details of Notation" at
> http://lilypond.org/manuals.html.  Could anyone please come up with
> a better formulation than "details of ...", since it's far from
> intuitive what such a link might contain.

Perhaps simply replacing '(details of ...)' with '(more)'?


Werner



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


Re: Collision between accidental and tuplet

2024-01-01 Thread Werner LEMBERG


> while typing down the score from an old scan, I discovered a
> collision between an accidental and a tuplet spanner, or rather the
> number in it:
>
>
> \version "2.24"
> \language "deutsch"
>
> \relative c' {
>   \tupletUp
>   \times 2/3 { g'=''8 b4 } des8 h~ h4 r4
> }
>
>
> Perhaps this is worthy of an issue?

Well, you can check that by yourself: Go to

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

and search for

  accidental tuplet

and you will get

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

as an open issue.


Werner




Re: Cascade Chords

2023-12-29 Thread Werner LEMBERG


> Is there a special notation for cascade chords (chords played by
> adding successive notes )?  I could do it by adding a new voice for
> each note, but that seems unwieldly and cluttered.

https://lsr.di.unimi.it/LSR/Item?id=408


Werner



Re: Forcing custodes to be always placed at the right-hand margin?

2023-12-28 Thread Werner LEMBERG


> I wanted a more natural text spacing for some chant in modern
> notation I am typesetting, using the setting *ragged-right = ##t*.
> However, the custodes also moves along with the line, and I would
> like it to always be in the same place, at the right-hand margin.
> That is, custodes is always placed at the end of the line-width.

Such a mode between ragged-right and normal justification doesn't
exist in LilyPond.  Can you provide scans of some real-world examples
that show how you would actually like to format stuff?


Werner



Re: horizontal spacing issue with `keyCancellation`

2023-12-27 Thread Werner LEMBERG


Some days ago I wrote:

> Consider this snippet.
> 
> ```tex
> cancellationFirst =
> \override Score.BreakAlignment.break-align-orders =
>   #(grob-transformer 'break-align-orders
>  (lambda (grob orig)
>(let ((vec (vector-copy orig))
>  (middle '(key-cancellation
>staff-bar
>key-signature)))
>  (vector-set! vec 1 middle)
>  vec)))
> 
> music = { \key ces \major ces'1 \bar "||"
>   \key cis \major cis'1 }
> 
> { <>^\markup "default"
>   \music }
> 
> { <>^\markup "cancellationFirst"
>   \cancellationFirst
>   \music }
> ```
> 
> As can be seen in the image, flipping the order of the bar line and
> the key cancellation changes the horizontal spacing between the
> `NoteHead` and `NonMusicalPaperColumn` grobs in a bad way.  Why does
> this happen, and how can I avoid this?
> 
> The third line shows the same without a bar line, where the spacing
> is just fine.

Any takers?  If nobody knows the reason, how can I debug this most
easily to find the culprit?


Werner



Re: Automatically adding extender lines in lyrics

2023-12-23 Thread Werner LEMBERG


> Often, multiple voices in a score have the same lyrics, or the
> lyrics have repeating components (such as lines from a poem).  Is
> there a way to automatically add extender lines to melismata in the
> lyrics?

Examples, please, both a scan from a real-world example, and ideally
some LilyPond code that demonstrates how you want to do it.

Have you already checked our issues database?  Maybe the problem is
already filed.

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


 Werner



Re: clefs, time signatures, and key signatures

2023-12-22 Thread Werner LEMBERG


> does the new proposed spacing mean that the time signatures are not
> aligned across staves any more but were before?

No, they are aligned as before.


Werner



Re: right indent once, horizontal space

2023-12-22 Thread Werner LEMBERG

> Thank you, yes this works if the measure is the last one.  For
> exemple in your exemple, I’d need the second staff to have a right
> indent.

Simply split your music into two scores.  You can adjust the distance
between the last line of a score and the first line of the next score
with the paper variable `score-system-spacing`.

Everything else gets quickly much more complicated – I'm not sure
whether it is solvable at all in the general case, since there are not
many possibilities to manipulate LilyPond's layout mechanism.


Werner


Re: right indent once, horizontal space

2023-12-22 Thread Werner LEMBERG

> is it possible to add after a bar and before a break some horizontal
> space only for a particular system ?

Try the `ragged-last` paper variable.

Example:

```
\score {
  { \repeat unfold 60 c'4 }
  \layout {
ragged-last = ##t
  }
}

\score {
  { \repeat unfold 60 d'4 }
  \layout {
ragged-last = ##t
  }
}
```


Werner


horizontal spacing issue with `keyCancellation`

2023-12-22 Thread Werner LEMBERG

Consider this snippet.

```tex
cancellationFirst =
\override Score.BreakAlignment.break-align-orders =
  #(grob-transformer 'break-align-orders
 (lambda (grob orig)
   (let ((vec (vector-copy orig))
 (middle '(key-cancellation
   staff-bar
   key-signature)))
 (vector-set! vec 1 middle)
 vec)))

music = { \key ces \major ces'1 \bar "||"
  \key cis \major cis'1 }

{ <>^\markup "default"
  \music }

{ <>^\markup "cancellationFirst"
  \cancellationFirst
  \music }
```

As can be seen in the image, flipping the order of the bar line and
the key cancellation changes the horizontal spacing between the
`NoteHead` and `NonMusicalPaperColumn` grobs in a bad way.  Why does
this happen, and how can I avoid this?

The third line shows the same without a bar line, where the spacing is
just fine.


Werner


Re: Why has `NonMusicalPaperColumn` a width?

2023-12-19 Thread Werner LEMBERG


>> Why does the `NonMusicalPaperColumn` grob have a width of 0.5
>> units? Where it is defined?
> 
> Are you referring to the blue arrow from the second-to-last
> non-musical column to the last rest?  That's not a width, it's the
> [ideal] distance to the last rest's musical column.

Yes, it was sloppily formulated, sorry.

> Also, why would non-musical columns have no width in general?  Since
> they're containers, is it not logical for them to have the same
> width as the set of grobs they contain?

I fully agree.  However, what I don't understand is why a zero-width
non-musical paper column has a non-zero ideal spring distance.
Additionally, this 0.5 value is hard-coded and undocumented,
apparently present in the code since the very beginning.


Werner



Re: clefs, time signatures, and key signatures

2023-12-18 Thread Werner LEMBERG
>>> please have a look at Merge Request 2188 and comment there on how
>>> to proceed with the new distances between clefs and time
>>> signatures, together with the new distances between clefs and key
>>> signatures.
>>> 
>>>   https://gitlab.com/lilypond/lilypond/-/merge_requests/2188
>>> 
>>> The question is whether the new distances should be based on the
>>> widest standard clef glyph (which is the alto clef, and which is
>>> done currently in the MR), or whether they should be based on the
>>> most common one, the treble clef.
> 
> A few people responded, and the opinions are exactly 50:50.  It
> would be great if more people could chime in!

Thanks for all who commented.  There was a slight preference for a
wider setting.  For this reason I now suggest a compromise as a final
resolution, namely to make the bass clef invariant, which in turn
minimizes the differences of the other main clefs (treble and alto);
see attached image.  Doing so, the probably most used scores with a
violin and a bass clef (e.g., for piano music) stay unaffected.

If there aren't any serious complaints, I'm going to commit this.


Werner


Why has `NonMusicalPaperColumn` a width?

2023-12-16 Thread Werner LEMBERG

Consider this example

```tex
\version "2.19.2"

music = { r4 r r \mark III r }

{ \music }

{ \override Score.RehearsalMark.non-musical = #'()
  \music }

\layout {
  \context {
\Score
\override NonMusicalPaperColumn.stencil = #ly:paper-column::print
\override PaperColumn.stencil = #ly:paper-column::print } }
```

Why does the `NonMusicalPaperColumn` grob have a width of 0.5 units?
Where it is defined?  And where does the additional 0.25 units between
the rest and the non-musical paper column come from?


Werner


Re: displaying `script-priority`

2023-12-15 Thread Werner LEMBERG


>> > How can I make LilyPond display the actual values of
>> > `script-priority` for a stack of grobs?  [...]
>>
>> Any suggestions how to do that?  Otherwise I'll file an issue.
> 
> A few days ago I was looking for something, and stumbled across
> https://lsr.di.unimi.it/LSR/Item?id=1017 And I thought that it might
> help here.  [...]

Veery nice, thanks a lot!  It was quite helpful, and it eventually
lead to

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2203


Werner



Re: displaying `script-priority`

2023-12-13 Thread Werner LEMBERG


Walking through some unanswered e-mails of mine I stumbled across this
one, asked in October.

  https://lists.gnu.org/archive/html/lilypond-user/2023-10/msg00222.html

> How can I make LilyPond display the actual values of
> `script-priority` for a stack of grobs?  [...]

Any suggestions how to do that?  Otherwise I'll file an issue.


Werner



Re: lilypond "preprocessor"?

2023-12-12 Thread Werner LEMBERG

>> One thing occurred to me.  If the original \score did not have a
>> \midi block, would it be possible to ask lilypond to produce midi
>> output without modifying the input file?
> 
> No, this is not currently possible, although it would be a nice
> addition.

Stefano, please file an issue for this in our tracker!


Werner


Re: clefs, time signatures, and key signatures

2023-12-08 Thread Werner LEMBERG

> I’ve just looked at the images and especially w/r to the Alto clef I
> strongly prefer the new spacing.  For the others there are spots
> where I’m not sure it is too tight but overall the new spacing
> appears to be more balanced.
> 
> I thus think the new spacing is better overall.

Thanks, but I would like to know whether you prefer the top
(alto-based) or bottom (treble-based) image on

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2188


Werner


Re: clefs, time signatures, and key signatures

2023-12-08 Thread Werner LEMBERG


>> please have a look at Merge Request 2188 and comment there on how
>> to proceed with the new distances between clefs and time
>> signatures, together with the new distances between clefs and key
>> signatures.
>> 
>>   https://gitlab.com/lilypond/lilypond/-/merge_requests/2188
>> 
>> The question is whether the new distances should be based on the
>> widest standard clef glyph (which is the alto clef, and which is
>> done currently in the MR), or whether they should be based on the
>> most common one, the treble clef.
> 
> For better comparison, I've updated/added the screenshots in the MR
> so that you can do a blink-comparison of the images.

A few people responded, and the opinions are exactly 50:50.  It would
be great if more people could chime in!


Werner



Re: accessing current file name in markup function

2023-12-08 Thread Werner LEMBERG

>> The name "sip" is a bit weird; looking in the commit that added the
>> code 19 years ago, it looks like it was meant as "smob input"
>> (where smob = Scheme object = LilyPond C++ object made available to
>> Scheme).

Quickly written documentation by an insider.  It should be eventually
replaced with better wording...

> The technical glossary
> (https://lilypond.org/doc/v2.24/Documentation/notation/technical-glossary)
> does include smob but not sip.

... so that we don't have to explain it.

> And I had misinterpreted *location* as either an attempt at emphasis
> in email and/or short for insert-your-location-here rather than
> literally executable scheme code.
> 
> Is that construct (*location*) a general scheme syntax (so that some
> *foo* could be also be meaningful), or perhaps is it a reserved
> word?

Yes, `*` is nothing special – in Scheme you can use almost all
characters for function and variable names.  You might try LilyPond's
Scheme sandbox:

```
lilypond scheme-sandbox
[...]
scheme@(#{ g125}#)> *location*
$1 = #
scheme@(#{ g125}#)> (*location*)
$2 = #
scheme@(#{ g125}#)> (ly:input-file-line-char-column (*location*))
$3 = (".../scheme-sandbox.ly" 34 1 1)
```

And of course, documentation for `*location*` is missing, too.  You
might open an issue for this.


Werner


Re: accessing current file name in markup function

2023-12-07 Thread Werner LEMBERG
>> Thanks!  However, Jean's statement
>>
>> > markups don't store location info, unfortunately.
>>
>> is still true, which means that you can't access the current input
>> location within `define-markup-command`.
>
> Yes, sure, but you could inject this during parsing.  [...]

I'm doing very similar, thanks for confirmation :-)


Werner



Re: accessing current file name in markup function

2023-12-06 Thread Werner LEMBERG


>> Maybe a bit less esoteric:
> 
> Or even less esoteric:

Thanks!  However, Jean's statement

> markups don't store location info, unfortunately.

is still true, which means that you can't access the current input
location within `define-markup-command`.


Werner



Re: accessing current file name in markup function

2023-12-06 Thread Werner LEMBERG

>> How can I access the current LilyPond input file name from within a
>> markup command?  Or do I have to use the (undocumented)
>> `delay-stencil-evaluation` functionality?
> 
> If you mean the name of the file from which the command is called
> (vs. defined), you can't — markups don't store location info,
> unfortunately.

OK, thanks.  But what about accessing the `input-file-name` variable?
Shouldn't this work within `delay-stencil-evaluation`?


Werner


accessing current file name in markup function

2023-12-06 Thread Werner LEMBERG


How can I access the current LilyPond input file name from within a
markup command?  Or do I have to use the (undocumented)
`delay-stencil-evaluation` functionality?


Werner



Re: clefs, time signatures, and key signatures

2023-12-05 Thread Werner LEMBERG


>> please have a look at Merge Request 2188 and comment there on how
>> to proceed with the new distances between clefs and time
>> signatures, [...]
> 
> FWIW, I think the Petrucci clef distances are a big improvement and
> make incipits closer to what they usually look like in sources.

Yes, this was the starting point of the original bug report.

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

However, the distances are actually still too large IMHO;
additionally, the clef should directly start at the left edge, without
any leading space.  I eventually plan to improve that in a follow-up
commit by adjusting the spacing values within the `PetrucciStaff`
(and/or `MensuralStaff`) context.


Werner



Re: clefs, time signatures, and key signatures

2023-12-04 Thread Werner LEMBERG


> please have a look at Merge Request 2188 and comment there on how to
> proceed with the new distances between clefs and time signatures,
> together with the new distances between clefs and key signatures.
> 
>   https://gitlab.com/lilypond/lilypond/-/merge_requests/2188
> 
> The question is whether the new distances should be based on the
> widest standard clef glyph (which is the alto clef, and which is
> done currently in the MR), or whether they should be based on the
> most common one, the treble clef.

For better comparison, I've updated/added the screenshots in the MR so
that you can do a blink-comparison of the images.


Werner



clefs, time signatures, and key signatures

2023-12-04 Thread Werner LEMBERG


Folks,


please have a look at Merge Request 2188 and comment there on how to
proceed with the new distances between clefs and time signatures,
together with the new distances between clefs and key signatures.

  https://gitlab.com/lilypond/lilypond/-/merge_requests/2188

The question is whether the new distances should be based on the
widest standard clef glyph (which is the alto clef, and which is done
currently in the MR), or whether they should be based on the most
common one, the treble clef.


Werner



  1   2   3   4   5   6   7   8   9   10   >