mutwo.converters.symmetrical.playing_indicators module¶
Apply PlayingIndicator on Event.
Classes:
|
Apply arpeggio on |
|
Abstract base class to apply |
Apply |
- 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.PlayingIndicatorConverterApply arpeggio on
SimpleEvent.- Parameters
duration_for_each_attack (parameters.abc.DurationType) – Set how long each attack of the Arpeggio lasts. Default to 0.1.
simple_event_to_pitches (typing.Callable[[events.basic.SimpleEvent], parameters.abc.Pitch], optional) – Function to extract from a
mutwo.events.basic.SimpleEventa tuple that contains pitch objects (objects that inherit frommutwo.parameters.abc.Pitch). By default it asks the Event for itspitch_or_pitchesattribute (because by defaultmutwo.events.music.NoteLikeobjects are expected). When using different Event classes thanNoteLikewith a different name for their pitch property, this argument should be overridden. If the function call raises anAttributeError(e.g. if no pitch can be extracted), mutwo will assume an event without any pitches.simple_event_to_playing_indicators (typing.Callable[[events.basic.SimpleEvent], parameters.playing_indicators.PlayingIndicatorCollection,], optional) – Function to extract from a
mutwo.events.basic.SimpleEventamutwo.parameters.playing_indicators.PlayingIndicatorCollectionobject. By default it asks the Event for itsplaying_indicatorsattribute (because by defaultmutwo.events.music.NoteLikeobjects are expected). When using different Event classes thanNoteLikewith a different name for their playing_indicators property, this argument should be overridden. If the function call raises anAttributeError(e.g. if no playing indicator collection can be extracted), mutwo will build a playing indicator collection fromDEFAULT_PLAYING_INDICATORS_COLLECTION_CLASS.set_pitches_for_simple_event (typing.Callable[[events.basic.SimpleEvent, typing.List[parameters.abc.Pitch]], None]) – Function which assigns a list of
Pitchobjects to aSimpleEvent. By default the function assigns the passed pitches to thepitch_or_pitchesattribute (because by defaultmutwo.events.music.NoteLikeobjects are expected).
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.ConverterAbstract base class to apply
PlayingIndicatoron aSimpleEvent.- Parameters
simple_event_to_playing_indicators (typing.Callable[[events.basic.SimpleEvent], parameters.playing_indicators.PlayingIndicatorCollection], optional) – Function to extract from a
mutwo.events.basic.SimpleEventamutwo.parameters.playing_indicators.PlayingIndicatorCollectionobject. By default it asks the Event for itsplaying_indicatorsattribute (because by defaultmutwo.events.music.NoteLikeobjects are expected). When using different Event classes thanNoteLikewith a different name for their playing_indicators property, this argument should be overridden. If the function call raises anAttributeError(e.g. if no playing indicator collection can be extracted), mutwo will build a playing indicator collection fromDEFAULT_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.SymmetricalEventConverterApply
PlayingIndicatoron anyEvent.- Parameters
playing_indicator_converters (typing.Sequence[PlayingIndicatorConverter]) – A sequence of
PlayingIndicatorConverterwhich shall be applied on eachSimpleEvent.
Methods:
convert(event_to_convert)- convert(event_to_convert)[source]¶
- Parameters
event_to_convert (mutwo.events.abc.Event) –
- Return type