Re: MetronomeMark aligned to accidentals

2014-04-07 Thread Trevor Daniels

David, you wrote Monday, April 07, 2014 12:54 AM

 Well, here's something rough which appears to do the trick.
 
 The basic idea is that the function locates a PaperColumn that is related
 to both our MetronomeMark grob and an AccidentalPlacement grob.  If it
 finds it, it calculates the extent of all the accidentals and sets X-offset
 based on this.
 
 Hope this helps.  Let me know if you run into problems with it.

That looks pretty good to me, thanks David.

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


RE: MetronomeMark aligned to accidentals

2014-04-07 Thread Daniel Rosen
 -Original Message-
 From: Trevor Daniels [mailto:t.dani...@treda.co.uk]
 Sent: Monday, April 07, 2014 6:43 AM
 To: David Nalesnik
 Cc: Daniel Rosen; lilypond-user
 Subject: Re: MetronomeMark aligned to accidentals
 
 
 David, you wrote Monday, April 07, 2014 12:54 AM
 
  Well, here's something rough which appears to do the trick.
 
  The basic idea is that the function locates a PaperColumn that is
  related to both our MetronomeMark grob and an AccidentalPlacement
  grob.  If it finds it, it calculates the extent of all the accidentals
  and sets X-offset based on this.
 
  Hope this helps.  Let me know if you run into problems with it.
 
 That looks pretty good to me, thanks David.
 
 Trevor

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


RE: MetronomeMark aligned to accidentals

2014-04-06 Thread Daniel Rosen
 -Original Message-
 From: Trevor Daniels [mailto:t.dani...@treda.co.uk]
 Sent: Saturday, April 05, 2014 6:24 PM
 To: Daniel Rosen; lilypond-user@gnu.org
 Subject: Re: MetronomeMark aligned to accidentals
 
 
 Daniel, you wrote Saturday, April 05, 2014 1:44 PM
 
  I would like the MetronomeMark to be aligned with the left edge of the
 leftmost Accidental (almost with the BarLine, but not quite). I've been trying
 to manipulate the Score.MetronomeMark.non-break-align-symbols
 property, but to no avail (I'm not sure I quite understand how that property
 works; it's a little unclear to me in the IR). Can anyone steer me in the 
 right
 direction?
 
 I think you'll find all you need to know in the following section.  You can't 
 align
 to an accidental using this, but by using an offset from an alignment to the
 bar line anchor you may be able to achieve the positioning you want.
 
 http://www.lilypond.org/doc/v2.17/Documentation/notation/aligning-
 objects#using-the-break_002dalignable_002dinterface
 
 Trevor

Thanks, that should do fine as a workaround.

Does anyone else agree that the behavior I'm suggesting should be the default? 
We've heard from Elaine Gould thanks to Brian, but she's not the end-all 
be-all, so I don't want to ask that this be added as a bug without some kind of 
consensus.

DR

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


RE: MetronomeMark aligned to accidentals

2014-04-06 Thread Daniel Rosen
 -Original Message-
 From: Trevor Daniels [mailto:t.dani...@treda.co.uk]
 Sent: Saturday, April 05, 2014 6:24 PM
 To: Daniel Rosen; lilypond-user@gnu.org
 Subject: Re: MetronomeMark aligned to accidentals
 
 
 Daniel, you wrote Saturday, April 05, 2014 1:44 PM
 
  I would like the MetronomeMark to be aligned with the left edge of the
 leftmost Accidental (almost with the BarLine, but not quite). I've been trying
 to manipulate the Score.MetronomeMark.non-break-align-symbols
 property, but to no avail (I'm not sure I quite understand how that property
 works; it's a little unclear to me in the IR). Can anyone steer me in the 
 right
 direction?
 
 I think you'll find all you need to know in the following section.  You can't 
 align
 to an accidental using this, but by using an offset from an alignment to the
 bar line anchor you may be able to achieve the positioning you want.
 
 http://www.lilypond.org/doc/v2.17/Documentation/notation/aligning-
 objects#using-the-break_002dalignable_002dinterface
 
 Trevor

I've tried this based on the page you linked me to above, but it's not working. 
What am I missing here? 

\version 2.19.3
{
  R1 |
  \override Score.MetronomeMark.break-align-symbols = #'(key-signature)
  \tempo Tempo
  as' bes'
}

DR

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


Re: MetronomeMark aligned to accidentals

2014-04-06 Thread Trevor Daniels

Daniel, you wrote April 06, 2014 3:21 PM

 I've tried this based on the page you linked me to above, but it's not 
 working. What am I missing here? 
 
 \version 2.19.3
 {
  R1 |
  \override Score.MetronomeMark.break-align-symbols = #'(key-signature)
  \tempo Tempo
  as' bes'
 }

I'm afraid I've misled you here.  Although MetronomeMark layout object 
supposedly supports the break-alignable-interface, according to the IR, it 
seems not to behave in the same way as RehearsalMark and BarNumber layout 
objects.  Sorry about that; I should have checked more carefully before making 
the suggestion.

However, you may be able to obtain a satisfactory placing by overriding 
self-alignment-X, eg

\version 2.19.3
{
  R1 |
  \override Score.MetronomeMark.self-alignment-X = -0.3
  \tempo Tempo
  as' bes'
}

This offsets the metronome mark from its default position of 0 - centered on 
the left-most notehead.  Unfortunately the required value will depend on the 
string length provided to \tempo and the number of accidentals, so this is 
strictly a poor work-around.

Maybe someone else will have a better solution.

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


Re: MetronomeMark aligned to accidentals

2014-04-06 Thread David Nalesnik
Hi all,

On Sun, Apr 6, 2014 at 11:10 AM, Trevor Daniels t.dani...@treda.co.ukwrote:


 Maybe someone else will have a better solution.


Well, here's something rough which appears to do the trick.

The basic idea is that the function locates a PaperColumn that is related
to both our MetronomeMark grob and an AccidentalPlacement grob.  If it
finds it, it calculates the extent of all the accidentals and sets X-offset
based on this.

Hope this helps.  Let me know if you run into problems with it.

--David
\version 2.19.3

#(define align-tempo-with-accidental
   (lambda (grob)
 (let* ((p-col (ly:grob-parent grob X))
(sys (ly:grob-parent p-col X))
(all (ly:grob-object sys 'all-elements))
(grob-name (lambda (x) (assq-ref (ly:grob-property x 'meta) 'name)))
(pl (filter
   (lambda (x) (eq? 'AccidentalPlacement (grob-name x)))
   (ly:grob-array-list all)))
(pl-p-col (filter
(lambda (x) (eq? p-col (ly:grob-parent x X)))
pl)))
   (if (pair? pl-p-col)
   (let* ((accs (map cadr (ly:grob-object (car pl-p-col) 'accidental-grobs)))
  (X-exts (map (lambda (x) (ly:grob-extent x sys X)) accs))
  (un (reduce interval-union '() X-exts)))
 (car un))
 ; Return the default.
 (ly:make-simple-closure
  `(,+
,(ly:make-simple-closure
  (list ly:break-alignable-interface::self-align-callback))
,(ly:make-simple-closure
  (list ly:self-alignment-interface::x-aligned-on-self

{
  R1 |
  \override Score.MetronomeMark.X-offset = #align-tempo-with-accidental
  \tempo Tempo
  aes' bes'
  \tempo Tempo II
  as' bes' ges' fes' es' des' ces'
  \tempo Tempo III
  ais' bis' gis' fis' eis' dis' cis'
}attachment: metronome-mark-alignment.png___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: MetronomeMark aligned to accidentals

2014-04-05 Thread Pierre Perol-Schneider
2014-04-05 14:44 GMT+02:00 Daniel Rosen drose...@gmail.com:

 Consider the following example:

 \version 2.19.3
 {
   R1 |
   \tempo Tempo
   as' bes'
 }

 I would like the MetronomeMark to be aligned with the left edge of the
 leftmost Accidental (almost with the BarLine, but not quite). I've been
 trying to manipulate the Score.MetronomeMark.non-break-align-symbols
 property, but to no avail (I'm not sure I quite understand how that
 property works; it's a little unclear to me in the IR). Can anyone steer me
 in the right direction?

 DR


I'm not sure I can help in detail...
For one shot :

\version 2.19.3

{

R1 |

\tweak X-offset #-2.5 \tempo Tempo

as' bes'

}

 % or

{

R1 |

\once\override Score.MetronomeMark.self-alignment-X = #-0.3

\tempo Tempo

as' bes'

}


HTH,

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


RE: MetronomeMark aligned to accidentals

2014-04-05 Thread Daniel Rosen
Well, yes, that is one option, but it’s not one I love for two reasons: 1) it’s 
kludgy, and 2) I think that maybe LilyPond should do what I’m describing by 
default. The current default output looks very odd to me (although it could be 
just me).

DR

From: Pierre Perol-Schneider [mailto:pierre.schneider.pa...@gmail.com]
Sent: Saturday, April 05, 2014 9:53 AM
To: Daniel Rosen
Cc: lilypond-user@gnu.org
Subject: Re: MetronomeMark aligned to accidentals

2014-04-05 14:44 GMT+02:00 Daniel Rosen 
drose...@gmail.commailto:drose...@gmail.com:
Consider the following example:

\version 2.19.3
{
  R1 |
  \tempo Tempo
  as' bes'
}

I would like the MetronomeMark to be aligned with the left edge of the leftmost 
Accidental (almost with the BarLine, but not quite). I've been trying to 
manipulate the Score.MetronomeMark.non-break-align-symbols property, but to no 
avail (I'm not sure I quite understand how that property works; it's a little 
unclear to me in the IR). Can anyone steer me in the right direction?

DR

I'm not sure I can help in detail...
For one shot :

\version 2.19.3

{

R1 |

\tweak X-offset #-2.5 \tempo Tempo

as' bes'

}

 % or

{

R1 |

\once\override Score.MetronomeMark.self-alignment-X = #-0.3

\tempo Tempo

as' bes'

}



HTH,

Pierre

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


RE: MetronomeMark aligned to accidentals

2014-04-05 Thread Daniel Rosen
I should also mention that aligning the MetronomeMark with the BarLine would be 
fine as a workaround for now, but I can’t figure out how to do that either.

DR

From: Daniel Rosen
Sent: Saturday, April 05, 2014 10:25 AM
To: 'Pierre Perol-Schneider'
Cc: lilypond-user@gnu.org
Subject: RE: MetronomeMark aligned to accidentals

Well, yes, that is one option, but it’s not one I love for two reasons: 1) it’s 
kludgy, and 2) I think that maybe LilyPond should do what I’m describing by 
default. The current default output looks very odd to me (although it could be 
just me).

DR

From: Pierre Perol-Schneider [mailto:pierre.schneider.pa...@gmail.com]
Sent: Saturday, April 05, 2014 9:53 AM
To: Daniel Rosen
Cc: lilypond-user@gnu.orgmailto:lilypond-user@gnu.org
Subject: Re: MetronomeMark aligned to accidentals

2014-04-05 14:44 GMT+02:00 Daniel Rosen 
drose...@gmail.commailto:drose...@gmail.com:
Consider the following example:

\version 2.19.3
{
  R1 |
  \tempo Tempo
  as' bes'
}

I would like the MetronomeMark to be aligned with the left edge of the leftmost 
Accidental (almost with the BarLine, but not quite). I've been trying to 
manipulate the Score.MetronomeMark.non-break-align-symbols property, but to no 
avail (I'm not sure I quite understand how that property works; it's a little 
unclear to me in the IR). Can anyone steer me in the right direction?

DR

I'm not sure I can help in detail...
For one shot :

\version 2.19.3

{

R1 |

\tweak X-offset #-2.5 \tempo Tempo

as' bes'

}

 % or

{

R1 |

\once\override Score.MetronomeMark.self-alignment-X = #-0.3

\tempo Tempo

as' bes'

}



HTH,

Pierre

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


RE: MetronomeMark aligned to accidentals

2014-04-05 Thread Brian Barker



At 12:44 05/04/2014 +, Daniel Rosen wrote:
I would like the MetronomeMark to be aligned with the left edge of 
the leftmost Accidental (almost with the BarLine, but not quite).


At 14:25 05/04/2014 +, Daniel Rosen wrote:
... I think that maybe LilyPond should do what I'm describing by 
default. The current default output looks very odd to me (although 
it could be just me).


No, it's not just you.  For what it's worth, here's Elaine Gould (at page 183):

When a tempo marking coincides with a time signature indication, 
align the tempo with the left edge of the time signature.
When there is no new time signature, align the tempo marking with the 
first element of the notation (e.g. a note or accidental) after the 
clef and key signature. Note that when the tempo change is at the 
start of the bar, the marking is not placed on the barline.


Brian Barker  



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


RE: MetronomeMark aligned to accidentals

2014-04-05 Thread Daniel Rosen
 -Original Message-
 From: Brian Barker [mailto:b.m.bar...@btinternet.com]
 Sent: Saturday, April 05, 2014 1:47 PM
 To: Daniel Rosen
 Subject: RE: MetronomeMark aligned to accidentals
 
 At 14:25 05/04/2014 +, you wrote:
 ... I think that maybe LilyPond should do what I'm describing by
 default. The current default output looks very odd to me (although it
 could be just me).
 
 No, its not just you; here's Elaine Gould at page 183:
 
 When a tempo marking coincides with a time signature indication, align the
 tempo with the left edge of the time signature.
 When there is no new time signature, align the tempo marking with the first
 element of the notation (e.g. a note or accidental) after the clef and key
 signature. Note that when the tempo change is at the start of the bar, the
 marking is not placed on the barline.
 
 Brian Barker - privately

Thanks, Brian. Since you agreed with me (off-list) that this is useful 
information for the list to have, I'm forwarding it to them.

DR

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


Re: MetronomeMark aligned to accidentals

2014-04-05 Thread Trevor Daniels

Daniel, you wrote Saturday, April 05, 2014 1:44 PM

 I would like the MetronomeMark to be aligned with the left edge of the 
 leftmost Accidental (almost with the BarLine, but not quite). I've been 
 trying to manipulate the Score.MetronomeMark.non-break-align-symbols 
 property, but to no avail (I'm not sure I quite understand how that property 
 works; it's a little unclear to me in the IR). Can anyone steer me in the 
 right direction?

I think you'll find all you need to know in the following section.  You can't 
align to an accidental using this, but by using an offset from an alignment to 
the bar line anchor you may be able to achieve the positioning you want.

http://www.lilypond.org/doc/v2.17/Documentation/notation/aligning-objects#using-the-break_002dalignable_002dinterface

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