mutwo.music_events

Event classes which are designated for musical usage.

Object

Documentation

mutwo.music_events.NoteLike

NoteLike can be a tone, chord, percussion note or rest.

class NoteLike(pitch_list=[], duration=1, volume='mf', grace_note_consecution=None, after_grace_note_consecution=None, playing_indicator_collection=None, notation_indicator_collection=None, lyric=DirectLyric(), instrument_list=[], *, tempo=None, tag=None)[source]

Bases: Chronon

NoteLike can be a tone, chord, percussion note or rest.

Parameters:

mutwo.music doesn’t differentiate between tones, chords and rests, but rather simply implements one general class that can represent any of the mentioned definitions (e.g. a NoteLike with several pitches may be called a ‘chord’ and a NoteLike with only one pitch may be called a ‘tone’).

Example:

>>> from mutwo import music_parameters
>>> from mutwo import music_events
>>> tone = music_events.NoteLike(music_parameters.WesternPitch('a'), 1, 1)
>>> other_tone = music_events.NoteLike('3/2', 1, 0.5)
>>> chord = music_events.NoteLike(
...     [music_parameters.WesternPitch('a'), music_parameters.JustIntonationPitch('3/2')], 1, 1
... )
>>> other_chord = music_events.NoteLike('c4 dqs3 10/7', 1, 3)

Public Data Attributes:

pitch_list

The pitch or pitches of the event.

volume

The Volume of the event.

grace_note_consecution

Consecution before NoteLike

after_grace_note_consecution

Consecution after NoteLike

playing_indicator_collection

notation_indicator_collection

Inherited from Chronon

parameter_to_exclude_from_representation_tuple

duration

The duration of an event.

Inherited from Event

duration

The duration of an event.

tempo

The tempo of an event.

Public Methods:

Inherited from Chronon

destructive_copy()

Adapted deep copy method that returns a new object for every leaf.

get_parameter(parameter_name[, flat, ...])

Return event attribute with the entered name.

set_parameter(*args, **kwargs)

Sets event parameter to new value.

metrize()

Apply tempo of event on itself

cut_out(start, end)

Time-based slicing of the respective event.

cut_off(start, end)

Time-based deletion / shortening of the respective event.

Inherited from Event

destructive_copy()

Adapted deep copy method that returns a new object for every leaf.

set(attribute_name, value)

Set an attribute of the object to a specific value

get_parameter(parameter_name[, flat, ...])

Return event attribute with the entered name.

set_parameter(parameter_name, object_or_function)

Sets parameter to new value for all children events.

mutate_parameter(parameter_name, function)

Mutate parameter with a function.

reset_tempo()

Set events tempo so that one beat equals one second (tempo 60).

metrize()

Apply tempo of event on itself

cut_out(start, end)

Time-based slicing of the respective event.

cut_off(start, end)

Time-based deletion / shortening of the respective event.

split_at(*absolute_time[, ...])

Split event into n events at absolute_time.

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


property after_grace_note_consecution: Consecution[Chronon]

Consecution after NoteLike

property grace_note_consecution: Consecution[Chronon]

Consecution before NoteLike

property notation_indicator_collection: NotationIndicatorCollection
property pitch_list: Any

The pitch or pitches of the event.

property playing_indicator_collection: PlayingIndicatorCollection
property volume: Any

The Volume of the event.

mutwo.music_events.configurations

Set default values for mutwo.music_events.NoteLike.

DEFAULT_NOTATION_INDICATORS_COLLECTION_CLASS

Default value for mutwo.music_events.NoteLike.notation_indicator_collection in NoteLike

DEFAULT_PLAYING_INDICATORS_COLLECTION_CLASS

Default value for mutwo.music_events.NoteLike.playing_indicator_collection in NoteLike