[HELP] Change notehead font-size depending on note duration

2022-03-01 Thread Robert Mengual
Hello everyone,

I am facing a challenge in which I have been stuck already 7 days. I am sending 
this email as my last hope to get this done or at least receive any assistance 
that allows me to move forward. I really hope you can help me.

Find attached a Tiny.ly, I did the same for changing things like NoteHead.text 
and NoteHead.Y-offset and everything worked perfectly. However, it looks like I 
cannot use the grob when changing the NoteHead.font-size

I would really appreciate any help. Am I doing something wrong? Is there a 
better way to achieve what I want?

Thanks in advance

Best,
Robert
#(define (size-notehead grob) 2)

\relative c' {
\override NoteHead.font-size = #size-notehead
c d e
}

Key cancellation at the beginning

2022-03-01 Thread Thomas Scharkowski
Hi,

I’d like to have key cancellation naturals at the beginning of a score for f, c 
and g.
How can I do this?

Thank you,
Thomas


Re: [HELP] Change notehead font-size depending on note duration

2022-03-01 Thread David Kastrup
Robert Mengual  writes:

> Hello everyone,
>
> I am facing a challenge in which I have been stuck already 7 days. I
> am sending this email as my last hope to get this done or at least
> receive any assistance that allows me to move forward. I really hope
> you can help me.
>
> Find attached a Tiny.ly, I did the same for changing things like
> NoteHead.text and NoteHead.Y-offset and everything worked
> perfectly. However, it looks like I cannot use the grob when changing
> the NoteHead.font-size
>
> I would really appreciate any help. Am I doing something wrong? Is
> there a better way to achieve what I want?

Well, font properties are not callback material.  And you should not
have mentioned NoteHead.text as being relevant and cause me extra work.

Here is one way:

#(define resized-stencil (grob-transformer 'stencil
			  (lambda (grob default)
			   (let ((scale (magstep (- 2
		  (ly:duration-log
		   (ly:event-property
		(event-cause grob) 'duration))
			(ly:stencil-scale default scale scale)

\relative c' {
  \temporary \override NoteHead.stencil = #resized-stencil
  c1 | c2 d4 e8 f16 g32 a64 b128 c
}

-- 
David Kastrup


Re: Ossia with beam too long

2022-03-01 Thread Mats Bengtsson

  
  


On 2022-02-25 18:01, Knute Snortum
  wrote:


  On Fri, Feb 25, 2022 at 8:25 AM Mats Bengtsson  wrote:

  
How about

ossiaPart = \relative {
   \global
   \stopStaff
   s4. \startStaff
   <<
 {
   \magnifyMusic 0.63 { \slashFlag as8*1/32\noBeam^\ossia
 as16*1/16[ cs fs] } as16. b32*1/2 | \stopStaff s8
 }
 \\
 { \forceHShiftF as,8*15/16 [  \hideNotes b8] }
   >>
   s4. |
}

  
  
Almost!  But this is what I get (attached).


Strange, I cannot reproduce that problem! Attached, you can find
  your full MWE with the above inserted, and the resulting PDF. I
  also tried the same modification in your ossia_context.ly file and
  the resulting ossia looks the same. 

   /Mats


  


ossia_stand_alone.pdf
Description: Adobe PDF document
\version "2.22.2"
\language "english"

forceHShiftF = \once \override NoteColumn.force-hshift = -0.325
slashFlag = \once \override Flag.stroke-style = "grace"
ossia = \markup \small \italic "ossia"

global = {
  \time 2/4
  \key fs \major
  \accidentalStyle piano
}

ossiaPart = \relative {
  \global
  \stopStaff
  s4. \startStaff
  <<
{
  \magnifyMusic 0.63 { \slashFlag as8*1/32\noBeam^\ossia
as16*1/16[ cs fs] } as16. b32*1/2 | \stopStaff s8
}
\\
{ \forceHShiftF as,8*15/16 [  \hideNotes b8] }
  >>
  s4. |
}

\score {
  <<
\new Staff = "ossia" \with {
  \remove "Time_signature_engraver"
  \hide Clef
  \hide BarLine
  \override BarLine.allow-span-bar = ##f
  \override KeySignature.stencil = ##f
  \magnifyStaff #2/3
  \override VerticalAxisGroup.staff-staff-spacing = 
#'((basic-distance . 0) 
  (minimum-distance . 0)
  (padding . 1)
  (stretchability . 0))
} {
  \ossiaPart
}
  >>
}


Re: [HELP] Change notehead font-size depending on note duration

2022-03-01 Thread Valentin Petzel
Hello Robert,

the problem here is that the font-size property of the NoteHead is not 
evaluated. (This happens from time to time, and I’m not sure why this is so.)

To get your callback working you can ensure that the font-size is calculated 
by doing something like

\override NoteHead.stencil =
#(lambda (grob)
   (ly:grob-property grob 'font-size)
   (ly:note-head::print grob))

(the grob-property effectively just forces Lilypond to calculate the value).

Cheers,
Valentin

Am Dienstag, 1. März 2022, 13:15:45 CET schrieb Robert Mengual:
> Hello everyone,
> 
> I am facing a challenge in which I have been stuck already 7 days. I am
> sending this email as my last hope to get this done or at least receive any
> assistance that allows me to move forward. I really hope you can help me.
> 
> Find attached a Tiny.ly, I did the same for changing things like
> NoteHead.text and NoteHead.Y-offset and everything worked perfectly.
> However, it looks like I cannot use the grob when changing the
> NoteHead.font-size
> 
> I would really appreciate any help. Am I doing something wrong? Is there a
> better way to achieve what I want?
> 
> Thanks in advance
> 
> Best,
> Robert



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


Re: Ossia with beam too long

2022-03-01 Thread Knute Snortum
You are right!  When I carefully checked for all differences, the
ossia rendered as I wanted it to.

Thanks!

--
Knute Snortum


On Tue, Mar 1, 2022 at 11:01 AM Mats Bengtsson  wrote:
>
>
> On 2022-02-25 18:01, Knute Snortum wrote:
>
> On Fri, Feb 25, 2022 at 8:25 AM Mats Bengtsson  
> wrote:
>
> How about
>
> ossiaPart = \relative {
>\global
>\stopStaff
>s4. \startStaff
><<
>  {
>\magnifyMusic 0.63 { \slashFlag as8*1/32\noBeam^\ossia
>  as16*1/16[ cs fs] } as16. b32*1/2 | \stopStaff s8
>  }
>  \\
>  { \forceHShiftF as,8*15/16 [  \hideNotes b8] }
>>>
>s4. |
> }
>
> Almost!  But this is what I get (attached).
>
> Strange, I cannot reproduce that problem! Attached, you can find your full 
> MWE with the above inserted, and the resulting PDF. I also tried the same 
> modification in your ossia_context.ly file and the resulting ossia looks the 
> same.
>
>/Mats
>
>



RE: [HELP] Change notehead font-size depending on note duration

2022-03-01 Thread Robert Mengual
Thank you very much Valentin! 🙂 It works perfectly although as you said it 
looks extrange. I will add it to lilypond snippets in case someone has the same 
problem in the future.

Robert


De: Valentin Petzel
Enviado: Martes, 01 de Marzo de 2022 20:34
Para: lilypond-user@gnu.org
CC: Robert Mengual
Asunto: Re: [HELP] Change notehead font-size depending on note duration

Hello Robert,

the problem here is that the font-size property of the NoteHead is not
evaluated. (This happens from time to time, and I’m not sure why this is so.)

To get your callback working you can ensure that the font-size is calculated
by doing something like

\override NoteHead.stencil =
#(lambda (grob)
   (ly:grob-property grob 'font-size)
   (ly:note-head::print grob))

(the grob-property effectively just forces Lilypond to calculate the value).

Cheers,
Valentin

Am Dienstag, 1. März 2022, 13:15:45 CET schrieb Robert Mengual:
> Hello everyone,
>
> I am facing a challenge in which I have been stuck already 7 days. I am
> sending this email as my last hope to get this done or at least receive any
> assistance that allows me to move forward. I really hope you can help me.
>
> Find attached a Tiny.ly, I did the same for changing things like
> NoteHead.text and NoteHead.Y-offset and everything worked perfectly.
> However, it looks like I cannot use the grob when changing the
> NoteHead.font-size
>
> I would really appreciate any help. Am I doing something wrong? Is there a
> better way to achieve what I want?
>
> Thanks in advance
>
> Best,
> Robert



RE: Key change with clef after the bar line?

2022-03-01 Thread Alasdair
Dear Jean, I have just had time to make that change (of key to key-signature).  However, there is still an issue.  For example, in change from g major to g minor, we go from one sharp to two flats.  As I have a key signature in the middle of a bar (after a “Fine”), my current bar looks like this: g4^\markup \fontsize #2 \italic "Fin" \bar "||" \set Staff.forceClef = ##t  \key g \minor d8 | However, what happens is that the natural sign is printed on top of the double bar line.  So either I need to not print the natural (which would be my preference), or somehow push the entire new key signature (one natural and two flats) after the clef sign. Note that I’m not interested in modern best practice, but I want to (with modern music printing) maintain the spirit of the 18th century manuscript. Thank you again,Alasdair Sent from Mail for Windows From: Jean Abou SamraSent: Sunday, 27 February 2022 7:31 PMTo: Alasdair McAndrew; lilypond-user@gnu.orgSubject: Re: Key change with clef after the bar line? Le 27/02/2022 à 08:09, Alasdair McAndrew a écrit :> In my current project, I'm trying as far as possible to replicate the > spirit of the original 18th century publication, in which a key change > has a clef printed, and both after the bar line.  In one piece, > there's a segno in the middle of a bar, with such a key change.  In > standard Lilypond, this micro-example shows that the printed clef > comes before the bar line (I've left out the segno marker and all > other markers outside the score):> > global = {>   \language english> >   \clef treble>   \time 4/4> }> > \relative c' {\key c \major c4 d e fs | g a \bar "||" \set> Staff.forceClef = ##t \key c \minor bf c | bf af g f | ef d c2 }> > > But modern practice is to put the clef before the double bar, and the > key change afterwards. I want the clef to come after that double bar.  > According to the documentation, this can be changed with > "break-alignment", in particular with:> > \override Score.BreakAlignment #'break-align-orders => #(make-vector 3 '(span-bar>    breathing-sign>    staff-bar>    key>    clef> >  time-signature))> > > However, in the mini example just given above, adding that override in > the global declaration has no effect.  I tried changing the order of > "key" and "clef" in the override, again with no effect.  (When I tried > his in a larger piece, the key change was printed on the bar-line!)> > Is there any way I can notate a key change, at a segno with an extra > bar line, in order: bar line, clef, key ?  Well, the \global is unused in your example, so it's notsurprising that the override has no effect. With thatoversight corrected, the problem is that the break align symbolfor a KeySignature is not 'key but 'key-signature. Youwill find this athttp://lilypond.org/doc/v2.23/Documentation/internals/keysignature(the break-align-symbol property). So this works: \version "2.22.1" \language english global = {   \clef treble   \time 4/4   \override Score.BreakAlignment.break-align-orders =   #(make-vector 3 '(span-bar     breathing-sign     staff-bar     clef     key-signature     time-signature))} \relative c' {   \global   \key c \majorhttps://lilypond.org/doc/v2.23/Documentation/notation/adjusting-horizontal-spacing-for-specific-layout-objects   c4 d e fs |   g a   \bar "||"   \set Staff.forceClef = ##t   \key c \minor   bf c |   bf af g f |   ef d c2}  If, like me, you find the space between the clef and thekey signature slightly excessive, you will want to lookat https://lilypond.org/doc/v2.23/Documentation/notation/adjusting-horizontal-spacing-for-specific-layout-objects(that documentation was added in 2.23, but it works in2.22 as well). Best,Jean  



RE: Altering the appearance of a time signature.

2022-03-01 Thread Calvin Ransom
Thanks Valentin! 
That is exactly what I was looking for!

Thanks,
Calvin Ransom
-Original Message-
From: Valentin Petzel  
Sent: February 28, 2022 3:06 AM
To: lilypond-user@gnu.org
Cc: Calvin Ransom 
Subject: Re: Altering the appearance of a time signature.

Hello Calvin,

is this to your liking?

Cheers,
Valentin

Am Montag, 28. Februar 2022, 09:34:01 CET schrieb Calvin Ransom:
> Hello everyone,
> 
> Can you help me create a time signature that has spacing like the attached?
> I would like to have the numerator centred near the 4th line and the 
> denominator centred near the 2nd line with space in between the characters.
> I have figured out how to adjust the font size but I have not been 
> able to figure out how to adjust the placement of the individual 
> characters. I have included a link to the relevant part of the internals 
> reference I used.
>  SNIPPET BEGINS 
> \version "2.22.1"
> {
> \once \override Staff.TimeSignature.font-size =#'-2.1 \set 
> Staff.timeSignatureFraction = #'(3 . 2) a'1.
> }
>  SNIPPET ENDS 
> [cid:image001.png@01D82C33.D7B1D620]
> 3.1.130
> TimeSignature mesig
> nature>




Altering repeat dot style

2022-03-01 Thread Calvin Ransom
Hello everyone,
Can I have some help making a repeat sign that looks like the image attached?
I figured out how to reduce the height of the bar lines, but I am unable to 
properly change the dots to diamonds. Right now, I have adapted the code from 
LSR 913 by changing the dots.dot glyph 
to noteheads.s2neomensural. The only issue with this is that it changes all of 
the repeat dots throughout the score, and I am looking for a function that 
works like \once \override. I have attached a snippet showing the work I have 
done so far.
If you know a better way to do this, please let me know!

Thank you,

Calvin Ransom






Repeat.ly
Description: Repeat.ly


Re: Key change with clef after the bar line?

2022-03-01 Thread Wols Lists

On 01/03/2022 22:51, Alasdair wrote:
However, what happens is that the natural sign is printed on top of the 
double bar line.  So either I need to not print the natural (which would 
be my preference), or somehow push the entire new key signature (one 
natural and two flats) after the clef sign.


Isn't there some switch to suppress naturals?


Note that I’m not interested in modern best practice, but I want to 
(with modern music printing) maintain the spirit of the 18^th century 
manuscript.


I had the same problem - I just wanted to save as much space as possible 
printing march cards, which is normal practice in turn of (last) century 
band music.


Cheers,
Wol



Re: Key change with clef after the bar line?

2022-03-01 Thread Jean Abou Samra



Le 01/03/2022 à 23:51, Alasdair a écrit :


Dear Jean,

I have just had time to make that change (of key to key-signature).  
However, there is still an issue.  For example, in change from g major 
to g minor, we go from one sharp to two flats.  As I have a key 
signature in the middle of a bar (after a “Fine”), my current bar 
looks like this:


g4^\markup \fontsize #2 \italic "Fin" \bar "||" \set Staff.forceClef = 
##t  \key g \minor d8 |


However, what happens is that the natural sign is printed on top of 
the double bar line.  So either I need to not print the natural (which 
would be my preference), or somehow push the entire new key signature 
(one natural and two flats) after the clef sign.


Note that I’m not interested in modern best practice, but I want to 
(with modern music printing) maintain the spirit of the 18^th century 
manuscript.





The naturals are printed by a KeyCancellation grob, which has
break-align-symbol 'key-cancellation
(https://lilypond.org/doc/v2.23/Documentation/internals/keycancellation).
When overriding the order, you have not told LilyPond where to
put it. Just add key-cancellation to the vector before
key-signature.

\version "2.22.1"

\language english

global = {
  \clef treble
  \time 4/4
  \override Score.BreakAlignment.break-align-orders =
  #(make-vector 3 '(span-bar
    breathing-sign
    staff-bar
    clef
    key-cancellation
    key-signature
    time-signature))
}

\relative c' {
  \global
  \key g \major
  c4 d e fs |
  g a
  \bar "||"
  \set Staff.forceClef = ##t
  \key c \minor
  bf c |
  bf af g f |
  ef d c2
}


Best,
Jean






Re: [HELP] Change notehead font-size depending on note duration

2022-03-01 Thread Jean Abou Samra

Le 01/03/2022 à 20:34, Valentin Petzel a écrit :

Hello Robert,

the problem here is that the font-size property of the NoteHead is not
evaluated. (This happens from time to time, and I’m not sure why this is so.)




Look at Font_interface::get_default_font. It takes a property alist
chain from the grob and then applies the font selection mechanism
to this alist chain. If there are callbacks, they won't be understood,
and the grob is not available in this part. This is a known dark
corner in LilyPond's design, caused by the interaction between
markups and grobs. Font selection works with alist chains because
that's all you have when working with a markup. Similarly, this
means that the properties used by a markup that gets interpreted
by grob-interpret-markup are not automatically evaluated if
they are callbacks. Better would be changing markups not to use
alist chain but some kind of overarching data structure that
could come with a grob or not, and would automatically execute
callbacks transparently on property accesses. Another possibility
would be to make the interpretation of standalone markups
actually handled by a special grob. Yet another one would be
traversing the markup to resolve all properties it uses (as
declared by the markup command definitions) beforehand.
The last one would be less flexible though.

Best,
Jean




Re: [HELP] Change notehead font-size depending on note duration

2022-03-01 Thread Valentin Petzel
I understand. Maybe we could make sure to evaluate relevant properties in 
music_font_alist_chain should they be a callback? Alternatively we might also 
change the internal callback structure. Kind of if a property is a callback 
((grob) ...) we might wrap it into a function like
(() ((grob) ...) (this-grob))

This would allow us to call the callback property just by the property without 
always having the grob around (and it should not induce problems, as you’d 
normally not call a callback for a grob on a different grob).

Cheers,
Valentin

Am Mittwoch, 2. März 2022, 07:37:52 CET schrieb Jean Abou Samra:
> Le 01/03/2022 à 20:34, Valentin Petzel a écrit :
> > Hello Robert,
> > 
> > the problem here is that the font-size property of the NoteHead is not
> > evaluated. (This happens from time to time, and I’m not sure why this is
> > so.)
> Look at Font_interface::get_default_font. It takes a property alist
> chain from the grob and then applies the font selection mechanism
> to this alist chain. If there are callbacks, they won't be understood,
> and the grob is not available in this part. This is a known dark
> corner in LilyPond's design, caused by the interaction between
> markups and grobs. Font selection works with alist chains because
> that's all you have when working with a markup. Similarly, this
> means that the properties used by a markup that gets interpreted
> by grob-interpret-markup are not automatically evaluated if
> they are callbacks. Better would be changing markups not to use
> alist chain but some kind of overarching data structure that
> could come with a grob or not, and would automatically execute
> callbacks transparently on property accesses. Another possibility
> would be to make the interpretation of standalone markups
> actually handled by a special grob. Yet another one would be
> traversing the markup to resolve all properties it uses (as
> declared by the markup command definitions) beforehand.
> The last one would be less flexible though.
> 
> Best,
> Jean



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