lilypond-user
[Top][All Lists]
Advanced

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

Re: scheme function help


From: Madoka Machitani
Subject: Re: scheme function help
Date: Mon, 6 May 2013 19:39:16 +0900

Hi, David! 

On Mon, May 6, 2013 at 6:40 PM, David Kastrup <address@hidden> wrote:
Madoka Machitani <address@hidden> writes:

> Now, is it correct to assume you are trying to achieve something like
> this?  \insMark "a" musical-sequence
>
> If so, the function would be:
>
> insMark =
> #(define-music-function (parser location mark mus)
>    (markup? ly:music?)
>    (set! (ly:music-property mus 'elements)
>          (cons (make-music 'MarkEvent 'label mark)
>                (ly:music-property mus 'elements)))
>    mus)
>
> This is a crude example and won't work with single note events like c'4

Why wouldn't you do

insMark =
#(define-music-function (parser location mark mus)
   (markup? ly:music?)
   #{ \mark #mark #mus #})

instead?  Note that depending on the version, #mark and/or #mus might
need to be $mark or $mus instead.

Ah, yes, I should have done that way (and was aware of that notation) but Stjepan 
mentioned things like cons and ly: function, so I did the hard way :)

-- 
Madoka
 
P.S. 
I've recently switched from MuseScore so I'm a Lilypond newbie, with some amount of Scheme experience.
Hello to you all :)

--
David Kastrup


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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