lilypond-devel
[Top][All Lists]
Advanced

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

Re: [frogs] Picking up contents of \paper \layout and \midi blocks in Sc


From: Reinhold Kainhofer
Subject: Re: [frogs] Picking up contents of \paper \layout and \midi blocks in Scheme
Date: Sat, 27 Jun 2009 19:35:59 +0200
User-agent: KMail/1.11.4 (Linux/2.6.28-13-generic; KDE/4.2.4; i686; ; )

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Samstag, 27. Juni 2009 15:27:08 schrieb Ian Hulin:
> I want to pick up attributes set in these blocks in Scheme.  I can
> successfully pick up the outermost blocks by doing things like
>
> let* ((mymidi  ly:parser-lookup (parser '$defaultmidi))
>      (keyval '() )
>     (set! keyval (ly:output-def-lookup mymidi 'an-attribute)))
>
>
> How do I pick up the contents of a locally declared \midi within a
> \bookpart, i.e not declared at the outermost level?

That depends on where you need to obtain the output-def. Can you give use the 
context of the scheme function? In particular, if you have the score object, 
you can use ly:score-output-defs to get all output defs (layout and midi) and 
simply filter out the midi block. If that is not set, you can use $defaultmidi.

But, as I said, everything depends on the context of the scheme code...

I had a similar problem a while ago (see my mail "Re: Accessing header 
properties from ordinary markup" On May 22, 2008 to lilypond-user), but have 
not yet been able to properly solve it... 
My current code can be found at:
      http://lsr.dsi.unimi.it/LSR/Snippet?id=467
but it only uses $defaultlayout so far, either, since I haven't found a way to 
obtain the score there.

So, if someone with deeper knowledge about the internals can provide a 
solution, it would also help me a lot.

Cheers,
Reinhold

PS: the LSR seems to break with this snippet: only the header fields are shown 
in the image, but not the actual markup produced by the snippet!
- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, 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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iD8DBQFKRliATqjEwhXvPN0RApchAKCXzYGAYouy/WMnXpc0CIStHD/yOgCeNDxI
XINuAOxkhCYcauAwnBa8WrU=
=2rPY
-----END PGP SIGNATURE-----




reply via email to

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