|
From: | Jean Abou Samra |
Subject: | Re: trying to define microtonal note names and accidentals |
Date: | Wed, 21 Oct 2020 13:28:21 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hello,
Dear community,
I'm trying to define microtonal note names and accidentals with the HE-font.
Unfortunately, I get the following error message when I compile the below quoted file:error: wrong type for argument 2. Expecting
music, found "c"
Music = \relative
c' {ch2 cl }
/home/stefan/partituren/vorlagen/snippet_stefansMikrotoene.ly:65:20: error: syntax error, unexpected '''
Music = \relative c
' {ch2 cl }
/home/stefan/partituren/vorlagen/snippet_stefansMikrotoene.ly:65:23: error: not a note name: ch
Music = \relative c' {
ch2 cl }
/home/stefan/partituren/vorlagen/snippet_stefansMikrotoene.ly:65:27: error: not a note name: cl
Music = \relative c' {ch2
cl }
Does someone know how I can get it working?
Here is my file:
%%%%%%%%%%%%% SNIPPET
\version "2.20.0"
% Define tunings:
\paper{
#(define fonts (make-pango-font-tree "Century Schoolbook L"
"HE"
"Bitstream Vera Sans Mono"
1))
}
#(define-public SyntoHigherNatural 1/12)
#(define-public SyntoLowerNatural -1/12)
StefansPitchnames = #'(
(ch . ,(ly:make-pitch -1 0 SyntoHigherNatural))
(cl . ,(ly:make-pitch -1 0 SyntoLowerNatural))
)
pitchnames = \StefansPitchnames
#(ly:parser-set-note-names pitchnames)
Here is the main problem. You are redefining the whole note
names alist,
so LilyPond doesn't know about the c pitch anymore, which
causes the error
at \relative.
Thus, this should read:
StefansPitchnames = #`(
(ch . ,(ly:make-pitch -1 0 SyntoHigherNatural))
(cl . ,(ly:make-pitch -1 0 SyntoLowerNatural))
)
pitchnames = #(append StefansPitchnames (assoc-get
'nederlands language-pitch-names))
#(ly:parser-set-note-names pitchnames)
I can't comment on the font problem. At least this gives
a start (the file
compiles and shows special accidentals). By the way, just
out of curiosity,
why do you have overrides to X-extent, Y-extent and the
skylines?
Best,
Jean
Full code:
%%%%%%%%%%%%%
\version "2.20.0"
% Define tunings:
\paper {
#(define fonts (make-pango-font-tree "Century Schoolbook L"
"HE"
"Bitstream Vera Sans Mono"
1))
}
#(define SyntoHigherNatural 1/12)
#(define SyntoLowerNatural -1/12)
StefansPitchnames = #`(
(ch . ,(ly:make-pitch -1 0 SyntoHigherNatural))
(cl . ,(ly:make-pitch -1 0 SyntoLowerNatural))
)
pitchnames = #(append StefansPitchnames (assoc-get 'nederlands
language-pitch-names))
#(ly:parser-set-note-names pitchnames)
FONTNAME = "HE"
SyntoHigherNatural = "o"
SyntoLowerNatural = "m"
StefansStrings = #`(
(1/12 . ,SyntoHigherNatural)
(-1/12 . ,SyntoLowerNatural)
)
#(define (my-Y-extent grob)
(ly:stencil-extent (ly:text-interface::print grob) Y))
\layout {
\context {
\Score
\override Accidental.stencil = #ly:text-interface::print
\override Accidental.font-name = #FONTNAME
\override Accidental.text = #(lambda (grob)
(cdr (assoc (ly:grob-property
grob 'alteration)
StefansStrings)))
\override Accidental.font-size = #-1
\override Accidental.X-extent = #(lambda (grob)
(ly:stencil-extent
(ly:text-interface::print grob) X))
\override Accidental.Y-extent =
#(ly:make-unpure-pure-container
my-Y-extent
(lambda (grob start end)
(my-Y-extent grob)))
\override Accidental.horizontal-skylines = #'()
\override Accidental.vertical-skylines = #'()
}
}
Music = \relative c' { ch2 cl }
\new Staff \Music
[Prev in Thread] | Current Thread | [Next in Thread] |