[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: note names as solmisation printed as markup automagically?
From: |
Anders Eriksson |
Subject: |
Re: note names as solmisation printed as markup automagically? |
Date: |
Mon, 30 May 2016 21:11:39 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 |
On 2016-05-30 20:50, bart deruyter wrote:
Hi,
it would only be for my students. I would alter my guitar course for
next year. They are the only target audience actually. And here we
only use Fixed do (using si for the B) as far as I know.
Here is a quick hack that will do what you want (Hopefully)
There is probably many improvements you can do to the code, but it is a
start...
I have not tested on 2.18 (as I don't have it installed)
// Anders
%==== Code ======
\version "2.19.42"
\header {
title = "Test of SolfageNoteNames"
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
solfege-names =
#`(
("c" . "do")
("d" . "re")
("e" . "mi")
("f" . "fa")
("g" . "sol")
("a" . "la")
("b" . "si")
("ces" . "do")
("des" . "re")
("ees" . "mi")
("fes" . "fa")
("ges" . "sol")
("aes" . "la")
("bes" . "si")
("cis" . "do")
("dis" . "re")
("eis" . "mi")
("fis" . "fa")
("gis" . "sol")
("ais" . "la")
("bis" . "si")
)
solfegeFixedNames =
#(lambda (grob)
(let* (
;; bindings
(default-name (ly:grob-property grob 'text))
(new-name (assoc-get default-name solfege-names))
)
;; body
(ly:grob-set-property! grob 'text new-name)
(ly:text-interface::print grob)
)
)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global = {
\time 4/4
\key a \major
\tempo 4=100
}
melody = \relative c'' {
\global
a4 a e' e %
fis fis e2 %
d4 d cis cis %
b b a2
}
\score {
<<
\context NoteNames \with {
\override NoteName #'stencil = #solfegeFixedNames
}{ \melody }
\new Staff { \melody }
>>
\layout { }
\midi { }
}
% ===============