K: Key signature


The K: header line gives the key signature. The basic syntax is: K:<note><mode><, where
<note>
is the tonic note of the key. It should be an upper-case letter A-G, plus 'b' for flat or '#' for sharp. (Yes, this is different from the notation for sharps and flats in ABC tunes.)
<mode>
is the first three letters of the classical modes (major, minor, Ionian, Dorian, Phrygian, Lydian, Mixolydian, Aeolian, or Locrian. major may be omitted, and minor may be abbreviabed to 'm'. Also, case is ignored.
<accidentals>
is only implemented by a few ABC tools. This is a list of explicit accidentals, to be used for scales that don't fit the classical European modes. Depending on the software, these accidentals may be shown in the key signature, or applied to every note in the list throughout the tune.

Also, some ABC tools let you include a clef in the K: key signature. The Tune Finder includes these (treble, alto, tenor and bass), so you can use them in a match. Put the clef just after the key signature. So K: Bb bass would match if the tune's key is Bb and is for bass clef. But there isn't much ABC online that uses this.