ChordEvent
ChordEvent(duration: Duration | None = None, chord: ToneCollection)A ChordEvent is a SequentialEvent containing a ToneCollection, representing a named set of tones. ChordEvents are typically represented in a score as a single symbol (such as in a lead sheet or chord chart), with the specific voicing or realization of the chord left to the performer or arranger.
In most WSMN contexts, a ChordEvent will use a systems.wsmn.tonal.Chord as its ToneCollection, but other systems may use different ToneCollection types.
>>> from openmusickit.systems.wsmn.temporal.symbols import whole
>>> from openmusickit.systems.wsmn.tonal.symbols import C, maj
>>> event = ChordEvent(chord=C(maj), duration=whole)
>>> str(event.chord), event.duration
('C', MetricalDuration(1, 1))Attributes
| Name | Description |
|---|---|
__slots__ |
|
| meta | |
| id | |
| duration | |
| chord |
Methods
| Name | Description |
|---|---|
__setattr__ |
|
| alter_duration | |
| transform_tones | Replaces the chord with self.chord.transform(operation, *args, **kwargs). |
__setattr__
__setattr__(name: str, value: Any)alter_duration
alter_duration(operation: Callable[[Duration, Any], Duration], operand: Any)transform_tones
transform_tones(operation: Callable[..., Tone], *args, **kwargs)Replaces the chord with self.chord.transform(operation, *args, **kwargs).
>>> from openmusickit.systems.wsmn.tonal.symbols import C, maj, M3
>>> from openmusickit.systems.wsmn.tonal.tonal_vector import TonalVector
>>>
>>> event = ChordEvent(chord=C(maj))
>>> event.transform_tones(TonalVector.transpose, M3)
>>> str(event.chord)
'E'