lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PATCH: Arrowed accidentals for microtone notation


From: Maximilian Albert
Subject: PATCH: Arrowed accidentals for microtone notation
Date: Fri, 12 Sep 2008 17:12:41 +0200
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

Hi all,

for various reasons I've been inactive on this list for quite a long time. My last post was concerning a possible contribution, namely arrowed microtonal accidentals, which have been requested on this list quite a few times.

IIRC, I had already sent a pdf file showing off the new accidentals but haven't provided a patch yet. The reason for this is that 1) out of some amazing stupidness I hadn't properly put my attempts under version control and thus needed to re-write a couple of things and 2) the original design was very generic (to allow for easy tweaking), but once the design was settled I needed to eliminate a lot of variables, which turned out much more time-consuming than expected. So alas I didn't get to do it before now. My sincere apologies to everyone who has been waiting for me to follow up.

Anyway, here finally is a series of patches implementing these accidentals. The first one adds a function to draw the arrow, while the other ones add sharp/flat/natural signs with up- and downward pointing arrows attached. I made it so that the plain accidentals (i.e., without arrows) are created using the exact same operations as before, so that their shape isn't changed. Nnote that for natural and flat signs *with* arrows attached the brushing of the stems needed to be slightly reduced, or else they would look very awkward; but this only applies to the new accidentals. Patch No. #5 is optional because it adds accidentals with arrows in *both* directions (which is probably not needed, but you never know what people want to use in their scores :-). As for No. #6, see below.

A sample .pdf showing the accidentals in various positions is attached, together with its .ly file (the latter is basically a slight variation of the maqam example). I guess that the file could be stripped down but I was too lazy for that. :-) In any case, it should be easy to adapt it so that you can inspect the accidentals in all positions and combinations.

Anyone up for a review?

Cheers,
Max

P.S.: I took care to make the charboxes precisely enclose the glyphs (which metafont confirms). However, the result looks rather clamped, and there are even occasional collisions with the arrowheads. Is this a bug in lilypond's spacing algorithm? I seem to remember that there have been problems with accidentals being placed too close to other symbols. Could this be the same issue? If for some reason there really needs to be more space around the glyphs, you can also apply patch #6 (and tweak the numbers if you wish).

Attachment: micro_accs_patches.tgz
Description: GNU Unix tar archive

Attachment: microtone_accs.pdf
Description: Adobe PDF document

\include "deutsch.ly"

#(define-public KOMA 1/9)
#(define-public BAKIYE 4/9)
#(define-public KUCUK 5/9)
#(define-public BUYUKMUCENNEB 8/9)

makamPitchNames = #`(
  (c . ,(ly:make-pitch -1 0 NATURAL))
  (d . ,(ly:make-pitch -1 1 NATURAL))
  (e . ,(ly:make-pitch -1 2 NATURAL))
  (f . ,(ly:make-pitch -1 3 NATURAL))
  (g . ,(ly:make-pitch -1 4 NATURAL))
  (a . ,(ly:make-pitch -1 5 NATURAL))
  (b . ,(ly:make-pitch -1 6 NATURAL))
  
  (cc . ,(ly:make-pitch -1 0 KOMA))
  (dc . ,(ly:make-pitch -1 1 KOMA))
  (ec . ,(ly:make-pitch -1 2 KOMA))
  (fc . ,(ly:make-pitch -1 3 KOMA))
  (gc . ,(ly:make-pitch -1 4 KOMA))
  (ac . ,(ly:make-pitch -1 5 KOMA))
  (bc . ,(ly:make-pitch -1 6 KOMA))

  (cb . ,(ly:make-pitch -1 0 BAKIYE))
  (db . ,(ly:make-pitch -1 1 BAKIYE))
  (eb . ,(ly:make-pitch -1 2 BAKIYE))
  (fb . ,(ly:make-pitch -1 3 BAKIYE))
  (gb . ,(ly:make-pitch -1 4 BAKIYE))
  (ab . ,(ly:make-pitch -1 5 BAKIYE))
  (bb . ,(ly:make-pitch -1 6 BAKIYE))

  (ck . ,(ly:make-pitch -1 0 KUCUK))
  (dk . ,(ly:make-pitch -1 1 KUCUK))
  (ek . ,(ly:make-pitch -1 2 KUCUK))
  (fk . ,(ly:make-pitch -1 3 KUCUK))
  (gk . ,(ly:make-pitch -1 4 KUCUK))
  (ak . ,(ly:make-pitch -1 5 KUCUK))
  (bk . ,(ly:make-pitch -1 6 KUCUK))

  (cbm . ,(ly:make-pitch -1 0 BUYUKMUCENNEB))
  (dbm . ,(ly:make-pitch -1 1 BUYUKMUCENNEB))
  (ebm . ,(ly:make-pitch -1 2 BUYUKMUCENNEB))
  (fbm . ,(ly:make-pitch -1 3 BUYUKMUCENNEB))
  (gbm . ,(ly:make-pitch -1 4 BUYUKMUCENNEB))
  (abm . ,(ly:make-pitch -1 5 BUYUKMUCENNEB))
  (bbm . ,(ly:make-pitch -1 6 BUYUKMUCENNEB))

  ;; f for flat.
  (cfc . ,(ly:make-pitch -1 0 (- KOMA)))
  (dfc . ,(ly:make-pitch -1 1 (- KOMA)))
  (efc . ,(ly:make-pitch -1 2 (- KOMA)))
  (ffc . ,(ly:make-pitch -1 3 (- KOMA)))
  (gfc . ,(ly:make-pitch -1 4 (- KOMA)))
  (afc . ,(ly:make-pitch -1 5 (- KOMA)))
  (bfc . ,(ly:make-pitch -1 6 (- KOMA)))
  
  (cfb . ,(ly:make-pitch -1 0 (- BAKIYE)))
  (dfb . ,(ly:make-pitch -1 1 (- BAKIYE)))
  (efb . ,(ly:make-pitch -1 2 (- BAKIYE)))
  (ffb . ,(ly:make-pitch -1 3 (- BAKIYE)))
  (gfb . ,(ly:make-pitch -1 4 (- BAKIYE)))
  (afb . ,(ly:make-pitch -1 5 (- BAKIYE)))
  (bfb . ,(ly:make-pitch -1 6 (- BAKIYE)))

  (cfk . ,(ly:make-pitch -1 0 (- KUCUK)))
  (dfk . ,(ly:make-pitch -1 1 (- KUCUK)))
  (efk . ,(ly:make-pitch -1 2 (- KUCUK)))
  (ffk . ,(ly:make-pitch -1 3 (- KUCUK)))
  (gfk . ,(ly:make-pitch -1 4 (- KUCUK)))
  (afk . ,(ly:make-pitch -1 5 (- KUCUK)))
  (bfk . ,(ly:make-pitch -1 6 (- KUCUK)))

  (cfbm . ,(ly:make-pitch -1 0 (- BUYUKMUCENNEB)))
  (dfbm . ,(ly:make-pitch -1 1 (- BUYUKMUCENNEB)))
  (efbm . ,(ly:make-pitch -1 2 (- BUYUKMUCENNEB)))
  (ffbm . ,(ly:make-pitch -1 3 (- BUYUKMUCENNEB)))
  (gfbm . ,(ly:make-pitch -1 4 (- BUYUKMUCENNEB)))
  (afbm . ,(ly:make-pitch -1 5 (- BUYUKMUCENNEB)))
  (bfbm . ,(ly:make-pitch -1 6 (- BUYUKMUCENNEB)))

)

pitchnames = \makamPitchNames 
#(ly:parser-set-note-names parser makamPitchNames)

microGlyphs = #'((1    . "accidentals.sharpsharp")
                 (8/9  . "accidentals.sharp.arrowup")
                 (5/9  . "accidentals.sharp")
                 (4/9  . "accidentals.sharp.arrowdown")
                 (1/9  . "accidentals.natural.arrowup")
                 (0    . "accidentals.natural")
                 (-1/9 . "accidentals.natural.arrowdown")
                 (-4/9 . "accidentals.flat.arrowup")
                 (-5/9 . "accidentals.flat")
                 (-8/9 . "accidentals.flat.arrowdown")
                 (-1   . "accidentals.flatflat"))

\relative c'' {
  \override Staff.KeySignature #'glyph-name-alist = #microGlyphs
  \set Staff.keySignature =  #'(
        (1 .  1)
        (2 .  8/9)
        (3 .  5/9)
        (4 .  4/9)
        (5 .  1/9)
        (6 .  0))
  \override Accidental #'glyph-name-alist = #microGlyphs

  c cc db fk, gbm gfc gfb efk dfbm
}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]