Re: set-global-staff-size from inside Scheme function

2014-05-16 Thread Jan-Peter Voigt
Hi Urs,

the last statement the include returns is not music:
#(ly:set-option 'preview #t)
so the parser complains.
Those warnings can be avoided with void-functions, which wrap the statement.

(A bit in a hurry, so no example for noew ;) )

Cheers, Jan-Peter


Am 16.05.2014 12:05, schrieb Urs Liska:
> compileScore =
> #(define-void-function (parser location score)(ly:score?)
>#{ \include "example-styles.ily" #}
>(let ((book
>   #{
> \book {
>   % \include "example-styles.ily"
>   \score { #score }
> }
>   #}))
>  (ly:book-process
>   book
>   #{ \paper {} #}
>   #{ \layout{} #}
>   (ly:parser-output-name parser
> 
> works (i.e. doing the include first before the (let ) block).
> But I still get a warning
> 
> "
> example-styles.ily:3:1: warning: Ignoring non-music expression
> 
> #(set-global-staff-size 44)
> "
> 
> I might accept this because the result is the accepted, but is there a
> way to avoid that warning?


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


Re: set-global-staff-size from inside Scheme function

2014-05-16 Thread Phil Burfitt
- Original Message - 
From: "Urs Liska" 

To: "lilypond-user" 
Sent: Friday, May 16, 2014 9:42 AM
Subject: set-global-staff-size from inside Scheme function



Hi,

I have been there already, but I can't find the corresponding email, and 
I don't recall if they actually contained a solution or only an 
explanation of the cause of the issue. So I have to start nes.


For the creation of music examples in a book I have written a function 
\compileScore which does a number of things like munging file names, 
cleaning up temporary files and particularly compiling different 
versions of the file.


One particular issue is that it includes appropriate style sheets 
according to the example type (which is expressed as a variable).
The problem is that #(set-global-staff-size) doesn't work in that 
constellation, IISC because it's not a toplevel expression anymore.


The attached files show a very stripped-down version of the stuff and 
will probably not look very useful.


But my question is: How can I set the global staff size from within the 
included file?


Best
Urs


Have you tried #(layout-set-staff-size) ?

Phil.




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


Re: set-global-staff-size from inside Scheme function

2014-05-16 Thread Urs Liska

Am 16.05.2014 10:54, schrieb Jan-Peter Voigt:

Hi Urs,

this constellation compiles, if you wrap the scheme-call to
set-global-staff-size into a void-function. But if it is called, when
the book is already opened, the staff-size is already initialized and
can't be changed (for this book).
It probably works, if you place #(set-global-staff-size ..) before \book
{...} .


compileScore =
#(define-void-function (parser location score)(ly:score?)
   #{ \include "example-styles.ily" #}
   (let ((book
  #{
\book {
  % \include "example-styles.ily"
  \score { #score }
}
  #}))
 (ly:book-process
  book
  #{ \paper {} #}
  #{ \layout{} #}
  (ly:parser-output-name parser

works (i.e. doing the include first before the (let ) block).
But I still get a warning

"
example-styles.ily:3:1: warning: Ignoring non-music expression

#(set-global-staff-size 44)
"

I might accept this because the result is the accepted, but is there a 
way to avoid that warning?


Urs



HTH, Jan-Peter

Am 16.05.2014 10:42, schrieb Urs Liska:

Hi,

I have been there already, but I can't find the corresponding email, and
I don't recall if they actually contained a solution or only an
explanation of the cause of the issue. So I have to start nes.

For the creation of music examples in a book I have written a function
\compileScore which does a number of things like munging file names,
cleaning up temporary files and particularly compiling different
versions of the file.

One particular issue is that it includes appropriate style sheets
according to the example type (which is expressed as a variable).
The problem is that #(set-global-staff-size) doesn't work in that
constellation, IISC because it's not a toplevel expression anymore.

The attached files show a very stripped-down version of the stuff and
will probably not look very useful.

But my question is: How can I set the global staff size from within the
included file?

Best
Urs


___
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: set-global-staff-size from inside Scheme function

2014-05-16 Thread Jan-Peter Voigt
Hi Urs,

this constellation compiles, if you wrap the scheme-call to
set-global-staff-size into a void-function. But if it is called, when
the book is already opened, the staff-size is already initialized and
can't be changed (for this book).
It probably works, if you place #(set-global-staff-size ..) before \book
{...} .

HTH, Jan-Peter

Am 16.05.2014 10:42, schrieb Urs Liska:
> Hi,
> 
> I have been there already, but I can't find the corresponding email, and
> I don't recall if they actually contained a solution or only an
> explanation of the cause of the issue. So I have to start nes.
> 
> For the creation of music examples in a book I have written a function
> \compileScore which does a number of things like munging file names,
> cleaning up temporary files and particularly compiling different
> versions of the file.
> 
> One particular issue is that it includes appropriate style sheets
> according to the example type (which is expressed as a variable).
> The problem is that #(set-global-staff-size) doesn't work in that
> constellation, IISC because it's not a toplevel expression anymore.
> 
> The attached files show a very stripped-down version of the stuff and
> will probably not look very useful.
> 
> But my question is: How can I set the global staff size from within the
> included file?
> 
> Best
> Urs
> 
> 
> ___
> 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


set-global-staff-size from inside Scheme function

2014-05-16 Thread Urs Liska

Hi,

I have been there already, but I can't find the corresponding email, and 
I don't recall if they actually contained a solution or only an 
explanation of the cause of the issue. So I have to start nes.


For the creation of music examples in a book I have written a function 
\compileScore which does a number of things like munging file names, 
cleaning up temporary files and particularly compiling different 
versions of the file.


One particular issue is that it includes appropriate style sheets 
according to the example type (which is expressed as a variable).
The problem is that #(set-global-staff-size) doesn't work in that 
constellation, IISC because it's not a toplevel expression anymore.


The attached files show a very stripped-down version of the stuff and 
will probably not look very useful.


But my question is: How can I set the global staff size from within the 
included file?


Best
Urs
\version "2.19.6"

compileScore =
#(define-void-function (parser location score)(ly:score?)
   (let ((book
  #{
\book {
  \include "example-styles.ily"
  \score { #score }
}
  #}))
 (ly:book-process
book
#{ \paper {} #}
#{ \layout{} #}
   (ly:parser-output-name parser

\compileScore
\score {
  \new Staff { c' }
}
\version "2.19.6"

#(set-global-staff-size 44)

#(ly:set-option 'preview #t)

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