lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to include a file just once?


From: Dmytro O. Redchuk
Subject: Re: How to include a file just once?
Date: Fri, 22 Jan 2010 10:23:47 +0200

У чт, 2010-01-21 у 11:47 -0600, Michael J. O'Donnell пише:
> I am putting together a large choral score from bookparts for each
> number in the work. I like to be able to produce either a single number,
> or the whole score. The natural approach is to include style definitions
> in each of the files that I might set, including the file to format the
> whole score and the files to format individual numbers. Files to format
> individual numbers also include the style definitions.
> 
> I find that repeated inclusion of the same definitions leads quickly to
> a segmentation fault.
> 
> I can either add one more level of indirection, with one more file per
> number. Or, I can do some Scheme hacking, with a global variable to set
> showing inclusion (tricky, because the variable needs to be testable
> reliably even when it has never been set explicitly).
I am not sure, but probably you can use your own names for element style
definitions and check them with "(if (defined? ..." constructs?..

Probably, i simply don't knwo what's i'm talking about, but... It's a
chance to ask for me :-)

For example, i use these in macro.lyi:

% -----------------8<---------------------------
globalStaffSize = #(if (defined? 'globalStaffSize) globalStaffSize 20)

#(symbol-fset! 'barno-plain ly:text-interface::print)
#(symbol-fset! 'barno-boxed (make-stencil-boxer 0.1 0.33 
ly:text-interface::print))
ourBarNumberStencil =
  #(if (defined? 'ourBarNumberStencil)
       (symbol-fref ourBarNumberStencil)
       (symbol-fref 'barno-boxed))
% -----------------8<---------------------------

And then i can use these in score templates:

% -----------------8<---------------------------
globalStaffSize = #22
ourBarNumberStencil = #'barno-plain
% -----------------8<---------------------------

And later they will be used in appropriate places...

> But, I'd prefer to use a well-known standard method, if it exists.
Hardly believe this is a "standard method" thought :O)

And i have not tried these with \bookpart, but "should work" i guess.

And, please, as always --- any comments are welcome!

> 
> Thanks,
> 
> Mike O'Donnell

-- 
  Dmytro O. Redchuk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]