lilypond-user
[Top][All Lists]
Advanced

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

Re: Microtonal Helmholtz-Ellis notation in Lilypond: fine-tuning


From: Kees van den Doel
Subject: Re: Microtonal Helmholtz-Ellis notation in Lilypond: fine-tuning
Date: Mon, 07 Sep 2009 13:10:33 -0700

Not sure if it will help you, but you can look at my solution for microtonal 
notation in this package: http://people.cs.ubc.ca/~kvdoel/tmp/persian.zip

Cheers,
Kees



----- Original Message -----
From: Torsten Anders <address@hidden>
Date: Monday, September 7, 2009 5:21 am
Subject: Microtonal Helmholtz-Ellis notation in Lilypond: fine-tuning
To: address@hidden
Cc: "address@hidden" <address@hidden>

> Dear Lilyponders,
> 
> Finally, I got some microtonal notation working in Lilypond that uses
> a special font for the accidentals (i.e. not the usual Feta font),
> please see the attached example PDF file. The full Lilypond code is
> included at the end of this mail. This example shows a harmonic
> seventh chord over C (first as an "arpeggio" and then all notes
> together) using the "Extended Helmholtz-Ellis JI Pitch Notation" (HE
> for short) by Marc Sabat and Wolfgang von Schweinitz. Besides 
> non-
> Feta accidentals, the example also uses accidentals that consist of
> multiple signs where additional signs show comma inflections (e.g.,
> the septimal comma before the B-flat in the example, the 
> harmonic 7th
> over C). The required font and further information about this
> notation is available at
> 
>     http://music.calarts.edu/~msabat/ms/pdfs/HE-
> font-2009.zip.
> 
> I implemented this microtonal notation by changing the notation of
> accidentals to markups, following an idea by Graham Breed. Doing so
> did not only allow for selecting a different font, but also for
> accidentals that consist of more than a single sign. Changing
> accidentals for individual notes in a chord was particularly tricky,
> and I used an idea by Mark Polesky for this.
> 
> Anyway, although this this approach to microtonal notation is already
> usable, it could use some improvements. I would be grateful for
> suggestions.
> 
> The main problem is the horizontal spacing. Spacing with single-sign
> accidentals works fine, Lilypond takes care of that automatically.
> However, Lilypond does not know about multiple-sign accidentals, 
> so I
> somehow have to create more horizontal space for these manually. The
> Lily manual (http://lilypond.org/doc/v2.12/Documentation/user/
> lilypond/Horizontal-spacing-overview#Horizontal-spacing-overview)
> suggests as a trick to use the following code, however I could not
> get this approach working. What am I missing?
> 
>    \once \override Score.SeparationItem #'padding = #1
> 
> Instead, I globally increased the horizontal spacing (http://
> lilypond.org/doc/v2.12/Documentation/user/lilypond/Changing-
> horizontal-spacing#Changing-horizontal-spacing).
> 
> Any further idea to insert some additional horizonal space 
> before a
> note in order to fit in complex accidentals? Spacing of multiple-sign
> accidentals in a chord is even more tricky...
> 
> The second issue is the readability of the Lilypond code. I defined
> the music function \accidental that expects a markup and sets the
> accidental of next note to that markup. I also started defining
> readable accidental names that are mapped to the respective markup.
> For example, the following two notes are first an untransposed C and
> then an E a just major third above it: with respect to the
> Phythagorean E it is transposed down by a syntonic comma (see the
> second note in the attached example).
> 
>     c
>     \accidental \naturalSyntonicDown
>     e
> 
> However, I failed to do the same for chord tones. I need to 
> define a
> music function that creates the following code, but the markup should
> be given as an argument, as above.
> 
> \tweak #'before-line-breaking #(accidental-text (markup #:sans "m"))
> 
> The problem might be that I do not know how to automatically
> translate a Lily-syntax markup (e.g., \markup{\sans "m"}) into the
> Scheme-syntax markup required here.
> 
> Of course, I also cordially welcome any other ideas for improving
> this approach to microtonal notation.
> 
> Thank you!
> 
> Best
> Torsten
> 
> --
> Torsten Anders
> Interdisciplinary Centre for Computer Music Research
> University of Plymouth
> Office: +44-1752-586219
> Private: +44-1752-558917
> http://strasheela.sourceforge.net
> http://www.torsten-anders.de
> 
> 
> -----------------------------------------------
> %% Lily code (first various defs and then the score at the end)
> 
> \version "2.12.00"
> 
> %% Font "HE" must be installed (e.g., on MacOS in /Library/Fonts)
> %% Font HE put in as 2nd font: can be accessed as \sans
> \paper{
> #(define fonts (make-pango-font-tree "Century Schoolbook L"
>                                        "HE"
>                                        "Bitstream Vera Sans Mono"
>                           1))
> }
> 
> \layout {
>     \context
>     { \Score
>       %% more space between all notes 
> (to allow for extra accidentals)
>       \override SpacingSpanner #'base-
> shortest-duration = #(ly:make- 
> moment 1 16)
>       %% all accidentals are written as 
> markups      \override Accidental 
> #'stencil = #ly:text-interface::print
>       %% default is natural accidental -
> - causes error...
>       \override Accidental #'text = 
> #(markup #:sans "n")
>     }
> }
> 
> #(define (modify-accidental note-grob prop-alist)
>     ;; notehead before-line-breaking callback
>     (let ((accidental (ly:grob-object note-grob 
> 'accidental-grob)))
>      (if (not (null? accidental))
>       (for-each
>        (lambda (x)
>         (ly:grob-set-
> property! accidental (car x) (cdr x)))
>        prop-alist))))
> #(define (accidental-text markup)
>     (lambda (grob)
>      (modify-accidental grob `((text . 
> ,markup)))))
> %% expects a markup and sets accidental of next note to that markup
> accidental =
> #(define-music-function (parser location markup) (markup?)
>     #{
>     \once \override Accidental #'text = #$markup
>     #})
> 
> % %% !! Buggy
> % %% expects a markup and sets accidental of next chord note to that
> markup
> % chordAccidental =
> % #(define-music-function (parser location markup) (markup?)
> %   #{
> %   \tweak #'before-line-breaking #(accidental-text 
> #$markup)%   #})
> 
> 
> %%
> %% Selection of accidentals to markups mappings, see HE-font-map.pdf
> provided with font
> %%
> sharp = \markup{\sans "v"}
> natural = \markup{\sans "n"}
> flat = \markup{\sans "e"}
> 
> sharpSyntonicUp = \markup{\sans "w"}
> naturalSyntonicUp = \markup{\sans "o"}
> flatSyntonicUp = \markup{\sans "f"}
> sharpSyntonicDown = \markup{\sans "u"}
> naturalSyntonicDown = \markup{\sans "m"}
> flatSyntonicDown = \markup{\sans "d"}
> 
> %% etc
> 
> %%
> %% The score
> %%
> 
> {
> 
>     %% there is an accidental for every note
>     #(set-accidental-style 'dodecaphonic)
> 
>     c'
>     \accidental \naturalSyntonicDown
>     e'
>     g'
>     \accidental \markup{\halign #0 \sans "<e"}
>     b'
> 
>     %% \override does not work for chords nor for 
> accidentals, but
>     %% here is a way:
>     %% see http://www.mail-archive.com/lilypond-
> address@hidden/ 
> msg22555.html
>     %%
>     %% TODO: def function that only expects 
> markup and returns
>     %% lambda-expression
>     <
>       c'!
>       \tweak #'before-line-breaking 
> #(accidental-text (markup #:sans  
> "m"))
>       e'!
>       g'!
>       \tweak #'before-line-breaking 
> #(accidental-text (markup  
> #:halign 0 #:sans "<e"))
>       b'!>2
> 
> }
> 
>




reply via email to

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