lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scheme markup macros


From: Nicolas Sceaux
Subject: Re: scheme markup macros
Date: Wed, 11 May 2005 11:42:28 +0200
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Graham Percival <address@hidden> writes:

> Is it possible to define a \markup macro that looks like a lilypond
> command?
>
> This produces the output I want:
>
> \version "2.5.23"
> #(def-markup-command (tempoMark layout props str) (markup?)
>    (interpret-markup layout props
>      (markup #:bold #:large str)))
> \relative c'' {
>    c4^\markup{ \tempoMark Allegro }
> }
>
> I'm wondering if I can alter the syntax so the command is used like
> this:
>
> \relative c'' {
>    c4^\tempoMark{ Allegro }
> }

Han-Wen has answered your question.

However, for that particular example, you can define a function that
builds a \mark.

\layout {
  \context { \Score \remove "Mark_engraver" }
  \context { \Staff \consists "Mark_engraver" }
}

tempoMark = #(def-music-function (parser location markp) (markup?)
              #{ \once \override Staff . RehearsalMark #'self-alignment-X = #-1
                 \once \override Staff . RehearsalMark #'no-spacing-rods = ##t
                 %% eventually, some other overrides here
                 \mark \markup { \bold \italic $markp } #})

{ 
  \tempoMark \markup Allegro
  c'
}

You can not get rid of the explicit "\markup", though.

nicolas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]