|
From: | Urs Liska |
Subject: | Re: Basic function question |
Date: | Tue, 26 Jul 2011 12:36:49 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 |
Am 26.07.2011 12:14, schrieb Dmytro O. Redchuk:
On Tue 26 Jul 2011, 11:39 Urs Liska wrote:Am 26.07.2011 11:28, schrieb Dmytro O. Redchuk:So (if so), you need to define markup function. #(define-markup-command (instr layout props what) (markup?) (interpret-markup layout props (markup #:bold #:italic #:huge what))) (not tested thougth).Well this works. This is a solution I had also found in the docs. So it seems it is not possible to _use_ functions the way I had wanted? I have always either to use a markup function (and write "\markup") or to first write the function name and provide the note as an argument. Is that correct?Actually I don't know why _markup function_ behaves like this. Docs*) says: %----------------------------8<---------------------------------- The markup macro builds markup expressions in Scheme while providing a LilyPond-like syntax. For example, (markup #:column (#:line (#:bold #:italic "hello" #:raise 0.4 "world") #:larger #:line ("foo" "bar" "baz"))) is equivalent to: \markup \column { \line { \bold \italic "hello" \raise #0.4 "world" } \larger \line { foo bar baz } } %----------------------------8<---------------------------------- But is that really equivalent? Why markup function should (shouldn't it?) be preceeded with \markup ? I don't know actually. Sorry.
Well, that's actually a snippet that I also had problems with. I think it depends on the perspective.It is equivalent in the sense that writing the above Scheme snippet within a function will give the same result as writing the lilypond snippet within a music expression. But I think actually the Scheme expression returns a markup object containing everything from the first #. So in order to use it you can replace everything after the "\markup" by the result of the function.
So if it is at all possible one would have to create a function that returns the "\markup" command as well as the markup object created in the above example. Of course I don't have a clue as to how to achieve this. But my vaguely remembered programming experience leads me to believe that it should be possible.
Any ideas anyone? Or should I just drop this and use c4 \markup \inst "Vl." ? Best Urs
_____________________ * http://lilypond.org/doc/v2.15/Documentation/extending/markup-construction-in-scheme
[Prev in Thread] | Current Thread | [Next in Thread] |