lilypond-user
[Top][All Lists]
Advanced

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

Re: Abbreviation for markup?


From: Helge Kruse
Subject: Re: Abbreviation for markup?
Date: Sun, 29 Jan 2012 16:46:56 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.5) Gecko/20091204 Lightning/1.0b1 Thunderbird/3.0

Am 29.01.2012 11:32, schrieb David Kastrup:
Is there a way with a music-function or something similar to define an
abbreviation?

{
   r4_\markup \concat \vcenter { D\sharp } r4 c'' dis' |
   a'_\markup \concat \vcenter { D\flat } b' c'' d' |
}

I would like to do it somehow like this:

{
   r2\setlever{ D\sharp } r4 c'' dis' |
   a'\setlever{ D\flat } b' c'' d' |
}

You have the crossing of two domains here: music and markup.  Having a
markup command argument is only possible inside of markup, so there are
two possibilities of syntax:

r2\setlever \markuplist { D\sharp }

(note that the application of concat and vcenter suggests a markup list
being in use here).

r2_\markup \setlever { D\sharp }

and actually, since the namespace of markup functions and music
functions is separate, you could support _both_ at the same time, one
with music (event) function, one with a markup function.  This would be
something like
setlever =
#(define-event-function (parser location pedal) (markup-list?)
   #{ _\markup \concat \vcenter #pedal })

for the event variant (#1), and

(define-markup-function (layout props pedal) (markup-list?)
   (interpret-markup layout props
     #{ \markup \concat \vcenter #pedal }))

for the markup function variant (#2).

So you can't avoid switching into markup mode either for your command
itself, or at least for its argument explicitly.


Thanks for reply.

I tried to make minimal examples with this proposal. I am not experienced with Scheme, so I don't know why this does not work. I append the ly code snippets and Lilypond output at the end.

Your help is very appreciated if there is a solution for this convenience approach. But if it is not possible with an appropriate effort I admit it's not that important since it's just an abbreviation.

Thanks,
Helge


\version "2.15.27"

(define-markup-function (layout props pedal) (markup-list?)
  (interpret-markup layout props
    #{ \markup \concat \vcenter #pedal }))

{  a'_\markup \setlever { D\flat } b' c'' d'  }


this results in this error list:
------------------------------
GNU LilyPond 2.15.27
»d.ly« wird verarbeitet
Analysieren...
d.ly:4:0: Fehler: syntax error, unexpected '('

(define-markup-function (layout props pedal) (markup-list?)
d.ly:6:5: Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
    #
     { \markup \concat \vcenter #pedal }))
Unbound variable: {
d.ly:6:32: Fehler: syntax error, unexpected SCM_TOKEN, expecting MARKUP_FUNCTION or '{'
    #{ \markup \concat \vcenter
                                #pedal }))
d.ly:6:33: Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
    #{ \markup \concat \vcenter #
                                 pedal }))
Unbound variable: pedal
d.ly:9:19: Fehler: Ungültige Fluchtsequenz: »\setlever«
        a'_\markup
                   \setlever { D\flat } b' c'' d'
d.ly:8:0: Fehler: Fehler gefunden, musikalischer Ausdruck wird ignoriert

{
fatal error: gescheiterte Dateien: "d.ly"
------------------------------

The other way you mentioned was to use this construct:

\version "2.15.27"

setlever =
#(define-event-function (parser location pedal) (markup-list?)
  #{ _\markup \concat \vcenter #pedal })

{  r4\setlever \markuplist { D\sharp } r4 c'' dis'  }


this results in this error list:
------------------------------
GNU LilyPond 2.15.27
»c.ly« wird verarbeitet
Analysieren...
c.ly:4:1: Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
#
 (define-event-function (parser location pedal) (markup-list?)
Wrong type argument in position 1 (expecting character): #<eof>
c.ly:4:1: Fehler: syntax error, unexpected '('
#
 (define-event-function (parser location pedal) (markup-list?)
c.ly:5:3: Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
  #
   { _\markup \concat \vcenter #pedal })
Unbound variable: {
c.ly:5:31: Fehler: syntax error, unexpected SCM_TOKEN, expecting MARKUP_FUNCTION or '{'
  #{ _\markup \concat \vcenter
                               #pedal })
c.ly:5:32: Fehler: GUILE signalisierte einen Fehler für den hier beginnenden Ausdruck
  #{ _\markup \concat \vcenter #
                                pedal })
Unbound variable: pedal
c.ly:7:0: Fehler: Fehler gefunden, musikalischer Ausdruck wird ignoriert

{  r4\setlever \markuplist { D\sharp } r4 c'' dis'  }
fatal error: gescheiterte Dateien: "c.ly"
---------------------------------------



reply via email to

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