mutwo.converters.symmetrical.playing_indicators module

Apply PlayingIndicator on Event.

Classes:

ArpeggioConverter([...])

Apply arpeggio on SimpleEvent.

PlayingIndicatorConverter([...])

Abstract base class to apply PlayingIndicator on a SimpleEvent.

PlayingIndicatorsConverter(...)

Apply PlayingIndicator on any Event.

class ArpeggioConverter(duration_for_each_attack=0.1, simple_event_to_pitches=<function ArpeggioConverter.<lambda>>, simple_event_to_playing_indicators=<function ArpeggioConverter.<lambda>>, set_pitches_for_simple_event=<function ArpeggioConverter.<lambda>>)[source]

Bases: mutwo.converters.symmetrical.playing_indicators.PlayingIndicatorConverter

Apply arpeggio on SimpleEvent.

Parameters

Methods:

convert(simple_event_to_convert)

Apply PlayingIndicator on simple_event.

convert(simple_event_to_convert)

Apply PlayingIndicator on simple_event.

Parameters

simple_event_to_convert (events.basic.SimpleEvent) – The event which shall be converted.

Return type

mutwo.events.basic.SequentialEvent[mutwo.events.basic.SimpleEvent]

class PlayingIndicatorConverter(simple_event_to_playing_indicators=<function PlayingIndicatorConverter.<lambda>>)[source]

Bases: mutwo.converters.abc.Converter

Abstract base class to apply PlayingIndicator on a SimpleEvent.

Parameters

simple_event_to_playing_indicators (typing.Callable[[events.basic.SimpleEvent], parameters.playing_indicators.PlayingIndicatorCollection], optional) – Function to extract from a mutwo.events.basic.SimpleEvent a mutwo.parameters.playing_indicators.PlayingIndicatorCollection object. By default it asks the Event for its playing_indicators attribute (because by default mutwo.events.music.NoteLike objects are expected). When using different Event classes than NoteLike with a different name for their playing_indicators property, this argument should be overridden. If the function call raises an AttributeError (e.g. if no playing indicator collection can be extracted), mutwo will build a playing indicator collection from DEFAULT_PLAYING_INDICATORS_COLLECTION_CLASS.

Methods:

convert(simple_event_to_convert)

Apply PlayingIndicator on simple_event.

convert(simple_event_to_convert)[source]

Apply PlayingIndicator on simple_event.

Parameters

simple_event_to_convert (events.basic.SimpleEvent) – The event which shall be converted.

Return type

mutwo.events.basic.SequentialEvent[mutwo.events.basic.SimpleEvent]

class PlayingIndicatorsConverter(playing_indicator_converters)[source]

Bases: mutwo.converters.abc.SymmetricalEventConverter

Apply PlayingIndicator on any Event.

Parameters

playing_indicator_converters (typing.Sequence[PlayingIndicatorConverter]) – A sequence of PlayingIndicatorConverter which shall be applied on each SimpleEvent.

Methods:

convert(event_to_convert)

convert(event_to_convert)[source]
Parameters

event_to_convert (mutwo.events.abc.Event) –

Return type

mutwo.events.abc.Event