Re: [frogs] chord-name-engraver plus capo - schemeing away ... |
[ Thread Index |
Date Index
| More lilynet.net/frogs Archives
]
- To: Wols Lists <antlists@xxxxxxxxxxxxxxx>
- Subject: Re: [frogs] chord-name-engraver plus capo - schemeing away ...
- From: Neil Puttock <n.puttock@xxxxxxxxx>
- Date: Fri, 27 Aug 2010 23:42:01 +0100
- Cc: frogs@xxxxxxxxxxx, Lilypond Developers <lilypond-devel@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=6nraq4MJhw6/e4csv+cdDHR7l2jgOAJmSUkWQ0S8dBs=; b=IFIsPNLOlEtie1cJIBTZeiOsNmPg22hD+Tl02G6pDaV5FJ9GhDTuHRUVZPc5ZHPXaB A4AN5P4UPYxy3IdUmZmf4xL2tUMPm//kreiq4bBzV6d8c6p/iSyZOn+x0nxLtSqv5sTv 0Qewxw2kMHVCIjJR+Ur7CLtABuaiF7dhLmVcY=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=acJwVTpSsGWO2VxFl0NbrsWQCfEUlSSFoPJuABiUDkMpoURzzjwOxlds2tCGrqX8Oo SLwYUz155kBtB0Ks98xWR/AYNkReSA79ZaG5vI+GM/xQodNdcxuTSi4UZzLd93vRoEqh CoXn4jCp5c2P645sT+D3Mkl1tBjeTGExrw58c=
On 27 August 2010 21:49, Wols Lists <antlists@xxxxxxxxxxxxxxx> wrote:
> There's a function called "parenthesize" in define-markup-commands.scm
> that looks like it does what I want (line 3154), but
> ly_lily_module_constant can't find it, and I don't know whether I've got
> the call to it in the line below correct or not, anyway.
ly_lily_module_constant ("parenthesize-markup")
> And lastly, the call to line-markup blows up with "invalid arguments".
> I've found another function - markup-join (markup.scm, l514) - should I
> be using that? But I think it wants a pair, and scm_cons does not seem
> to be the function that creates a pair. There's probably more to it than
> that, though.
scm_cons does create a pair, but you need a list for the arguments to \line.
Just to prove how nasty doing markup in C++ is, here's the above code corrected:
SCM paren_proc = ly_lily_module_constant ("parenthesize-markup");
SCM line_proc = ly_lily_module_constant ("line-markup");
SCM hspace_proc = ly_lily_module_constant ("hspace-markup");
SCM final_markup = scm_list_n (line_proc,
scm_list_3 (markup,
scm_list_2 (hspace_proc,
scm_from_int (1)),
scm_list_2 (paren_proc, capo_markup)),
SCM_UNDEFINED);
chord_name_->set_property ("text", final_markup);
I feel dirty after messing with that. ;)
I haven't used scm_call, since the markup isn't evaluated until the
stencil's created: the 'text property just stores the markup pending
its conversion to a stencil via Text_interface::interpret_markup.
BTW, I forgot that there's no word-space set for ChordName markup,
since it would mess up the spacing of the individual elements, so I
had to add some space using \hspace instead.
Cheers,
Neil
---
----
Join the Frogs!