Lukas-Fabian Moser <[email protected]> writes:
> Folks,
>
> I sometimes enter music which consists of a lot of "patterns" where
> (relatively complicated) constructions of beams, tuplets etc. are used
> repeatedly with changing pitches. Of course I'd like to put those in a
> function.
>
> For instance, in a Mozart symphony I have
>
> r16 \once \omit TupletBracket \tuplet 3/2 { c32([ e g] } c16) c-!
>
> all over the place. So, I want do define a function \pat that takes
>
> \pat c e g c
>
> and creates just this pattern.
>
> QUESTION: I am under the impression that, since I want to give only
> pitches to the function, I have to create the music in Scheme, and
> hence I do not know how to attach the various articulations etc. other
> than in Scheme. Hence, my function now reads:
[...]
> Works like a charm, but I admit that I find the definition quite
> tedious (me being a non-Schemer, essentially), especially I think that
> I only realized part of -! in my articulation definition (the MIDI
> part being omitted).
>
> What I really would like to have is something like:
>
> pat = #(define-music-function
> (pa pb pc pd)
> (ly:pitch? ly:pitch? ly:pitch? ly:pitch?)
> #{
> r16 \once \omit TupletBracket \tuplet 3/2 { #pa 32([ #pb
> #pc] } #pd 16) #pd-!
> #}
> )
>
> But of course this does not work since pitch #pa and 32([ do not glue
> together.
>
>
> Is there some easy way to define the function I want?
Use $pa $pb $pc (and make sure to add a space before adding something
like ] afterwards) and $pd . For # in music expressions, Lily expects
music expressions, not pitches. For $ it chooses the syntactical
category according to expression type.
--
David Kastrup
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user