User’s Guide, Chapter 32: Articulations

Articulations are elements attached usually to Notes that specify how the note should be played. In music21 we use the term articulation also to refer to indications that are specific to instruments, such as bowing or fingering information. They all live in the music21.articulations module and start with the class Articulation.

from music21 import *

art = articulations.Articulation()

All articulations have a .placement attribute which can be ‘above’, ‘below’, or None.

art.placement = 'above'

All articulations have additional .style information, which we will discuss in more depth later: = 20

Now, most of the time you won’t want any articulation, you will want the specific articulation such as Staccato, Accent, etc. So there are classes for each of them:

stac = articulations.Staccato()
acc = articulations.Accent()

To make an articulation display, attach it to the .articulations list on a Note:

n1 = note.Note('A4')

Because .articulations is a list, a note may have multiple articulations:

doit = articulations.Doit()

Some articulations affect the length of the note:


The 0.7 in this case indicates that the note should be played for 70% of its normal length.

Others affect the volume:


Here, instead of 10% of the normal volume (that’d be a weird accent), it means 10% more than its normal volume. This inconsistency may be fixed in a later version.

Many articulations have additional parameters. StrongAccent for instance can point up or down:

sacc = articulations.StrongAccent()
sacc.placement = 'above'

n2 = note.Note('A4')

sacc2 = articulations.StrongAccent()
sacc2.pointDirection = 'down'
sacc2.placement = 'below'

n3 = note.Note('A4')

m = stream.Measure()
m.append([n2, n3])

Unfortunately, neither MuseScore (which generates these images) nor Finale respect .placement or pointDirection at this time.

As we saw in Chapter 13, when a note is split, its articulations go either on the first note of the split, the last, or all the notes:

n12, n22 = n1.splitAtQuarterLength(0.5)
m2 = stream.Measure()
m2.append([n12, n22])

This property is determined by the .tieAttach value for an articulation:

acc.tieAttach, stac.tieAttach
 ('first', 'last')

Breath marks can have a .symbol of ‘comma’ or ‘tick’:

bm2 = articulations.BreathMark()
bm2.symbol = 'comma'

bm3 = articulations.BreathMark()
bm3.symbol = 'tick'

Again, unfortunately, some MusicXML readers do not respect this value.

MusicXML distinguishes articulations from technical indications, but in music21 these are all in the articulations module and stored in the .articulations list. They do, however, have TechnicalIndication in their classes. A Fingering is something that MusicXML considers a TechnicalIndication:

f = articulations.Fingering(5)
n3.articulations = []

Music21 can represent all the information in MusicXML articulations, and every MusicXML technical indication with the exception of guitar information, arrows, and woodwind/brass fingering.

This is a short chapter, because once you know a bit about articulations, you’ll just want to spend your time in the music21.articulations module reference to learn more about them. But there is a related concept called “expressions” that we will learn about in Chapter 33: Expressions and Ornaments when it is completed.

For now, the next completed chapter is Chapter 44: Advanced Graphing (Axes, Plots, and Graphs).