[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creation of a generic pattern
From: |
James Lowe |
Subject: |
Re: Creation of a generic pattern |
Date: |
Sun, 27 Feb 2011 20:42:28 +0000 |
User-agent: |
Microsoft-MacOutlook/14.2.0.101115 |
Hello
-----Original Message-----
From: voyageur <address@hidden>
Date: Sun, 27 Feb 2011 19:35:51 +0000
To: lilypond-user <address@hidden>
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
>