A.8.1 Jazz combo (LilyPond 学习手册)

#### A.8.1 Jazz combo

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

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

>     % To make the example display properly in the documentation.
>     \paper {
>       paper-width = 130\mm
>       paper-height = 205\mm
>     }

>     % #(set-global-staff-size 16)

>     \include "english.ly"

>     %%%%%%%%%%%% Some macros %%%%%%%%%%%%%%%%%%%

>     sl = { \override NoteHead.style = #'slash
>            \hide Stem }
>     nsl = { \revert NoteHead.style
>             \undo \hide Stem }
>     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
>       \clef treble
>       \trpt
>     }

>     % ------ Alto Saxophone ------
>     alto = \transpose c a \relative c' {
>       \Key
>       c1 | c | c |
>     }
>     altoHarmony = \transpose c' a {
>       \jazzChords
>     }
>     altoSax = {
>       \global
>       \clef treble
>       \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
>       \clef treble
>       \bari
>     }

>     % ------ Trombone ------
>     tbone = \relative c {
>       \Key
>       c1 | c | c |
>     }
>     tboneHarmony = \chordmode {
>       \jazzChords
>     }
>     trombone = {
>       \global
>       \clef bass
>       \tbone
>     }

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

>     % ------ Guitar ------
>     gtr = \relative c'' {
>       \Key
>       c1 |
>       \sl b4 b b b \nsl |
>       c1 |
>     }
>     gtrHarmony = \chordmode {
>       \jazzChords
>       s1 | c2:min7+ d2:maj9 | s1 |
>     }
>     guitar = {
>       \global
>       \clef treble
>       \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
>       <<
>         \new Voice = "one" \rhUpper
>         \new Voice = "two" \rhLower
>       >>
>     }
>     PianoLH = {
>       \clef bass
>       \global
>       <<
>         \new Voice = "one" \lhUpper
>         \new Voice = "two" \lhLower
>       >>
>     }

>     piano = <<
>       \new Staff = "upper" \PianoRH
>       \new Staff = "lower" \PianoLH
>     >>

>     % ------ Bass Guitar ------
>     Bass = \relative c {
>       \Key
>       c1 | c | c |
>     }
>     bass = {
>       \global
>       \clef bass
>       \Bass
>     }

>     % ------ Drums ------
>     up = \drummode {
>       \voiceOne
>       hh4 <hh sn> hh <hh sn> |
>       hh4 <hh sn> hh <hh sn> |
>       hh4 <hh sn> hh <hh sn> |
>     }
>     down = \drummode {
>       \voiceTwo
>       bd4 s bd s |
>       bd4 s bd s |
>       bd4 s bd s |
>     }

>     drumContents = {
>       \global
>       <<
>         \new DrumVoice \up
>         \new DrumVoice \down
>       >>
>     }

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

>     \book { % For the LilyPond documentation.
>       \score {
>         <<
>           \new StaffGroup = "horns" <<
>             \new Staff = "trumpet" \with { instrumentName = "Trumpet" }
>               \trumpet
>             \new Staff = "altosax" \with { instrumentName = "Alto Sax" }
>               \altoSax
>             \new ChordNames = "barichords" \with { instrumentName = "Bari Sax" }
>               \bariHarmony
>             \new Staff = "barisax" \with { instrumentName = "Bari Sax" }
>               \bariSax
>             \new Staff = "trombone" \with { instrumentName = "Trombone" }
>               \trombone
>           >>

>           \new StaffGroup = "rhythm" <<
>             \new ChordNames = "chords" \with { instrumentName = "Guitar" }
>               \gtrHarmony
>             \new Staff = "guitar" \with { instrumentName = "Guitar" }
>               \guitar
>             \new PianoStaff = "piano" \with {
>               instrumentName = "Piano"
>               midiInstrument = "acoustic grand"
>             } \piano
>             \new Staff = "bass" \with { instrumentName = "Bass" }
>               \bass
>             \new DrumStaff \with { instrumentName = "Drums" }
>               \drumContents
>           >>
>         >>

>         \layout {
>           \context {
>             \Staff
>             \RemoveEmptyStaves
>           }
>           \context {
>             \Score
>             \override BarNumber.padding = 3
>             \override RehearsalMark.padding = 2
>             skipBars = ##t
>           }
>         }
>         \midi { }
>       }
>     }

#### LilyPond 学习手册 v2.26.0 (stable-branch).

- 1 Installing
  - 1.1 Graphical setup
  - 1.2 Command line setup
- 2 教程
  - 2.1 编译文件
  - 2.2 如何写输入文件
    - 2.2.1 简单记谱法
      - 音高
      - 时值 (节奏)
      - 休止符
      - 拍子记号
      - 速度记号
      - 谱号（音部记号）
      - 所有的都放在一起
    - 2.2.2 处理输入文件
  - 2.3 处理报错
    - 2.3.1 一般解决问题的方法
    - 2.3.2 常见的错误
  - 2.4 如何阅读教程
    - 2.4.1 忽略掉的内容
    - 2.4.2 可以点开的例子
    - 2.4.3 手册概览
- 3 Common notation
  - 3.1 Single-staff notation
    - 3.1.1 Bar lines and bar checks
      - Bar lines
      - Bar checks
    - 3.1.2 Pitches and key signatures
      - Pitch alterations
      - Key signatures
      - Warning: key signatures and pitches
    - 3.1.3 Ties and slurs
      - Ties
      - Slurs
      - Phrasing slurs
      - Warnings: slurs vs. ties
    - 3.1.4 Articulations and dynamics
      - Articulations
      - Fingerings
      - Dynamics
    - 3.1.5 Adding text
    - 3.1.6 Automatic and manual beams
    - 3.1.7 Advanced rhythmic commands
      - Partial measure
      - Tuplets
      - Grace notes
  - 3.2 Multiple notes at once
    - 3.2.1 Music expressions explained
      - Analogy: mathematical expressions
      - Simultaneous music expressions: multiple staves
      - Simultaneous music expressions: single-staff
    - 3.2.2 Multiple staves
    - 3.2.3 Staff groups
    - 3.2.4 Combining notes into chords
    - 3.2.5 Single-staff polyphony
  - 3.3 Songs
    - 3.3.1 Setting simple songs
    - 3.3.2 Aligning lyrics to a melody
    - 3.3.3 Lyrics to multiple staves
  - 3.4 Final touches
    - 3.4.1 Organizing pieces with variables
    - 3.4.2 Adding titles
    - 3.4.3 Absolute note names
    - 3.4.4 After the tutorial
- 4 Fundamental concepts
  - 4.1 How LilyPond input files work
    - 4.1.1 Introduction to the LilyPond file structure
    - 4.1.2 A score is a (single) compound musical expression
    - 4.1.3 Nesting music expressions
    - 4.1.4 Structure of a note entry
    - 4.1.5 On the un-nestedness of brackets and ties
  - 4.2 Voices contain music
    - 4.2.1 I’m hearing voices
    - 4.2.2 Explicitly instantiating voices
    - 4.2.3 Voices and vocals
  - 4.3 Contexts and engravers
    - 4.3.1 Contexts explained
    - 4.3.2 Creating contexts
    - 4.3.3 Engravers explained
    - 4.3.4 Modifying context properties
    - 4.3.5 Adding and removing engravers
  - 4.4 Extending the templates
    - 4.4.1 Soprano and cello
    - 4.4.2 Four-part SATB vocal score
    - 4.4.3 Building a score from scratch
    - 4.4.4 Saving typing with variables and functions
    - 4.4.5 Scores and parts
- 5 Tweaking output
  - 5.1 Tweaking basics
    - 5.1.1 Objects and interfaces
    - 5.1.2 Naming conventions of objects and properties
    - 5.1.3 Tweaking methods
      - The `\override` command
      - The `\revert` command
      - The `\once` prefix
      - The `\tweak` and `\offset` commands
      - The `\single` prefix
  - 5.2 The Internals Reference manual
    - 5.2.1 Properties of layout objects
    - 5.2.2 Properties found in interfaces
    - 5.2.3 Types of properties
  - 5.3 Appearance of objects
    - 5.3.1 Visibility and color of objects
      - The `stencil` property
      - The `break-visibility` property
      - The `transparent` property
      - The `color` property
    - 5.3.2 Size of objects
    - 5.3.3 Length and thickness of objects
  - 5.4 Offsets and alignments
  - 5.5 Placement of objects
    - 5.5.1 Automatic behavior
    - 5.5.2 Within-staff objects
      - The `direction` property
      - Fingering
    - 5.5.3 Outside-staff objects
      - The `outside-staff-priority` property
      - The `\textLengthOn` command
      - Dynamics placement
      - Grob sizing
  - 5.6 Vertical spacing
  - 5.7 Collisions of objects
    - 5.7.1 Moving objects
    - 5.7.2 Fixing overlapping notation
      - The `padding` property
      - The `right-padding` property
      - The `staff-padding` property
      - The `self-alignment-X` property
      - The `staff-position` property
      - The `extra-offset` property
      - The `positions` property
      - The `force-hshift` property
    - 5.7.3 Real music example
  - 5.8 Further tweaking
    - 5.8.1 Other uses for tweaks
      - Tying notes across voices
      - Simulating a fermata in MIDI
    - 5.8.2 Using variables for layout adjustments
    - 5.8.3 Style sheets
    - 5.8.4 Other sources of information
    - 5.8.5 Advanced tweaks with Scheme
- Appendix A Templates
  - A.1 Built-in templates
    - A.1.1 SATB template
    - A.1.2 SSAATTBB template
  - A.2 Single staff templates
    - A.2.1 Notes only
    - A.2.2 Notes and lyrics
    - A.2.3 Notes and chords
    - A.2.4 Notes, lyrics, and chords
  - A.3 Piano templates
    - A.3.1 Solo piano
    - A.3.2 Piano and melody with lyrics
    - A.3.3 Piano-centered lyrics
  - A.4 String quartet templates
    - A.4.1 String quartet
    - A.4.2 String quartet parts
  - A.5 Vocal ensembles templates
    - A.5.1 SATB vocal score
    - A.5.2 SATB vocal score and automatic piano reduction
    - A.5.3 SATB with aligned contexts
    - A.5.4 SATB on four staves
    - A.5.5 Solo verse and two-part refrain
    - A.5.6 Hymn tunes
    - A.5.7 Psalms
  - A.6 Orchestral templates
    - A.6.1 Orchestra, choir and piano
  - A.7 Ancient notation templates
    - A.7.1 Transcription of mensural music
    - A.7.2 Gregorian transcription template
  - A.8 Other templates
    - A.8.1 Jazz combo
- Appendix B GNU Free Documentation License
- Appendix C Index