Y-offset of dynamic text after break

2023-10-21 Thread Knute Snortum
Hi, everyone.  I have a question for you, more than a need for a solution.
It involves tweaking the Y-offset of a dynamic text after a break.  Here is
some code to illustrate what I mean:

%%%
\version "2.24.2"

rh = \relative {
  c'4 4 4 4 |
  f,4 4 4 4 |
  f'4 4 4 4 |
}

lh = \relative {
  \clef bass
  c'4 4 4 4 |
  g'4 4 4 4 |
  g,4 4 4 4 |
}

dyn = {
  s1\f | \break
  s1 |
  s1-\tweak Y-offset -2 \p % Y-offset is not effective with break
}

\new PianoStaff <<
  \new Staff \rh
  \new Dynamics \dyn
  \new Staff \lh
>>
%%%

In this snippet, if you remove the break, you can control the
piano marking's Y-offset with a tweak.  But with the break in place, the p
floats to the bottom of the treble staff and does not respond to tweaking
the Y-offset.  I can use extra-offset to move the p, but I'm curious about
what is going on.  Does someone have the time to explain this to me?

Thanks as always.

--
Knute Snortum


Re: markup on ambitus?

2023-10-21 Thread Graham King
Thanks Michael, that looks very promising.  (And I would not have
thought of using the Balloon engraver)

-- Graham


Re: markup on ambitus?

2023-10-21 Thread Michael Werner
Hi Graham,

On Sat, Oct 21, 2023 at 9:48 AM Graham King  wrote:

> In the following MWE, is it possible to put a small markup above each
> ambitus to signify the voice to which the ambitus belongs?
>
> I'm just failing to see where to attach ^\markup { foo }
>

I couldn't find a place to directly attach a markup either. But I did come
up with a somewhat hack-ish workaround that seems to sorta kinda work, in a
somewhat roundabout way. I found that the Balloon_engraver can be pressed
into service to (more or less) do what you're looking for. By setting the
BalloonText.annotation-balloon to false the box that normally is drawn
around the target grob is removed. If you want the pointer line to be
removed, uncomment the marked line. For more details,
https://lilypond.org/doc/v2.25/Documentation/internals/balloontext
and
http://lilypond.org/doc/v2.25/Documentation/notation/balloon-help
contain all the gory details.

\version "2.25.9"

\new Staff <<
  \new Voice = "c_Instr" \with {
\consists "Ambitus_engraver"
\consists "Balloon_engraver"
  }
  \relative {
\override BalloonText.annotation-balloon = ##f
%\override BalloonText.annotation-line = ##f % Uncomment to remove the
pointer line
\balloonGrobText Ambitus #'(-2 . 4) \markup { \tiny "C Instr" }
c' d e f
  }

  \new Voice = "c_Singer" \with {
\consists "Ambitus_engraver"
\consists "Balloon_engraver"
  }
  \relative {
\override BalloonText.annotation-balloon = ##f
%\override BalloonText.annotation-line = ##f % Uncomment to remove the
pointer line
\balloonGrobText Ambitus #'(2 . 4) \markup { \tiny "C Sing" }
\override Ambitus.X-offset = #2.5
s1 a'4 b c d
  }
>>
-- 
Michael


markup on ambitus?

2023-10-21 Thread Graham King
In the following MWE, is it possible to put a small markup above each
ambitus to signify the voice to which the ambitus belongs?

I'm just failing to see where to attach ^\markup { foo }

%
\version "2.25.9"

\new Staff <<
  \new Voice = "c_Instr" \with { \consists "Ambitus_engraver" }
\relative { c' d e f }
  \new Voice = "c_Singer" \with { \consists "Ambitus_engraver" }
\relative { \override Ambitus.X-offset = #2.5
s1 a'4 b c d }
>>
%

-- Graham



Re: function to force accidentals on a subset of notes

2023-10-21 Thread Michael Winter via LilyPond user discussion
Thanks Jean,

I am not sure I completely follow.

Lets say I have a music sequence:

a b c d e f g a bes c d e f g ...

How do I apply what you have written as a function to only show the flats and 
naturals for b and bes. Again. I do not want to apply this to individual notes.

Sorry if I am missing something.

Best,

Michael

Oct 21, 2023, 01:37 by j...@abou-samra.fr:

>
> Try
>
> \displayMusic c'!
>
> This shows you that the > !>  syntax corresponds to settingthe > 
> force-accidental>  property to true. Thus, if you haveidentified the note 
> events you want to force accidentalson, you can do
>
> (ly:music-set-property! the-note-event 'force-accidental #t)
>
> on each of them.
>
>
> Best,
>
>
> Jean
>
>