[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Rotating/grouping grobs for microtonal accidentals
From: |
Torsten Anders |
Subject: |
Re: Rotating/grouping grobs for microtonal accidentals |
Date: |
Thu, 3 Apr 2008 19:08:06 +0100 |
Dear Mats
thank you for your kind reply and sorry for my late response. The
example you provided does indeed work nicely for monotonic voices.
However, it appears it does not work for chords
%% !! causes lilypond parsing error!
\version "2.10.0"
\relative c'{
c d e
< \once \override Accidental #'stencil = #ly:text-interface::print
\once \override Accidental #'text = \markup{\rotate #180
\musicglyph #"scripts.lvarcomma"}
dis
\once \override Accidental #'stencil = #ly:text-interface::print
\once \override Accidental #'text = \markup{\rotate #180
\musicglyph #"scripts.rvarcomma"}
fis
\once \override Accidental #'stencil = #ly:text-interface::print
\once \override Accidental #'text = \markup{\rotate #90
\musicglyph #"scripts.lvarcomma"}
ais >
e d c1 }
This solution will not automatically recognize what glyph to use
depending on
the pitch of the note. Rather you will have to manually specify
what markup to
use for each accidental.
Such a restriction would be totally fine for me -- in the end I am
generating the *.ly file automatically by a program.
A more advanced solution would be to write a few lines of Scheme
code that
automatically gives you the proper accidental based on the note pitch.
This is what I tried in the first place by starting with the maqam
example shown in the list of new features at
http://lilypond.org/doc/v2.11/Documentation/topdocs/NEWS.html.
I do know Scheme, but I don't know the internals of Lilypond which I
would like to change :) Attached is a *.ly file which shows a working
example I did for a microtonal notation in 22-tone equal temperament
(using common Feta-font accidentals, just to have a working example).
Now, all I want to do is replace the accidental signs either by signs
from another font or by transformations of Feta-font characters
(e.g., using text markup, as you suggested). More specifically, I
want to change the following section of the attached example which
changes the glyph-name-alist of the Accidental context (please see
example excerpt below). Unfortunately, I don't know whether/how I can
use some text markup in the etTwentytwoGlyphs specification.
% ---------- example start
% cut out declarations, see attached files
% [...]
%% set pitch names.
pitchnames = \etTwentytwoPitchNames
#(ly:parser-set-note-names parser etTwentytwoPitchNames)
etTwentytwoGlyphs = #'((1 . "accidentals.doublesharp")
(1/2 . "accidentals.sharp")
(1/3 . "accidentals.sharp.slashslashslash.stem")
(1/6 . "accidentals.sharp.slashslash.stem")
(0 . "accidentals.natural")
(-1/3 . "accidentals.flat.slash")
(-1/6 . "accidentals.flat.slashslash")
(-1/2 . "accidentals.flat")
(-1 . "accidentals.flatflat")
)
{
\override Accidental #'glyph-name-alist = \etTwentytwoGlyphs
\override Staff.KeySignature #'glyph-name-alist = \etTwentytwoGlyphs
% actual score follows here
}
% ------------ example end
Any help is much appreciated!
Best
Torsten
PS: Please note also that such an approach (which allows for
arbitrary text markup as accidentals) could likely provide Lilypond
support for arbitrary microtonal notations. As demonstrated by the
maqam example, Lilypond users can define arbitrary fractions of a
whole tone step and associate them with custom Lilypond note names
and custom accidental symbols. Of course, not all microtonal music
can be expressed by fractions of a whole tone step, but in the end
these fractions can be irrelevant for the notation. We simply have a
mapping of user-defined note names to pitches with user-defined
accidentals. For example, the huge set of accidentals in Sagittal
notation could be supported this way, if we can use their true type
font or postscript font via pango. I am mentioning this to show the
potential I see in this approach :)
http://users.bigpond.net.au/d.keenan/sagittal/
ET22-Lilytest.ly
Description: Binary data
On Mar 31, 2008, at 10:45 AM, Mats Bengtsson wrote:
As far as I understand, the answer to both of your questions is
that you
have to replace the function that normally is done to typeset the
accidentals
with your own function. This is not necessarily so difficult as it
first may seem.
The simplest solution is to use the standard function used to
typeset any "text"
and specify the glyph to be printed as a markup, for example:
\version "2.10.0"
\relative c'{
\once \override Accidental #'stencil = #ly:text-interface::print
\once \override Accidental #'text = \markup{\rotate #180
\musicglyph #"scripts.lvarcomma"}
cis d e f g f e d c1 }
This solution will not automatically recognize what glyph to use
depending on
the pitch of the note. Rather you will have to manually specify
what markup to
use for each accidental. Of course, you can still use the standard
mechanism
for the accidentals where the Feta font has a suitable glyph and
only use the
workaround for the rest. Don't forget to define macros for the
different settings
to save some typing.
A more advanced solution would be to write a few lines of Scheme
code that
automatically gives you the proper accidental based on the note pitch.
/Mats
Torsten Anders wrote:
On Mar 28, 2008, at 8:58 PM, Torsten Anders wrote:
I would like to define a microtonal notation with alteration
fractions (cf. http://lilypond.org/doc/v2.11/Documentation/
topdocs/NEWS.html) -- thanks for providing this feature!
Everything works great.
My only problem is the creation of suitable accidentals. I need
four additional signs: a comma up (/), a comma down (\), and a
combination of these signs with the standard accidentals (#\ and
b/). I figure I could use something like "scripts.lvarcomma" for
a comma up. For a comma down, however, I need to rotate this sign
or "scripts.rvarcomma". Moreover, I would like to group my commas
with the common accidentals. How can I rotate and group feta font
symbols which I want to add to the list of accidentals.
% code does not work, should only clarify problem
myGlyphs = #'((1 . "accidentals.doublesharp")
[...]
(1/6 . "scripts.rvarcomma")
(0 . "accidentals.natural")
;; how can I rotate a symbol?
(1/6 . (rotate "scripts.lvarcomma"))
[...]
)
Alternatively, is it perhaps possible to use another font (e.g.,
TrueType, or some PostScript font) for the accidentals?
Thank you!
Best
Torsten
--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-233667
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de
- Re: Rotating/grouping grobs for microtonal accidentals,
Torsten Anders <=