mutwo.timeline_converters¶
Convert mutwo.timeline_interfaces.TimeLine to objects useable by other parts of mutwo.
Object |
Documentation |
|---|---|
Create event with Concurrence for each tag. |
|
Fetch from |
|
|
Fill empty |
|
Split |
- class TimeLineToEventPlacementDict[source]¶
Bases:
ConverterPublic Methods:
convert(timeline_to_convert)Inherited from
MutwoObjectcopy()Return a deep copy of mutwo object.
- convert(timeline_to_convert)[source]¶
- Parameters:
timeline_to_convert (TimeLine) –
- Return type:
dict[‘str’, tuple[mutwo.timeline_interfaces.timelines.EventPlacement, …]]
- class TimeLineToConcurrence(random_seed=100)[source]¶
Bases:
ConverterCreate event with Concurrence for each tag.
- Parameters:
random_seed (int) – Seed for random operation in case start_or_start_range or end_or_end_range of an
mutwo.timeline_interfaces.EventPlacementis a ranges.Range andTimeLineToConcurrenceneeds to pick a value within the given range.
The main intention of this converter is to convert a
TimeLineinto a representation which is useable for concrete third party converters likemutwo.midi_converters.EventToMidiFile.To be successful the tagged events in the
mutwo.timeline_interfaces.EventPlacementin themutwo.timeline_interfaces.TimeLinewhich is converted need a specific structure: the deepest nested structure they can follow is:- core_events.Concurrence[
- core_events.Consecution[
core_events.Chronon
]
]
Because this will be the final structure. This clean ordering is necessary to be functional with various third party converters as e.g.
mutwo.midi_converters.EventToMidiFile.Public Methods:
convert(timeline_to_convert)Inherited from
MutwoObjectcopy()Return a deep copy of mutwo object.
- class TimeLineToEventPlacementTuple[source]¶
Bases:
ConverterFetch from
TimeLineallEventPlacementwhich contains of user defined tags.Unlike
TimeLineToEventPlacementDictthis converter doesn’t split the fetchedmutwo.timeline_interfaces.EventPlacement`s into different `tuples, but returns all of them in one common tuple.Public Methods:
convert(timeline_to_convert, tag_tuple)Inherited from
MutwoObjectcopy()Return a deep copy of mutwo object.
- convert(timeline_to_convert, tag_tuple)[source]¶
- Parameters:
timeline_to_convert (TimeLine) –
tag_tuple (tuple['str', ...]) –
- Return type:
tuple[mutwo.timeline_interfaces.timelines.EventPlacement, …]
- class EventPlacementTupleToGaplessEventPlacementTuple[source]¶
Bases:
ConverterFill empty
EventPlacementinto the gaps between two EventPlacement.Public Methods:
convert(event_placement_tuple_to_convert[, ...])Inherited from
MutwoObjectcopy()Return a deep copy of mutwo object.
- convert(event_placement_tuple_to_convert, duration=None)[source]¶
- Parameters:
event_placement_tuple_to_convert (tuple[mutwo.timeline_interfaces.timelines.EventPlacement, ...]) –
duration (Optional[Duration]) –
- Return type:
tuple[mutwo.timeline_interfaces.timelines.EventPlacement, …]
- class EventPlacementTupleToSplitEventPlacementDict[source]¶
Bases:
ConverterSplit
EventPlacementinto new `EventPlacement`s by tags.So the returned event attribute of each returned
mutwo.timeline_interfaces.EventPlacementonly contains one specific tagged event.Public Methods:
convert(event_placement_tuple_to_convert)Inherited from
MutwoObjectcopy()Return a deep copy of mutwo object.
- convert(event_placement_tuple_to_convert)[source]¶
- Parameters:
event_placement_tuple_to_convert (tuple[mutwo.timeline_interfaces.timelines.EventPlacement, ...]) –
- Return type:
dict[‘str’, tuple[mutwo.timeline_interfaces.timelines.EventPlacement, …]]