lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: calculation of the total duration of a score


From: Marc Hohl
Subject: Re: calculation of the total duration of a score
Date: Wed, 14 Sep 2016 14:24:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Hi Jan-Peter,

Am 14.09.2016 um 13:18 schrieb Jan-Peter Voigt:
Hi Marc,

I am busy today, so I will look into your example later.

No problem!

In short: Repeats are not taken into account right now.

Yes. Therefore I used the \unfoldRepeats/\midi-combination, but the
duration computed in one \score is not visible in the other one.

I thought of writing the duration to a external file to be read from
within the markup call in the score to be printed, but did not follow
this route any further yet.

I thought of a factor, that is set, when a repeat starts. But I don't
know yet, how to deal with alternatives and repeats with more than
two loops. Probably the engraver might look for barlines. Still it
needs to recognize alternatives with its possible repetitions (e.g.
1-3).

I don't know whether it is doable to implement the stuff that
\unfoldRepeats does within the engraver. Detecting the beginning and the
end of a repeated section should not be that hard, but the bookkeeping
is probably tricky in terms of alternatives, as you pointed out.

We'll crack that nut :-)

Sounds probising, thank you very much!

Marc

Jan-Peter

Am 14. September 2016 12:03:43 MESZ, schrieb Marc Hohl
<address@hidden>:

Hi Jan-Peter,

ok, so I played around with your engraver. It does exactly what it
needs to do, but somehow I am not able to get everything to work.

I'll try to explain:

Let's say that I have some music:

music = { ...stuff... \repeat volta 2 { ... more stuff ... } }

and want it displayed nicely:

\score { \new Staff { \music } }

If I include your engraver here, the calculated time is wrong,
because the repeats are not taken into account.

So I go for the midi-block

\score { \new Staff { \unfoldRepeats \music } \midi { \context {
\Score \consists ...your code here ... } } }


But it looks like the duration variable is visible within its score
only, see the attached compilable example.

How can I obtain the correct duration in combination with a compact
score?

Thanks in advance,

Marc Am 13.09.2016 um 10:24 schrieb Jan-Peter Voigt:

Hi Marc,

you already received some solutions, but I stumbled across this
thread and just want to quickly show my engraver - perhaps it also
helps.

It doesn't read repeats right now, but this may be solved with
\unfoldRepeats and the engraver placed in the midi-block. The
duration-markup-command relies on a global variable and a delayed
stencil - this will not work with multiple scores, as only the
duration of the last score will be displayed. But that is manageable,
if needed.

HTH Jan-Peter

Am 05.09.2016 um 11:01 schrieb Marc Hohl:

Hi list,

I have a couple of songs in my latest theatre project. It would be
nice to have something like "duration: 3'22''" at the end of each
song.

Doing this by hand is straightforward:I generate a midi file that
sounds accurate and let it play by timidity – but IMHO it would be
less tedious and less error-prone if lilypond were capable of doing
these calculations itself.

Tempo indications and meter changes have to be taken into account,
so this is probably doable with a special engraver only IIUC.

Has someone else already done something like this? I have no
experience in writing scheme engravers, so any hint would be highly
appreciated.

Thanks in advance,

Marc

------------------------------------------------------------------------

 lilypond-user mailing list address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user




------------------------------------------------------------------------

 lilypond-user mailing list address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user



------------------------------------------------------------------------

 lilypond-user mailing list address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


-- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9
Mail gesendet.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]