John A.,

I agree with you 100% that cautionary accidentals can and should be handled 
by the typesetting program, NOT with special syntax in the ABC music 
file.  I took the liberty to rewrite your pseudo code.  IMO, if the user 
specifies an unnecessary accidental, then the typesetter should show it 
with parentheses around it.  The following is my attempt at a revised 
algorithm for accidentals.

let n = the current note
let p = the most recent note with the same letter and octave as n.

if (n has no accidental) {
   if (p is in the measure just before n, and p is not in the key signature) {
     n should be shown with a cautionary accidental
   }
   else {
     n should not have any accidental
   }
}
else if (n has an accidental that is already in the key signature)
{
   if (p is in the same measure as n, and p has different accidental than n) {
     n should show it's accidental
   }
   else {
     n should be shown with a cautionary accidental
   }
}
else if (n has an accidental that is not in the key signature)
{
   if (p is in the same measure as n, and p has the same accidental as n) {
     n should be shown with a cautionary accidental
   }
   else {
     n should show it's accidental
   }
}

To make everyone happy, this algorithm should have parameters to fine tune 
it.  For instance, the threshold in the number of measures between p and n, 
and to turn off, or remove parens from any of the three "cautionary" cases 
above.


John Henckel          alt. mailto:[EMAIL PROTECTED]
Zumbro Falls, Minnesota, USA   (507) 753-2216

http://geocities.com/jdhenckel/

To subscribe/unsubscribe, point your browser to: http://www.tullochgorm.com/lists.html

Reply via email to