music21.volpiano

The Volpiano font is a specialized font for encoding Western Plainchant easily with immediate visual feedback (see the CANTUS database).

This module parses chants encoded in Volpiano and can generate Volpiano from any music21 Stream.

This module will move to a medren repository hopefully by v.7

ErrorLevel

class music21.volpiano.ErrorLevel

An enumeration.

Functions

music21.volpiano.fromStream(s, *, layoutToBreaks=False)

Convert a Stream to Volpiano.

These tests show how the same input converts back out:

>>> input = '1--c--d---f--d---ed--c--d---f---g--h--j---hgf--g--h---'
>>> veniSancti = volpiano.toPart(input)
>>> volpiano.fromStream(veniSancti)
'1---c-d-f-d-ed-c-d-f-g-h-j-hg-f-g-h-'
>>> breakTest = volpiano.toPart('1---e-E--')
>>> volpiano.fromStream(breakTest)
'1---e-E-'
>>> accTest = volpiano.toPart('1---e--we--e--We--e')
>>> volpiano.fromStream(accTest)
'1---e-we-e-We-e-'
music21.volpiano.toPart(volpianoText, *, breaksToLayout=False)

Returns a music21 Part from volpiano text.

>>> veniSancti = volpiano.toPart('1---c--d---f--d---ed--c--d---f'
...                              + '---g--h--j---hgf--g--h---')
>>> veniSancti.show('text')
{0.0} <music21.stream.Measure 0 offset=0.0>
    {0.0} <music21.clef.TrebleClef>
    {0.0} <music21.note.Note C>
    {1.0} <music21.note.Note D>
    {2.0} <music21.note.Note F>
    {3.0} <music21.note.Note D>
    {4.0} <music21.note.Note E>
    {5.0} <music21.note.Note D>
    {6.0} <music21.volpiano.Neume <music21.note.Note E><music21.note.Note D>>
    {6.0} <music21.note.Note C>
    {7.0} <music21.note.Note D>
    {8.0} <music21.note.Note F>
    {9.0} <music21.note.Note G>
    {10.0} <music21.note.Note A>
    {11.0} <music21.note.Note B>
    {12.0} <music21.note.Note A>
    {13.0} <music21.note.Note G>
    {14.0} <music21.note.Note F>
    {15.0} <music21.volpiano.Neume <music21.note.Note A><music21.note.Note G>>
    {15.0} <music21.note.Note G>
    {16.0} <music21.note.Note A>

Clefs!

>>> clefTest = volpiano.toPart('1---c--2---c')
>>> clefTest.show('text')
{0.0} <music21.stream.Measure 0 offset=0.0>
    {0.0} <music21.clef.TrebleClef>
    {0.0} <music21.note.Note C>
    {1.0} <music21.clef.BassClef>
    {1.0} <music21.note.Note E>
>>> for n in clefTest.recurse().notes:
...     n.nameWithOctave
'C4'
'E2'

Flats and Naturals:

>>> accTest = volpiano.toPart('1---e--we--e--We--e')
>>> [n.name for n in accTest.recurse().notes]
['E', 'E-', 'E-', 'E', 'E']

Breaks and barlines

>>> breakTest = volpiano.toPart('1---e-7-e-77-e-777-e-3-e-4')
>>> breakTest.show('text')
{0.0} <music21.stream.Measure 0 offset=0.0>
    {0.0} <music21.clef.TrebleClef>
    {0.0} <music21.note.Note E>
    {1.0} <music21.volpiano.LineBreak object at 0x105250fd0>
    {1.0} <music21.note.Note E>
    {2.0} <music21.volpiano.PageBreak object at 0x105262128>
    {2.0} <music21.note.Note E>
    {3.0} <music21.volpiano.ColumnBreak object at 0x105262240>
    {3.0} <music21.note.Note E>
    {4.0} <music21.bar.Barline type=regular>
{4.0} <music21.stream.Measure 0 offset=4.0>
    {0.0} <music21.note.Note E>
    {1.0} <music21.bar.Barline type=double>

As layout objects using breaksToLayout=True

>>> breakTest = volpiano.toPart('1---e-7-e-77-e-777-e-3-e-4', breaksToLayout=True)
>>> breakTest.show('text')
{0.0} <music21.stream.Measure 0 offset=0.0>
    {0.0} <music21.clef.TrebleClef>
    {0.0} <music21.note.Note E>
    {1.0} <music21.layout.SystemLayout>
    {1.0} <music21.note.Note E>
    {2.0} <music21.layout.PageLayout>
    {2.0} <music21.note.Note E>
    {3.0} <music21.volpiano.ColumnBreak object at 0x105262240>
    {3.0} <music21.note.Note E>
    {4.0} <music21.bar.Barline type=regular>
{4.0} <music21.stream.Measure 0 offset=4.0>
    {0.0} <music21.note.Note E>
    {1.0} <music21.bar.Barline type=double>

Liquescence test:

>>> breakTest = volpiano.toPart('1---e-E-')
>>> breakTest.recurse().notes[0].editorial.misc
{'liquescence': False}
>>> breakTest.recurse().notes[0].notehead
'normal'
>>> breakTest.recurse().notes[1].editorial.misc
{'liquescence': True}
>>> breakTest.recurse().notes[1].notehead
'x'

Changed in v5.7 – corrected spelling of liquescence.