Hello

-----Original Message-----
From: voyageur <voyageur.galacti...@gmail.com>
Date: Sun, 27 Feb 2011 19:35:51 +0000
To: lilypond-user <lilypond-user@gnu.org>
Subject: Creation of a generic pattern

>Hi,
>I have a score with a reccurent rythmic pattern.
>This is an example :
>
>\times 2/3 {c16\>[(d c\!) } e16 \staccato c \staccato]
>
>I want to create some kind of template to save me typing the code many
>times.
>
>I'm not sure template is the appropriate word, perhaps something like a C
>macro
>would be more descriptive.
>
>From the lilypond tutorial, I made the assumption it could be done with
>scheme
>functions. However I didn't found enough examples to get started.
>
>Could you give some direction on how you would do that ?

There is an LSR snippet


http://lsr.dsi.unimi.it/LSR/Snippet?id=328

This helped me for lots of triplets so for example:

---

\version "2.13.40"

% Function to simplify triplet
% syntax is \tpt { c d e }
tpt = #(define-music-function (parser location music) (ly:music?)
  #{ \times 2/3 $music #})

Mytriplets = { \tpt {c16\>[(d c\!)] } e16 \staccato }

{ \Mytriplets }


----

Gives you what you want I think, however I notice in your example that you
did NOT terminate your end-beam so I have added the second ']' don't
forget that!

Hope this helps.

James







>


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to