Getting started¶
Let’s convert a simple Volpiano chant, and show it as html. Note that this only works if you have the Volpiano typeface installed.
from music21 import converter
import chant21
ch = converter.parse('cantus: 1---f-g--h---g--f--h---3/Abra cadabra')
ch.show('html')
Section
conversion | {'originalFormat': 'cantus/volpiano', 'converter': 'chant21', 'version': '0.4.6'} |
chant21version | 0.4.6 |
We have included the lyrics after the slash: chant21 can automatically align Latin text to the music.
When chant21 converts a chant, the result is a chant21.chant.Chant
object. This is a music21 object (a music21.part.Part
) tweaked to
better represent chants by retaining the exact division in sections, words,
syllables and neumes using other custom music21 elements. You can inspect the
structure using ch.show('text')
:
ch.show('text')
{0.0} <chant21.chant.Section>
{0.0} <chant21.chant.Word>
{0.0} <chant21.chant.Syllable>
{0.0} <chant21.chant.Clef>
{0.0} <chant21.chant.Word>
{0.0} <chant21.chant.Syllable lyrics=A>
{0.0} <chant21.chant.Neume>
{0.0} <chant21.chant.Note F>
{1.0} <chant21.chant.Neume>
{0.0} <chant21.chant.Note G>
{2.0} <chant21.chant.Syllable lyrics=bra>
{0.0} <chant21.chant.Neume>
{0.0} <chant21.chant.Note A>
{3.0} <chant21.chant.Word>
{0.0} <chant21.chant.Syllable lyrics=ca>
{0.0} <chant21.chant.Neume>
{0.0} <chant21.chant.Note G>
{1.0} <chant21.chant.Syllable lyrics=da>
{0.0} <chant21.chant.Neume>
{0.0} <chant21.chant.Note F>
{2.0} <chant21.chant.Syllable lyrics=bra>
{0.0} <chant21.chant.Neume>
{0.0} <chant21.chant.Note A>
{6.0} <chant21.chant.Word>
{0.0} <chant21.chant.Syllable>
{0.0} <chant21.chant.PausaMajor>
Chants imported from the gabc format are represented in the same way:
ch2 = converter.parse('gabc: (c2) a(f)b(g) (::)')
ch2.show('html')
ch2.show('text')
Section
conversion | {'originalFormat': 'gabc', 'converter': 'chant21', 'version': '0.4.6'} |
chant21version | 0.4.6 |
{0.0} <chant21.chant.Section>
{0.0} <chant21.chant.Word>
{0.0} <chant21.chant.Syllable>
{0.0} <chant21.chant.Clef>
{0.0} <chant21.chant.Word>
{0.0} <chant21.chant.Syllable lyrics=a>
{0.0} <chant21.chant.Neume>
{0.0} <chant21.chant.Note C>
{1.0} <chant21.chant.Syllable lyrics=b>
{0.0} <chant21.chant.Neume>
{0.0} <chant21.chant.Note D>
{2.0} <chant21.chant.Word>
{0.0} <chant21.chant.Syllable>
{0.0} <chant21.chant.PausaFinalis>
You can of course also convert complete files. A handful of GABC and Cantus examples are included in chant21. Here is one:
from chant21.examples import kyrie as kyrieFilename
kyrie = converter.parse(kyrieFilename)
kyrie.show('html')
Section
Section
Section
Section
conversion | {'originalFormat': 'gabc', 'converter': 'chant21', 'version': '0.4.6'} |
name | Kyrie (ad lib.) X. - Orbis Factor |
office-part | Kyriale |
mode | 1 |
book | Graduale Romanum, 1961, p. 82* & The Liber Usualis, 1961, p. 85 |
transcriber | Andrew Hinkley |
commentary | (X.) c. |
chant21version | 0.4.6 |