Richard Shann <[email protected]> writes:

> On Sun, 2015-10-18 at 11:19 +0200, David Kastrup wrote:
>> Richard Shann <[email protected]> writes:
>> 
>> > Can anyone spot the error in this:
>> > 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
>> > \version "2.19.25"
>> >
>> > \score {
>> >           <<
>> >              \new ChordNames \chordmode {  e4 s4 f:/g8 s8 s4 
>> >                                            d8:m s8 s8 s8 s8 s8 s8 s8  }
>> >              \new Staff {
>> >                          d'4 d' b8 d' f4
>> >                          a'8 g' a' g' a' g' a' g' }
>> >           >>
>> >        } 
>> > 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
>> > run under Frescobaldi (which says version 2.18.2) it gives
>> > warning: Spurious garbage following chord: (#<Pitch c'' >)
>> > and the Dm chord symbol is shifted to the right - without the /g the
>> > positioning is correct.
>> 
>> You probably mean f8:/g instead of f:/g8 here.  The error message is
>> awful, though.
>> 
>
> Thank you! I see that the page
> http://www.lilypond.org/doc/v2.18/Documentation/notation/chord-mode
> I was looking at was only showing implicit durations so I should have
> engaged my brain more with it to understand where the duration should
> come...

By the way, chord steps are encoded relative to #<Pitch c'> so the error
message indeed refers to the trailing "8" which is unexpected after a
chord root specification.  Usually trailing garbage would consist of
symbols like (dim) instead.  I think this at least warrants an actual
parser error, like

-*- mode: compilation; default-directory: "/tmp/" -*-
Compilation started at Sun Oct 18 11:35:53

/usr/local/tmp/lilypond/out/bin/lilypond gaga.ly 
GNU LilyPond 2.19.29
Processing `gaga.ly'
Parsing...
gaga.ly:5:56: error: Spurious garbage following chord: (#<Pitch c'' >)
             \new ChordNames \chordmode {  e4 s4 f:/g8 
                                                       s8 s4 
Interpreting music...
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `/tmp/lilypond-pRpiGC'...
Converting to `gaga.pdf'...
Deleting `/tmp/lilypond-pRpiGC'...
fatal error: failed files: "gaga.ly"

Compilation exited abnormally with code 1 at Sun Oct 18 11:35:54

The error location is not perfect (the parsed chord data does not
provide error locators, but these days at least the current position in
the file after the whole chord is accessible).

But it certainly is much better than none at all.

-- 
David Kastrup

_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to