Re: How to unfold percent but not volta repeats?

2019-12-06 Thread vampyrebat
I've managed to answer my own question about how to achieve this in 2.18. Or, 
rather, the LSR has answered it for me:

http://lsr.di.unimi.it/LSR/Item?id=870

Still would love to know the status of issue 769! Wanting a MIDI without 
percent and tremolo repeats must be rare; it should certainly be possible if 
the user asks for it, but it makes little sense as the default.

On 12/6/19, vampyre...@gmail.com wrote:
> Thank you, David. This appears to be undocumented in the 2.19.83 manual (no
> mention in "3.5.6 Using repeats with MIDI", which describes \unfoldRepeats).
> Is this an oversight?
> 
> I infer this feature isn't in 2.18? Is there any way to achieve it in 2.18?
> I'd rather not rely on a development release for functionality integral to
> this score.
> 
> On a related note, does anyone know the status of issue #769
> (http://sourceforge.net/p/testlilyissues/issues/769/)? I agree that this
> proposed change is the more sensible default, but this issue was last
> updated four years ago.




Re: Place a markup string at the right of a notehead

2019-12-06 Thread Paolo Pr
Thanks Thomas.

A really smart solution.

On Fri, Dec 6, 2019 at 12:08 PM Thomas Morley 
wrote:

> Am Fr., 6. Dez. 2019 um 01:55 Uhr schrieb Paolo Pr :
> >
> > Hello.
> >
> > I can't find an easy way to place a markup string exactly at the right
> of a notehead so they appear horizontally aligned. The only apparent way to
> obtain that is the trial-and-error procedure.
> > This can be very frustrating because I have to compile the input several
> times.
> > A work-around would be to replace the notehead's stencil with the
> notehead+text, but it doesn't convince me and it causes spacing issues with
> groups of notes.
> >
> > Is there a simpler way to solve this?
> >
> > Thanks
>
> Hijack StrokeFinger?
>
> {
>   <
>bes-\tweak text "foo" -\rightHandFinger #0
>d'-\tweak text "bar" -\rightHandFinger #0
>f'-\tweak text "buzz" -\rightHandFinger #0
>bes'-\tweak text "boink" -\rightHandFinger #0
>   >
> }
>
> Cheers,
>   Harm
>


Re: How to unfold percent but not volta repeats?

2019-12-06 Thread Aaron Hill

On 2019-12-06 3:32 pm, vampyre...@gmail.com wrote:

Thank you, David. This appears to be undocumented in the 2.19.83
manual (no mention in "3.5.6 Using repeats with MIDI", which describes
\unfoldRepeats). Is this an oversight?


Not undocumented, just not cross-referenced well:

http://lilypond.org/doc/v2.19/Documentation/notation/available-music-functions#index-unfoldRepeats


-- Aaron Hill



Re: How to unfold percent but not volta repeats?

2019-12-06 Thread vampyrebat
Thank you, David. This appears to be undocumented in the 2.19.83 manual (no 
mention in "3.5.6 Using repeats with MIDI", which describes \unfoldRepeats). Is 
this an oversight?

I infer this feature isn't in 2.18? Is there any way to achieve it in 2.18? I'd 
rather not rely on a development release for functionality integral to this 
score.

On a related note, does anyone know the status of issue #769 
(http://sourceforge.net/p/testlilyissues/issues/769/)? I agree that this 
proposed change is the more sensible default, but this issue was last updated 
four years ago.

On 12/6/19, David Kastrup  wrote:
> \unfoldRepeats tremolo,percent { ... }
> 
> Supported since Issue 5003, version 2.19.53 .
> 
> -- 
> David Kastrup




Re: How to unfold percent but not volta repeats?

2019-12-06 Thread David Kastrup
vampyre...@gmail.com writes:

> Hello, I'm having an issue with repeats in MIDI output. This is for a
> score of multiple voices, where musicians who will be playing the
> piece will use the MIDI as a learning aid.
>
> I don't want volta repeats included in the MIDI. Hearing the same
> passage played twice serves no purpose to musicians learning the
> piece.
>
> However, I *do* want percent repeats included. These are just a
> notational shorthand in certain voices; the measures they represent
> are still part of the harmonic structure of the piece. For MIDI
> learning purposes, passages with these measures omitted will sound
> wrong.
>
> As far as I can tell, \unfoldRepeats is all-or-nothing. Am I
> overlooking a simple solution? (I sure don't want to have to wrap
> chunks of my source code in tags to be selected based on whether
> output is PDF or MIDI. This creates a maintenance burden, as then
> simple changes need to be made in multiple places--usually a sign of
> badly written code.) Any ideas appreciated.

\unfoldRepeats tremolo,percent { ... }

Supported since Issue 5003, version 2.19.53 .

-- 
David Kastrup



Re: How to remove all notes and only show Chords and Lyrics?

2019-12-06 Thread Kieren MacMillan
Hi Dominic,

> in a special case I need a "score" with notes, only chords and lyrics.

Have you looked through the archives for related threads (e.g., 
https://lists.gnu.org/archive/html/lilypond-user/2018-12/msg00111.html)?

Cheers,
Kieren.


Kieren MacMillan, composer (he/him/his)
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info




Re: Poster for music engraving conference

2019-12-06 Thread Urs Liska



Am 06.12.19 um 18:33 schrieb Urs Liska:


Am 06.12.19 um 07:30 schrieb Werner LEMBERG:

[...] I'll let you know if I think of anything else.

Great suggestions, from you and all other contributors!


I wish I could help a little more directly, but I'm in the middle of
a few very busy weeks.  I would like to be involved in some way next
year.

Well, we need all posters approximately one week before the conference
starts so that they can be plotted in time.  In other words, we need
something until Jan 9th, which gives us more than a month.

I think that using lyluatex might be a good option.  The main
question, however, is which poster class we should use.  Some ideas
can be found at

   https://www.latextemplates.com/cat/conference-posters   ;

another possibility could be

   http://www.brian-amberg.de/uni/poster   .

Urs, could you set up a git repository for a LilyPond poster?



I'm right now doing this initially.
I can set up a document class based on a template and check that 
lyluatex works.


I went for this template 
https://www.latextemplates.com/template/a0poster-landscape-poster 
because I think if the content is about a visual thing the medium 
should be not be a distraction. Also, it gives us plenty of room to 
organize content, and I think the header section is pretty practical 
for our purposes.


Right now I'm claiming the right to decide by means of being the one 
who *does* it, but that doesn't mean it is carved in stone. However, 
stripping the content from these sample templates does require some 
work, so we shouldn't to that too often.


Whoever wants to participate may either open a pull request or email 
me personally their Github user names.




Of course I should have stated that it is at 
https://github.com/openlilylib-resources/conference-posters/


It might also be an option to create two posters, one for »plain« 
LilyPond and one for Frescobaldi.


Urs


One thing to state in advance: In this case not only the printed 
poster is part of the exhibition but also the code repository, so the 
code should be exemplary.


Best
Urs





 Werner







Re: Poster for music engraving conference

2019-12-06 Thread mason
On 12/06, Werner LEMBERG wrote:
> Well, we need all posters approximately one week before the conference
> starts so that they can be plotted in time.  In other words, we need
> something until Jan 9th, which gives us more than a month.

Okay, I have some work to wrap up, but when I have time I'll see what I
can do if no one else has stepped up.

> I think that using lyluatex might be a good option.  The main
> question, however, is which poster class we should use.  Some ideas
> can be found at
> 
>   https://www.latextemplates.com/cat/conference-posters   ;
> 
> another possibility could be
> 
>   http://www.brian-amberg.de/uni/poster   .

Hopefully our decisions about what to include in the poster will then
inform our decisions about the layout.  I think we can start by coming
up with some text and snippets.

What language(s) should the text of the poster be in?


signature.asc
Description: PGP signature


Re: Poster for music engraving conference

2019-12-06 Thread Urs Liska



Am 06.12.19 um 07:30 schrieb Werner LEMBERG:

[...] I'll let you know if I think of anything else.

Great suggestions, from you and all other contributors!


I wish I could help a little more directly, but I'm in the middle of
a few very busy weeks.  I would like to be involved in some way next
year.

Well, we need all posters approximately one week before the conference
starts so that they can be plotted in time.  In other words, we need
something until Jan 9th, which gives us more than a month.

I think that using lyluatex might be a good option.  The main
question, however, is which poster class we should use.  Some ideas
can be found at

   https://www.latextemplates.com/cat/conference-posters   ;

another possibility could be

   http://www.brian-amberg.de/uni/poster   .

Urs, could you set up a git repository for a LilyPond poster?



I'm right now doing this initially.
I can set up a document class based on a template and check that 
lyluatex works.


I went for this template 
https://www.latextemplates.com/template/a0poster-landscape-poster 
because I think if the content is about a visual thing the medium should 
be not be a distraction. Also, it gives us plenty of room to organize 
content, and I think the header section is pretty practical for our 
purposes.


Right now I'm claiming the right to decide by means of being the one who 
*does* it, but that doesn't mean it is carved in stone. However, 
stripping the content from these sample templates does require some 
work, so we shouldn't to that too often.


Whoever wants to participate may either open a pull request or email me 
personally their Github user names.


One thing to state in advance: In this case not only the printed poster 
is part of the exhibition but also the code repository, so the code 
should be exemplary.


Best
Urs





 Werner





How to unfold percent but not volta repeats?

2019-12-06 Thread vampyrebat
Hello, I'm having an issue with repeats in MIDI output. This is for a score of 
multiple voices, where musicians who will be playing the piece will use the 
MIDI as a learning aid.

I don't want volta repeats included in the MIDI. Hearing the same passage 
played twice serves no purpose to musicians learning the piece.

However, I *do* want percent repeats included. These are just a notational 
shorthand in certain voices; the measures they represent are still part of the 
harmonic structure of the piece. For MIDI learning purposes, passages with 
these measures omitted will sound wrong.

As far as I can tell, \unfoldRepeats is all-or-nothing. Am I overlooking a 
simple solution? (I sure don't want to have to wrap chunks of my source code in 
tags to be selected based on whether output is PDF or MIDI. This creates a 
maintenance burden, as then simple changes need to be made in multiple 
places--usually a sign of badly written code.) Any ideas appreciated.



Re: Place a markup string at the right of a notehead

2019-12-06 Thread Carl Sorensen


From: Paolo Pr 
Date: Thursday, December 5, 2019 at 5:54 PM
To: lilypond-user 
Subject: Place a markup string at the right of a notehead

Hello.

I can't find an easy way to place a markup string exactly at the right of a 
notehead so they appear horizontally aligned. The only apparent way to obtain 
that is the trial-and-error procedure.
This can be very frustrating because I have to compile the input several times.
A work-around would be to replace the notehead's stencil with the 
notehead+text, but it doesn't convince me and it causes spacing issues with 
groups of notes.

Is there a simpler way to solve this?

In my opinion you will need to create a new type of Grob, and create an 
engraver for it.  It could be a scheme engraver.  LilyPond has the concept of 
text in a notehead, and text above or below a note+stem combination, but there 
is no traditional musical element that is aligned directly beside a notehead.  
Hence the need for a new engraver.

This seems strange, since it would be so easy to do in a graphical interface 
program, but that’s one of the strengths of LilyPond.  If you get the music 
semantically right, the graphics happen almost by magic.  So to do what you 
want, you need to add the semantics to LilyPond.

Carl


Re: Poster for music engraving conference

2019-12-06 Thread Jacques Menu
Hello,

A unique feature of Lily is the ability to place scores in markups at will, 
that may be impressive.

JM

> Le 5 déc. 2019 à 20:48, ma...@masonhock.com a écrit :
> 
> On 12/04, Werner LEMBERG wrote:
>> 
>> Folks,
>> 
>> 
>> the music engraving conference in Salzburg (January 17.-19.) aims to
>> present as much note engraving programs as possible.  While some
>> companies send representatives (e.g., Dorico, Capella, Finale) – some
>> even with talks – we don't have something similar for LilyPond in the
>> main part of the conference.
>> 
>> Instead, we would like to have a poster (in A0 format) that shows how
>> LilyPond works, together with some showcase results.
>> 
>> Now my question: Are there people who are willing to produce such a
>> poster?  Has anyone already done something similar for other
>> conferences?
>> 
>> 
>>Werner
> 
> I don't have the time/skill to make a poster right now, but here are my
> first thoughts about some things which might be good to include.  In no
> particular order:
> 
> (1) Mention Frescobaldi, and include a screenshot which exposes the
> playback functionality.  While Frescobaldi is not the only way to use
> Lilypond, seeing a GUI and playback bar will likely be comforting to
> people used to graphical notational software who are intimidated by the
> idea of working with straight text files.
> 
> (2) Show off things which are easier in Lilypond than in graphical
> notation software.  Some things which come to mind are
> 
> * quarter tones
> 
> * \cadenzaOn and \cadenzaOff
> 
> * per-staff meters
> 
> * percussion input
> 
> (3) Keep Lilypond code snippets simple.  Focus on one thing per snippet.
> (For example, don't use any accidentals, except for a snippet
> demonstrating accidentals and quarter tone accidentals and nothing
> else.)  Lilypond's syntax often consists of English words and musical
> terms.  Try to stick to code that an English-speaking musician could
> parse without any familiarity with Lilypond.
> 
> (4) If the text of the poster is in English, use English note names.  If
> the text of the poster is not in English, I am on the fence as to
> whether it would be better to use note names consistent with the
> language of the poster, or to use English note names in order to be
> consistent with the language of Lilypond's syntax.  Or perhaps have only
> one example using accidentals at all, and demonstrate in multiple
> languages.
> 
> (5) Emphasize the high quality of Lilypond's default output,
> pre-tweaking.  Lilypond takes longer to learn than graphical notation
> software, but it makes up for that in the long run by requiring far less
> manual tweaking.  I rarely have to manually tweak anything other than
> slurs.  This also makes Lilypond more robust against layout changes,
> which when I used Sibelius always came with the risk of ruining my score
> and requiring hours of cleanup.
> 
> (6) Show off a simple macro example.  Another time-saving feature of
> Lilypond is the ability define a specific set of instructions once and
> apply it multiple times.  Back when I used Sibelius, I had a
> several-step process, which involved disabling and renabling magnetic
> layout and alternating between Ctrl+Up/Down and Up/Down, plus several
> clicks, in order to create an acceptable glissando, and I use a *lot* of
> glissandi in my music.  Doing this over and over again wasted countless
> hours of my life.  I'm sure many other composers/engravers have their
> own tedious workarounds that they would automate with a macro if they
> could.
> 
> (7) Also show off some fancy, Ferneyhough-esque or otherwise specialist
> examples, perhaps including some of the wackier stuff from the LSR,
> 
> http://lsr.di.unimi.it/LSR/Item?id=1007
> 
> but without the Lilypond source code, in order to demonstrate what
> Lilypond is capable of without overwhelming people with too much code.
> Only include enough code  on the poster to demystify how Lilypond is
> actually used.
> 
> (8) As free software, Lilypond does not require a subscription or a EULA
> or any other loss of autonomy over the ability to access your work now
> or in the future.  Moreover, Lilypond files are human readable/editable
> without even having a copy of Lilypond.  Both are advantages in terms of
> long-term sustainability and preservation.
> 
> (9) Include some of the information from here,
> 
> http://lilypond.org/doc/v2.18/Documentation/essay-big-page#engraving-details
> 
> in order to show off Lilypond's attention to detail.
> 
> (10) The ability to use LyLuaTex, Edition-Engraver, and version control
> also come to mind as huge advantages of using Lilypond, but they might
> be too much to explain briefly on a poster.
> 
> (11) Even without the knowledge of scheme needed to extend Lilypond
> yourself, someone the mailing list can often provide an include snippet
> to achieve what you want.  Good luck convincing AVID to implement a new
> feature just for your unique use case.  The helpfulness of Lilyp

Re: Place a markup string at the right of a notehead

2019-12-06 Thread Thomas Morley
Am Fr., 6. Dez. 2019 um 01:55 Uhr schrieb Paolo Pr :
>
> Hello.
>
> I can't find an easy way to place a markup string exactly at the right of a 
> notehead so they appear horizontally aligned. The only apparent way to obtain 
> that is the trial-and-error procedure.
> This can be very frustrating because I have to compile the input several 
> times.
> A work-around would be to replace the notehead's stencil with the 
> notehead+text, but it doesn't convince me and it causes spacing issues with 
> groups of notes.
>
> Is there a simpler way to solve this?
>
> Thanks

Hijack StrokeFinger?

{
  <
   bes-\tweak text "foo" -\rightHandFinger #0
   d'-\tweak text "bar" -\rightHandFinger #0
   f'-\tweak text "buzz" -\rightHandFinger #0
   bes'-\tweak text "boink" -\rightHandFinger #0
  >
}

Cheers,
  Harm



How to remove all notes and only show Chords and Lyrics?

2019-12-06 Thread Dominic Sonntag
Hi,

in a special case I need a "score" with notes, only chords and lyrics. A basic 
example is
this:

\version "2.19.82"
\score { <<
\new ChordNames { s4 f2 c }
\new Staff {
\relative c' {
\partial 4
\time 4/4
\key f \major
f8 g | f4. e16 d e c8~ c4
}
}
\addlyrics { It's not time to make a change, }
>> }


I want the notes and clefs and barlines etc. (the whole staff) not to be shown, 
but the
lyrics should still take the time the notes have. In this little example, the 
result
should look something like this:

 F  C
It's not time to make a change,

or see my attached image.

How can I achieve this? (Maybe with the least effort on changing the input as 
it is a long
song.)

Kind regards
Dominic


Re: Poster for music engraving conference

2019-12-06 Thread Werner LEMBERG
> [...] I'll let you know if I think of anything else.

Great suggestions, from you and all other contributors!

> I wish I could help a little more directly, but I'm in the middle of
> a few very busy weeks.  I would like to be involved in some way next
> year.

Well, we need all posters approximately one week before the conference
starts so that they can be plotted in time.  In other words, we need
something until Jan 9th, which gives us more than a month.

I think that using lyluatex might be a good option.  The main
question, however, is which poster class we should use.  Some ideas
can be found at

  https://www.latextemplates.com/cat/conference-posters   ;

another possibility could be

  http://www.brian-amberg.de/uni/poster   .

Urs, could you set up a git repository for a LilyPond poster?


Werner



Re: Poster for music engraving conference

2019-12-06 Thread Urs Liska

Hi Jan-Peter,

that sounds like a very nice idea.

However, I'm so involved in the conference already (along with my other 
duties which are quite overwhelming right now) that I can't commit to 
that beyond maybe occasional commenting or helping out with some 
lyluatex syntax/options.


From what I see in this thread I have the impression that it's 
necessary that *someone* steps out, creates a repository and a basic 
file, having some confidence not to stay alone with the task.


Best
Urs

Am 05.12.19 um 15:43 schrieb Jan-Peter Voigt:

Hi Werner, hi Bernhard, and especially Urs ;-),

what about using a LaTeX a0poster-template together with lyluatex? That
would make collaboration with GIT straightforward.
A quick search brought up these templates:
https://www.cfd.tu-berlin.de/~panek/tex/poster/poster.html
http://www.latextemplates.com/cat/conference-posters

Though, the template(s) need some adaption to work with lualatex.

Even though my schedule is quite tight I would like to contribute.
I have obtained the permission from two publishers to use single
excerpts/pictures from the St.Mark passion (Ortus Berlin, I will talk
about it) and a contemporary score composed by Hermann Keller (Edition
Juliane Klein Berlin).

Jan-Peter


Am 04.12.19 um 12:05 schrieb Werner LEMBERG:

Folks,


the music engraving conference in Salzburg (January 17.-19.) aims to
present as much note engraving programs as possible.  While some
companies send representatives (e.g., Dorico, Capella, Finale) – some
even with talks – we don't have something similar for LilyPond in the
main part of the conference.

Instead, we would like to have a poster (in A0 format) that shows how
LilyPond works, together with some showcase results.

Now my question: Are there people who are willing to produce such a
poster?  Has anyone already done something similar for other
conferences?


 Werner







Re: Fingering orientation question

2019-12-06 Thread Jacques Menu
> Le 5 déc. 2019 à 18:02, Mark Stephen Mrotek  a écrit :
> 
> Jacques,
> 
> You do not need to use chord notation and the \set command.
> Fingering down indicated by the _ (underscore), e.g., a,4_3, and the up 
> fingering by the ^ (carat), e.g., e^1
> The - (dash) is a neutral setting and Lilypond decides according to voice 
> number.

Thanks Mark, using ‘_’ alone is the easiest way for me!

JM





Re: Poster for music engraving conference

2019-12-06 Thread Vaughan McAlley
On Fri, 6 Dec 2019, 02:14  wrote:

> David Menéndez Hurtado:
> ...
> > I think it is a good idea to gather some statistics on what drew people
> to
> > Lilypond, so I have made a quick and informal survey:
> >
> >
> https://docs.google.com/forms/d/e/1FAIpQLScAhjveMwqAD50YXLsWnclPILT2j20xaroeZ3QolAUFWRA_vA/viewform
> >
> > Hopefully, we can converge on a few things that make people start and
> stick
> > to highlight on the poster. I am sure I am missing things, that is why I
> > called it informal, so please add suggestions. I will add them to the
> > options.
>
> Not fond of thoose web forms/sites.
>
> I mentioned four possible headers:
>
> . quality in detail
>
> . excellent print quality
>
> . one source, multiple output variations
>   like Simon Albrecht pointed to, and which I was thinking about
>
> . flexibility, whatever you need, it can be done
>
> Do you have any input on thoose, or do you suggest some other poster
> topic ?
>
> Regards,
> /Karl Hammar
>

A couple of things I love about Lilypond that was lacking in Finale 2012
are:

• Automatic page layout, not having the last page have one measure then
having to distribute measures evenly over the last few pages.

• Vertical spacing takes account of music and objects. For example, in
Finale 2012 the position of lyrics below the staff is fixed and needs to be
adjusted system by system (such as when alto lines go low and bump into the
lyrics). Lilypond takes care of this automatically.

Both of these (especially the second) could be illustrated easily enough in
a side-box with well-crafted examples. I imagine Dorico would handle these
situations better, and for all I know Finale post-2012 does too, but if it
doesn't, the poster viewer could be thinking “There's something I have to
do to every single piece that I wouldn't have to with Lilypond”.

Vaughan


Re: Size of the arpeggio's arrow

2019-12-06 Thread Thomas Morley
Am Fr., 6. Dez. 2019 um 01:39 Uhr schrieb Paolo Pr :
>
> Thomas,
>
> thank you for your help. Unfortunately the snippet produces two errors that 
> are visible with a size bigger than 1.2.
>
> Have a look at:   http://lilybin.com/y1t45z/1
>
> 1)   A collision between the arrow and the notehead that cannot be removed 
> properly by overriding  Arpeggio.padding
> 2) A graphical mismatch between the arrow and the stem
>
> About 1), I can't find another property that can fix the issue.

Well, this is indeed a bug. We forgot to adjust X-extent for the
enlarged stencil.
Fixed in the code at the bottom of this mail.
Probably we need to adjust the stencil itself as well. Not sure,
though. In the code it's commented.

> About 2), Instead of the default symbol, I would use a simple triangle, so to 
> avoid any mismatch. Which is the way to add it?

So far it's more due to the changed calculation:

I wrote:

>>  (/
>>   (- (interval-length stil-x-ext)
>>  (interval-length red-arrow-x-ext))
>>   2)

The lilybin-file reads:

 (/
  (- (interval-length stil-x-ext)
 (interval-length red-arrow-x-ext))
  10)

Which causes the problem. Go back to `2´ and all is fine.

If you want another stencil for the arrow-head then the method is
already demonstrated.
Get the stencil from the font (there are other arrows available) or
construct it. Using markup would be the most simple. Add it to the
default line. Move the arrow accordingly.
Take care of properties positions and X-extent.

Here the changed code, additionally I did some clean up, avoiding
multiple calculations of the same things adding comments etc.

biggerArrow =
#(define-music-function (scale)(number?)
"Returns an override for @code{Arpeggio.stencil}, with arrow-heads scaled by
@var{scale}"
#{
  \override Arpeggio.stencil =
  #(lambda (grob)
(let* ((arp-dir (ly:grob-property grob 'arpeggio-direction)))
  ;; If 'arpeggio-direction is unset use default-stencil
  (if (null? arp-dir)
  (ly:arpeggio::print grob)
  (let* ((arrow-glyph
   (format #f
 "scripts.arpeggio.arrow.~a1"
 (if (negative? arp-dir) "M" "")))
 (font (ly:grob-default-font grob))
 (arrow-head-stil (ly:font-get-glyph font arrow-glyph))
 (arrow (ly:stencil-scale arrow-head-stil scale scale))
 (arrow-y-ext (ly:stencil-extent arrow Y))
 (arrow-x-ext (ly:stencil-extent arrow X))
 (arrow-width (interval-length arrow-x-ext))
 (pos (ly:grob-property grob 'positions)))

;; 'positions modified to reflect the height of the arrow-head
(ly:grob-set-property! grob 'positions
  (if (positive? arp-dir)
  (cons (car pos) (- (cdr pos) arrow-width))
  (cons (+ (car pos) arrow-width) (cdr pos

;; unset 'arpeggio-direction to get the default trill-line stencil
(ly:grob-set-property! grob 'arpeggio-direction '())

(let* ((stil (ly:arpeggio::print grob))
   (stil-y-ext (ly:stencil-extent stil Y))
   (stil-x-ext (ly:stencil-extent stil X))
   (stil-width (interval-length stil-x-ext))
   ;; A scaled arrow-head will be slightly off, find the value
   ;; to compensate for x-axis, before adding it to the
   ;; arpeggio-line
   (scale-compensate-x (/ (- stil-width arrow-width) 2))
   (new-stil
 (ly:stencil-add
   (ly:stencil-translate
 arrow
 (cons
   scale-compensate-x
   (if (negative? arp-dir)
   ;; For a down pointing arrow, it's top will be at
   ;; arpeggio-line-bottom, move by it's height to
   ;; let the arrow-basis match with the line-bottom
   (- (car stil-y-ext)
  (interval-length arrow-y-ext))
   (cdr stil-y-ext
   stil)))

   ;; We need to adjust 'X-extent to reflect the enlarged arrow,
   ;; in order to avoid spacing issues
   (ly:grob-set-property! grob 'X-extent
 (interval-widen
   (ly:arpeggio::width grob)
   (* scale-compensate-x -2)))

   ;; Do we need to resize the stencil? For now commented
   ;(ly:make-stencil
   ;  (ly:stencil-expr new-stil)
   ;  (interval-widen stil-x-ext (* scale-compensate-x -2))
   ;  (ly:stencil-extent new-stil Y))
   new-stil
   )
#})

%% d

Re: Size of the arpeggio's arrow

2019-12-06 Thread Paolo Pr
Thank you Thomas, now all is perfect and very useful

On Fri, Dec 6, 2019 at 12:05 PM Thomas Morley 
wrote:

> Am Fr., 6. Dez. 2019 um 01:39 Uhr schrieb Paolo Pr :
> >
> > Thomas,
> >
> > thank you for your help. Unfortunately the snippet produces two errors
> that are visible with a size bigger than 1.2.
> >
> > Have a look at:   http://lilybin.com/y1t45z/1
> >
> > 1)   A collision between the arrow and the notehead that cannot be
> removed properly by overriding  Arpeggio.padding
> > 2) A graphical mismatch between the arrow and the stem
> >
> > About 1), I can't find another property that can fix the issue.
>
> Well, this is indeed a bug. We forgot to adjust X-extent for the
> enlarged stencil.
> Fixed in the code at the bottom of this mail.
> Probably we need to adjust the stencil itself as well. Not sure,
> though. In the code it's commented.
>
> > About 2), Instead of the default symbol, I would use a simple triangle,
> so to avoid any mismatch. Which is the way to add it?
>
> So far it's more due to the changed calculation:
>
> I wrote:
>
> >>  (/
> >>   (- (interval-length stil-x-ext)
> >>  (interval-length red-arrow-x-ext))
> >>   2)
>
> The lilybin-file reads:
>
>  (/
>   (- (interval-length stil-x-ext)
>  (interval-length red-arrow-x-ext))
>   10)
>
> Which causes the problem. Go back to `2´ and all is fine.
>
> If you want another stencil for the arrow-head then the method is
> already demonstrated.
> Get the stencil from the font (there are other arrows available) or
> construct it. Using markup would be the most simple. Add it to the
> default line. Move the arrow accordingly.
> Take care of properties positions and X-extent.
>
> Here the changed code, additionally I did some clean up, avoiding
> multiple calculations of the same things adding comments etc.
>
> biggerArrow =
> #(define-music-function (scale)(number?)
> "Returns an override for @code{Arpeggio.stencil}, with arrow-heads scaled
> by
> @var{scale}"
> #{
>   \override Arpeggio.stencil =
>   #(lambda (grob)
> (let* ((arp-dir (ly:grob-property grob 'arpeggio-direction)))
>   ;; If 'arpeggio-direction is unset use default-stencil
>   (if (null? arp-dir)
>   (ly:arpeggio::print grob)
>   (let* ((arrow-glyph
>(format #f
>  "scripts.arpeggio.arrow.~a1"
>  (if (negative? arp-dir) "M" "")))
>  (font (ly:grob-default-font grob))
>  (arrow-head-stil (ly:font-get-glyph font arrow-glyph))
>  (arrow (ly:stencil-scale arrow-head-stil scale scale))
>  (arrow-y-ext (ly:stencil-extent arrow Y))
>  (arrow-x-ext (ly:stencil-extent arrow X))
>  (arrow-width (interval-length arrow-x-ext))
>  (pos (ly:grob-property grob 'positions)))
>
> ;; 'positions modified to reflect the height of the arrow-head
> (ly:grob-set-property! grob 'positions
>   (if (positive? arp-dir)
>   (cons (car pos) (- (cdr pos) arrow-width))
>   (cons (+ (car pos) arrow-width) (cdr pos
>
> ;; unset 'arpeggio-direction to get the default trill-line
> stencil
> (ly:grob-set-property! grob 'arpeggio-direction '())
>
> (let* ((stil (ly:arpeggio::print grob))
>(stil-y-ext (ly:stencil-extent stil Y))
>(stil-x-ext (ly:stencil-extent stil X))
>(stil-width (interval-length stil-x-ext))
>;; A scaled arrow-head will be slightly off, find the
> value
>;; to compensate for x-axis, before adding it to the
>;; arpeggio-line
>(scale-compensate-x (/ (- stil-width arrow-width) 2))
>(new-stil
>  (ly:stencil-add
>(ly:stencil-translate
>  arrow
>  (cons
>scale-compensate-x
>(if (negative? arp-dir)
>;; For a down pointing arrow, it's top will
> be at
>;; arpeggio-line-bottom, move by it's
> height to
>;; let the arrow-basis match with the
> line-bottom
>(- (car stil-y-ext)
>   (interval-length arrow-y-ext))
>(cdr stil-y-ext
>stil)))
>
>;; We need to adjust 'X-extent to reflect the enlarged
> arrow,
>;; in order to avoid spacing issues
>(ly:grob-set-property! grob 'X-extent
>  (interval-widen
>(ly:arpeggio::width grob)
>(* scale-compensate-x -2)))