[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
music function with access to context properties like currentBarNumber?
From: |
Malte Meyn |
Subject: |
music function with access to context properties like currentBarNumber? |
Date: |
Wed, 15 Jul 2015 20:20:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
Hello list,
I would like to have somthing like
\version "2.19.22"
{
\time 3/4
% bar 1
c'2.
\skipUntil #5 % s2.*4
% bar 5
c'2.
\restUntil #8 % R2.*2
% bar 8
c'2.
}
so I don’t have to count bars every time an instrument has a long rest
(could also be helpful when composing, or, in a more advanced version,
when skipping several bars with many time signature changes).
My first thought was “I need a music function that accesses
currentBarNumber” but that (and, for the more advanced version,
measureLength) is a context property. Now I don’t know how to get the
context to this music function and making it return a (make-music
'MultiMeasureRestMusic …). Attached is my first attempt but that returns
only (make-music 'ApplyContext …).
Is this the correct approach? Or do I have to write an engraver? If so,
where can I learn how to do that?
Thanks in advance,
Malte
restUntil01.ly
Description: Text Data