-
-
Notifications
You must be signed in to change notification settings - Fork 334
Description
Consider for example:
K: C
^c c
This will produce a C# then another C#. If you are a human writing abc notation by hand to transcribe a written piece of music, this is very intuitive. If you are a computer generating abc notation, this is very problematic because the program has to check whether any previous note in that bar had an accidental at the same octave and understand key signatures, then determine whether the note should be natural or bare.
This makes the process of generating abc notation difficult to get right, because it is dependent on not only the key but the rhythm and time signature too: if a note moves across a barline it may need an accidental or lose one, so you have to figure out where the barlines are before you decide what note it is. It's easy to get it wrong and introduce bugs.
This makes using abc notation for generated notation really uncomfortable, because it's hard to prove that your code always generates the right notes, whereas this class of bugs doesn't exist in Lilypond.
Lilypond's solution is more convenient: you write absolute pitches, so c
always means C natural, cs
always means C sharp, etc, and the renderer automatically determines whether a note needs a natural, sharp, flat accidental or not as necessary, taking into account barlines, key signatures/modulations and ties. Moving the complexity of accidentals to the renderer means that it can be solved once correctly rather than many times badly.
It would be helpful to have an option where pitches are treated as absolute, so that ^c c
would be automatically converted to ^c =c
in K: C
, or c =c
in K: C#
etc. In other words, elide sharps and flats where they are implied and insert naturals, sharps and flats where they are necessary.
This is different from #941 because %%propagate-accidentials
wouldn't actually solve the problem AFAIU.