Pitches

Pitches


Adding ambitus per voice

Ambitus can be added per voice. In this case, the ambitus must be moved manually to prevent collisions.

\newStaff<<
\newVoice\with{
\consists"Ambitus_engraver"
}\relativec''{
\overrideAmbitus.X-offset=#2.0
\voiceOne
c4ade
f1
}
\newVoice\with{
\consists"Ambitus_engraver"
}\relativec'{
\voiceTwo
es4fgas
b1
}
>>

[image of music]


Adding an ottava marking to a single voice

If you have more than one voice on the staff, setting octavation in one voice transposes the position of notes in all voices for the duration of the ottava bracket. If the octavation is only intended to apply to one voice, the Ottava_spanner_engraver should be moved to Voice context.

\layout{
\context{
\Staff
\removeOttava_spanner_engraver
}
\context{
\Voice
\consistsOttava_spanner_engraver
}
}
{
\clefbass
<<{<gd'>1~q2<c'e'>}
\\
{
r2.
\ottava-1
<b,,,b,,>4~|
q2
\ottava0
<ce>2
}
>>
}

[image of music]


Aiken head thin variant noteheads

Aiken head white notes get harder to read at smaller staff sizes, especially with ledger lines. Losing interior white space makes them appear as quarter notes.

\score{
{
\aikenHeads
c''2a'c'a
% Switch to thin-variant noteheads
\setshapeNoteStyles=##(doThinreThinmiThin
faThinsollaThintiThin)
c''a'c'a
}
}

[image of music]


Altering the length of beamed stems

Stem lengths on beamed notes can be varied by overriding the beamed-lengths property of the details of the Stem. If a single value is used as an argument, the length applies to all stems. When multiple arguments are used, the first applies to eighth notes, the second to sixteenth notes and so on. The final argument also applies to all notes shorter than the note length of the final argument. Non-integer arguments may also be used.

\relativec''{
\overrideStem.details.beamed-lengths=#'(2)
a8[a]a16[a]a32[a]
\overrideStem.details.beamed-lengths=#'(81012)
a8[a]a16[a]a32[a]r8
\overrideStem.details.beamed-lengths=#'(8)
a8[a]
\overrideStem.details.beamed-lengths=#'(8.5)
a8[a]
\revertStem.details.beamed-lengths
a8[a]a16[a]a32[a]r16
}

[image of music]


Ambitus

Ambitus indicate pitch ranges for voices.

Accidentals only show up if they are not part of the key signature. AmbitusNoteHead grobs also have ledger lines.

\layout{
\context{
\Voice
\consists"Ambitus_engraver"
}
}
<<
\newStaff{
\relativec'{
\time2/4
c4f'
}
}
\newStaff{
\relativec'{
\time2/4
\keyd\major
cis4as'
}
}
>>

[image of music]


Ambitus after key signature

By default, ambitus are positioned at the left of the clef. The \ambitusAfter function allows for changing this placement. Syntax is \ambitusAfter grob-interface (see Graphical Object Interfaces for a list of possible values for grob-interface.)

A common use case is printing the ambitus between key signature and time signature.

\newStaff\with{
\consistsAmbitus_engraver
}\relative{
\ambitusAfterkey-signature
\keyd\major
es'8gbescisd2
}

[image of music]


Ambitus with multiple voices

Adding the Ambitus_engraver to the Staff context creates a single ambitus per staff, even in the case of staves with multiple voices.

\newStaff\with{
\consists"Ambitus_engraver"
}
<<
\newVoice\relativec''{
\voiceOne
c4ade
f1
}
\newVoice\relativec'{
\voiceTwo
es4fgas
b1
}
>>

[image of music]


Applying note head styles depending on the step of the scale

The shapeNoteStyles property can be used to define various note head styles for each step of the scale (as set by the key signature or the tonic property).

This property requires a set of symbols, which can be purely arbitrary (geometrical expressions such as triangle, cross, and xcircle are allowed) or based on old American engraving tradition (some latin note names are also allowed).

That said, to imitate old American song books, there are several predefined note head styles available through shortcut commands such as \aikenHeads or \sacredHarpHeads.

This example shows different ways to obtain shape note heads, and demonstrates the ability to transpose a melody without losing the correspondence between harmonic functions and note head styles.

fragment={
\keyc\major
c2d
e2f
g2a
b2c
}
\newStaff{
\transposecd
\relativec'{
\setshapeNoteStyles=##(doremifa
#flati)
\fragment
}
\break
\relativec'{
\setshapeNoteStyles=##(crosstrianglefa#f
mensuralxcirclediamond)
\fragment
}
}

[image of music]


Automatically changing the stem direction of the middle note based on the melody

LilyPond can alter the stem direction of the middle note on a staff so that it follows the melody, by adding the Melody_engraver to the Voice context.

The context property suspendMelodyDecisions may be used to turn off this behavior locally.

\relativec''{
\time3/4
a8bgfbg|
\setsuspendMelodyDecisions=##t
abgfbg|
\unsetsuspendMelodyDecisions
cbdcbc|
}
\layout{
\context{
\Voice
\consists"Melody_engraver"
\autoBeamOff
}
}

[image of music]


Changing ottava text

Internally, \ottava sets the properties ottavation (for example, to 8va or 8vb) and middleCPosition. To override the text of the bracket, set ottavation after invoking \ottava.

Short text is especially useful when a brief ottava is used.

{
c'2
\ottava#1
\setStaff.ottavation=#"8"
c''2
\ottava#0
c'1
\ottava#1
\setStaff.ottavation=#"Text"
c''1
}

[image of music]


Changing the ambitus gap

It is possible to change the default gap between the ambitus noteheads and the line joining them.

\layout{
\context{
\Voice
\consists"Ambitus_engraver"
}
}
\newStaff{
\time2/4
% Default setting
c'4g''
}
\newStaff{
\time2/4
\overrideAmbitusLine.gap=#0
c'4g''
}
\newStaff{
\time2/4
\overrideAmbitusLine.gap=#1
c'4g''
}
\newStaff{
\time2/4
\overrideAmbitusLine.gap=#1.5
c'4g''
}

[image of music]


Changing the interval of lines on the stave

staffLineLayoutFunction is used to change the position of notes. This snippet shows setting its value to ly:pitch-semitones in order to produce a chromatic scale with the distance between each space and line of the stave equal to one semitone.

scale=\relativec'{
a4aisbc
cis4ddise
f4fisggis
a1
}
\newStaff\with{
\remove"Accidental_engraver"
staffLineLayoutFunction=#ly:pitch-semitones
}
{
<<
\scale
\contextNoteNames{
\setprintOctaveNames=##f
\scale
}
>>
}

[image of music]


Clefs can be transposed by arbitrary amounts

Clefs can be transposed by arbitrary amounts, not just by octaves.

\relativec'{
\cleftreble
c4ccc
\clef"treble_8"
c4ccc
\clef"treble_5"
c4ccc
\clef"treble^3"
c4ccc
}

[image of music]


Coloring notes depending on their pitch

It is possible to color note heads depending on their pitch and/or their names: the function used in this example even makes it possible to distinguish enharmonics.

%Association list of pitches to colors.
#(definecolor-mapping
(list
(cons(ly:make-pitch00NATURAL)(x11-color'red))
(cons(ly:make-pitch00SHARP)(x11-color'green))
(cons(ly:make-pitch01FLAT)(x11-color'green))
(cons(ly:make-pitch02NATURAL)(x11-color'red))
(cons(ly:make-pitch02SHARP)(x11-color'green))
(cons(ly:make-pitch03FLAT)(x11-color'red))
(cons(ly:make-pitch03NATURAL)(x11-color'green))
(cons(ly:make-pitch04SHARP)(x11-color'red))
(cons(ly:make-pitch05NATURAL)(x11-color'green))
(cons(ly:make-pitch05FLAT)(x11-color'red))
(cons(ly:make-pitch06SHARP)(x11-color'red))
(cons(ly:make-pitch01NATURAL)(x11-color'blue))
(cons(ly:make-pitch03SHARP)(x11-color'blue))
(cons(ly:make-pitch04FLAT)(x11-color'blue))
(cons(ly:make-pitch05SHARP)(x11-color'blue))
(cons(ly:make-pitch06FLAT)(x11-color'blue))))
%Compare pitch and alteration (not octave).
#(define(pitch-equals?p1p2)
(and
(=(ly:pitch-alterationp1)(ly:pitch-alterationp2))
(=(ly:pitch-notenamep1)(ly:pitch-notenamep2))))
#(define(pitch-to-colorpitch)
(let((color(assocpitchcolor-mappingpitch-equals?)))
(ifcolor
(cdrcolor))))
#(define(color-noteheadgrob)
(pitch-to-color
(ly:event-property(event-causegrob)'pitch)))
\score{
\newStaff\relativec'{
\overrideNoteHead.color=#color-notehead
c8bddiseesfgaes
}
}

[image of music]


Creating a sequence of notes on various pitches

In music that contains many occurrences of the same sequence of notes at different pitches, the following music function may prove useful. It takes a note, of which only the pitch is used.

This example creates the rhythm used throughout Mars, from Gustav Holst’s The Planets.

rhythm=
#(define-music-function(p)(ly:pitch?)
"Make the rhythm in Mars (the Planets) at the given pitch"
#{\tuplet3/2{$p888}44884#})
\newStaff{
\time5/4
\rhythmc'
\rhythmc''
\rhythmg
}

[image of music]


Creating custom key signatures

LilyPond supports custom key signatures. In this example, print for D minor with an extended range of printed flats.

\newStaff\with{
\overrideStaffSymbol.line-count=#8
\overrideKeySignature.flat-positions=#'((-7.6))
\overrideKeyCancellation.flat-positions=#'((-7.6))
% presumably sharps are also printed in both octaves
\overrideKeySignature.sharp-positions=#'((-6.7))
\overrideKeyCancellation.sharp-positions=#'((-6.7))
\overrideClef.stencil=#
(lambda(grob)(grob-interpret-markupgrob
#{\markup\combine
\musicglyph"clefs.C"
\translate#'(-3.-2)
\musicglyph"clefs.F"
#}))
clefPosition=#3
middleCPosition=#3
middleCClefPosition=#3
}
{
\keyd\minor
fbes,fbes,
}

[image of music]


Direction of merged ’fa’ shape note heads

Using property NoteCollision.fa-merge-direction, the direction of ‘fa’ shape note heads (‘fa’, ‘faThin’, etc.) can be controlled independently of the stem direction if two voices with the same pitch and different stem directions are merged. If this property is not set, the ‘down’ glyph variant is used.

{
\clefbass
<<{\aikenHeads
f2
\overrideStaff.NoteCollision.fa-merge-direction=#UP
f2}
\\{\aikenHeads
f2
f2}
>>
}

[image of music]


Force a cancellation natural before accidentals

The following example shows how to force a natural sign before an accidental.

\relativec'{
\keyes\major
bescdes
\tweakAccidental.restore-first##t
eis
}

[image of music]


Forcing a clef symbol to be displayed

When a clef sign has already been displayed and it has not been changed to a different clef, then repeating the \clef command will be ignored by LilyPond, since it is not a change of clef. It is possible to force the clef to be redisplayed using the command \set Staff.forceClef = ##t.

\relativec'{
\cleftreble
c1
\cleftreble
c1
\setStaff.forceClef=##t
c1
\cleftreble
c1
}

[image of music]


Generating random notes

This Scheme-based snippet generates 24 random notes (or as many as required), based on the current time (or any randomish number specified instead, in order to obtain the same random notes each time): i.e., to get different random note patterns, just change this number.

\score{
{
$(let((random-state(seed->random-state(current-time))))
(make-sequential-music
(map(lambda(x)
(let((idx(random12random-state)))
(make-event-chord
(list
(make-music'NoteEvent
'duration(ly:make-duration201/1)
'pitch(ly:make-pitch
(quotientidx7)
(remainderidx7)
0))))))
(make-list24))))
}
}

[image of music]


Hiding accidentals on tied notes at the start of a new system

This shows how to hide accidentals on tied notes at the start of a new system.

\relativec''{
\overrideAccidental.hide-tied-accidental-after-break=##t
cis1~cis~
\break
cis
}

[image of music]


Keep change clefs full sized

When a clef is changed, the clef sign displayed is smaller than the initial clef. This can be overridden with full-size-change.

\relativec'{
\clef"treble"
c1
\clef"bass"
c1
\clef"treble"
c1
\overrideStaff.Clef.full-size-change=##t
\clef"bass"
c1
\clef"treble"
c1
\revertStaff.Clef.full-size-change
\clef"bass"
c1
\clef"treble"
c1
}

[image of music]


Makam example

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.

% Initialize makam settings
\include"makam.ly"
\relativec'{
\setStaff.keyAlterations=#`((6.,(-KOMA))(3.,BAKIYE))
c4ccdbfk
gbm4gfcgfbefk
fk4dbccc
}

[image of music]


Modifying the Ottava spanner slope

It is possible to change the slope of the Ottava spanner.

\relativec''{
\overrideStaff.OttavaBracket.stencil=#ly:line-spanner::print
\overrideStaff.OttavaBracket.bound-details=
#`((left.((Y.0)
(attach-dir.,LEFT)
(padding.0)
(stencil-align-dir-y.,CENTER)))
(right.((Y.5.0); Change the number here
(padding.0)
(attach-dir.,RIGHT)
(text.,(make-draw-dashed-line-markup
(cons0-1.2))))))
\overrideStaff.OttavaBracket.left-bound-info=
#ly:horizontal-line-spanner::calc-left-bound-info-and-text
\overrideStaff.OttavaBracket.right-bound-info=
#ly:horizontal-line-spanner::calc-right-bound-info
\ottava#1
c1
c'''1
}

[image of music]


Non-traditional key signatures

The commonly used \key command sets the keyAlterations property, in the Staff context.

To create non-standard key signatures, set this property directly. The format of this command is a list:

\set Staff.keyAlterations =
 #`(((octave . step) . alter) ((octave . step) . alter) ...)

where, for each element in the list, octave specifies the octave (0 being the octave from middle C to the B above), step specifies the note within the octave (0 means C and 6 means B), and alter is ,SHARP ,FLAT ,DOUBLE-SHARP etc.

Alternatively, using the more concise format for each item in the list (step . alter) specifies the same alteration holds in all octaves.

For microtonal scales where a “sharp” is not 100 cents, alter refers to the alteration as a proportion of a 200-cent whole tone.

\include"arabic.ly"
\relativedo'{
\setStaff.keyAlterations=#`((0.,SEMI-FLAT)
(1.,SEMI-FLAT)
(2.,FLAT)
(5.,FLAT)
(6.,SEMI-FLAT))
%\set Staff.extraNatural = ##f
rereb\dwnrebresd
doddobdosd\dwndob|
dobsbdodsddodo|
}

[image of music]


Numbers as easy note heads

Easy notation note heads use the note-names property of the NoteHead object to determine what appears inside the note head. By overriding this property, it is possible to print numbers representing the scale-degree.

A simple engraver can be created to do this for every note head object it sees.

#(defineEz_numbers_engraver
(make-engraver
(acknowledgers
((note-head-interfaceengravergrobsource-engraver)
(let*((context(ly:translator-contextengraver))
(tonic-pitch(ly:context-propertycontext'tonic))
(tonic-name(ly:pitch-notenametonic-pitch))
(grob-pitch
(ly:event-property(event-causegrob)'pitch))
(grob-name(ly:pitch-notenamegrob-pitch))
(delta(modulo(-grob-nametonic-name)7))
(note-names
(make-vector7(number->string(1+delta)))))
(ly:grob-set-property!grob'note-namesnote-names))))))
#(set-global-staff-size26)
\layout{
ragged-right=##t
\context{
\Voice
\consists\Ez_numbers_engraver
}
}
\relativec'{
\easyHeadsOn
c4def
g4abc\break
\keya\major
a,4bcisd
e4fisgisa\break
\keyd\dorian
d,4efg
a4bcd
}

[image of music]


Orchestra, choir and piano template

This template demonstrates the use of nested StaffGroup and GrandStaff contexts to sub-group instruments of the same type together, and a way to use \transpose so that variables hold music for transposing instruments at concert pitch.

#(set-global-staff-size17)
\paper{
indent=3.0\cm% add space for instrumentName
short-indent=1.5\cm% add less space for shortInstrumentName
}
fluteMusic=\relativec'{\keyg\majorg'1b}
% Pitches as written on a manuscript for Clarinet in A
% are transposed to concert pitch.
clarinetMusic=\transposec'a
\relativec''{\keybes\majorbes1d}
trumpetMusic=\relativec{\keyg\majorg''1b}
% Key signature is often omitted for horns
hornMusic=\transposec'f
\relativec{d'1fis}
percussionMusic=\relativec{\keyg\majorg1b}
sopranoMusic=\relativec''{\keyg\majorg'1b}
sopranoLyrics=\lyricmode{Lyr--ics}
altoIMusic=\relativec'{\keyg\majorg'1b}
altoIIMusic=\relativec'{\keyg\majorg'1b}
altoILyrics=\sopranoLyrics
altoIILyrics=\lyricmode{Ah--ah}
tenorMusic=\relativec'{\clef"treble_8"\keyg\majorg1b}
tenorLyrics=\sopranoLyrics
pianoRHMusic=\relativec{\keyg\majorg''1b}
pianoLHMusic=\relativec{\clefbass\keyg\majorg1b}
violinIMusic=\relativec'{\keyg\majorg'1b}
violinIIMusic=\relativec'{\keyg\majorg'1b}
violaMusic=\relativec{\clefalto\keyg\majorg'1b}
celloMusic=\relativec{\clefbass\keyg\majorg1b}
bassMusic=\relativec{\clef"bass_8"\keyg\majorg,1b}
\score{
<<
\newStaffGroup="StaffGroup_woodwinds"<<
\newStaff="Staff_flute"\with{instrumentName="Flute"}
\fluteMusic
\newStaff="Staff_clarinet"\with{
instrumentName=\markup{\concat{"Clarinet in B"\flat}}
}
% Declare that written Middle C in the music
% to follow sounds a concert B flat, for
% output using sounded pitches such as MIDI.
%\transposition bes
% Print music for a B-flat clarinet
\transposebesc'\clarinetMusic
>>
\newStaffGroup="StaffGroup_brass"<<
\newStaff="Staff_hornI"\with{instrumentName="Horn in F"}
% \transposition f
\transposefc'\hornMusic
\newStaff="Staff_trumpet"\with{instrumentName="Trumpet in C"}
\trumpetMusic
>>
\newRhythmicStaff="RhythmicStaff_percussion"
\with{instrumentName="Percussion"}
<<
\percussionMusic
>>
\newPianoStaff\with{instrumentName="Piano"}
<<
\newStaff{\pianoRHMusic}
\newStaff{\pianoLHMusic}
>>
\newChoirStaff="ChoirStaff_choir"<<
\newStaff="Staff_soprano"\with{instrumentName="Soprano"}
\newVoice="soprano"
\sopranoMusic
\newLyrics\lyricsto"soprano"{\sopranoLyrics}
\newGrandStaff="GrandStaff_altos"
\with{\acceptsLyrics}<<
\newStaff="Staff_altoI"\with{instrumentName="Alto I"}
\newVoice="altoI"
\altoIMusic
\newLyrics\lyricsto"altoI"{\altoILyrics}
\newStaff="Staff_altoII"\with{instrumentName="Alto II"}
\newVoice="altoII"
\altoIIMusic
\newLyrics\lyricsto"altoII"{\altoIILyrics}
>>
\newStaff="Staff_tenor"\with{instrumentName="Tenor"}
\newVoice="tenor"
\tenorMusic
\newLyrics\lyricsto"tenor"{\tenorLyrics}
>>
\newStaffGroup="StaffGroup_strings"<<
\newGrandStaff="GrandStaff_violins"<<
\newStaff="Staff_violinI"\with{instrumentName="Violin I"}
\violinIMusic
\newStaff="Staff_violinII"\with{instrumentName="Violin II"}
\violinIIMusic
>>
\newStaff="Staff_viola"\with{instrumentName="Viola"}
\violaMusic
\newStaff="Staff_cello"\with{instrumentName="Cello"}
\celloMusic
\newStaff="Staff_bass"\with{instrumentName="Double Bass"}
\bassMusic
>>
>>
\layout{}
}

[image of music]


Preventing extra naturals from being automatically added

In accordance with traditional typesetting rules, a natural sign is printed before a sharp or flat if a previous double sharp or flat on the same note is canceled. To change this behavior to contemporary practice, set the extraNatural property to f in the Staff context.

\relativec''{
aeses4aesaisa
\setStaff.extraNatural=##f
aeses4aesaisa
}

[image of music]


Preventing natural signs from being printed when the key signature changes

When the key signature changes, natural signs are automatically printed to cancel any accidentals from previous key signatures. This may be prevented by setting to f the printKeyCancellation property in the Staff context.

\relativec'{
\keyd\major
a4bcisd
\keyg\minor
a4bescd
\setStaff.printKeyCancellation=##f
\keyd\major
a4bcisd
\keyg\minor
a4bescd
}

[image of music]


Quoting another voice with transposition

Quotations take into account the transposition of both source and target. In this example, all instruments play sounding middle C; the target is an instrument in F. The target part may be transposed using \transpose. In this case, all the pitches (including the quoted ones) are transposed.

\addQuoteclarinet{
\transpositionbes
\repeatunfold8{d'16d'd'8}
}
\addQuotesax{
\transpositiones'
\repeatunfold16{a8}
}
quoteTest={
% french horn
\transpositionf
g'4
<<\quoteDuring"clarinet"{\skip4}s4^"clar.">>
<<\quoteDuring"sax"{\skip4}s4^"sax.">>
g'4
}
{
\newStaff\with{
instrumentName=\markup{\column{Horn"in F"}}
}
\quoteTest
\transposec'd'<<\quoteTests4_"up a tone">>
}

[image of music]


Separating key cancellations from key signature changes

By default, the accidentals used for key cancellations are placed adjacent to those for key signature changes. This behavior can be changed by overriding the 'break-align-orders property of the BreakAlignment grob.

The value of 'break-align-orders is a vector of length 3, with quoted lists of breakable items as elements. This example only modifies the second list, moving key-cancellation before staff-bar; by modifying the second list, break alignment behavior only changes in the middle of a system, not at the beginning or the end.

\newStaff{
\overrideScore.BreakAlignment.break-align-orders=
##((left-edgeambitusbreathing-signclefstaff-bar
key-cancellationkey-signaturetime-signaturecustos)
(left-edgeambitusbreathing-signclefkey-cancellation
staff-barkey-signaturetime-signaturecustos)
(left-edgeambitusbreathing-signclefkey-cancellation
key-signaturestaff-bartime-signaturecustos))
\keydes\major
c'1
\bar"||"
\keybes\major
c'1
}

[image of music]


Transposing pitches with minimum accidentals ("Smart" transpose)

This example uses some Scheme code to enforce enharmonic modifications for notes in order to have the minimum number of accidentals. In this case, the following rules apply:

Double accidentals should be removed

B sharp -> C

E sharp -> F

C flat -> B

F flat -> E

In this manner, the most natural enharmonic notes are chosen.

#(define(naturalize-pitchp)
(let((o(ly:pitch-octavep))
(a(*4(ly:pitch-alterationp)))
;; alteration, a, in quarter tone steps,
;; for historical reasons
(n(ly:pitch-notenamep)))
(cond
((and(>a1)(or(eqv?n6)(eqv?n2)))
(set!a(-a2))
(set!n(+n1)))
((and(<a-1)(or(eqv?n0)(eqv?n3)))
(set!a(+a2))
(set!n(-n1))))
(cond
((>a2)(set!a(-a4))(set!n(+n1)))
((<a-2)(set!a(+a4))(set!n(-n1))))
(if(<n0)(begin(set!o(-o1))(set!n(+n7))))
(if(>n6)(begin(set!o(+o1))(set!n(-n7))))
(ly:make-pitchon(/a4))))
#(define(naturalizemusic)
(let((es(ly:music-propertymusic'elements))
(e(ly:music-propertymusic'element))
(p(ly:music-propertymusic'pitch)))
(if(pair?es)
(ly:music-set-property!
music'elements
(mapnaturalizees)))
(if(ly:music?e)
(ly:music-set-property!
music'element
(naturalizee)))
(if(ly:pitch?p)
(begin
(set!p(naturalize-pitchp))
(ly:music-set-property!music'pitchp)))
music))
naturalizeMusic=
#(define-music-function(m)
(ly:music?)
(naturalizem))
music=\relativec'{c4deg}
\score{
\newStaff{
\transposecais{\music}
\naturalizeMusic\transposecais{\music}
\transposecdeses{\music}
\naturalizeMusic\transposecdeses{\music}
}
\layout{}
}

[image of music]


Turkish Makam example

This template uses the start of a well-known Turkish Saz Semai that is familiar in the repertoire in order to illustrate some of the elements of Turkish music notation.

\paper{tagline=##f}
% Initialize makam settings
\include"turkish-makam.ly"
\header{
title="Hüseyni Saz Semaisi"
composer="Lavtacı Andon"
}
\relative{
\setStaff.extraNatural=##f
\setStaff.autoBeaming=##f
\keya\huseyni
\time10/8
a'4g'16[fb]e8.[d16]d[cde]c[dc8]bfc|
a16[bfca8]bfcc16[dc8]d16[ed8]e4fb8|
d4a'8a16[gfbe]fb8[g]a8.[b16]a16[g]|
g4g16[fb]fb8.[e16]e[gfbe]e4r8|
}

[image of music]


Tweaking clef properties

Changing the Clef glyph, its position, or the ottavation does not change the position of subsequent notes on the staff. To get key signatures on their correct staff lines middleCClefPosition must also be specified, with positive or negative values moving middle C up or down respectively, relative to the staff’s center line.

For example, \clef "treble_8" is equivalent to setting the clefGlyph, clefPosition (the vertical position of the clef itself on the staff), middleCPosition and clefTransposition. Note that when any of these properties (except middleCPosition) are changed a new clef symbol is printed.

The following examples show the possibilities when setting these properties manually. On the first line, the manual changes preserve the standard relative positioning of clefs and notes, whereas on the second line, they do not.

{
% The default treble clef
\keyf\major
c'1
% The standard bass clef
\setStaff.clefGlyph=#"clefs.F"
\setStaff.clefPosition=#2
\setStaff.middleCPosition=#6
\setStaff.middleCClefPosition=#6
\keyg\major
c'1
% The baritone clef
\setStaff.clefGlyph=#"clefs.C"
\setStaff.clefPosition=#4
\setStaff.middleCPosition=#4
\setStaff.middleCClefPosition=#4
\keyf\major
c'1
% The standard choral tenor clef
\setStaff.clefGlyph=#"clefs.G"
\setStaff.clefPosition=#-2
\setStaff.clefTransposition=#-7
\setStaff.middleCPosition=#1
\setStaff.middleCClefPosition=#1
\keyf\major
c'1
% A non-standard clef
\setStaff.clefPosition=#0
\setStaff.clefTransposition=#0
\setStaff.middleCPosition=#-4
\setStaff.middleCClefPosition=#-4
\keyg\major
c'1\break
% The following clef changes do not preserve
% the normal relationship between notes, key signatures
% and clefs:
\setStaff.clefGlyph=#"clefs.F"
\setStaff.clefPosition=#2
c'1
\setStaff.clefGlyph=#"clefs.G"
c'1
\setStaff.clefGlyph=#"clefs.C"
c'1
\setStaff.clefTransposition=#7
c'1
\setStaff.clefTransposition=#0
\setStaff.clefPosition=#0
c'1
% Return to the normal clef:
\setStaff.middleCPosition=#0
c'1
}

[image of music]


Using autochange with more than one voice

Using autochange with more than one voice.

\score
{
\newPianoStaff
<<
\newStaff="up"{
<<
\setTiming.beamExceptions=#'()
\setTiming.beatStructure=#'(4)
\newVoice{
\voiceOne
\autoChange
\relativec'{
g8abcdefg
g,8abcdefg
}
}
\newVoice{
\voiceTwo
\autoChange
\relativec'{
g8abcdefg
g,,8abcdefg
}
}
>>
}
\newStaff="down"{
\clefbass
}
>>
}

[image of music]


<< Back to Documentation Index

LilyPond — Snippets v2.24.4 (stable-branch).

AltStyle によって変換されたページ (->オリジナル) /