Lilypond sandbox

From www.oscarvandillen.com

Jump to: navigation, search
CCBYNCSA.png

Except where otherwise noted, all content is available under Creative Commons License BY-NC-SA 3.0.

For comments, questions, or editing access, please contact oscarvandillen AT gmail DOT com
editing access is subject to permission by the owner of this wiki and may be revoked in case of serious misbehaviour or legal threats




BELOW ARE EXAMPLES: PLEASE EXPERIMENT AND DO NOT WORRY, YOUR EDITS WILL BE REVERTED AT SOME POINT (or you can try to change it back yourself by saving an older version of this page - see history tab above)

Welcome to the special Sandbox to experiment with Lilypond.

Contents

Example of melody and ossia


\version "2.12.2"
\relative c' {  
\new Staff = melody
\time 2/4 \key d \minor 
</p>
<pre> d( e8 f g a b cis d) d,( f'4 es d cis) 
 <<
   { a,16( cis e g a cis) r8 r16 a,( e' cis' }
   \new Staff \with {
     alignAboveContext = #"melody"
     fontSize = #-4
     firstClef = ##f
   \remove "Time_signature_engraver"
   \override StaffSymbol #'staff-space = #0.7
   \override StaffSymbol #'thickness = #0.5
   }
   {  \override TextScript #'padding = #3
   a,16^"ossia"( cis e g a b! cis d e fis gis a s)}
 >>
g?16 f e8~ e4) r8 d,,( d'''4) s
</pre>
<p>}

Example of percussion notation


\relative c' { 
\new Staff
</p>
<pre>\with {
 \override StaffSymbol #'line-count = #3 }
</pre>
<p>\clef percussion
\time 4/4
</p>
<pre>\partial 8
 e8
 a,4. \grace { e'32 } c8 a4 e'8 e | 
 a,4. \grace { e'32 } c8 a[ e' e]
\bar "|."
</pre>
<p>}

Transcription general djembe notation to classical notation

Transcription

Table

e 1 e 2 e 3 e 4 e 1 e 2 e 3 e 4 e
B O O B S S B O O B S S
R R L R R L R R L R R L

Tones

"B" → 
\version "2.12.2"
<<
\new Staff 
</p>
<pre>\with {
 \override StaffSymbol #'line-count = #3
 }
\relative c' { 
\clef percussion
\time 2/2
 a4 
\bar "|."
}

</pre>
<p>>>

"O" → 
\version "2.12.2"
<<
\new Staff 
</p>
<pre>\with {
 \override StaffSymbol #'line-count = #3
 }
\relative c' { 
\clef percussion
\time 2/2
 c4 
\bar "|."
}

</pre>
<p>>>

"S" → 
\version "2.12.2"
<<
\new Staff 
</p>
<pre>\with {
 \override StaffSymbol #'line-count = #3
 }
\relative c' { 
\clef percussion
\time 2/2
 e4 
\bar "|."
}

</pre>
<p>>>

Ritme

e 1 e 2 e
B O

→ 1 second → 
\version "2.12.2"
<<
\new Staff 
</p>
<pre>\with {
 \override StaffSymbol #'line-count = #3
 }
\relative c' { 
\clef percussion
\time 2/2
 a4 c
</pre>
<p>% \bar "|."
</p>
<pre>}

</pre>
<p>>>

2 e
O O

→ half second → 
\version "2.12.2"
<<
\new Staff 
</p>
<pre>\with {
 \override StaffSymbol #'line-count = #3
 }
\relative c' { 
\clef percussion
\time 2/2
 c8[ c] 
</pre>
<p>% \bar "|."
</p>
<pre>}

</pre>
<p>>>

or ...

Results into :

Classical notation

Regular notation:


\version "2.12.2"
<<
\new Staff 
</p>
<pre>\with {
 \override StaffSymbol #'line-count = #3
 }
\relative c' { 
\clef percussion
\time 2/2
 a4 c8 c a4 e'8 e | 
 a,4 c8 c a4 e'8 e 
\bar "|."
}
 \addlyrics {
   R R L R R L R R L R R L
}
</pre>
<p>>>


Example useful for teaching: Notation with superfluous strikes added:


\version "2.12.2"
<<
\new Staff 
</p>
<pre>\with {
 \override StaffSymbol #'line-count = #3
 }
\relative c' { 
\clef percussion
\time 2/2
 a4 c8 c a4 e'8 e | 
 a,4 c8 c a4 e'8 e 
\bar "|."
}
 \addlyrics {
   R R L R R L R R L R R L
}
 \addlyrics {
   B O O B S S B O O B S S
}
</pre>
<p>>>

Makam bug

<lilymidi>
% Initialize makam settings
\version "2.12.2"
\include "makam.ly"
<<
\relative c' {
  \set Staff.keySignature = #`((3 . ,BAKIYE) (6 . ,(- KOMA)))
  c4 cc db fk
  gbm4 gfc gfb efk
  fk4 db cc c
}
>>
</lilymidi>

cf manual "Makam is a type of melody from Turkey using 1/9th-tone microtonal alterations. Consult the initialization file ‘ly/makam.ly’ for details of pitch names and alterations."

what is wrong with the code above? see error message below. oscar 20:24, 26 December 2009 (CET)


LilyPond error:
Processing `your code.ly'
Parsing...
your code.ly:13:9: error: include files are not allowed in safe mode
\include
         "makam.ly"
your code.ly:16:29: error: GUILE signaled an error for the expression beginning here
  \set Staff.keySignature = #
                             `((3 . ,BAKIYE) (6 . ,(- KOMA)))
your code.ly:17:5: error: syntax error, unexpected STRING
  c4
     cc db fk
your code.ly:14:0: error: errors found, ignoring music expression

<<
error: failed files: "your code.ly"
Unbound variable: KOMA

Clefs and staff test

<lilymidi>
\version "2.12.2"
\relative c' {
 <<
  \new Staff
  \with {
  \override StaffSymbol #'staff-space = #2 
  \remove "Time_signature_engraver" }
 {
    \cadenzaOn
 \clef percussion { \override Staff.Stem #'transparent = ##t c4 s s s }

 \clef treble { \override Staff.Stem #'transparent = ##t c4 s s s }

 \clef bass { \override Staff.Stem #'transparent = ##t c4 s s s }

 \clef alto { \override Staff.Stem #'transparent = ##t c4 s s s }

 \clef tenor { \override Staff.Stem #'transparent = ##t c4 s s s } 
    \cadenzaOff { s1 }
 }
\addlyrics { "Perc. clef" "G clef" "F clef" "Alto clef" "Tenor clef" }
 >>
}
</lilymidi>


\version "2.12.2"
\relative c' {
</p>
<pre><<
 \new Staff
 \with {
 \override StaffSymbol #'staff-space = #2 
 \remove "Time_signature_engraver" }
{
   \cadenzaOn
\clef percussion { \override Staff.Stem #'transparent = ##t c4 s s s }
</pre>
<pre>\clef treble { \override Staff.Stem #'transparent = ##t c4 s s s }
</pre>
<pre>\clef bass { \override Staff.Stem #'transparent = ##t c4 s s s }
</pre>
<pre>\clef alto { \override Staff.Stem #'transparent = ##t c4 s s s }
</pre>
<pre>\clef tenor { \override Staff.Stem #'transparent = ##t c4 s s s } 
   \cadenzaOff { s1 }
}
</pre>
<p>\addlyrics { "Perc. clef" "G clef" "F clef" "Alto clef" "Tenor clef" }
</p>
<pre>>>
</pre>
<p>}

Other tests

See also

  • See Lilypond for more information.
  • See the main Sandbox for experimenting with general wikicode.
Personal tools