lilypond-user
[Top][All Lists]
Advanced

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

Re: markup accidentals for a microtonal system


From: Gregory Evans
Subject: Re: markup accidentals for a microtonal system
Date: Sun, 13 Aug 2023 09:36:23 -0500

Hi Nike,

I believe this could work. First you would assign glyph values to your accidentals arbitrarily, ensuring you use no duplicate glyph. Then you could use something like the following function to swap the glyphs out for your markups.

alt-accidentals = #(lambda (grob)
    (let* (
        (sz (ly:grob-property grob 'font-size 0))
        (mlt (magstep sz))
        (glyph (ly:grob-property grob 'glyph-name)))
        (cond
            ((equal? glyph "accidentals.sharp.slashslash.stem")
                (grob-interpret-markup grob one-quarter-sharp-markup-short)
            )
            ((equal? glyph "accidentals.sharp.slashslash.stemstemstem")
                (grob-interpret-markup grob three-quarters-sharp-markup-triple)
            )
            ((equal? glyph "accidentals.mirroredflat")
                (grob-interpret-markup grob one-quarter-flat-markup-black)
            )
            ((equal? glyph "accidentals.mirroredflat.flat")
                (ly:stencil-scale (grob-interpret-markup grob three-quarters-flat-markup-black) (* .7 mlt) (* .7 mlt))
            )
            (else (ly:clef::print grob)))
        )
    )

This will check the accidentals when they are supposed to be printed and if the glyph matches your condition it is replaced by a new symbol (a markup interpreted as a grob). You can also use this mlt variable to rescale the symbol relative to the font size if you need it. Somewhere at the top of your file, or in a stylesheet you will include \override Accidental.stencil = \alt-accidentals to activate the substitution process. If this doesn’t work, there’s always Ekmelily (http://www.ekmelic-music.org/en/extra/ekmelily.htm).

regards,
gregory evans

p.s. I will be interested to see if anyone has a different solution.


On Sun, Aug 13, 2023 at 2:27 AM Nike Hedges <engraveaway@gmail.com> wrote:
Hi,

Looking back at how to implement a microtonal system in LilyPond,

I've known it with a single glyph of an accidental per pitch,
as my old question was answered:
Re: Eighth Tones (microtonal) by Mark Knoop
https://lists.gnu.org/archive/html/lilypond-user/2015-07/msg00485.html

Now I want to mark up an accidental glyph into a new accidental symbol, e.g. shown here,
Re: accidental query by Gregory Evans
https://lists.gnu.org/archive/html/lilypond-user/2023-02/msg00256.html

and to put such a markup into a microtonal system Mark suggested.

However I couldn't find any room to put \markup here but one glyph name.

arrowGlyphs = #`(
        ( 1                     . "accidentals.doublesharp")
        (,SEVEN-E-SHARP         . "accidentals.sharp.slashslashslash.stemstem")
 

How could I possibly build a microtonal system with markup? Or rather I can't help putting \markup on each note on the fly as Gregory does, can I?


Kind regards,
Nike Hedges



--
gregory rowland evans

reply via email to

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