Funny Bug or feature?. instrumentNames rendered in reverse order than music

2010-10-08 Thread Francisco Vila
Hello.  This makes figures attached to notes to be printed in the
expected (ascending) order, but instrument names in reverse
(descending) order.  Another exciting case later below.

\version 2.13.34

#(define sequence-number 0)
#(define-markup-command (score-sequence layout props) ()
 (set! sequence-number (+ sequence-number 1))
 (interpret-markup layout props
   (markup #:bold #:large (number-string sequence-number

\new Staff {
 \set Staff.instrumentName = \markup\score-sequence
 a'1^\markup\score-sequence
}

\new Staff {
 \set Staff.instrumentName = \markup\score-sequence
 b'1^\markup\score-sequence
}

\new Staff {
 \set Staff.instrumentName = \markup\score-sequence
 c''1^\markup\score-sequence
}

===

When the staves are into a group in a single score, the behavior
reverses. Last note or note markup renders first, and last instrument
name renders last.

\version 2.13.34

#(define sequence-number 0)
#(define-markup-command (score-sequence layout props) ()
 (set! sequence-number (+ sequence-number 1))
 (interpret-markup layout props
   (markup #:bold #:large (number-string sequence-number

 \new Staff { \set Staff.instrumentName = \markup\score-sequence
a'1^\markup\score-sequence }


\new Staff {
 \set Staff.instrumentName = \markup\score-sequence
b'1^\markup\score-sequence }


\new Staff {
 \set Staff.instrumentName = \markup\score-sequence
c''1^\markup\score-sequence }




-- 
Francisco Vila. Badajoz (Spain)
www.paconet.org , www.csmbadajoz.com

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Funny Bug or feature?. instrumentNames rendered in reverse order than music

2010-10-08 Thread David Kastrup
Francisco Vila paconet@gmail.com writes:

 Hello.  This makes figures attached to notes to be printed in the
 expected (ascending) order, but instrument names in reverse
 (descending) order.  Another exciting case later below.

I don't see what the problem is.  Lilypond does not, as far as I can
see, guarantee any particular order of evaluation here.

This is neither a bug nor a feature as far as I can see.  There is
nothing that guarantees this will be different, there is nothing that
guarantees that it will stay like this.  There is nothing that
guarantees you'll get the same behavior on two different runs even.

-- 
David Kastrup


___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Funny Bug or feature?. instrumentNames rendered in reverse order than music

2010-10-08 Thread Reinhold Kainhofer
Am Freitag, 8. Oktober 2010, 13:17:42 schrieb David Kastrup:
 Francisco Vila paconet@gmail.com writes:
  Hello.  This makes figures attached to notes to be printed in the
  expected (ascending) order, but instrument names in reverse
  (descending) order.  Another exciting case later below.
 
 I don't see what the problem is.  Lilypond does not, as far as I can
 see, guarantee any particular order of evaluation here.
 
 This is neither a bug nor a feature as far as I can see.  There is
 nothing that guarantees this will be different, there is nothing that
 guarantees that it will stay like this.  There is nothing that
 guarantees you'll get the same behavior on two different runs even.

But in real life, in scores with multiple movements, the headers are numbered 
sequentially. Ideally, LilyPond should be able to do that automatically... As 
that example shows, one has to hardcode the movement number (which becomes a 
mess if in a huge oratorio you decide to split one piece into two...).

Cheers,
Reinhold
-- 
--
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial  Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Funny Bug or feature?. instrumentNames rendered in reverse order than music

2010-10-08 Thread Francisco Vila
2010/10/8 David Kastrup d...@gnu.org:
 Francisco Vila paconet@gmail.com writes:

 Hello.  This makes figures attached to notes to be printed in the
 expected (ascending) order, but instrument names in reverse
 (descending) order.  Another exciting case later below.

 I don't see what the problem is.  Lilypond does not, as far as I can
 see, guarantee any particular order of evaluation here.

 This is neither a bug nor a feature as far as I can see.  There is
 nothing that guarantees this will be different, there is nothing that
 guarantees that it will stay like this.  There is nothing that
 guarantees you'll get the same behavior on two different runs even.

I partially agree.  The part I don't agree is that we need counters,
the snippet implements a counter and it doesn't work, but the code
looks right.  If we'd understand the logic behind rendering order, we
could do the right thing.

-- 
Francisco Vila. Badajoz (Spain)
www.paconet.org , www.csmbadajoz.com

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Funny Bug or feature?. instrumentNames rendered in reverse order than music

2010-10-08 Thread Carl Sorensen
On 10/8/10 2:37 AM, Francisco Vila paconet@gmail.com wrote:

 Hello.  This makes figures attached to notes to be printed in the
 expected (ascending) order, but instrument names in reverse
 (descending) order.  Another exciting case later below.
 

Here's a different version that forces the evaluation to happen during
parsing, thus making it happen the way you want it.

\version 2.13.34

#(define sequence-number 0)
#(define-markup-command (score-sequence layout props sequence-number)
(number?)
 (interpret-markup layout props
   (markup #:bold #:large (number-string sequence-number

\new Staff {
 #(set! sequence-number (1+ sequence-number))
 \set Staff.instrumentName = \markup\score-sequence #sequence-number
 a'1^\markup\score-sequence #sequence-number
}

\new Staff {
 #(set! sequence-number (1+ sequence-number))
 \set Staff.instrumentName = \markup\score-sequence #sequence-number
 b'1^\markup\score-sequence #sequence-number
}

\new Staff {
 #(set! sequence-number (1+ sequence-number))
 \set Staff.instrumentName = \markup\score-sequence #sequence-number
 c''1^\markup\score-sequence #sequence-number
}


The problem you had earlier was that the scheme was not evaluated during the
parsing stage, but during the translation stage.  And there is no implied
relationship between parsing order and translation order.

If you want stuff to happen in parsing order, it's necessary to make sure
the code is evaluated during parsing.

HTH,

Carl


___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond


Re: Funny Bug or feature?. instrumentNames rendered in reverse order than music

2010-10-08 Thread Reinhold Kainhofer
Am Freitag, 8. Oktober 2010, um 23:24:27 schrieben Sie:
 On 10/8/10 8:02 AM, Reinhold Kainhofer reinh...@kainhofer.com wrote:
  But in real life, in scores with multiple movements, the headers are
  numbered sequentially. Ideally, LilyPond should be able to do that
  automatically... As that example shows, one has to hardcode the movement
  number (which becomes a mess if in a huge oratorio you decide to split
  one piece into two...).
 
 This is an appropriate feature request -- an automatic means of numbering
 headers.
 
 Making the clever hack (that is not a part of the LilyPond distribution)
 keep working is not necessarily the best way to handle this enhancement
 request, IMO.

Actually, I don't think there is a cleaner way than providing a means to 
include a counter directly into the title markup. First, there are various 
different ways to number the titles (all of these are really used in published 
scores by well-known publishers):

Nr. 1 Title
No. 1 Title
№ 1 Title (That's the textnumero sign #8470; as XML entity)
№. 1 Title
№. 1. Title
1. Title
1 Title
1 -- Title

Further complicating is the fact that every now and then a header does not get 
a new number, e.g. in Oratorios when a piece consists of a short recitativo 
and then a choral. In some editions, such a piece gets a piece title of 9. 
Recitativo and Choral and right before the begin of the Choral (two lines 
later) Choral without any new number.

Cheers,
Reinhold
-- 
--
Reinhold Kainhofer, reinh...@kainhofer.com, http://reinhold.kainhofer.com/
 * Financial  Actuarial Math., Vienna Univ. of Technology, Austria
 * http://www.fam.tuwien.ac.at/, DVR: 0005886
 * LilyPond, Music typesetting, http://www.lilypond.org

___
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond