lilypond-user
[Top][All Lists]
Advanced

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

Re: scheme function with string


From: David Kastrup
Subject: Re: scheme function with string
Date: Mon, 19 Nov 2018 16:06:03 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Gianmaria Lari <address@hidden> writes:

> I have this simple scheme substitution function
>
> myFin = #(define-music-function (m)  (ly:music?)
>     #{ \addStringNumber \addFingering $m "1x2x" "x3x4" #}
> )
>
>
> It simply adds some fingering and string numbers on the musical expression
> argument m. I use like this:
>
> \myFin {a b c' d'}
>
>
> I would like to modify "myFin" function adding two more string parameters
> so that I can pass the fingering strings. In the end I would like to be
> able to write
>
> \myFin {a b c' d' "1x2x" "x3x4" }
>
>
> How can I do it?

You can't because {a b c' d' "1x2x" "x3x4" } is not valid input
in any mode (possibly lyricsmode but it would be really tricky to turn
that into something useful).

You could try for

    \myFin {a b c' d'} "1x2x" "x3x4"

instead which is obviously done using

myFin = #(define-music-function (m a b)  (ly:music? string? string?)
    #{ \addStringNumber \addFingering $m #a #b #}
)


-- 
David Kastrup



reply via email to

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