lilypond-user
[Top][All Lists]
Advanced

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

Re: note names as solmisation printed as markup automagically?


From: bart deruyter
Subject: Re: note names as solmisation printed as markup automagically?
Date: Mon, 30 May 2016 22:06:29 +0200

Anders, 

that is really great, copy pasted your code, it worked instantly ! It will be an enormous time saver.

A kind of thing to add to the snippet repository :-)

grtz,

Bart


2016-05-30 21:11 GMT+02:00 Anders Eriksson <address@hidden>:
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 { }
}

% ===============


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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