LyricSyllable

LyricSyllable(duration: Duration | None = None, word: Word, index: int = 0)

One sung syllable: the index-th syllable of word.

The syllables of a word share one Word, so the text, the position in the word and the lexical stress are all read from it. Syllables are placed in sequence with NEXT edges, and a LYRIC edge from a note marks the syllable’s onset: the notes that go on sustaining it (a melisma) carry no edge, and a note may begin several syllables (a reciting tone). The duration is normally None: the sung length is the notes’.

>>> word = Word.from_string("Al-le-'lu-ia")
>>> lu = LyricSyllable(word=word, index=2)
>>> lu.text, lu.placement, lu.lexical_stress
('lu', <SyllablePlacement.MIDDLE: 'middle'>, <LexicalStress.PRIMARY: 'primary'>)
>>> [str(LyricSyllable(word=word, index=i)) for i in range(4)]
['Al -', '- le -', '- lu -', '- ia']
>>> LyricSyllable(word=word, index=4)
Traceback (most recent call last):
...
openmusickit.errors.LyricConsistencyError: Index 4 is out of range for Word('Al', 'le', 'lu', 'ia', stress={2: 'primary'}).

Attributes

Name Description
meta
id
duration
word
index
text
lexical_stress
placement >>> LyricSyllable(word=Word([“sing”])).placement

Methods

Name Description
__setattr__
alter_duration
syl_str The syllable with the hyphens that connect it to its neighbours.
__str__
__repr__

__setattr__

__setattr__(name: str, value: Any)

alter_duration

alter_duration(operation: Callable[[Duration, Any], Duration], operand: Any)

syl_str

syl_str(hyphen: str = '-')

The syllable with the hyphens that connect it to its neighbours.

__str__

__str__()

__repr__

__repr__()