Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 3a7b4dfc766af1222d90c7f03a0844e6 > files > 10231

lilypond-doc-2.11.57-1mdv2009.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- header_tag -->
<html lang="en">
<head>
<title>Keyboards - LilyPond snippets</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="LilyPond snippets">
<meta name="generator" content="makeinfo 4.11">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="Chords.html#Chords" title="Chords">
<link rel="next" href="Percussion.html#Percussion" title="Percussion">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
hr { border:0; height:1; color: #000000; background-color: #000000; }
/* hr {
  border:  none;
  height: 1px;
  color: #666666;
  background-color: #666666;
}
body {
  border-left: 1px solid #666666;
  border-right: 1px solid #666666;
  color: #332d28;
  margin-right: auto;
  margin-left: auto;
  width: 60em;
  list-style-type: square;
  font-family: Arial,Helvetica,sans-serif;
  padding-right: 1em;
  padding-left: 1em;
}
a {
  border-bottom: 1px dashed #344242;
  text-decoration: none;
  color: #344242;
}
a:link {
  text-decoration: none;
}
a:visited {
  border-bottom: 1px dashed #666666;
  color: #666666;
}
a:active {
  border-bottom: 1px solid #00cccc;
  color: #00cccc;
}
a:hover {
  border-bottom: 1px solid #1d7b85;
  color: #1d7b85;
}
blockquote {
  border: 1px solid #cccccc;
  padding: 3px;
  width: 40em;
}
.node {
  border-left: 1px solid #666666;
  margin: -0.5em 0px 1em;
  padding: 2px 1px 0px;
  font-style: italic;
}
.node a {
  border:  none;
  text-decoration: underline;
  font-style: normal;
  font-weight: bold;
}
.verbatim {
  font-family: "Courier New",Courier,monospace;
}
.unnumberedsubsubsec {
  font-size: large;
  color: #1d7b85;
}
.subsubheading {
  font-size: large;
  color: #3b220d;
}
.contents {
  border: 1px dashed #339999;
  margin: 3px 2em;
  list-style-type: square;
  padding-right: 1em;
  width: 40em;
  background-color: #fcfff9;
}
.contents a {
  border-bottom: 1px dashed #423d34;
  text-decoration: none;
  color: #423d34;
}
.contents a:visited {
  border-bottom: 1px dashed #666666;
  color: #666666;
}
.contents a:active {
  border-bottom: 1px solid #f0d86d;
  color: #f0d86d;
}
.contents a:hover {
  border-bottom: 1px solid #3b220d;
  color: #3b220d;
}
.menu {
  border-left: 1px dashed #339999;
  margin: 3px 2em 1em;
  list-style-type: square;
  padding-left: 1.4em;
  width: 40em;
}
.unnumbered {
}
h2 {
  font-size: x-large;
  color: #1d7b85;
}
*/
--></style>
</head>
<BODY BGCOLOR=WHITE TEXT=BLACK>

<div class="node">
<p>
<a name="Keyboards"></a>
Next:&nbsp;<a rel="next" accesskey="n" href="Percussion.html#Percussion">Percussion</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Chords.html#Chords">Chords</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>

<h2 class="unnumbered">Keyboards</h2>

<p>These snippets illustrate the Notation Reference,
section <a href="../../../Documentation/user/lilypond/Keyboard-instruments.html#Keyboard-instruments">Keyboard instruments</a>.

   <p><a name="accordion-discant-symbols.ly"></a>

<h3 class="unnumberedsec">Accordion-discant symbols</h3>

<p>Accordion discant-specific symbols are added using <code>\markup</code>. The
vertical placement of the symbols can be tweaked by changing the
<code>\raise</code> arguments.

<pre class="verbatim">
discant = \markup {
  \musicglyph #"accordion.accDiscant"
}
dot = \markup {
  \musicglyph #"accordion.accDot"
}

% 16 voets register
accBasson = ^\markup {
  \combine
  \discant
  \raise #0.5 \dot
}

% een korig 8 en 16 voets register
accBandon = ^\markup {
  \combine
    \discant
    \combine
      \raise #0.5 \dot
      \raise #1.5 \dot
}

accVCello = ^\markup {
  \combine
    \discant
    \combine
      \raise #0.5 \dot
      \combine
        \raise #1.5 \dot
        \translate #'(1 . 0) \raise #1.5 \dot
}

% 4-8-16 voets register
accHarmon = ^\markup {
  \combine
    \discant
    \combine
      \raise #0.5 \dot
      \combine
        \raise #1.5 \dot
        \raise #2.5 \dot
}

accTrombon = ^\markup {
  \combine
    \discant
    \combine
      \raise #0.5 \dot
      \combine
        \raise #1.5 \dot
        \combine
          \translate #'(1 . 0) \raise #1.5 \dot
          \translate #'(-1 . 0) \raise #1.5 \dot
}

% eenkorig 4 en 16 voets register
accOrgan = ^\markup {
  \combine
    \discant
    \combine
      \raise #0.5 \dot
      \raise #2.5 \dot
}

accMaster = ^\markup {
  \combine
    \discant
    \combine
      \raise #0.5 \dot
      \combine
        \raise #1.5 \dot
        \combine
          \translate #'(1 . 0) \raise #1.5 \dot
          \combine
            \translate #'(-1 . 0) \raise #1.5 \dot
            \raise #2.5 \dot
}

accAccord = ^\markup {
  \combine
    \discant
    \combine
      \raise #1.5 \dot
      \combine
        \translate #'(1 . 0) \raise #1.5 \dot
        \combine
          \translate #'(-1 . 0) \raise #1.5 \dot
          \raise #2.5 \dot
}

accMusette = ^\markup {
  \combine
    \discant
    \combine
      \raise #1.5 \dot
      \combine
        \translate #'(1 . 0) \raise #1.5 \dot
        \translate #'(-1 . 0) \raise #1.5 \dot
}

accCeleste = ^\markup {
  \combine
    \discant
    \combine
      \raise #1.5 \dot
      \translate #'(-1 . 0) \raise #1.5 \dot
}

accOboe = ^\markup {
  \combine
    \discant
    \combine
      \raise #1.5 \dot
      \raise #2.5 \dot
}

accClarin = ^\markup {
  \combine
    \discant
    \raise #1.5 \dot
}

accPiccolo = ^\markup {
    \combine
       \discant 
       \raise #2.5 \dot
}

accViolin = ^\markup {
  \combine
    \discant
    \combine
      \raise #1.5 \dot
      \combine
        \translate #'(1 . 0) \raise #1.5 \dot
        \raise #2.5 \dot
}

\relative c'' {
  c4 d\accBasson e f
  c4 d\accBandon e f
  c4 d\accVCello e f
  c4 d\accHarmon e f
  c4 d\accTrombon e f
  c4 d\accOrgan e f
  c4 d\accMaster e f
  c4 d\accAccord e f
  c4 d\accMusette e f
  c4 d\accCeleste e f
  c4 d\accOboe e f
  c4 d\accClarin e f
  c4 d\accPiccolo e f
  c4 d\accViolin e f
}
</pre>
<p>
 <a href="../60/lily-f324a46f.ly">
  <img align="middle"
    border="0" src="../60/lily-f324a46f.png" alt="[image of music]">
 </a>
</p>

   <p><a name="clusters.ly"></a>

<h3 class="unnumberedsec">Clusters</h3>

<p>Clusters are a device to denote that a complete range of notes is to be
played.

<pre class="verbatim">
\layout {
  ragged-right = ##t 
}

fragment = \relative c' {
  c4 f &lt;e d'>4
  &lt;g a>8 &lt;e a> a4 c2 &lt;d b>4
  e2 c
}

&lt;&lt;
  \new Staff \fragment
  \new Staff \makeClusters \fragment
>>
</pre>
<p>
 <a href="../67/lily-7b23dbb9.ly">
  <img align="middle"
    border="0" src="../67/lily-7b23dbb9.png" alt="[image of music]">
 </a>
</p>

   <p><a name="controlling-the-placement-of-chord-fingerings.ly"></a>

<h3 class="unnumberedsec">Controlling the placement of chord fingerings</h3>

<p>The placement of fingering numbers can be controlled precisely.

<pre class="verbatim">
\relative c' {
  \set fingeringOrientations = #'(left)
  &lt;c-1 e-3 a-5>4
  \set fingeringOrientations = #'(down)
  &lt;c-1 e-3 a-5>4
  \set fingeringOrientations = #'(right)
  &lt;c-1 e-3 a-5>4
  \set fingeringOrientations = #'(up)
  &lt;c-1 e-3 a-5>4
  \set fingeringOrientations = #'(left down)
  &lt;c-1 e-3 a-5>2
  \set fingeringOrientations = #'(up right down)
  &lt;c-1 e-3 a-5>2
}
</pre>
<p>
 <a href="../de/lily-34875599.ly">
  <img align="middle"
    border="0" src="../de/lily-34875599.png" alt="[image of music]">
 </a>
</p>

   <p><a name="creating-slurs-across-voices.ly"></a>

<h3 class="unnumberedsec">Creating slurs across voices</h3>

<p>In some situations, it may be necessary to create slurs between notes
from different voices.

   <p>The solution is to add invisible notes to one of the voices, using
<code>\hideNotes</code>.

   <p>This example is measure 235 of the Ciaconna from Bach's 2nd Partita for
solo violin, BWV 1004.

<pre class="verbatim">
\relative c' {
  &lt;&lt; {
    d16( a') s a s a[ s a] s a[ s a]
  }
  \\
  {
    \slurUp
    bes,16[ s e](
    \hideNotes a)
    \unHideNotes f[(
    \hideNotes a)
    \unHideNotes fis](
    \hideNotes a)
    \unHideNotes g[(
    \hideNotes a)
    \unHideNotes gis](
    \hideNotes a)
  } >>
}
</pre>
<p>
 <a href="../ce/lily-e9383e5e.ly">
  <img align="middle"
    border="0" src="../ce/lily-e9383e5e.png" alt="[image of music]">
 </a>
</p>

   <p><a name="demo-midiinstruments.ly"></a>

<h3 class="unnumberedsec">Demo MidiInstruments</h3>

<p>Problem: How to know which <code>midiInstrument</code> would be best for your
composition? Solution: A LilyPond demo file.

<pre class="verbatim">
\header {
  title = "Demo of all midi sounds"
  arranger = "Myself "
}

basemelodie = \relative c' {
  c4. \mf g  c16 b' c d
  e16 d e f g4 g'4 r
  R1
}
melodie = { \tempo 4 = 150 \basemelodie }

\score {
  \new Staff &lt;&lt;
    \new Voice { \melodie
    }
  >>
  \layout { }
}

\score { 
  \new Staff &lt;&lt;
    %\set Staff.instrumentName= #"S/A"
    %\set Staff.midiMinimumVolume = #0.2 
    %\set Staff.midiMaximumVolume = #0.4
    %\set Voice.dynamicAbsoluteVolumeFunction = #0.6
    \new Voice { r \mf
      \set Staff.midiInstrument = #"acoustic grand" \melodie
      \set Staff.midiInstrument = #"bright acoustic" \melodie
      \set Staff.midiInstrument = #"electric grand" \melodie
      \set Staff.midiInstrument = #"honky-tonk" \melodie
      \set Staff.midiInstrument = #"electric piano 1" \melodie
      \set Staff.midiInstrument = #"electric piano 2" \melodie
      \set Staff.midiInstrument = #"harpsichord" \melodie
      \set Staff.midiInstrument = #"clav" \melodie
      \set Staff.midiInstrument = #"celesta" \melodie
      \set Staff.midiInstrument = #"glockenspiel" \melodie
      \set Staff.midiInstrument = #"music box" \melodie
      \set Staff.midiInstrument = #"vibraphone" \melodie
      \set Staff.midiInstrument = #"marimba" \melodie
      \set Staff.midiInstrument = #"xylophone" \melodie
      \set Staff.midiInstrument = #"tubular bells" \melodie
      \set Staff.midiInstrument = #"dulcimer" \melodie
      \set Staff.midiInstrument = #"drawbar organ" \melodie
      \set Staff.midiInstrument = #"percussive organ" \melodie
      \set Staff.midiInstrument = #"rock organ" \melodie
      \set Staff.midiInstrument = #"church organ" \melodie
      \set Staff.midiInstrument = #"reed organ" \melodie
      \set Staff.midiInstrument = #"accordion" \melodie
      \set Staff.midiInstrument = #"harmonica" \melodie
      \set Staff.midiInstrument = #"concertina" \melodie
      \set Staff.midiInstrument = #"acoustic guitar (nylon)" \melodie
      \set Staff.midiInstrument = #"acoustic guitar (steel)" \melodie
      \set Staff.midiInstrument = #"electric guitar (jazz)" \melodie
      \set Staff.midiInstrument = #"electric guitar (clean)" \melodie
      \set Staff.midiInstrument = #"electric guitar (muted)" \melodie
      \set Staff.midiInstrument = #"overdriven guitar" \melodie
      \set Staff.midiInstrument = #"distorted guitar" \melodie
      \set Staff.midiInstrument = #"acoustic bass" \melodie
      \set Staff.midiInstrument = #"electric bass (finger)" \melodie
      \set Staff.midiInstrument = #"electric bass (pick)" \melodie
      \set Staff.midiInstrument = #"fretless bass" \melodie
      \set Staff.midiInstrument = #"slap bass 1" \melodie
      \set Staff.midiInstrument = #"slap bass 2" \melodie
      \set Staff.midiInstrument = #"synth bass 1" \melodie
      \set Staff.midiInstrument = #"synth bass 2" \melodie
      \set Staff.midiInstrument = #"violin" \melodie
      \set Staff.midiInstrument = #"viola" \melodie
      \set Staff.midiInstrument = #"cello" \melodie
      \set Staff.midiInstrument = #"contrabass" \melodie
      \set Staff.midiInstrument = #"tremolo strings" \melodie
      \set Staff.midiInstrument = #"pizzicato strings" \melodie
      \set Staff.midiInstrument = #"orchestral strings" \melodie
      \set Staff.midiInstrument = #"timpani" \melodie
      \set Staff.midiInstrument = #"string ensemble 1" \melodie
      \set Staff.midiInstrument = #"string ensemble 2" \melodie
      \set Staff.midiInstrument = #"synthstrings 1" \melodie
      \set Staff.midiInstrument = #"synthstrings 2" \melodie
      \set Staff.midiInstrument = #"choir aahs" \melodie
      \set Staff.midiInstrument = #"voice oohs" \melodie
      \set Staff.midiInstrument = #"synth voice" \melodie
      \set Staff.midiInstrument = #"orchestra hit" \melodie
      \set Staff.midiInstrument = #"trumpet" \melodie
      \set Staff.midiInstrument = #"trombone" \melodie
      \set Staff.midiInstrument = #"tuba" \melodie
      \set Staff.midiInstrument = #"muted trumpet" \melodie
      \set Staff.midiInstrument = #"french horn" \melodie
      \set Staff.midiInstrument = #"brass section" \melodie
      \set Staff.midiInstrument = #"synthbrass 1" \melodie
      \set Staff.midiInstrument = #"synthbrass 2" \melodie
      \set Staff.midiInstrument = #"soprano sax" \melodie
      \set Staff.midiInstrument = #"alto sax" \melodie
      \set Staff.midiInstrument = #"tenor sax" \melodie
      \set Staff.midiInstrument = #"baritone sax" \melodie
      \set Staff.midiInstrument = #"oboe" \melodie
      \set Staff.midiInstrument = #"english horn" \melodie
      \set Staff.midiInstrument = #"bassoon" \melodie
      \set Staff.midiInstrument = #"clarinet" \melodie
      \set Staff.midiInstrument = #"piccolo" \melodie
      \set Staff.midiInstrument = #"flute" \melodie
      \set Staff.midiInstrument = #"recorder" \melodie
      \set Staff.midiInstrument = #"pan flute" \melodie
      \set Staff.midiInstrument = #"blown bottle" \melodie
      \set Staff.midiInstrument = #"shakuhachi" \melodie
      \set Staff.midiInstrument = #"whistle" \melodie
      \set Staff.midiInstrument = #"ocarina" \melodie
      \set Staff.midiInstrument = #"lead 1 (square)" \melodie
      \set Staff.midiInstrument = #"lead 2 (sawtooth)" \melodie
      \set Staff.midiInstrument = #"lead 3 (calliope)" \melodie
      \set Staff.midiInstrument = #"lead 4 (chiff)" \melodie
      \set Staff.midiInstrument = #"lead 5 (charang)" \melodie
      \set Staff.midiInstrument = #"lead 6 (voice)" \melodie
      \set Staff.midiInstrument = #"lead 7 (fifths)" \melodie
      \set Staff.midiInstrument = #"lead 8 (bass+lead)" \melodie
      \set Staff.midiInstrument = #"pad 1 (new age)" \melodie
      \set Staff.midiInstrument = #"pad 2 (warm)" \melodie
      \set Staff.midiInstrument = #"pad 3 (polysynth)" \melodie
      \set Staff.midiInstrument = #"pad 4 (choir)" \melodie
      \set Staff.midiInstrument = #"pad 5 (bowed)" \melodie
      \set Staff.midiInstrument = #"pad 6 (metallic)" \melodie
      \set Staff.midiInstrument = #"pad 7 (halo)" \melodie
      \set Staff.midiInstrument = #"pad 8 (sweep)" \melodie
      \set Staff.midiInstrument = #"fx 1 (rain)" \melodie
      \set Staff.midiInstrument = #"fx 2 (soundtrack)" \melodie
      \set Staff.midiInstrument = #"fx 3 (crystal)" \melodie
      \set Staff.midiInstrument = #"fx 4 (atmosphere)" \melodie
      \set Staff.midiInstrument = #"fx 5 (brightness)" \melodie
      \set Staff.midiInstrument = #"fx 6 (goblins)" \melodie
      \set Staff.midiInstrument = #"fx 7 (echoes)" \melodie
      \set Staff.midiInstrument = #"fx 8 (sci-fi)" \melodie
      \set Staff.midiInstrument = #"sitar" \melodie
      \set Staff.midiInstrument = #"banjo" \melodie
      \set Staff.midiInstrument = #"shamisen" \melodie
      \set Staff.midiInstrument = #"koto" \melodie
      \set Staff.midiInstrument = #"kalimba" \melodie
      \set Staff.midiInstrument = #"bagpipe" \melodie
      \set Staff.midiInstrument = #"fiddle" \melodie
      \set Staff.midiInstrument = #"shanai" \melodie
      \set Staff.midiInstrument = #"tinkle bell" \melodie
      \set Staff.midiInstrument = #"agogo" \melodie
      \set Staff.midiInstrument = #"steel drums" \melodie
      \set Staff.midiInstrument = #"woodblock" \melodie
      \set Staff.midiInstrument = #"taiko drum" \melodie
      \set Staff.midiInstrument = #"melodic tom" \melodie
      \set Staff.midiInstrument = #"synth drum" \melodie
      \set Staff.midiInstrument = #"reverse cymbal" \melodie
      \set Staff.midiInstrument = #"guitar fret noise" \melodie
      \set Staff.midiInstrument = #"breath noise" \melodie
      \set Staff.midiInstrument = #"seashore" \melodie
      \set Staff.midiInstrument = #"bird tweet" \melodie
      \set Staff.midiInstrument = #"telephone ring" \melodie
      \set Staff.midiInstrument = #"helicopter" \melodie
      \set Staff.midiInstrument = #"applause" \melodie
      \set Staff.midiInstrument = #"gunshot" \melodie
    }
  >>
  \midi { }
}
</pre>
<p>
 <a href="../52/lily-d2f91df9.ly">
  <img align="middle"
    border="0" src="../52/lily-d2f91df9.png" alt="[image of music]">
 </a>
</p>

   <p><a name="fine-tuning-pedal-brackets.ly"></a>

<h3 class="unnumberedsec">Fine-tuning pedal brackets</h3>

<p>For fine-tuning the appearance of a pedal bracket, the properties
<code>edge-width</code>, <code>edge-height</code>, and <code>shorten-pair</code> of
<code>PianoPedalBracket</code> objects can be modified.  For example, the
bracket may be extended to the right edge of the note head:

<pre class="verbatim">
\relative c'' {
  \override Staff.PianoPedalBracket #'shorten-pair = #'(0 . -1.0)
  c4\sostenutoOn d e c,
  f4 g a2\sostenutoOff
}
</pre>
<p>
 <a href="../38/lily-ae6927a2.ly">
  <img align="middle"
    border="0" src="../38/lily-ae6927a2.png" alt="[image of music]">
 </a>
</p>

   <p><a name="indicating-cross-staff-chords-with-arpeggio-bracket.ly"></a>

<h3 class="unnumberedsec">Indicating cross-staff chords with arpeggio bracket</h3>

<p>An arpeggio bracket can indicate that notes on two different staves are
to be played with the same hand. In order to do this, the
<code>PianoStaff</code> must be set to accept cross-staff arpeggios and the
arpeggios must be set to the bracket shape in the <code>PianoStaff</code>
context.

   <p>(Debussy, Les collines d’Anacapri, m. 65)

<pre class="verbatim">
\paper { ragged-right = ##t }

\new PianoStaff &lt;&lt;
  \set PianoStaff.connectArpeggios = ##t
  \override PianoStaff.Arpeggio #'stencil = #ly:arpeggio::brew-chord-bracket
  \new Staff {
    \relative c' {
      \key b \major
      \time 6/8
      b8-.(\arpeggio fis'-.\> cis-. e-. gis-. b-.)\!\fermata^\laissezVibrer
      \bar "||"
    }
  }
  \new Staff {
    \relative c' {
      \clef bass
      \key b \major
      &lt;&lt;
        {
          &lt;a e cis>2.\arpeggio
        }
        \\
        {
          &lt;a, e a,>2.
        }
      >>
    }
  }
>>
</pre>
<p>
 <a href="../aa/lily-d49b372e.ly">
  <img align="middle"
    border="0" src="../aa/lily-d49b372e.png" alt="[image of music]">
 </a>
</p>

   <p><a name="jazz-combo-template.ly"></a>

<h3 class="unnumberedsec">Jazz combo template</h3>

<p>This is quite an advanced template, for a jazz ensemble. Note that all
instruments are notated in <code>\key c \major</code>. This refers to the
key in concert pitch; the key will be automatically transposed if the
music is within a <code>\transpose</code> section.

<pre class="verbatim">
\header {
  title = "Song"
  subtitle = "(tune)"
  composer = "Me"
  meter = "moderato"
  piece = "Swing"
  tagline = \markup {
    \column {
      "LilyPond example file by Amelie Zapf,"
      "Berlin 07/07/2003"
    }
  }
}

%#(set-global-staff-size 16)
\include "english.ly"

%%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%

sl = {
  \override NoteHead #'style = #'slash
  \override Stem #'transparent = ##t
}
nsl = {
  \revert NoteHead #'style
  \revert Stem #'transparent
}
crOn = \override NoteHead #'style = #'cross
crOff = \revert NoteHead #'style

%% insert chord name style stuff here.

jazzChords = { }

%%%%%%%%%%%% Keys'n'thangs %%%%%%%%%%%%%%%%%

global = { \time 4/4 }

Key = { \key c \major }

% ############ Horns ############

% ------ Trumpet ------
trpt = \transpose c d \relative c'' {
  \Key
  c1 | c | c |
}
trpHarmony = \transpose c' d {
  \jazzChords
}
trumpet = {
  \global
  \set Staff.instrumentName = #"Trumpet"
  \clef treble
  &lt;&lt;
    \trpt
  >>
}

% ------ Alto Saxophone ------
alto = \transpose c a \relative c' {
  \Key
  c1 | c | c |
}
altoHarmony = \transpose c' a {
  \jazzChords
}
altoSax = {
  \global
  \set Staff.instrumentName = #"Alto Sax"
  \clef treble
  &lt;&lt;
    \alto
  >>
}

% ------ Baritone Saxophone ------
bari = \transpose c a' \relative c {
  \Key
  c1
  c1
  \sl
  d4^"Solo" d d d
  \nsl
}
bariHarmony = \transpose c' a \chordmode {
  \jazzChords s1 s d2:maj e:m7
}
bariSax = {
  \global
  \set Staff.instrumentName = #"Bari Sax"
  \clef treble
  &lt;&lt;
    \bari
  >>
}

% ------ Trombone ------
tbone = \relative c {
  \Key
  c1 | c | c
}
tboneHarmony = \chordmode {
  \jazzChords
}
trombone = {
  \global
  \set Staff.instrumentName = #"Trombone"
  \clef bass
  &lt;&lt;
    \tbone
  >>
}

% ############ Rhythm Section #############

% ------ Guitar ------
gtr = \relative c'' {
  \Key
  c1
  \sl
  b4 b b b
  \nsl
  c1
}
gtrHarmony = \chordmode {
  \jazzChords
  s1 c2:min7+ d2:maj9
}
guitar = {
  \global
  \set Staff.instrumentName = #"Guitar"
  \clef treble
  &lt;&lt;
    \gtr
  >>
}

%% ------ Piano ------
rhUpper = \relative c'' {
  \voiceOne
  \Key
  c1 | c | c
}
rhLower = \relative c' {
  \voiceTwo
  \Key
  e1 | e | e
}

lhUpper = \relative c' {
  \voiceOne
  \Key
  g1 | g | g
}
lhLower = \relative c {
  \voiceTwo
  \Key
  c1 | c | c
}

PianoRH = {
  \clef treble
  \global
  \set Staff.midiInstrument = #"acoustic grand"
  &lt;&lt;
    \new Voice = "one" \rhUpper
    \new Voice = "two" \rhLower
  >>
}
PianoLH = {
  \clef bass
  \global
  \set Staff.midiInstrument = "acoustic grand"
  &lt;&lt;
    \new Voice = "one" \lhUpper
    \new Voice = "two" \lhLower
  >>
}

piano = {
  &lt;&lt;
    \set PianoStaff.instrumentName = #"Piano"
    \new Staff = "upper" \PianoRH
    \new Staff = "lower" \PianoLH
  >>
}

% ------ Bass Guitar ------
Bass = \relative c {
  \Key
  c1 | c | c
}
bass = {
  \global
  \set Staff.instrumentName = #"Bass"
  \clef bass
  &lt;&lt;
    \Bass
  >>
}

% ------ Drums ------
up = \drummode {
  \voiceOne
  hh4 &lt;hh sn> hh &lt;hh sn>
  hh4 &lt;hh sn> hh &lt;hh sn>
  hh4 &lt;hh sn> hh &lt;hh sn>
}
down = \drummode {
  \voiceTwo
  bd4 s bd s
  bd4 s bd s
  bd4 s bd s
}

drumContents = {
  \global
  &lt;&lt;
    \set DrumStaff.instrumentName = #"Drums"
    \new DrumVoice \up
    \new DrumVoice \down
  >>
}

%%%%%%%%% It All Goes Together Here %%%%%%%%%%%%%%%%%%%%%%

\score {
  &lt;&lt;
    \new StaffGroup = "horns" &lt;&lt;
      \new Staff = "trumpet" \trumpet
      \new Staff = "altosax" \altoSax
      \new ChordNames = "barichords" \bariHarmony
      \new Staff = "barisax" \bariSax
      \new Staff = "trombone" \trombone
    >>
    
    \new StaffGroup = "rhythm" &lt;&lt;
      \new ChordNames = "chords" \gtrHarmony
      \new Staff = "guitar" \guitar
      \new PianoStaff = "piano" \piano
      \new Staff = "bass" \bass
      \new DrumStaff \drumContents
    >>
  >>
  
  \layout {
    \context { \RemoveEmptyStaffContext }
    \context {
      \Score
      \override BarNumber #'padding = #3
      \override RehearsalMark #'padding = #2
      skipBars = ##t
    }
  }
  
  \midi { }
}
</pre>
<p>
 <a href="../ea/lily-36b7ad93.ly">
  <img align="middle"
    border="0" src="../ea/lily-36b7ad93.png" alt="[image of music]">
 </a>
</p>

   <p><a name="laissez-vibrer-ties.ly"></a>

<h3 class="unnumberedsec">Laissez vibrer ties</h3>

<p>Laissez vibrer ties have a fixed size. Their formatting can be tuned
using <code>'tie-configuration</code>.

<pre class="verbatim">
\relative c' {
  &lt;c e g>4\laissezVibrer r &lt;c f g>\laissezVibrer r
  &lt;c d f g>4\laissezVibrer r &lt;c d f g>4.\laissezVibrer r8

  &lt;c d e f>4\laissezVibrer r
  \override LaissezVibrerTieColumn #'tie-configuration
     = #`((-7 . ,DOWN)
          (-5 . ,DOWN)
          (-3 . ,UP)
          (-1 . ,UP))
  &lt;c d e f>4\laissezVibrer r
}
</pre>
<p>
 <a href="../fd/lily-61b8d987.ly">
  <img align="middle"
    border="0" src="../fd/lily-61b8d987.png" alt="[image of music]">
 </a>
</p>

   <p><a name="piano-template-simple.ly"></a>

<h3 class="unnumberedsec">Piano template (simple)</h3>

<p>Here is a simple piano staff with some notes.

<pre class="verbatim">
upper = \relative c'' {
  \clef treble
  \key c \major
  \time 4/4
  
  a4 b c d  
}

lower = \relative c {
  \clef bass
  \key c \major
  \time 4/4
  
  a2 c  
}

\score {
  \new PianoStaff &lt;&lt;
    \set PianoStaff.instrumentName = #"Piano  "
    \new Staff = "upper" \upper
    \new Staff = "lower" \lower
  >>
  \layout { }
  \midi { }
}
</pre>
<p>
 <a href="../33/lily-72cc9456.ly">
  <img align="middle"
    border="0" src="../33/lily-72cc9456.png" alt="[image of music]">
 </a>
</p>

   <p><a name="piano-template-with-centered-dynamics.ly"></a>

<h3 class="unnumberedsec">Piano template with centered dynamics</h3>

<p>Many piano scores have the dynamics centered between the two staves. 
This requires a bit of tweaking to implement, but since the template is
right here, you don't have to do the tweaking yourself.

<pre class="verbatim">
upper = \relative c'' {
  \clef treble
  \key c \major
  \time 4/4
  
  a4 b c d
}

lower = \relative c {
  \clef bass
  \key c \major
  \time 4/4
  
  a2 c
}

dynamics = {
  s2\fff\> s4 s\!\pp
}

pedal = {
  s2\sustainOn s\sustainOff
}

\score {
  \new PianoStaff &lt;&lt;
    \new Staff = "upper" \upper
    \new Dynamics = "dynamics" \dynamics
    \new Staff = "lower" &lt;&lt;
      \clef bass
      \lower
    >>
    \new Dynamics = "pedal" \pedal
  >>
  \layout {
    \context {
      \type "Engraver_group"
      \name Dynamics
      % So that \cresc works, for example.
      \alias Voice
      \consists "Output_property_engraver"
      
      \override VerticalAxisGroup #'minimum-Y-extent = #'(-1 . 1)
      \override DynamicLineSpanner #'Y-offset = #0
      pedalSustainStrings = #'("Ped." "*Ped." "*")
      pedalUnaCordaStrings = #'("una corda" "" "tre corde")
      
      \consists "Piano_pedal_engraver"
      \consists "Script_engraver"
      \consists "Dynamic_engraver"
      \consists "Text_engraver"
      
      \override TextScript #'font-size = #2
      \override TextScript #'font-shape = #'italic
      
      \consists "Skip_event_swallow_translator"
      
      \consists "Axis_group_engraver"
    }
    \context {
      \PianoStaff
      \accepts Dynamics
    }
  }
}
\score {
  \new PianoStaff &lt;&lt;
    \new Staff = "upper" &lt;&lt; \upper \dynamics \pedal >>
    \new Staff = "lower" &lt;&lt; \lower \dynamics \pedal >>
  >>
  \midi { }
}
</pre>
<p>
 <a href="../81/lily-165c7953.ly">
  <img align="middle"
    border="0" src="../81/lily-165c7953.png" alt="[image of music]">
 </a>
</p>

   <p><a name="piano-template-with-centered-lyrics.ly"></a>

<h3 class="unnumberedsec">Piano template with centered lyrics</h3>

<p>Instead of having a full staff for the melody and lyrics, lyrics can be
centered between the staves of a piano staff.

<pre class="verbatim">
upper = \relative c'' {
  \clef treble
  \key c \major
  \time 4/4
  
  a4 b c d  
}

lower = \relative c {
  \clef bass
  \key c \major
  \time 4/4
  
  a2 c  
}

text = \lyricmode {
  Aaa Bee Cee Dee
}

\score {
  \new GrandStaff &lt;&lt;
    \new Staff = upper { \new Voice = "singer" \upper }
    \new Lyrics \lyricsto "singer" \text
    \new Staff = lower { \lower }
  >>
  \layout {
    \context {
      \GrandStaff
      \accepts "Lyrics"
    }
    \context {
      \Lyrics
      \consists "Bar_engraver"
    }
  }
  \midi { }
}
</pre>
<p>
 <a href="../37/lily-c18abd8d.ly">
  <img align="middle"
    border="0" src="../37/lily-c18abd8d.png" alt="[image of music]">
 </a>
</p>

   <p><a name="piano-template-with-melody-and-lyrics.ly"></a>

<h3 class="unnumberedsec">Piano template with melody and lyrics</h3>

<p>Here is a typical song format: one staff with the melody and lyrics,
with piano accompaniment underneath.

<pre class="verbatim">
melody = \relative c'' {
  \clef treble
  \key c \major
  \time 4/4
  
  a b c d  
}

text = \lyricmode {
  Aaa Bee Cee Dee
}

upper = \relative c'' {
  \clef treble
  \key c \major
  \time 4/4
  
  a4 b c d  
}

lower = \relative c {
  \clef bass
  \key c \major
  \time 4/4
  
  a2 c  
}

\score {
  &lt;&lt;
    \new Voice = "mel" { \autoBeamOff \melody }
    \new Lyrics \lyricsto mel \text    
    \new PianoStaff &lt;&lt;
      \new Staff = "upper" \upper
      \new Staff = "lower" \lower
    >>
  >>
  \layout {
    \context { \RemoveEmptyStaffContext }
  }
  \midi { }
}
</pre>
<p>
 <a href="../68/lily-e6876100.ly">
  <img align="middle"
    border="0" src="../68/lily-e6876100.png" alt="[image of music]">
 </a>
</p>

   <p><a name="vocal-ensemble-template-with-automatic-piano-reduction.ly"></a>

<h3 class="unnumberedsec">Vocal ensemble template with automatic piano reduction</h3>

<p>This template adds an automatic piano reduction to the standard SATB
vocal score demonstrated in "Vocal ensemble template". This
demonstrates one of the strengths of LilyPond – you can use a music
definition more than once. If any changes are made to the vocal notes
(say, <code>tenorMusic</code>), then the changes will also apply to the piano
reduction.

<pre class="verbatim">
global = {
  \key c \major
  \time 4/4
}

sopMusic = \relative c'' {
  c4 c c8[( b)] c4
}
sopWords = \lyricmode {
  hi hi hi hi
}

altoMusic = \relative c' {
  e4 f d e
}
altoWords =\lyricmode {
  ha ha ha ha
}

tenorMusic = \relative c' {
  g4 a f g
}
tenorWords = \lyricmode {
  hu hu hu hu
}

bassMusic = \relative c {
  c4 c g c
}
bassWords = \lyricmode {
  ho ho ho ho
}

\score {
  &lt;&lt;
    \new ChoirStaff &lt;&lt;
      \new Lyrics = sopranos { s1 }
      \new Staff = women &lt;&lt;
        \new Voice = sopranos { \voiceOne &lt;&lt; \global \sopMusic >> }
        \new Voice = altos { \voiceTwo &lt;&lt; \global \altoMusic >> }
      >>
      \new Lyrics = altos { s1 }
      \new Lyrics = tenors { s1 }
      \new Staff = men &lt;&lt;
        \clef bass
        \new Voice = tenors { \voiceOne &lt;&lt;\global \tenorMusic >> }
        \new Voice = basses { \voiceTwo &lt;&lt;\global \bassMusic >> }
      >>
      \new Lyrics = basses { s1 }
      \context Lyrics = sopranos \lyricsto sopranos \sopWords
      \context Lyrics = altos \lyricsto altos \altoWords
      \context Lyrics = tenors \lyricsto tenors \tenorWords
      \context Lyrics = basses \lyricsto basses \bassWords
    >>
    \new PianoStaff &lt;&lt;
      \new Staff &lt;&lt;
        \set Staff.printPartCombineTexts = ##f
        \partcombine
        &lt;&lt; \global \sopMusic >>
        &lt;&lt; \global \altoMusic >>
      >>
      \new Staff &lt;&lt;
        \clef bass
        \set Staff.printPartCombineTexts = ##f
        \partcombine
        &lt;&lt; \global \tenorMusic >>
        &lt;&lt; \global \bassMusic >>
      >>
    >>
  >>
  \layout {
    \context {
      % a little smaller so lyrics
      % can be closer to the staff
      \Staff
      \override VerticalAxisGroup #'minimum-Y-extent = #'(-3 . 3)
    }
  }
}
</pre>
<p>
 <a href="../99/lily-1164d362.ly">
  <img align="middle"
    border="0" src="../99/lily-1164d362.png" alt="[image of music]">
 </a>
</p>

   <!-- footer_tag --><br><hr>
<div class="node">
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Percussion.html#Percussion">Percussion</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Chords.html#Chords">Chords</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
</div>

<div style="background-color: #e8ffe8; padding: 2; border: #c0ffc0 1px solid;">
<p>
<font size="-1">
This page is for LilyPond-2.11.57 (development-branch).
<br>
<address>
Report errors to <a href="http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs">http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs</a>. </address>
<br>
Your <a href="http://lilypond.org/web/devel/participating/documentation-adding">suggestions for the documentation</a> are welcome.
</font>
</p>
</div>

</BODY></html>