Simple substitution for oddFooterMarkup?

2006-11-02 Thread Trevor Bača

Hi,

I've been looking over 12.1 and 12.4 and I'm still struggling with the
following task:

I want to store

 boldPageNumber = \markup { \fill-line { \bold \fontsize #3
\on-the-fly #print-page-number-check-first \fromproperty
#'page:page-number-string } }

in a standard include file called standard.ly and then write

 \include standard.ly

 \paper {
   oddFooterMarkup = \boldPageNumber
 }

This isn't right, however. The interpreter says

 Parsing...ERROR: Unbound variable: print-page-number-check-first

Can anyone help with the right way to store the longish markup command
in an external file for inclusion later in the paper block?



--
Trevor Bača
[EMAIL PROTECTED]
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple substitution for oddFooterMarkup?

2006-11-02 Thread Mats Bengtsson



Trevor Bača wrote:

Hi,

I've been looking over 12.1 and 12.4 and I'm still struggling with the
following task:

I want to store

 boldPageNumber = \markup { \fill-line { \bold \fontsize #3
\on-the-fly #print-page-number-check-first \fromproperty
#'page:page-number-string } }

in a standard include file called standard.ly and then write

 \include standard.ly

 \paper {
   oddFooterMarkup = \boldPageNumber
 }

This isn't right, however. The interpreter says

 Parsing...ERROR: Unbound variable: print-page-number-check-first

Can anyone help with the right way to store the longish markup command
in an external file for inclusion later in the paper block?

You probably have to copy the definition of 
print-page-number-check-first from
ly/titling-init.ly into your include file. The reason is probably that 
it's defined using
(define ...) instead of (define-public ...) and that your function 
definition is
outside the scope of the definitions in titling-init.ly (I don't know 
any details

on how this works, though).

  /Mats



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


Re: Simple substitution for oddFooterMarkup?

2006-11-02 Thread Trevor Bača

On 11/2/06, Mats Bengtsson [EMAIL PROTECTED] wrote:



Trevor Bača wrote:
 Hi,

 I've been looking over 12.1 and 12.4 and I'm still struggling with the
 following task:

 I want to store

  boldPageNumber = \markup { \fill-line { \bold \fontsize #3
 \on-the-fly #print-page-number-check-first \fromproperty
 #'page:page-number-string } }

 in a standard include file called standard.ly and then write

  \include standard.ly

  \paper {
oddFooterMarkup = \boldPageNumber
  }

 This isn't right, however. The interpreter says

  Parsing...ERROR: Unbound variable: print-page-number-check-first

 Can anyone help with the right way to store the longish markup command
 in an external file for inclusion later in the paper block?

You probably have to copy the definition of
print-page-number-check-first from
ly/titling-init.ly into your include file. The reason is probably that
it's defined using
(define ...) instead of (define-public ...) and that your function
definition is
outside the scope of the definitions in titling-init.ly (I don't know
any details
on how this works, though).


Hm; maybe it simplifies things a bit to get rid of the include file
and do the example in a single file like this?

%%% BEGIN %%%

\version 2.9.27

boldNumber = \markup { \fill-line { \bold \fontsize #3 \on-the-fly
#print-page-number-check-first \fromproperty #'page:page-number-string
} }

\paper {
 oddFooterMarkup = \boldNumber
}

\new Staff {
  c'4
}

%%% END %%%

And here the same parser error arises ...

 Parsing...ERROR: Unbound variable: print-page-number-check-first

... which makes me think that maybe there's something going on other
than a scoping error.

Come to think of it, is it even possible to define a substitution for
the righthand side of an assignment like this (where the righthand
side isn't actually a (music) expression but is markup instead)?

I'd love something like ...

boldNumber = \markup { \fill-line { \bold \fontsize #3 \on-the-fly
#print-page-number-check-first \fromproperty #'page:page-number-string
} }

  \paper {
oddFooterMarkup = \eval boldNumber
  }

... but this generates a syntax error:

Parsing...
342.ly:7:0: error: syntax error, unexpected '}', expecting '='

}



--
Trevor Bača
[EMAIL PROTECTED]
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple substitution for oddFooterMarkup?

2006-11-02 Thread Mats Bengtsson



Trevor Bača wrote:

On 11/2/06, Mats Bengtsson [EMAIL PROTECTED] wrote:





Hm; maybe it simplifies things a bit to get rid of the include file
and do the example in a single file like this?

%%% BEGIN %%%

\version 2.9.27

boldNumber = \markup { \fill-line { \bold \fontsize #3 \on-the-fly
#print-page-number-check-first \fromproperty #'page:page-number-string
} }

\paper {
 oddFooterMarkup = \boldNumber
}

\new Staff {
  c'4
}

%%% END %%%

And here the same parser error arises ...

 Parsing...ERROR: Unbound variable: print-page-number-check-first

... which makes me think that maybe there's something going on other
than a scoping error.
You will have to copy the definition also in this case. As far as I can 
understand,
the macros defined using (define ...) in ly/titling-init.ly are only 
visible within
ly/titling-init.ly (or maybe within a group of init files), but clearly 
not in the user

files.

  /Mats


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


Re: Simple substitution for oddFooterMarkup?

2006-11-02 Thread Trevor Bača

On 11/2/06, Mats Bengtsson [EMAIL PROTECTED] wrote:



Trevor Bača wrote:
 On 11/2/06, Mats Bengtsson [EMAIL PROTECTED] wrote:



 Hm; maybe it simplifies things a bit to get rid of the include file
 and do the example in a single file like this?

 %%% BEGIN %%%

 \version 2.9.27

 boldNumber = \markup { \fill-line { \bold \fontsize #3 \on-the-fly
 #print-page-number-check-first \fromproperty #'page:page-number-string
 } }

 \paper {
  oddFooterMarkup = \boldNumber
 }

 \new Staff {
   c'4
 }

 %%% END %%%

 And here the same parser error arises ...

  Parsing...ERROR: Unbound variable: print-page-number-check-first

 ... which makes me think that maybe there's something going on other
 than a scoping error.
You will have to copy the definition also in this case. As far as I can
understand,
the macros defined using (define ...) in ly/titling-init.ly are only
visible within
ly/titling-init.ly (or maybe within a group of init files), but clearly
not in the user
files.


OK, yes, you're clearly right. I was forgetting that oddFooterMarkup
is in fact defined in ly/titling-init.ly (along with
print-page-number-check-first).

Copying the definition of print-page-number-check-first now removes
the scoping error:

%%% BEGIN %%%

\version 2.9.27

#(define (print-page-number-check-first layout props arg)
 (if (or (not (= (chain-assoc-get 'page:page-number props -1)
 (ly:output-def-lookup layout 'first-page-number)))
 (eq? (ly:output-def-lookup layout 'print-first-page-number) #t))
  (print-page-number layout props arg)
  empty-stencil))

oddFooterMarkup = \markup { \fill-line { \bold \fontsize #3
\on-the-fly #print-page-number-check-first \fromproperty
#'page:page-number-string } }

\paper {
 \oddFooterMarkup
}

\new Staff {
  c'4
}

%%% END %%%

And now there's some grumbling at the way I'm invoking oddFooterMarkup:

Parsing...
343.ly:24:2: error: syntax error, unexpected MARKUP_IDENTIFIER

 \oddFooterMarkup


What's a good way to reference the redefinition of oddFooterMarkup
inside the paper block?


--
Trevor Bača
[EMAIL PROTECTED]
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Simple substitution for oddFooterMarkup?

2006-11-02 Thread Trevor Bača

On 11/2/06, Nicolas Sceaux [EMAIL PROTECTED] wrote:

Trevor Bača [EMAIL PROTECTED] writes:

 I want to store

  boldPageNumber = \markup { \fill-line { \bold \fontsize #3
 \on-the-fly #print-page-number-check-first \fromproperty
 #'page:page-number-string } }

 in a standard include file called standard.ly and then write

  \include standard.ly

  \paper {
oddFooterMarkup = \boldPageNumber
  }

 This isn't right, however.

Put your titling markup definitions in a standard-titling.ily file, then
include it in the paper block.

\paper {
  \include standard-titling.ily
  oddFooterMarkup = \boldPageNumber
}


That's exactly what I was looking for. Thank you!

Really cleans up my paper block.


--
Trevor Bača
[EMAIL PROTECTED]
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


[Q] Rehearsal marks in parts

2006-11-02 Thread Victor Eijkhout
If I put \mark \default in each part, then I get an annoying warnnig message 
about duplicate marks when 
I include the parts in a score document. What's the easiest way around this?

Victor.



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


Re: [Q] Rehearsal marks in parts

2006-11-02 Thread Paul Scott

Victor Eijkhout wrote:
If I put \mark \default in each part, then I get an annoying warnnig message 
about duplicate marks when 
I include the parts in a score document. What's the easiest way around this?
  
Can you give the version number of LilyPond you are using and a small 
example?


Paul Scott



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


Re: Simple substitution for oddFooterMarkup?

2006-11-02 Thread stk

Hi --

Your macro definition:

  boldPageNumber = \markup { \fill-line { \bold \fontsize #3
  \on-the-fly #print-page-number-check-first \fromproperty
  #'page:page-number-string } }

Question:  if print-page-number-check-first is a defined function,
does it have to be referenced as a literal symbol
(by adding an apostrophe after the #)? --

  #'print-page-number-check-first

-- Tom



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