lilypond-user
[Top][All Lists]
Advanced

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

[Documentation-worthy] Quotes from tagged music expressions


From: Jan Hajic, jr.
Subject: [Documentation-worthy] Quotes from tagged music expressions
Date: Fri, 17 Jan 2014 16:53:27 +0100

Hello,

first of all, let me briefly introduce myself: I'm a student of
composition at the Janáček Academy of Music and Performing Arts in
Brno, Czech Republic, and of IT at Charles University in Prague - in
short, if LilyPond has a bullseye-target audience, I'm probably there
somewhere. I hope I will be able to make a corresponding contribution
to the LilyPond community; it's the first and so far only music
typesetting tool I feel comfortable using and finally something that
allows me to notate efficiently.

And thus I embarked on my first larger-scale LilyPond project:
typesetting a wind quintet, together with exporting parts, for my
upcoming exams and a performance. Naturally, I needed to use cues, but
didn't want them in the score. So - I used a tag and quotes. The
instruments, of course, use cues from each other, and thus we end up
with this reasonably minimal example:

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

\version "2.18.0"

outputTypeTag = "isScore"

firstInstrument = \relative c' {
\tag #'isPart { \cueDuring #"quoteSecondInstrument" #UP { r2 } }
\tag #'isScore { r2 }
e4 f |
g4 a b c |

}

secondInstrument= \relative c'' {
c4 c r2
|
\cueDuring #"quoteFirstInstrument" #DOWN { r2 }
c4 c |
}

\addQuote quoteFirstInstrument \firstInstrument
\addQuote quoteSecondInstrument \secondInstrument

\new Staff <<
\keepWithTag \outputTypeTag \firstInstrument
>>
\new Staff <<
\keepWithTag \outputTypeTag \secondInstrument
>>

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

What happens is in the first attached picture,
tag_quote_bug_problem.png. The cue notes are two beats behind.
However, otherwise the music is aligned perfectly.

My theory of what happens:
- When line AAA is processed, tags are resolved in the process, two
bars of four-beat music are delivered. The #'isPart check fails,
#'isScore passes, so the rest is typeset
without further ado.
- When line BBB is processed, in the first bar, the same thing hapens
and we get a two-beat rest. However, when the quote is processed, the
\firstInstrument music is searched by the quote WITHOUT the tag
applied, thus putting the #'isScore rest in bar 1 of \firstInstrument
AFTER the #'isPart and putting the quote synchronization off by those
two beats.

What actually works is changing the quote definitions:

\addQuote quoteFirstInstrument \keepWithTag \outputTypeTag \firstInstrument
\addQuote quoteFirstInstrument \keepWithTag \outputTypeTag \secondInstrument

However, the solution of specifying tags with quotes is not ideal,
because it forces you to define your quotes in a place where you
already know what tags will be applied (or at least what variables the
tags will reside in) and that looks like a pretty unwieldy coupling.

What looks better is << >> around the pair of tagged expressions:

<< \tag #'isPart { \cueDuring #"quoteSecondInstrument" #UP { r2 } }
     \tag #'isScore { r2 } >>


If anyone has A Better Way Of Doing This - I bet there is (more than)
one - I would appreciate if you shared it.

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

In retrospect, it makes sense (and makes me want to bang my head
against something, after some 5+ hours of being incredibly stupidly
stuck on this one), but this behavior should probably be documented -
some kind of caveat or cautionary note about quoting music with tags.
I may not be the brightest bulb in the bunch, but this really wasn't
obvious - the tag system lends itself to thinking "Okay, either this
is here, or that." and there is no indication that it should be taken
into account when dealing with quotes.

I would put it in the docs myself, but I'm a little afraid to start
meddling quite so soon :) Should I?

On a related note, this behavior might also cause a hard-to-debug
barcheck failure: if the shifted quote requested by 2 from 1 fell into
an area which in 1 quotes 2... well, weird things will probably start
happening.

Thanks & keep up the great work!

--Jan

Attachment: tag_quote_bug_problem.png
Description: PNG image


reply via email to

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