Re: [frogs] Picking up contents of \paper \layout and \midi blocks in Scheme |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
-----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, reinhold@xxxxxxxxxxxxx, 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-----
---
----
Join the Frogs!