[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Manual volta repeat commands [was Re: Quoted text]
From: |
John Mandereau |
Subject: |
Manual volta repeat commands [was Re: Quoted text] |
Date: |
Fri, 30 May 2008 18:14:34 +0200 |
On 2008/05/29, Risto Vääräniemi wrote:
> I noticed that the LP front page states that "LilyPond now allows all
> text context properties to be markups". This does not yet cover volta
> brackets, though. That is Score.repeatCommands, which only accepts
> plain text. If you try to enter a markup the volta bracket disappears
> completely. I guess this is a bit more difficult to fix/change because
> to get some normal text inside volta brackets you have make some
> special overrides, i.e., font encoding, font family etc.
The volta text can already be a markup actually, but as this markup is
the second element of a list, which is itself contained in the
repeatCommands list, it's not obvious to set it. BTW I fixed the
misleading description of repeatCommands in the Internals Reference.
> \set Score.repeatCommands = #'((volta \markup {"markup"} ))
This won't work, because \markup is a LilyPond command, so it doesn't
work within Scheme; you should use something like
(markup #:line (#:simple "blablah"))
and as a consequence, you cannot use a list of constants (the first
quote character after the Scheme mark '#'), because you call Scheme
function markup. You could use
\set Score.repeatCommands =
#(list (list 'volta (markup #:line (#:simple "blablah"))))
but it's cumbersome to write markups in Scheme syntax [1], so it's
easier to define the markup as a variable first:
myVoltaMarkup = \markup { bla \roman baz }
\set Score.repeatCommands = #(list (list 'volta myVoltaMarkup))
[1] if you still prefer to write a particular markup in Scheme, write it
first with a note and call \displayMusic on it:
foo = \displayMusic c'1^\markup { bla \roman baz }
then you can read Scheme code that could be used to generate this music
expression on standard output.
Maybe this example helps understanding how to set repeatCommands to a
list containing variables:
- expression of a list of constants: '((volta "93") end-repeat)
- an equivalent expression in a "developed" form, where you can replace
constants with variables:
(list (list 'volta "93") 'end-repeat)
Ralph, would you like to update the ly snippet in "Manual repeat marks"
with an example of setting a markup within repeatCommands, and add a
cross-reference to Volta_engraver?
Maybe something like
\set Score.repeatCommands = #(list (list 'volta (markup
#:line (#:simple "1.2.3..." #:roman (#:italic "ad lib.")))) 'end-repeat)
or an equivalent form
voltaAdLib = \markup { "1.2.3..." \roman \italic "ad lib." }
\set Score.repeatCommands = #(list (list 'volta voltaAdLib) 'end-repeat)
is more realistic. However, I can't make it work with Lily 2.11.46 (see
the end of this email for a complete input file), I got this:
Drawing systems.../usr/local/share/lilypond/2.11.46/scm/markup.scm:549:24: In
procedure + in expression (+ space (cdr #)):
/usr/local/share/lilypond/2.11.46/scm/markup.scm:549:24: Wrong type argument in
position 1: #f
Is it a bug or a missing feature? It seems that using any markup more
complex than \markup { "foo" } doesn't work here, and the description in
repeat-commands doesn't mention markup can be used instead of a string.
Maybe explaining Scheme language features used in this example is
probably not relevant in the ly code or in the Repeats section. I think
such explanation should be added to the Scheme tutorial; I add it to my
TODO list, but don't expect changes for this from me within one week.
Graham, may I freely edit the Scheme tutorial, or is it to be revised
soon under GDP? IIRC this section has not a high priority in GDP, but
updating docs as questions from users arise is a good thing too.
Cheers,
John
%%% BEGIN LY %%%
\version "2.11.46"
voltaAdLib = \markup { "1.2.3..." \roman \italic "ad lib."}
\relative c'' {
c4
\set Score.repeatCommands = #(list (list 'volta voltaAdLib) 'end-repeat)
c4 b
d4 e
\set Score.repeatCommands = #'((volta #f))
}
%%% END LY %%%
- Re: Quoted text (was Re: When is "-" required in articulations?), Graham Percival, 2008/05/23
- Re: Quoted text (was Re: When is "-" required in articulations?), John Mandereau, 2008/05/24
- Re: Quoted text (was Re: When is "-" required in articulations?), Graham Percival, 2008/05/24
- Re: Quoted text (was Re: When is "-" required in articulations?), Risto Vääräniemi, 2008/05/29
- Re: Quoted text (was Re: When is "-" required in articulations?), Neil Puttock, 2008/05/29
- Manual volta repeat commands [was Re: Quoted text],
John Mandereau <=
- Re: Manual volta repeat commands [was Re: Quoted text], Neil Puttock, 2008/05/30
- Re: Manual volta repeat commands [was Re: Quoted text], Graham Percival, 2008/05/30
- Re: Manual volta repeat commands [was Re: Quoted text], John Mandereau, 2008/05/31
- Ottava brackets formatting [was Re: Quoted text (was Re: When is "-" required in articulations?)], John Mandereau, 2008/05/25
- Re: Ottava brackets formatting [was Re: Quoted text (was Re: When is "-" required in articulations?)], Neil Puttock, 2008/05/25
- Re: Ottava brackets formatting [was Re: Quoted text (was Re: When is "-" required in articulations?)], John Mandereau, 2008/05/26
- Re: Ottava brackets formatting [was Re: Quoted text (was Re: When is "-" required in articulations?)], Neil Puttock, 2008/05/26