[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Music function problem
From: |
Thomas Morley |
Subject: |
Re: Music function problem |
Date: |
Thu, 14 May 2015 14:06:45 +0200 |
2015-05-14 13:44 GMT+02:00 Peter Gentry <address@hidden>:
> I am trying to write an include file that will modify a music object
> dependent on the specified instrument.
>
> I am trying to write a function that will call the current music object and
> a user supplied argument string/number with the object of modifying the
> music object depending on the supplied number/string.
>
> I can get this to work if the two arguments are ( ly:music? color?) but not
> if they are (ly:music? number?) or (ly:music? string?)
>
> The function call in an include file aimed to get a music object and a user
> number is
>
> callmyfunction =
> #(define-music-function (parser location m n) (ly:music? number?)
> (anotherfunction m n))
>
> This is a fragment of the include file
>
> In the lilypond file
> ...
> \callmyfunction #2
Looks like you call 'callmyfunction' with a number as first argument,
but ly:music? is expected.
> ....etc
>
> The define-music-function does not accept a number or string my puzzle is
> how do I get the music object and the user argument into my include
> function. Any pointers gratefully recieved....
>
> I think I am missing something crucial about define-music-function
music-functions _do_ accept strings or numbers, something else must be wrong.
Can't say more without compilable code, though.
Cheers,
Harm