Matt Wallis <m...@heligon.net> writes: > So I made experimental changes to the source until I found the cause > of the error. > Here is a small example: > > \include "english.ly" > > global = { > \time 4/4 > \tempo 4 = 96 > } > \score { > \new Staff { > \clef treble > \global > \relative c' { c1 } > } > \midi { \global } > } > > ... that provokes this error in 2.19.80: > > GNU LilyPond 2.19.80 > Processing `PianoScore.ly' > Parsing.../opt/local/share/lilypond/2.19.80/scm/lily-library.scm:375:14: > In procedure ly:add-context-mod in expression (ly:add-context-mod > mods (list # #)): > /opt/local/share/lilypond/2.19.80/scm/lily-library.scm:375:14: Wrong > type argument in position 1 (expecting Context_mod): #f > > ... but works fine in 2.18.2 > > The error is triggered by the use of \global in the midi block when > global contains "\time 4/4". Incidentally, if the midi block contains > a \key signature, but no \time, then it works fine in 2.19.80. > > I can understand that \time is irrelevant to midi (as is \key?), but > I've used this lazily in the past because it works.
It isn't. The time signature is actually part of Midi files (SMF). I am not sure whether it is also part of realtime Midi, but it might. > I'd be interested to know if you think the correct fix is to restore > the original 2.18.2 behaviour, or to output an error message that > identifies the line that causes the problem. This sounds like a bug to me, and I have to take a look at what might be responsible here. Huh. The bug triggers in context-defs-from-music, but that is pre-2.16.0 material entirely. Hm, I think the representation of \time might have gotten changed. Let's check. There is commit fb79cea8ec10ebc40b96a05bf7f643e47fd93ddd Author: David Kastrup <d...@gnu.org> Date: Sun Mar 15 12:15:18 2015 +0100 Issue 4324: Don't create Bottom to announce TimeSignatureEvent As a fallout of issue 4138, << \time 3/4 \new Staff c2. >> created a spurious Staff only containing a time signature. This change avoids the creation of a Bottom context just for accommodating \time. As a result, { \tweak color #red \time 3/4 c2. } will no longer show a change in color since no Staff context exists at the time \time is executed and consequently the tweak does not apply anywhere. You have to use \time in existing Staff contexts to have either \tweak and point&click have an effect (and get an error locator when something with typesetting the signature goes wrong). Outside of such contexts, \time just changes properties of the Timing context. which is just one of a whole series of \time-changing commits by various authors after 2.18. That's likely the first occurence of the problem, but likely context-defs-from-music should be made safe against this usage. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user