lilypond-user
[Top][All Lists]
Advanced

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

Re: ChordNames vs. \numericTimeSignature: used to be OK, not now


From: Thomas Morley
Subject: Re: ChordNames vs. \numericTimeSignature: used to be OK, not now
Date: Sat, 18 Apr 2015 10:56:36 +0200

2015-04-18 4:19 GMT+02:00 James Harkins <address@hidden>:
> *sigh* Most of the time, LilyPond is amazing. Other times...
>
> I have an old document, a lead sheet, following basically the form an excerpt 
> [A]. This prints out as I would expect: a single staff with melody, lyrics 
> below and chord names above the staff.
>
> I have a new document, following almost exactly the same form, where LP 
> insists on printing an extraneous clef and time signature for the chord names 
> context. I can get this second document to print correctly by removing 
> \numericTimeSignature from the global variable, and moving it into the staff 
> proper.
>
> What I don't understand is -- why does [A] work perfectly well, even though 
> the chord names context includes \numericTimeSignature???? I've tried to 
> replicate the exact structure in the older document, and I simply can't break 
> it. And I can't make the new document behave like the old one.
>
> See [B] for minimal examples.
>
> hjh
>
>
> [A]
>
> global = {
>   \key f \major
>   \numericTimeSignature
>   \time 4/4
>   \tempo "Swing" 4 = 154
> }
>
> \score {
>   <<
>     \new ChordNames {
>       \global
>       \chordsVerse etc. etc.
>     }
>     \new Staff <<
>       \global
>       {
>         \notesVerseOne etc. etc.
>       }
>       \addlyrics { etc. etc. }
>     >>
>   >>
> }
>
> [B]
> \version "2.18.2"
> \language "english"
>
> globalBroken = { \numericTimeSignature \key f \major }
>
> globalOK = { \key f \major }
>
> changes = \chordmode { f2 d2:m7 g2:m7 c2:7 }
>
> \score {
>   \new ChordNames << \globalBroken \changes >>
> }
>
> \score {
>   \new ChordNames << \globalOK \changes >>
> }
>
> \score {
>   \new ChordNames { \globalBroken \changes }
> }
>
> \score { <<
>   \new ChordNames { \globalBroken \changes }
>   \new Staff { \globalBroken R1*2 }
>>> }
>
> \score { <<
>   \new ChordNames { \globalOK \changes }
>     % but I don't want a C time sig
>     % and I don't want two global variables
>   \new Staff { \globalOK R1*2 }
>>> }
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

Hi James,

look at code, pdf and terminal-output with \displayMusic from:

\new ChordNames \chordmode { \numericTimeSignature c:m }

The first thing in ChordNames is an override for Staff!
(numericTimeSignature = \override Staff.TimeSignature.style = #'numbered)

LilyPond thinks "Oh, there is no Staff! I'll create one!"
This happens in _every_ version, tested from 2.12.3 up to 2.19.18.


Even in

<<
\new ChordNames \chordmode { \numericTimeSignature c:m }
\new Staff { c'' }
>>

there is no Staff initiated at the time \numericTimeSignature is applied.
Same result: a new Staff is created.

Your old example did work as you wished because \numericTimeSignature
was _not_ the first thing in global.
Meaning, the Staff was already initiated at the time the \override for
Staff.TimeSignature was set and LilyPond applies it to the then known
Staff.

You could circumvent it for your new example doing something before
\numericTimeSignature in global like:


\version "2.18.2"
\language "english"

globalBroken = { \key f \major \numericTimeSignature  }

globalOK = { \key f \major }

changes = \chordmode { f2 d2:m7 g2:m7 c2:7 }


\score { <<
  \new ChordNames { \globalBroken \changes }
  \new Staff { \globalBroken R1*2 }
>> }

\score { <<
  \new ChordNames { \globalOK \changes }
  \new Staff { \globalOK R1*2 }
>> }

Though, the following will always initiate a normal Staff first!

\new ChordNames { \globalBroken \changes }

Again, because \numericTimeSignature will create a new Staff, if there
isn't any.


Hope it clearifies it a bit.

This behaviour is sometimes annoying, it is not a new one, tough.



Cheers,
  Harm



reply via email to

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