TonalObject
TonalObject()Mixin for objects with tonal content that a Tone -> Tone operation can be pushed through (notes, chord symbols, key signatures, …).
OmkGraph.transform_tones applies one operation to every TonalObject on a span; each object decides what its tonal content is.
>>> from openmusickit.objects.note_event import NoteEvent
>>> from openmusickit.systems.wsmn.tonal.symbols import C, D, M2
>>> from openmusickit.systems.wsmn.tonal.tonal_vector import TonalVector
>>> note = NoteEvent(tones={C})
>>> isinstance(note, TonalObject)
True
>>> note.transform_tones(TonalVector.transpose, M2)
>>> note.tones == {D}
TrueAttributes
| Name | Description |
|---|---|
__slots__ |
Methods
| Name | Description |
|---|---|
| transform_tones | Replaces this object’s tonal content, in place, with the result of |
transform_tones
transform_tones(operation: Callable[..., Tone], *args, **kwargs)Replaces this object’s tonal content, in place, with the result of applying operation(tone, *args, **kwargs) to it.