weird error with \repeat tremolo

2019-02-25 Thread N. Andrew Walsh
Hi List,

I have the following passage:


\version "2.19.82"


\relative c'' {
 \time 4/8
  | %45
  d32\( b g d \repeat tremolo 4 { b32 } \repeat tremolo 8 { g32 }

  | %46
  \repeat tremolo 8 { d'32 } \repeat tremolo 8 { g,32\) }

}

--
It compiles fine. But if I move it up one octave -- either by changing the
enclosing command to \relative c''' or by changing the first note to
d'32\(, it fails with the following error:

Starting lilypond 2.19.82 [Untitled]...
Processing `/tmp/frescobaldi-ujaa3_0t/tmptlvddq78/document.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...lilypond:
/home/gub/NewGub/gub/target/linux-64/src/lilypond-git.sv.gnu.org--lilypond.git-stable-2.20/flower/include/interval.hh:227:
T Interval_t::center() const [with T = double]: Assertion `!is_empty ()'
failed.
Exited with return code 6.

I do not have a directory named "/home/gub".

Any ideas what's going wrong here?

Cheers,

A
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: weird error with \repeat tremolo

2019-02-25 Thread Aaron Hill

On 2019-02-25 1:37 am, N. Andrew Walsh wrote:

Hi List,

I have the following passage:


\version "2.19.82"


\relative c'' {
 \time 4/8
  | %45
  d32\( b g d \repeat tremolo 4 { b32 } \repeat tremolo 8 { g32 }

  | %46
  \repeat tremolo 8 { d'32 } \repeat tremolo 8 { g,32\) }

}

--
It compiles fine. But if I move it up one octave -- either by changing 
the

enclosing command to \relative c''' or by changing the first note to
d'32\(, it fails with the following error:

Starting lilypond 2.19.82 [Untitled]...
Processing `/tmp/frescobaldi-ujaa3_0t/tmptlvddq78/document.ly'
Parsing...
Interpreting music...
Preprocessing graphical objects...lilypond:
/home/gub/NewGub/gub/target/linux-64/src/lilypond-git.sv.gnu.org--lilypond.git-stable-2.20/flower/include/interval.hh:227:
T Interval_t::center() const [with T = double]: Assertion `!is_empty 
()'

failed.
Exited with return code 6.

I do not have a directory named "/home/gub".

Any ideas what's going wrong here?


That's a failing assertion in the code.  The path is to the compiled 
file when it was built, so it is not relevant to your filesystem.  
Ultimately this is a programming error; but unfortunately, this is at 
the C++ level, so it would require a new build of LilyPond to address.


A similar issue was reported not too long ago regarding tremolos and 
beams.  I found via some experimentation that too short of a note stem 
can trigger the failing assertion.  You could try manually lengthening 
the stem to see if it helps as a possible workaround.



-- Aaron Hill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: weird error with \repeat tremolo

2019-02-25 Thread N. Andrew Walsh
Hi Aaron,

On Mon, Feb 25, 2019 at 10:50 AM Aaron Hill 
wrote:
   You could try manually lengthening

> the stem to see if it helps as a possible workaround.
>

I've gone all the way out to

 \once \override Beam.positions = #'(-20 . -24)

and still get the error, so I don't think tweaking stem length is going to
help. Any idea what the error might be? Is there a bug report?

Thanks for the help,

A
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: weird error with \repeat tremolo

2019-02-25 Thread Thomas Morley
Am Mo., 25. Feb. 2019 um 11:02 Uhr schrieb N. Andrew Walsh
:
>
> Hi Aaron,
>
> On Mon, Feb 25, 2019 at 10:50 AM Aaron Hill  wrote:
>You could try manually lengthening
>>
>> the stem to see if it helps as a possible workaround.
>
>
> I've gone all the way out to
>
>  \once \override Beam.positions = #'(-20 . -24)
>
> and still get the error, so I don't think tweaking stem length is going to 
> help. Any idea what the error might be? Is there a bug report?
>
> Thanks for the help,
>
> A
Some discussion here:
https://lists.gnu.org/archive/html/bug-lilypond/2019-02/msg0.html

No issue so far, afaik


Here another minimal:

\relative c'' {
  %\voiceOne
  d16. d32 \repeat tremolo 4 { b32 }
}

Looks like the error happens only if stems are pointing down, thus
above compiles fine if voiceOne is uncommented.


Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Slur over a single note

2019-02-25 Thread Urs Liska

Hi,

I'm in need of an idea how to approach this: I need to print a slur over 
a single note.


More concretely there already is a markup with a certain width above the 
note (see attached image), and I need to print a slur over that markup 
(see second attached image).


It should be possible (I think) to hook into the stencil callback, take 
the markup stencil and produce a new slur stencil from scratch. But 
until now I have only taken an existing slur stencil and worked with 
that, so I'm at a loss as to how I can add a new slur stencil to the 
existing one.


I've come to the point where I can access the markup as a stencil in the 
"stencil" override. From here I want to add an additional slur stencil, 
aligned to that markup stencil and add it to the whole resul.


Any pointers would be welcome
Urs

\version "2.21.0"

#(define (tremulo-type? obj)
   (and (symbol? obj)
(memq obj '(slow accel fast

tremulo =
#(define-event-function (type)(tremulo-type?)
   (let*
((markups
  `((accel .
  ,#{
\markup \concat {
  \fontsize #1
  \musicglyph "scripts.prall"
  \fontsize #-1
  \musicglyph "scripts.prallprall"
}
  #})))
 ;; store the actually used markup in a closure
 (use-markup (assq-ref markups type)))
#{
  \tweak stencil
  #(lambda (grob)
 (let*
  ((tremulo-stencil (grob-interpret-markup grob use-markup))
   )
   ; TODO:
   ; Create slur stencil and add/align it above the tremulo
   tremulo-stencil
   ))
  ^\markup ""
#}
))

{
  c''1 \tremulo accel
}

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: weird error with \repeat tremolo

2019-02-25 Thread Aaron Hill

On 2019-02-25 2:15 am, Thomas Morley wrote:

Am Mo., 25. Feb. 2019 um 11:02 Uhr schrieb N. Andrew Walsh
:


Hi Aaron,

On Mon, Feb 25, 2019 at 10:50 AM Aaron Hill  
wrote:

   You could try manually lengthening


the stem to see if it helps as a possible workaround.



I've gone all the way out to

 \once \override Beam.positions = #'(-20 . -24)

and still get the error, so I don't think tweaking stem length is 
going to help. Any idea what the error might be? Is there a bug 
report?


Thanks for the help,

A

Some discussion here:
https://lists.gnu.org/archive/html/bug-lilypond/2019-02/msg0.html


I was so certain I had posted to the bug alias on this issue, but I 
cannot find it.  It was a pretty big write up too, testing lots of 
things.  But I am feeling like I must have dreamt it, since there's no 
trace.  :-/




Here another minimal:

\relative c'' {
  %\voiceOne
  d16. d32 \repeat tremolo 4 { b32 }
}

Looks like the error happens only if stems are pointing down, thus
above compiles fine if voiceOne is uncommented.


The issue doesn't seem to be precisely stem direction.  You can trigger 
it with this:



\version "2.19.82"
{ a32 8..:32 }


If you change the note to g, then it works.  Lower notes result in a 
longer stem, which is why I had thought it might have something to do 
with stem length.


But then I found that beam-thickness can affect things too:


\version "2.19.82"
{ \override Beam.beam-thickness = #0.488934 a32 8..:32 }


This fails, but change the thickness to #0.488935 or higher and it 
works.



\version "2.19.82"
{ \override StemTremolo.beam-thickness = #0.465801 a32 8..:32 }


Again, this will fail, but *lower* the thickness to #0.465800 and it 
works.


-- Aaron Hill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Slur over a single note

2019-02-25 Thread Aaron Hill

On 2019-02-25 3:03 am, Urs Liska wrote:

Hi,

I'm in need of an idea how to approach this: I need to print a slur
over a single note.

More concretely there already is a markup with a certain width above
the note (see attached image), and I need to print a slur over that
markup (see second attached image).



Is this not just \overtie?


-- Aaron Hill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Slur over a single note

2019-02-25 Thread Thomas Morley
Am Mo., 25. Feb. 2019 um 12:04 Uhr schrieb Urs Liska :
>
> Hi,
>
> I'm in need of an idea how to approach this: I need to print a slur over a 
> single note.
>
> More concretely there already is a markup with a certain width above the note 
> (see attached image), and I need to print a slur over that markup (see second 
> attached image).
>
> It should be possible (I think) to hook into the stencil callback, take the 
> markup stencil and produce a new slur stencil from scratch. But until now I 
> have only taken an existing slur stencil and worked with that, so I'm at a 
> loss as to how I can add a new slur stencil to the existing one.
>
> I've come to the point where I can access the markup as a stencil in the 
> "stencil" override. From here I want to add an additional slur stencil, 
> aligned to that markup stencil and add it to the whole resul.
>
> Any pointers would be welcome
> Urs
>
> \version "2.21.0"
>
> #(define (tremulo-type? obj)
>(and (symbol? obj)
> (memq obj '(slow accel fast
>
> tremulo =
> #(define-event-function (type)(tremulo-type?)
>(let*
> ((markups
>   `((accel .
>   ,#{
> \markup \concat {
>   \fontsize #1
>   \musicglyph "scripts.prall"
>   \fontsize #-1
>   \musicglyph "scripts.prallprall"
> }
>   #})))
>  ;; store the actually used markup in a closure
>  (use-markup (assq-ref markups type)))
> #{
>   \tweak stencil
>   #(lambda (grob)
>  (let*
>   ((tremulo-stencil (grob-interpret-markup grob use-markup))
>)
>; TODO:
>; Create slur stencil and add/align it above the tremulo
>tremulo-stencil
>))
>   ^\markup ""
> #}
> ))
>
> {
>   c''1 \tremulo accel
> }

Hi Urs,

can't look deeper into it, have to run for my regular job...

Though, there are the under/overtie-markup-commands, customizable like
the tie-markup.command.
Probably better to use tie-markup directly, it respects 'direction
from parent-grob.


Cheers,
  Harm

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Slur over a single note

2019-02-25 Thread Urs Liska

Hi Aaron and Harm,

thank you for that pointer.

Yes, this is what I need. I'll manage to get from there (the challenge 
remains to make this optional).


Urs

Am 25.02.19 um 12:12 schrieb Aaron Hill:

On 2019-02-25 3:03 am, Urs Liska wrote:

Hi,

I'm in need of an idea how to approach this: I need to print a slur
over a single note.

More concretely there already is a markup with a certain width above
the note (see attached image), and I need to print a slur over that
markup (see second attached image).



Is this not just \overtie?


-- Aaron Hill

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: repeat title

2019-02-25 Thread Martin Tarenskeen




Thanks for your help. Sometimes it's simple to do complicated things, 
sometimes it's complicated to do do simple things in LilyPond ;-)


--

MT

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Slur over a single note

2019-02-25 Thread Pierre Perol-Schneider
Hi,
How about:
{
  a''1
  -\tweak X-offset #-1.8
  ^\markup\overtie\concat {
  \scale #'(1 . 2) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1.8) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1.6) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1.4) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1.2) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1) \musicglyph #"scripts.trill_element"
  }
}

Cheers,
Pierre

Le lun. 25 févr. 2019 à 12:34, Urs Liska  a écrit :

> Hi Aaron and Harm,
>
> thank you for that pointer.
>
> Yes, this is what I need. I'll manage to get from there (the challenge
> remains to make this optional).
>
> Urs
>
> Am 25.02.19 um 12:12 schrieb Aaron Hill:
> > On 2019-02-25 3:03 am, Urs Liska wrote:
> >> Hi,
> >>
> >> I'm in need of an idea how to approach this: I need to print a slur
> >> over a single note.
> >>
> >> More concretely there already is a markup with a certain width above
> >> the note (see attached image), and I need to print a slur over that
> >> markup (see second attached image).
> >>
> >
> > Is this not just \overtie?
> >
> >
> > -- Aaron Hill
> >
> > ___
> > lilypond-user mailing list
> > lilypond-user@gnu.org
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Slur over a single note

2019-02-25 Thread Urs Liska

Hi Pierre,

Am 25.02.19 um 12:55 schrieb Pierre Perol-Schneider:

Hi,
How about:
{
  a''1
  -\tweak X-offset #-1.8
  ^\markup\overtie\concat {
  \scale #'(1 . 2) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1.8) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1.6) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1.4) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1.2) \musicglyph #"scripts.trill_element" \hspace #-.1
  \scale #'(1 . 1) \musicglyph #"scripts.trill_element"
  }
}



thanks for the nice idea, but I explicitely need those two steps, so I'm 
quite happy with the implementation I had (regarding the design of the 
ornament).


Urs



Cheers,
Pierre

Le lun. 25 févr. 2019 à 12:34, Urs Liska > a écrit :


Hi Aaron and Harm,

thank you for that pointer.

Yes, this is what I need. I'll manage to get from there (the
challenge
remains to make this optional).

Urs

Am 25.02.19 um 12:12 schrieb Aaron Hill:
> On 2019-02-25 3:03 am, Urs Liska wrote:
>> Hi,
>>
>> I'm in need of an idea how to approach this: I need to print a slur
>> over a single note.
>>
>> More concretely there already is a markup with a certain width
above
>> the note (see attached image), and I need to print a slur over that
>> markup (see second attached image).
>>
>
> Is this not just \overtie?
>
>
> -- Aaron Hill
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org 
> https://lists.gnu.org/mailman/listinfo/lilypond-user

___
lilypond-user mailing list
lilypond-user@gnu.org 
https://lists.gnu.org/mailman/listinfo/lilypond-user

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Finding the objects at the start of the current measure

2019-02-25 Thread Urs Liska
Recently I managed (with considerable help from here) to write a 
function that can a) center some arbitrary stuff in a measure and b) 
print markup above/below that measure that pushes the surrounding 
barlines so the markup fits in the measure. However, before I can make 
this nice function available I have to resolve at least one further problem.


The function works by

- creating a markup stencil from the to-be-centered music
- creating the actual markup stencils and measuring their width
- inserting a MMR, setting its minimum-length to the determined width 
(plus some padding)

- replacing the MMR's stencil with the combined stencils created earlier.

As can be seen in the attached image this works smoothly in regular 
cases (first instance). However, it works *not* correctly when there is 
some stuff like clefs, key or time signatures at the beginning of the 
measure. The second and third instances in the image show cases where 
stuff of varying width is at the beginning of the measure, and in both 
cases the measure is not pushed wide enough. The same is true at the 
beginning of a system.


So what I need to do is determine if there's anything at that beginning, 
determine its width and calculate a value from there that I have to add 
to the minimum-length override.


I know that this is not linear. In the first instance (the 4/4 time sig) 
it would probably be ok to simply add the time signature's width, but in 
the other instance the to-be-added width is significantly less than the 
width of the combined time and the key signatures. I recall having to 
deal with that issue once, I think the calculation starts from a fixed 
width (2.0) and interpolates that up to a certain width when things work 
"normal" again.


First thing I need is to know: is it possible to know the width of these 
elements in a before-line-breaking callback? I have serious doubts 
because at that point we don't even know yet whether we're at a line 
break. However, in later callbacks I can't set minimum-length anymore.


If that is possible at all I'd need some help how to find the column 
where all these objects may be or some property of the current measure 
or the previous barline. From there I'd probably be able to get further 
on my own.


Thanks
Urs

\version "2.19.82"

\include "oll-core/package.ily"

% Center a (markup) stencil against an (original) MultiMeasureRest grob
#(define (center-stencil rest-grob markup-stencil)
   (let*
((rest-stencil (ly:multi-measure-rest::print rest-grob))
 (centered-markup-stencil (ly:stencil-aligned-to markup-stencil X 0))
 (rest-offset (interval-center (ly:stencil-extent rest-stencil X
;; return the self-centered time stencil offset by the rest's offset
(ly:stencil-translate-axis centered-markup-stencil rest-offset X)))

#(define (annotate-centered rest-grob markup-stencil upper-padding upper 
lower-padding lower)
   (let*
((base-stencil (center-stencil rest-grob markup-stencil))
 (base-y-extent (ly:stencil-extent base-stencil Y))
 (upper-offset (- 2 (cdr base-y-extent)))
 (lower-offset (+ (car base-y-extent) 2))
 (upper-stencil
  (center-stencil rest-grob
(grob-interpret-markup rest-grob
  (markup
   #:override '(baseline-skip . 2.5) upper
 (lower-stencil
  (center-stencil rest-grob
(grob-interpret-markup rest-grob
  (markup
   #:override '(baseline-skip . 2.5) lower
 (combined-stencil
  (ly:stencil-combine-at-edge
   (ly:stencil-combine-at-edge
base-stencil Y DOWN
lower-stencil
(+ lower-offset lower-padding))
   Y UP
   upper-stencil
   (+ upper-offset upper-padding
combined-stencil))

% Center some (annotated) music in a measure

% Wrap the music in a bare \markup \score context
% and return its stencil
getBareScoreMarkupStencil =
#(define-scheme-function (grob music)(ly:grob? ly:music?)
   (grob-interpret-markup grob
 #{
   \markup \score {
 \new Staff = "centered" {
   % Necessary to remove some offset to the right
   % (caused by the regular system-start gap)
   \once \override NoteColumn.X-offset = -2
   $music
 }
 \layout {
   ragged-right = ##t
   \context {
 \Score
 \omit StaffSymbol
 \omit Clef
 \omit TimeSignature
 \omit KeySignature
 \omit BarLine
   }
 }
   }
 #}))

annotateCenteredMusic =
#(with-options define-music-function (music)(ly:music?)
   `(strict
 (? above ,markup? ,#{ \markup \null #})
 (? below ,markup? ,(markup #:null)))
   ;; Store data in a closure to drag it over from the music-function stage
   ;; to before-line-breaking and stencil
   (let ((upper (assq-ref props 'above))
 (lower (assq-ref props 'below))
 (music-stil #f)
 (upper-stil #f)
 (lower-stil #f)
 (upper-paddi

Re: Slur over a single note

2019-02-25 Thread Carl Sorensen


From: Urs Liska 
Date: Monday, February 25, 2019 at 4:03 AM
To: lilypond-user 
Subject: Slur over a single note


Hi,

I'm in need of an idea how to approach this: I need to print a slur over a 
single note.

More concretely there already is a markup with a certain width above the note 
(see attached image), and I need to print a slur over that markup (see second 
attached image).

It should be possible (I think) to hook into the stencil callback, take the 
markup stencil and produce a new slur stencil from scratch. But until now I 
have only taken an existing slur stencil and worked with that, so I'm at a loss 
as to how I can add a new slur stencil to the existing one.

I've come to the point where I can access the markup as a stencil in the 
"stencil" override. From here I want to add an additional slur stencil, aligned 
to that markup stencil and add it to the whole result.

You might work with a bezier-sandwich-stencil, which is what both slurs and 
ties are constructed from.

See scm/stencil.scm

HTH,




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Create a macro for doubling the note in an arpeggio pattern

2019-02-25 Thread elmeri
Hello,

I later discovered that durations other than 16 are required for the doubled 
note later in the score (dotted 4th note for example), so I ended up doing 
something like this:

GR = #(define-music-function (m p1 p2 p3 p4 p5 p6)
(ly:music? ly:pitch? ly:pitch? ly:pitch? ly:pitch? ly:pitch? ly:pitch?)
#{
  <<
$m
\\
{ $p1 16[^( $p2 $p3 $p4 $p5 $p6 ])  }
  >>
#})

This makes it necessary to write the first pitch twice, (e.g. \GR f''8 f a, f 
a, c, f,) but it’s not a huge deal compared to having to write the whole << {} 
\\ {} >> construct every time. Now, on to figure out how to make a nice 
“knee’d” beam (3+3) for those notes.

 Thanks for the help!
-E



> On 22 Feb 2019, at 19.26, elmeri  wrote:
> 
> Hi,
> 
> I’m working on a score that has a lot of arpeggios where the first note of 
> the 6-note group of 16th notes is doubled as a dotted 4th note. Having a 
> macro/function to turn e.g. the pattern "f16 c a f c f,” into “<< { f4. } \\ 
> { f16 c a f c f, } >>”, or even more preferably “<< { f4. } \\ { f16([ c a f 
> c f,)] } >>” would save me a lot of typing and trouble. 
> 
> What I’ve been tinkering around with is something like:
> 
> GR = #(define-music-function (parser location p1 p2 p3 p4 p5 p6)
> (ly:music? ly:music? ly:music? ly:music? ly:music? ly:music?)
> #{
>   <<
> {$p1}
> \\
> {$p1 $p2 $p3 $p4 $p5 $p6}
>   >>
> #})
> 
> \GR f16 c a f c f,
> 
> which results in a ton of errors (at least on LilyPond 2.18.2).
> 
> Another one I’ve tried is this:
> 
> GR = #(define-music-function (parser location p1 DUMMY DURATION p2 p3 p4 p5 
> p6)
> (ly:pitch? string? ly:duration? ly:music? ly:music? ly:music? 
> ly:music? ly:music?)
> #{
>   <<
> {$p1 $DURATION}
> \\
> {$p1 16 $p2 $p3 $p4 $p5 $p6}
>   >>
> #})
> 
> \GR f ”” 16 c a f c f,
> 
> And another set of errors are generated. The DUMMY is (apparently) necessary 
> on LilyPond 2.18.2.
> 
> Any help is appreciated!
> 
> Thanks!
> 
> -Elmo
> 
> 
> 

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Finding the objects at the start of the current measure

2019-02-25 Thread Vaughan McAlley
On Mon, 25 Feb 2019 at 23:14, Urs Liska  wrote:

> Recently I managed (with considerable help from here) to write a function
> that can a) center some arbitrary stuff in a measure and b) print markup
> above/below that measure that pushes the surrounding barlines so the markup
> fits in the measure. However, before I can make this nice function
> available I have to resolve at least one further problem.
>
> The function works by
>
> - creating a markup stencil from the to-be-centered music
> - creating the actual markup stencils and measuring their width
> - inserting a MMR, setting its minimum-length to the determined width
> (plus some padding)
> - replacing the MMR's stencil with the combined stencils created earlier.
>
> As can be seen in the attached image this works smoothly in regular cases
> (first instance). However, it works *not* correctly when there is some
> stuff like clefs, key or time signatures at the beginning of the measure.
> The second and third instances in the image show cases where stuff of
> varying width is at the beginning of the measure, and in both cases the
> measure is not pushed wide enough. The same is true at the beginning of a
> system.
>
> So what I need to do is determine if there's anything at that beginning,
> determine its width and calculate a value from there that I have to add to
> the minimum-length override.
>
> I know that this is not linear. In the first instance (the 4/4 time sig)
> it would probably be ok to simply add the time signature's width, but in
> the other instance the to-be-added width is significantly less than the
> width of the combined time and the key signatures. I recall having to deal
> with that issue once, I think the calculation starts from a fixed width
> (2.0) and interpolates that up to a certain width when things work "normal"
> again.
>
> First thing I need is to know: is it possible to know the width of these
> elements in a before-line-breaking callback? I have serious doubts because
> at that point we don't even know yet whether we're at a line break.
> However, in later callbacks I can't set minimum-length anymore.
>
> If that is possible at all I'd need some help how to find the column where
> all these objects may be or some property of the current measure or the
> previous barline. From there I'd probably be able to get further on my own.
>
> Thanks
> Urs
>
> \version "2.19.82"
>
> \include "oll-core/package.ily"
>
> % Center a (markup) stencil against an (original) MultiMeasureRest grob
> #(define (center-stencil rest-grob markup-stencil)
>(let*
> ((rest-stencil (ly:multi-measure-rest::print rest-grob))
>  (centered-markup-stencil (ly:stencil-aligned-to markup-stencil X 0))
>  (rest-offset (interval-center (ly:stencil-extent rest-stencil X
> ;; return the self-centered time stencil offset by the rest's offset
> (ly:stencil-translate-axis centered-markup-stencil rest-offset X)))
>
> #(define (annotate-centered rest-grob markup-stencil upper-padding upper 
> lower-padding lower)
>(let*
> ((base-stencil (center-stencil rest-grob markup-stencil))
>  (base-y-extent (ly:stencil-extent base-stencil Y))
>  (upper-offset (- 2 (cdr base-y-extent)))
>  (lower-offset (+ (car base-y-extent) 2))
>  (upper-stencil
>   (center-stencil rest-grob
> (grob-interpret-markup rest-grob
>   (markup
>#:override '(baseline-skip . 2.5) upper
>  (lower-stencil
>   (center-stencil rest-grob
> (grob-interpret-markup rest-grob
>   (markup
>#:override '(baseline-skip . 2.5) lower
>  (combined-stencil
>   (ly:stencil-combine-at-edge
>(ly:stencil-combine-at-edge
> base-stencil Y DOWN
> lower-stencil
> (+ lower-offset lower-padding))
>Y UP
>upper-stencil
>(+ upper-offset upper-padding
> combined-stencil))
>
> % Center some (annotated) music in a measure
>
> % Wrap the music in a bare \markup \score context
> % and return its stencil
> getBareScoreMarkupStencil =
> #(define-scheme-function (grob music)(ly:grob? ly:music?)
>(grob-interpret-markup grob
>  #{
>\markup \score {
>  \new Staff = "centered" {
>% Necessary to remove some offset to the right
>% (caused by the regular system-start gap)
>\once \override NoteColumn.X-offset = -2
>$music
>  }
>  \layout {
>ragged-right = ##t
>\context {
>  \Score
>  \omit StaffSymbol
>  \omit Clef
>  \omit TimeSignature
>  \omit KeySignature
>  \omit BarLine
>}
>  }
>}
>  #}))
>
> annotateCenteredMusic =
> #(with-options define-music-function (music)(ly:music?)
>`(strict
>  (? above ,markup? ,#{ \markup \null #})
>  (? below ,markup? ,(markup #:null)))
>;; Store data in a closure to drag it over from

Re: Finding the objects at the start of the current measure

2019-02-25 Thread Urs Liska

Hi Vaughan,


...

Hi Urs,

FWIW, I don’t really see key signatures & time signatures as part of 
the measure proper, and don’t mind the look of those examples.



Maybe I should have made myself clearer. I'm not taking issue with the 
texts overlapping these elements on the *left* side. My problem is that 
in such cases the *right* barline is not pushed far enough to the right.


The attached image shows a markup added to the last measure of the 
original example. The point of the function is to make sure the markup 
doesn't protrude into the next measure, to avoid exactly the type of 
collision avoidance you can see in the image.


In order to be able to tackle my current engraving challenge I created a 
workaround by manually increasing the padding. This does work but I'm 
totally not happy with it yet. Unfortunately I do have concerns if it is 
at all possible to achieve automatically (since at the point when I can 
still influence the minimum-length I don't have the required data yet).


Urs




That’s some impressive coding!

Vaughan


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Frescobaldi

2019-02-25 Thread Martin Tarenskeen



Hi,

Frequently I see messages here with questions about Frescobaldi. Often 
these messages start with something like "maybe it's off-topic here but 
...".


For once and for all: Is it or is it not off-topic to discuss Frescobaldi 
using this mailing-list? I don't think it's off-topic. Every Frescobaldi 
user is also a LilyPond user, right?


--

MT

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Frescobaldi

2019-02-25 Thread Andrew Bernard
Hi Martin,

The problem is that the Frescobaldi Yahoo Groups group is moribund, and
people are forced to ask questions here. Is see no issue with that. I don't
think anyone has complained. I don't even know if this list has a moderator
anyway.

Andrew


On Tue, 26 Feb 2019 at 18:31, Martin Tarenskeen 
wrote:

>
> For once and for all: Is it or is it not off-topic to discuss Frescobaldi
> using this mailing-list? I don't think it's off-topic. Every Frescobaldi
> user is also a LilyPond user, right?
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user