#(define-public SHARP-Q-FLAT 1001/4000)
#(define-public FLAT-Q-SHARP -1001/4000)

quartertonearrowPitchNames =  #`(
        (ceses . ,(ly:make-pitch -1 0 DOUBLE-FLAT))
        (ceseh . ,(ly:make-pitch -1 0 THREE-Q-FLAT))
        (ces . ,(ly:make-pitch -1 0 FLAT))
        (cesih . ,(ly:make-pitch -1 0 FLAT-Q-SHARP))
        (ceh . ,(ly:make-pitch -1 0 SEMI-FLAT))
        (c . ,(ly:make-pitch -1 0 NATURAL))
        (cih . ,(ly:make-pitch -1 0 SEMI-SHARP))
        (ciseh . ,(ly:make-pitch -1 0 SHARP-Q-FLAT))
        (cis . ,(ly:make-pitch -1 0 SHARP))
        (cisih . ,(ly:make-pitch -1 0 THREE-Q-SHARP))
        (cisis . ,(ly:make-pitch -1 0 DOUBLE-SHARP))
        (cx . ,(ly:make-pitch -1 0 DOUBLE-SHARP))

        (deses . ,(ly:make-pitch -1 1 DOUBLE-FLAT))
        (deseh . ,(ly:make-pitch -1 1 THREE-Q-FLAT))
        (des . ,(ly:make-pitch -1 1 FLAT))
        (desih . ,(ly:make-pitch -1 1 FLAT-Q-SHARP))
        (deh . ,(ly:make-pitch -1 1 SEMI-FLAT))
        (d . ,(ly:make-pitch -1 1 NATURAL))
        (dih . ,(ly:make-pitch -1 1 SEMI-SHARP))
        (diseh . ,(ly:make-pitch -1 1 SHARP-Q-FLAT))
        (dis . ,(ly:make-pitch -1 1 SHARP))
        (disih . ,(ly:make-pitch -1 1 THREE-Q-SHARP))
        (disis . ,(ly:make-pitch -1 1 DOUBLE-SHARP))
        (dx . ,(ly:make-pitch -1 1 DOUBLE-SHARP))

        (eses . ,(ly:make-pitch -1 2 DOUBLE-FLAT))
        (eseh . ,(ly:make-pitch -1 2 THREE-Q-FLAT))
        (es . ,(ly:make-pitch -1 2 FLAT))
        (esih . ,(ly:make-pitch -1 2 FLAT-Q-SHARP))
        (eh . ,(ly:make-pitch -1 2 SEMI-FLAT))
        (e . ,(ly:make-pitch -1 2 NATURAL))
        (eih . ,(ly:make-pitch -1 2 SEMI-SHARP))
        (eiseh . ,(ly:make-pitch -1 2 SHARP-Q-FLAT))
        (eis . ,(ly:make-pitch -1 2 SHARP))
        (eisih . ,(ly:make-pitch -1 2 THREE-Q-SHARP))
        (eisis . ,(ly:make-pitch -1 2 DOUBLE-SHARP))
        (ex . ,(ly:make-pitch -1 2 DOUBLE-SHARP))

        (feses . ,(ly:make-pitch -1 3 DOUBLE-FLAT))
        (feseh . ,(ly:make-pitch -1 3 THREE-Q-FLAT))
        (fes . ,(ly:make-pitch -1 3 FLAT))
        (fesih . ,(ly:make-pitch -1 3 FLAT-Q-SHARP))
        (feh . ,(ly:make-pitch -1 3 SEMI-FLAT))
        (f . ,(ly:make-pitch -1 3 NATURAL))
        (fih . ,(ly:make-pitch -1 3 SEMI-SHARP))
        (fiseh . ,(ly:make-pitch -1 3 SHARP-Q-FLAT))
        (fis . ,(ly:make-pitch -1 3 SHARP))
        (fisih . ,(ly:make-pitch -1 3 THREE-Q-SHARP))
        (fisis . ,(ly:make-pitch -1 3 DOUBLE-SHARP))
        (fx . ,(ly:make-pitch -1 3 DOUBLE-SHARP))

        (geses . ,(ly:make-pitch -1 4 DOUBLE-FLAT))
        (geseh . ,(ly:make-pitch -1 4 THREE-Q-FLAT))
        (ges . ,(ly:make-pitch -1 4 FLAT))
        (gesih . ,(ly:make-pitch -1 4 FLAT-Q-SHARP))
        (geh . ,(ly:make-pitch -1 4 SEMI-FLAT))
        (g . ,(ly:make-pitch -1 4 NATURAL))
        (gih . ,(ly:make-pitch -1 4 SEMI-SHARP))
        (giseh . ,(ly:make-pitch -1 4 SHARP-Q-FLAT))
        (gis . ,(ly:make-pitch -1 4 SHARP))
        (gisih . ,(ly:make-pitch -1 4 THREE-Q-SHARP))
        (gisis . ,(ly:make-pitch -1 4 DOUBLE-SHARP))
        (gx . ,(ly:make-pitch -1 4 DOUBLE-SHARP))

        (ases . ,(ly:make-pitch -1 5 DOUBLE-FLAT))
        (aeses . ,(ly:make-pitch -1 5 DOUBLE-FLAT))
        (aeseh . ,(ly:make-pitch -1 5 THREE-Q-FLAT))
        (aseh . ,(ly:make-pitch -1 5 THREE-Q-FLAT))
        (as . ,(ly:make-pitch -1 5 FLAT))
        (aes . ,(ly:make-pitch -1 5 FLAT))
        (asih . ,(ly:make-pitch -1 5 FLAT-Q-SHARP))
        (aesih . ,(ly:make-pitch -1 5 FLAT-Q-SHARP))
        (aeh . ,(ly:make-pitch -1 5 SEMI-FLAT))
        (a . ,(ly:make-pitch -1 5 NATURAL))
        (aih . ,(ly:make-pitch -1 5 SEMI-SHARP))
        (aiseh . ,(ly:make-pitch -1 5 SHARP-Q-FLAT))
        (ais . ,(ly:make-pitch -1 5 SHARP))
        (aisih . ,(ly:make-pitch -1 5 THREE-Q-SHARP))
        (aisis . ,(ly:make-pitch -1 5 DOUBLE-SHARP))
        (ax . ,(ly:make-pitch -1 5 DOUBLE-SHARP))

        (beses . ,(ly:make-pitch -1 6 DOUBLE-FLAT))
        (beseh . ,(ly:make-pitch -1 6 THREE-Q-FLAT))
        (bes . ,(ly:make-pitch -1 6 FLAT))
        (besih . ,(ly:make-pitch -1 6 FLAT-Q-SHARP))
        (beh . ,(ly:make-pitch -1 6 SEMI-FLAT))
        (b . ,(ly:make-pitch -1 6 NATURAL))
        (bih . ,(ly:make-pitch -1 6 SEMI-SHARP))
        (biseh . ,(ly:make-pitch -1 6 SHARP-Q-FLAT))
        (bis . ,(ly:make-pitch -1 6 SHARP))
        (bisih . ,(ly:make-pitch -1 6 THREE-Q-SHARP))
        (bisis . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
        (bx . ,(ly:make-pitch -1 6 DOUBLE-SHARP))
)


%% set pitch names.
pitchnames = \quartertonearrowPitchNames
#(ly:parser-set-note-names parser pitchnames)


quartertonearrowGlyphs = #`(
        (4001/4000 . "accidentals.doublesharp")
        (1 . "accidentals.doublesharp")
        (3001/4000 . "accidentals.sharp.arrowup")
        (3/4 . "accidentals.sharp.arrowup")
        (2001/4000 . "accidentals.sharp")
        (1/2 . "accidentals.sharp")
        (1001/4000 . "accidentals.sharp.arrowdown")
        (1/4 . "accidentals.natural.arrowup")
        (1/4000 . "accidentals.natural")
        (0 . "accidentals.natural")
        (-1/4000 "accidentals.natural")
        (-1/4 . "accidentals.natural.arrowdown")
        (-1001/4000 . "accidentals.flat.arrowup")
        (-1/2 . "accidentals.flat")
        (-2001/4000 . "accidentals.flat")
        (-3/4 . "accidentals.flat.arrowdown")
        (-3001/4000 . "accidentals.flat.arrowdown")
        (-1 . "accidentals.flatflat")
        (-4001/4000 "accidentals.flatflat")
)


\layout {
  \context {
    \Score
    \override KeySignature.glyph-name-alist = \quartertonearrowGlyphs
    \override Accidental.glyph-name-alist = \quartertonearrowGlyphs
    \override AccidentalCautionary.glyph-name-alist = \quartertonearrowGlyphs
    \override TrillPitchAccidental.glyph-name-alist = \quartertonearrowGlyphs
    \override AmbitusAccidental.glyph-name-alist = \quartertonearrowGlyphs
  }
}


