[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Basic Scheme Markdown Function
From: |
Mark Knoop |
Subject: |
Re: Basic Scheme Markdown Function |
Date: |
Fri, 06 Dec 2024 16:21:07 +0000 |
User-agent: |
mu4e 1.12.7; emacs 29.4 |
At 14:40 on 06 Dec 2024, Steph Phillips wrote:
> Hi all, this one's probably a simple solution, but I'm a
> little fuzzy on how to implement custom Scheme functions
> still.
> I'm working on a musical theater score, and there are lots
> of instrument changes formatted like this:
> changeBbClar = ^\markup {
> \general-align #X #-0.7
> \bold
> \override #'(box-padding . 0.5) \box
> "Bb Clarinet"
> }
> My end goal is a function where I can define the name of
> the instrument and the x-alignment - something like
> \InstrumentChange "Bb Clarinet" #-0.7
This will do what you want.
InstrumentChange =
#(define-music-function
(mkp align) (markup? number?)
#{
<>^\markup
\general-align #X #align
\bold
\override #'(box-padding . 0.5)
\box #mkp
#})
For more details about writing music functions, see this excellent guide put
together by Jean:
https://extending-lilypond.gitlab.io/en/extending/index.html
--
Mark Knoop