pyampact.symbolicUtils.addMEINote

pyampact.symbolicUtils.addMEINote(note, parent, syl=None)[source]

Add a note element to an MEI parent element from a music21 note object.

This function creates a new ‘note’ subelement under the given parent element, and sets its attributes based on the properties of the given note. It also handles grace notes, accidentals, lyrics, and dynamics if any of these are found on the note.

Parameters: note (music21.note.Note): The note to add. The note’s properties (octave,

step, id, duration, pitch, lyric, expressions) are used to set the attributes of the new MEI element.

parent (xml.etree.ElementTree.Element): The parent element to which the new

‘note’ element will be added.

syl (str, optional): A syllable to add to the note as a ‘syl’ element. If

not provided, the note’s lyric property is used.

Returns: xml.etree.ElementTree.Element: The new ‘note’ element.