Invitation

Previous: dir(UP) Up: dir(TOP)


Invitation Write a Score//Music notation
use Lilypond
on
WSL
GNU/Linux 5.10.16.3-microsoft-standard-WSL x86_64
(windows 11 & Linux)
Sunday, January 26, 2025
Writer: Yukio Yoshida(Japan)

 

Top


Next:  

LilyPond(Sheet Music Typesetting)

Fierst of all; about LilyPond


Preface(LilyPond)

It must have been during a rehearsal of the EJE(Eindhoven Youth Orchestra), somewherein 1995 that Jan, one of the cranked violists told Han-Wen, one of the distorted French horn players, about the grand new project he was working on. It was an automated system for printing music (to be precise, it was MPP, a preprocessor for MusiXTeX. As it happened, Han-Wen accidentally wanted to print out some parts from a score, so he started looking at thesoftware, and he quickly got hooked. It was decided that MPP was a dead end. After lots of philosophizing and heated email exchanges, Han-Wen started LilyPond in 1996. This time, Jan got sucked into Han-Wen's new project.
In some ways, developing a computer program is like learning to play an instrument. In the beginning, discovering how it works is fun, and the things you cannot do are challenging. After the initial excitement, you have to practice and practice. Scales and studies can be dull, and if you are not motivated by others.teachers, conductors or audience. it is very tempting togive up. You continue, and gradually playing becomes a part of your life. Some days it comes naturally, and it is wonderful, and on some days it just does not work, but you keep playing, day after day.
Like making music, working on LilyPond can be dull work, and on some days it feels like plodding through a morass of bugs. Nevertheless, it has become a part of our life, and we keep doing it. Probably the most important motivation is that our program actually does something useful for people. When we browse around the net we find many people who use LilyPond, and produce impressive pieces of sheet music. Seeing that feels unreal, but in a very pleasant way.
Our users not only give us good vibes by using our program, many of them also help us by giving suggestions and sending bug reports, so we would like to thank all users that sent us bug reports, gave suggestions or contributed in any other way to LilyPond.
Playing and printing music is more than a nice analogy. Programming together is a lot of fun, and helping people is deeply satisfying, but ultimately, working on LilyPond is a way to express our deep love for music. May it help you create lots of beautiful music!
Han-Wen and Jan
Utrecht/Eindhoven, The Netherlands, July 2002.
Excerpt from LilyPond[ver1.6-lilypond.pdf-]








Next: , Previous: , Up: Top  

context Voice

Knowledge for writing sheet music(using LilyPond)
—LilyPond language in the description of the musical score manuscript—

LilyPond’s default is to read nederlands.ly(In Nederlands notation) and process the manuscript given. Strings such as Note Names(sharp, flat ...) in music are differences between countries(cultures).  It is necessary to replace it with a target flight.
Those provided by Lilypond are
................ english.ly , deutsch.ly , norsk.ly , svenska.ly , italiano.ly , catalan.ly , espanol.ly , portugues.ly , suomi.ly , vlaams.ly ...............
These are the declaration items at the start of the musical score manuscript file (described in the order below). For example,
\version "2.24.0"
\include "italiano.ly"

Version specification: This manuscript is written in ver2.24.0—. It is a clear statement to the "lilypond processing (token)".
In music manuscript coding, lilypond’s-running does not choose OS,
The ly(both old and new manuscript file) will run if it is (LilyPond environment construction)OS, and even in the latest lilypond version, too.


Default typesetting is output in Note(quarter) , Beat(4/4) , Clef(treble) , and Major(C).
Midi is created with "acoustic grand(piano)" if there is no designated instrument

Notes       Scale(pitch) basic code;
          " c d e f g a b " Scale(pitch explicit symbol)
[picture of music]
Notes       Note value(length of note) Basic code;
" c d e f g a b " to specify the scale, specify the numerical value " 1 2 4 8 16 32 64 128 " with the subscript.
Descriptions of    " c4   a'1   g,2   ..... " as note symbols.

1(Whole)⇒2(Half)⇒4(Quarter)⇒8(Eigth)⇒ 16(Sixteenth) ......
1=whole sound divided evenly by all sounds, the following diagram;    (Rests are also notes).
[picture of music]

In Lilypond, for a note without a note value, the note value is searched before and before it, and the note value is evaluated.
For example; " a4 c8 d e f g r c4 " is interpreted as " a4 c8 d8 e8 f8 g8 r8 c4 "


---- \clef treble \key c\major ----
As c\major   notes-writing are c' d' e' f' g' a' b'
                                                       [picture of music]

Major scale list:
Cycle of 5th: UP and DOWN(The minor scale is omitted, there is nature+harmony ...so,there are many sample notations.)

\clef treble \key c\major

                                                       [picture of music]
Deployment;

\key g\major    c' d' e' fis' g' a' b'
[picture of music]

\key d\major    cis' d' e' fis' g' a' b'
[picture of music]

\key a\major    cis' d' e' fis' gis' a' b'
[picture of music]

\key e\major    cis' dis' e' fis' gis' a' b'
[picture of music]

\key b\major    cis' dis' e' fis' gis' ais' b'
[picture of music]

\key fis\major    cis' dis' eis' fis' gis' ais' b'
[picture of music]

\key cis\major    cis' dis' eis' fis' gis' ais' bis'
[picture of music]

Here; ..... The changes are now back.
(c\major    c' d' e' f' g' a' b')
[picture of music]

   

\key f\major    c' d' e' f' g' a' bes'
[picture of music]

\key bes\major    c' d' ees' f' g' a' bes'
[picture of music]

\key ees\major    c' d' ees' f' g' aes' bes'
[picture of music]

\key aes\major    c' des' ees' f' g' aes' bes'
[picture of music]

\key des\major    c' des' ees' f' ges' aes' bes'
[picture of music]

\key ges\major    ces' des' ees' f' ges' aes' bes'
[picture of music]

\key ces\major    ces' des' ees' fes' ges' aes' bes'
[picture of music]

Here; ..... The changes are now back.
(c\major    c' d' e' f' g' a' b')
[picture of music]



meaning;[ – For example — \clef treble \key g \major The specified score is
————— The author; ⇒ " f "(note) must be written as " fis "(note).
————— The performer; ⇒ All " f " notation notes in the score must be played in " fis "(sound). ]
Or .... meaning;[ – For example — \clef treble \key a \major The specified score is
————— The author; ⇒ " c  f  g "(note) must be written as " cis  fis   gis "(note).
————— The performer; ⇒ All " c  f  g " notation notes in the score must be played in " cis  fis  gis "(sound). ]

————— • These are the basic precautions when writing a score. —————


A clef is a symbol at the beginning of a line of music, and... Clef is a word(noun) that refers to a state that envelops a kind of diversity.
Simply put, the clef symbol indicates the (c)position of its Scale(pitch)-on the staff-

About the \clef and \key:
Just move the \key sign notation with clef. • But!   ⇒⇒⇒ The description of notes by \key does not change.
   \clef ???????  <=====   treble or soprano or alto or tenor or bass    (LilyPond has othe \clef, too. see==>notation.pdf)

[picture of music]

[picture of music]

[picture of music]

[picture of music]

[picture of music]

[picture of music]

[picture of music]

    

[picture of music]

[picture of music]

[picture of music]

[picture of music]

[picture of music]

[picture of music]

[picture of music]



As you can see, all lilypond outputs automatically typesetting. The author specified \clef \key \time, and then followed \key. Just write c d e f g a b with \time in mind.
For example;(soprano.ly)

\version "2.22.2"
#(set-global-staff-size 18)
%% #(set-default-paper-size "letter")
\paper { paper-height = 35.00\mm }
soprano = { \autoBeamOff
%% 1-4(1-12)
  \repeat volta 2 {   \repeat volta 2 {
  r8 gis'8[ ais'] b'4. cis''8 disis''!2~ disis''8 | ais'4 dis''2 gis'2. | }
  fis'4 e' dis'4. fis'8 e'2 | ais'4 dis''2 gis'2. | } \bar "|."
          }
%% get sheet
\score { \context ChoirStaff <<
     \context Voice = "SopOne" {
                \clef soprano \key b\major \time 3/2 \tempo 4 = 58
     \set Staff.instrumentName = \markup{"soprano"} \soprano }
                       >>
       \layout {}
	   }
%% get midi
\score {  <<
     \new Staff { \clef soprano \key b\major \time 3/2
     \set Staff.midiInstrument = "pad 4 (choir)"
                                 \unfoldRepeats	\soprano }
         >>
       \midi { tempoWholesPerMinute = #(ly:make-moment 58 4) }  
	   }%% End score.
Any OS; (prompt)lilypond --pdf --png soprano.ly[Enter]

[picture of music]

soprano.midi (soprano.mp3)
Typesetting is output like this.(midi=It’s a one minute and ten second performance.)


This is just an example(because there are various forms of description)
\soprano means soprano = {... description ....} is called to this location for processing.
The staff call is usually \new Staff {
However, it is better to call the staff with \context Voice {

Also, \context Voice = "SopOne" {... description ....}
It is an act of giving the name "SopOne" to this music-processed memory stacks.
(Because you can specify a word etc. to this "SopOne".)


——– Please refer to "notation.pdf" for the correspondence between note spelling and lyrics.


About \time; For example
\time 3/2 describes the score with the length of three half notes as one unit.
The upper number indicates the number of beets par measure.
The lower number indicates the note that gets one beet(2=half note, 4=quarter note, 8=eight note ...etc.



When writing a score, it is recommended to keep notation.pdf + usage.pdf at hand.




Next: , Previous: , Up: Top  

Formatting text


For example, in lilypond the code
[picture of music]
        { c d e f g a b c' }
or    [picture of music]
       \relative c' { c d e f g a b c }

is not interpreted as a character(in lilypond-running). This object is often introduced in lilypond introductions,
But!

[picture of music]
\version "2.24.0"
\book{
 \markup { \italic "Gnu Music Clean Copy Typesetter." }
 \markup { "  " }
\score { \new Staff { \relative c' { c d e f g a b c } }
            }
  \markup { \verbatim-file #"lily-3.ly" }
 }
It would be nice if they could at least describe it like this.

{ ...... } => The process starts with {     } ends with.    And     Nesting is possible.


\book    Normally it works behind the scenes unless called. As you can see in the image above,
you can use \markup outside of \score. You can also bundle many \scores together.
\markup    You can output text, music symbols, etc., and can also typeset sheet music using \score.
\score    The music composition process begins. All components belonging to score will be called.
Staff    Staff is called with \new Staff , \context Staff, \new Voice, \conteext Voice
\layout    Outputs what is received in the score. This is a rough reference(this is about memory and files).
Run lilypond --pdf --png lily-3.ly.ly etc. to get the sheet music, musical score, etc.
At the root of Running, the "context Voice" is processed, received by the "context Staff", and the "context Score" is then completed.

Voice    Elements related to musical notes are this type.     For example;   NoteHead, ………
Staff    Elements related to musical staves are this type.     For example;   Staff.BarLine, ………
Score    Score(musical notation) elements are this type.     For example;   Score.BarNumber ………
Text output can be expressed as \markup { text } \header { items } \lyrics { lyrics }, but if only \markup { text } declares \book,
it can be used outside \score. Also, you can write musical notation using \score inside \markup.




Recently, LilyPond(running Guile2.2) can output PDF files. However, it is recommended that you have Ghostscript installed
on your computer, as it is required to obtain the BoundingBox: value of ps ===> eps.
lilypond -E lily-3.ly    It is likely that it is not possible to obtain the true value(?) of BoundingBox.
lilypond --ps lily-3.ly
gs -sDEVICE=eps2write -sOutputFile=lily-1.eps -dNOPAUSE lily-1.ps -c quit
You can get the value with this.
If you are using Windows OS, change "gs"==>"gswin64c" or "gswin32c" and it will be running OK (on Windows version; Ghostscript ).
This process runs the music part of the document through lilypond first, then inserts the result into that part of the document.
For example,
To edit a Texinfo document, use    ==>    @image{lily-3b, 3.5in,}
To edit an HTML document, use    ==>    <img src="lily-3b.svg" alt="[picture of music]" />



• The LilyPond-provided "lilypond-book.py" process for creating documents(including music notation) allows you to write lilypond code directly into
TeX(LaTeX) , Texinfo , and HTML document editing, and typeset music fragments(boxes) and music notation(boxes) at that position in the document(lilypond-book.py does not work on Windows OS !! but, Up to version 2.22.0 --- OK).
For example, here is an example, which has fragment in option.
Texino    @lilypond[fragment,staffsize=24]
c d e f g a b c
@end lilypond
       HTML    <lilypond quote fragment staffsize=24>
c d e f g a b c
</lilypond>
This is a Texinfo, HTML document description, but if you write lilypond(music notation) code in TeX(LaTeX) or hHTML document editing and
run it with "lilypond-book.py", the fragment will be typeset at that exact position in the document.
This way, we don't need the "gs running" and "boundinbox values" ​​from the previous section, and lilypond-book.py will do everything for us.





•• However, the easiest process is to just paste the LilyPond sheet music(pdf, ps, eps, png, svg .....) into a word processor (word, ……).
Although LilyPond and HTML formatting are good (code description is easy), TeX(not LaTeX) and Texinfo are quite difficult to write. TeX is a typesetting processor with a simple documentation macro called plain.tex. LaTeX is a huge documentation macro program that documents TeX. Texinfo can be roughly said to be an evolved version of plain.tex.

[It all began]   After the release of TeX, LaTeX and MusiXTeX were born, HTML was born in the fttp:// world in a universal format like LaTeX, and Lilypond(a music typesetting processor) was created…… However, it can be said that if TeX can understand the "boxes" and "glues" of typesetting processors to a certain extent, Lilypond, Texinfo, HTML, …… code writing becomes relatively easy.






Sheet music is a format that makes music visible to everyone, so of course the pursuit of "beauty" is unavoidable. The LilyPond format provides the value of the hard work of printing and typesetting engineers to everyone through automated typesetting. To put it in extreme terms, even amateurs can obtain sheet music using their long history of technical value by simply spelling out (writing code) the music object, c d e f g a b and related things. Well, I think this can be said from a bird's eye view.




Regarding LilyPond, please see below.
lilypond-2.24.4-documentation.tar.xz [share\doc\lilypond\html\Documentation\notation.pdf(7,114KB) + usage.pdf(519KB)

Regarding TeX(not LaTeX): Please refer to the following(download).
https://tug.ctan.org/info/impatient/book.pdf

About Texinfo: please see below (download).     https://www.gnu.org/software/texinfo/



Next: , Previous: , Up: Top  

context Staff

I’m sorry, please see below.  lilypond-2.24.4-documentation.tar.xz
[share\doc\.........\Documentation\notation.pdf(7,114KB) + usage.pdf(519KB)


Previous: , Up: Top  

context Score

I’m sorry, please see below.  lilypond-2.24.4-documentation.tar.xz
[share\doc\.........\Documentation\notation.pdf(7,114KB) + usage.pdf(519KB)