mutwo.abjad_converters§

Build Lilypond scores via Abjad from Mutwo data.

The following converter classes help to quantize and translate Mutwo data to Western notation. Due to the complex nature of this task, Mutwo tries to offer as many optional arguments as possible through which the user can affect the conversion routines. The most important class and best starting point for organising a conversion setting is SequentialEventToAbjadVoiceConverter. If one wants to build complete scores from within mutwo, the module offers the NestedComplexEventToAbjadContainerConverter.

Known bugs and limitations:

  1. Indicators attached to rests which follow another rest won’t be translated to abjad. This behaviour happens because the SequentialEventToAbjadVoiceConverter ties rests before converting the data to abjad objects.

  2. Quantization can be slow and not precise. Try both quantization classes. Change the parameters. Use different settings and classes for different parts of your music.

Object

Documentation

mutwo.abjad_converters.SequentialEventToQuantizedAbjadContainer

Quantize SequentialEvent objects.

mutwo.abjad_converters.NauertSequentialEventToQuantizedAbjadContainer

Quantize SequentialEvent objects via abjadext.nauert.

mutwo.abjad_converters.NauertSequentialEventToDurationLineBasedQuantizedAbjadContainer

Quantize SequentialEvent objects via abjadext.nauert.

mutwo.abjad_converters.LeafMakerSequentialEventToQuantizedAbjadContainer

Quantize SequentialEvent object via abjad.LeafMaker.

mutwo.abjad_converters.LeafMakerSequentialEventToDurationLineBasedQuantizedAbjadContainer

Quantize SequentialEvent object via abjad.LeafMaker.

mutwo.abjad_converters.ComplexEventToAbjadContainer

mutwo.abjad_converters.SequentialEventToAbjadVoice

Convert SequentialEvent to abjad.Voice.

mutwo.abjad_converters.NestedComplexEventToAbjadContainer

mutwo.abjad_converters.NestedComplexEventToComplexEventToAbjadContainers

mutwo.abjad_converters.CycleBasedNestedComplexEventToComplexEventToAbjadContainers

mutwo.abjad_converters.TagBasedNestedComplexEventToComplexEventToAbjadContainers

mutwo.abjad_converters.MutwoLyricToAbjadString

mutwo.abjad_converters.MutwoPitchToAbjadPitch

Convert Mutwo Pitch objects to Abjad Pitch objects.

mutwo.abjad_converters.TempoEnvelopeToAbjadAttachmentTempo

Convert tempo envelope to Tempo.

mutwo.abjad_converters.ComplexTempoEnvelopeToAbjadAttachmentTempo

Convert tempo envelope to Tempo.

mutwo.abjad_converters.MutwoVolumeToAbjadAttachmentDynamic

Convert Mutwo Volume objects to Dynamic.

mutwo.abjad_converters.MutwoPitchToHEJIAbjadPitch

Convert Mutwo JustIntonationPitch objects to Abjad Pitch objects.

mutwo.abjad_converters.ProcessAbjadContainerRoutine

mutwo.abjad_converters.AddDurationLineEngraver

mutwo.abjad_converters.PrepareForDurationLineBasedNotation

mutwo.abjad_converters.AddInstrumentName

mutwo.abjad_converters.AddAccidentalStyle

mutwo.abjad_converters.SetStaffSize

class SequentialEventToQuantizedAbjadContainer(time_signature_sequence=(TimeSignature((4, 4)),), tempo_envelope=None)[source]§

Quantize SequentialEvent objects.

Parameters:
  • time_signature_sequence (Sequence[TimeSignature]) – Set time signatures to divide the quantized abjad data in desired bar sizes. If the converted SequentialEvent is longer than the sum of all passed time signatures, the last time signature will be repeated for the remaining bars.

  • tempo_envelope (TempoEnvelope) – Defines the tempo of the converted music. This is an core_events.TempoEnvelope object which durations are beats and which levels are either numbers (that will be interpreted as beats per minute (‘BPM’)) or TempoPoint objects. If no tempo envelope has been defined, Mutwo will assume a constant tempo of 1/4 = 120 BPM.

Public Data Attributes:

tempo_envelope

Public Methods:

__init__([time_signature_sequence, ...])

convert(sequential_event_to_convert)

Inherited from Converter

convert(sequential_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


abstract convert(sequential_event_to_convert)[source]§
Parameters:

sequential_event_to_convert (SequentialEvent) –

Return type:

tuple[abjad.score.Container, tuple[tuple[tuple[int, …], …], …]]

property tempo_envelope: TempoEnvelope§
class NauertSequentialEventToQuantizedAbjadContainer(time_signature_sequence=(TimeSignature((4, 4)), ), duration_unit='beats', tempo_envelope=None, attack_point_optimizer=<abjadext.nauert.attackpointoptimizers.MeasurewiseAttackPointOptimizer object>, search_tree=None)[source]§

Quantize SequentialEvent objects via abjadext.nauert.

Parameters:
  • time_signature_sequence (Sequence[TimeSignature]) – Set time signatures to divide the quantized abjad data in desired bar sizes. If the converted SequentialEvent is longer than the sum of all passed time signatures, the last time signature will be repeated for the remaining bars.

  • duration_unit (str) – This defines the duration_unit of the passed SequentialEvent (how the duration attribute will be interpreted). Can either be ‘beats’ (default) or ‘miliseconds’. WARNING: ‘miliseconds’ isn’t working properly yet!

  • tempo_envelope (TempoEnvelope) – Defines the tempo of the converted music. This is an core_events.TempoEnvelope object which durations are beats and which levels are either numbers (that will be interpreted as beats per minute (‘BPM’)) or TempoPoint objects. If no tempo envelope has been defined, Mutwo will assume a constant tempo of 1/4 = 120 BPM.

  • attack_point_optimizer (Optional[AttackPointOptimizer]) – Optionally the user can pass a nauert.AttackPointOptimizer object. Attack point optimizer help to split events and tie them for better looking notation. The default attack point optimizer is nauert.MeasurewiseAttackPointOptimizer which splits events to better represent metrical structures within bars. If no optimizer is desired this argument can be set to None.

  • search_tree (Optional[SearchTree]) –

Unlike LeafMakerSequentialEventToQuantizedAbjadContainer this converter supports nested tuplets and ties across tuplets. But this converter is much slower than the LeafMakerSequentialEventToQuantizedAbjadContainer. Because the converter depends on the abjad extension nauert its quality is dependent on the inner mechanism of the used package. Because the quantization made by the nauert package can be somewhat indeterministic a lot of tweaking may be necessary for complex musical structures.

Public Data Attributes:

Inherited from SequentialEventToQuantizedAbjadContainer

tempo_envelope

Public Methods:

__init__([time_signature_sequence, ...])

convert(sequential_event_to_convert)

Inherited from SequentialEventToQuantizedAbjadContainer

__init__([time_signature_sequence, ...])

convert(sequential_event_to_convert)

Inherited from Converter

convert(sequential_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from SequentialEventToQuantizedAbjadContainer

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(sequential_event_to_convert)[source]§
Parameters:

sequential_event_to_convert (SequentialEvent) –

Return type:

tuple[abjad.score.Container, tuple[tuple[tuple[int, …], …], …]]

property tempo_envelope: TempoEnvelope§
class NauertSequentialEventToDurationLineBasedQuantizedAbjadContainer(*args, duration_line_minimum_length=6, duration_line_thickness=3, **kwargs)[source]§

Quantize SequentialEvent objects via abjadext.nauert.

Parameters:
  • time_signature_sequence – Set time signatures to divide the quantized abjad data in desired bar sizes. If the converted SequentialEvent is longer than the sum of all passed time signatures, the last time signature will be repeated for the remaining bars.

  • duration_unit – This defines the duration_unit of the passed SequentialEvent (how the duration attribute will be interpreted). Can either be ‘beats’ (default) or ‘miliseconds’. WARNING: ‘miliseconds’ isn’t working properly yet!

  • tempo_envelope – Defines the tempo of the converted music. This is an core_events.TempoEnvelope object which durations are beats and which levels are either numbers (that will be interpreted as beats per minute (‘BPM’)) or TempoPoint objects. If no tempo envelope has been defined, Mutwo will assume a constant tempo of 1/4 = 120 BPM.

  • attack_point_optimizer – Optionally the user can pass a nauert.AttackPointOptimizer object. Attack point optimizer help to split events and tie them for better looking notation. The default attack point optimizer is nauert.MeasurewiseAttackPointOptimizer which splits events to better represent metrical structures within bars. If no optimizer is desired this argument can be set to None.

  • duration_line_minimum_length (int) – The minimum length of a duration line.

  • duration_line_thickness (int) – The thickness of a duration line.

This converter differs from its parent class through the usage of duration lines for indicating rhythm instead of using flags, beams, dots and note head colors.

Note:

Don’t forget to add the ‘Duration_line_engraver’ to the resulting abjad Voice, otherwise Lilypond won’t be able to render the desired output.

Example:

>>> import abjad
>>> from mutwo import abjad_converters
>>> from mutwo import core_events
>>> converter = abjad_converters.SequentialEventToAbjadVoiceConverter(
>>>     abjad_converters.LeafMakerSequentialEventToDurationLineBasedQuantizedAbjadContainer(
>>>        )
>>>    )
>>> sequential_event_to_convert = core_events.SequentialEvent(
>>>     [
>>>         music_events.NoteLike("c", 0.125),
>>>         music_events.NoteLike("d", 1),
>>>         music_events.NoteLike([], 0.125),
>>>         music_events.NoteLike("e", 0.16666),
>>>         music_events.NoteLike("e", 0.08333333333333333)
>>>     ]
>>> )
>>> converted_sequential_event = converter.convert(sequential_event_to_convert)
>>> converted_sequential_event.consists_commands.append("Duration_line_engraver")

Public Data Attributes:

Inherited from SequentialEventToQuantizedAbjadContainer

tempo_envelope

Public Methods:

__init__(*args[, ...])

convert(sequential_event_to_convert)

Inherited from NauertSequentialEventToQuantizedAbjadContainer

__init__(*args[, ...])

convert(sequential_event_to_convert)

Inherited from SequentialEventToQuantizedAbjadContainer

__init__(*args[, ...])

convert(sequential_event_to_convert)

Inherited from Converter

convert(sequential_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Inherited from _DurationLineBasedQuantizedAbjadContainerMixin

__init__(*args[, ...])

Private Data Attributes:

_abc_impl

Inherited from NauertSequentialEventToQuantizedAbjadContainer

_abc_impl

Inherited from SequentialEventToQuantizedAbjadContainer

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(sequential_event_to_convert)[source]§
Parameters:

sequential_event_to_convert (SequentialEvent) –

Return type:

tuple[abjad.score.Container, tuple[tuple[tuple[int, …], …], …]]

property tempo_envelope: TempoEnvelope§
class LeafMakerSequentialEventToQuantizedAbjadContainer(*args, do_rewrite_meter=True, add_beams=True, **kwargs)[source]§

Quantize SequentialEvent object via abjad.LeafMaker.

Parameters:
  • time_signature_sequence – Set time signatures to divide the quantized abjad data in desired bar sizes. If the converted SequentialEvent is longer than the sum of all passed time signatures, the last time signature will be repeated for the remaining bars.

  • tempo_envelope – Defines the tempo of the converted music. This is an core_events.TempoEnvelope object which durations are beats and which levels are either numbers (that will be interpreted as beats per minute (‘BPM’)) or TempoPoint objects. If no tempo envelope has been defined, Mutwo will assume a constant tempo of 1/4 = 120 BPM.

  • do_rewrite_meter (bool) –

  • add_beams (bool) –

This method is significantly faster than the NauertSequentialEventToQuantizedAbjadContainer. But it also has several known limitations:

  1. LeafMakerSequentialEventToQuantizedAbjadContainer doesn’t support nested tuplets.

  2. LeafMakerSequentialEventToQuantizedAbjadContainer doesn’t support ties across tuplets with different prolation (or across tuplets and not-tuplet notation). If ties are desired the user has to build them manually before passing the SequentialEvent to the converter.

Public Data Attributes:

Inherited from SequentialEventToQuantizedAbjadContainer

tempo_envelope

Public Methods:

__init__(*args[, do_rewrite_meter, add_beams])

convert(sequential_event_to_convert)

Inherited from SequentialEventToQuantizedAbjadContainer

__init__(*args[, do_rewrite_meter, add_beams])

convert(sequential_event_to_convert)

Inherited from Converter

convert(sequential_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_maximum_dot_count

_abc_impl

Inherited from SequentialEventToQuantizedAbjadContainer

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(sequential_event_to_convert)[source]§
Parameters:

sequential_event_to_convert (SequentialEvent) –

Return type:

tuple[abjad.score.Container, tuple[tuple[tuple[int, …], …], …]]

property tempo_envelope: TempoEnvelope§
class LeafMakerSequentialEventToDurationLineBasedQuantizedAbjadContainer(*args, duration_line_minimum_length=6, duration_line_thickness=3, **kwargs)[source]§

Quantize SequentialEvent object via abjad.LeafMaker.

Parameters:
  • time_signature_sequence – Set time signatures to divide the quantized abjad data in desired bar sizes. If the converted SequentialEvent is longer than the sum of all passed time signatures, the last time signature will be repeated for the remaining bars.

  • tempo_envelope – Defines the tempo of the converted music. This is an core_events.TempoEnvelope object which durations are beats and which levels are either numbers (that will be interpreted as beats per minute (‘BPM’)) or TempoPoint objects. If no tempo envelope has been defined, Mutwo will assume a constant tempo of 1/4 = 120 BPM.

  • duration_line_minimum_length (int) – The minimum length of a duration line.

  • duration_line_thickness (int) – The thickness of a duration line.

This converter differs from its parent class through the usage of duration lines for indicating rhythm instead of using flags, beams, dots and note head colors.

Note:

Don’t forget to add the ‘Duration_line_engraver’ to the resulting abjad Voice, otherwise Lilypond won’t be able to render the desired output.

Example:

>>> import abjad
>>> from mutwo import abjad_converters
>>> from mutwo import core_events
>>> converter = abjad_converters.SequentialEventToAbjadVoiceConverter(
>>>     abjad_converters.LeafMakerSequentialEventToDurationLineBasedQuantizedAbjadContainer(
>>>        )
>>>    )
>>> sequential_event_to_convert = core_events.SequentialEvent(
>>>     [
>>>         music_events.NoteLike("c", 0.125),
>>>         music_events.NoteLike("d", 1),
>>>         music_events.NoteLike([], 0.125),
>>>         music_events.NoteLike("e", 0.16666),
>>>         music_events.NoteLike("e", 0.08333333333333333)
>>>     ]
>>> )
>>> converted_sequential_event = converter.convert(sequential_event_to_convert)
>>> converted_sequential_event.consists_commands.append("Duration_line_engraver")

Public Data Attributes:

Inherited from SequentialEventToQuantizedAbjadContainer

tempo_envelope

Public Methods:

__init__(*args[, ...])

convert(sequential_event_to_convert)

Inherited from LeafMakerSequentialEventToQuantizedAbjadContainer

__init__(*args[, ...])

convert(sequential_event_to_convert)

Inherited from SequentialEventToQuantizedAbjadContainer

__init__(*args[, ...])

convert(sequential_event_to_convert)

Inherited from Converter

convert(sequential_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Inherited from _DurationLineBasedQuantizedAbjadContainerMixin

__init__(*args[, ...])

Private Data Attributes:

_abc_impl

Inherited from LeafMakerSequentialEventToQuantizedAbjadContainer

_maximum_dot_count

_abc_impl

Inherited from SequentialEventToQuantizedAbjadContainer

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(sequential_event_to_convert)[source]§
Parameters:

sequential_event_to_convert (SequentialEvent) –

Return type:

tuple[abjad.score.Container, tuple[tuple[tuple[int, …], …], …]]

property tempo_envelope: TempoEnvelope§
class ComplexEventToAbjadContainer(abjad_container_class, lilypond_type_of_abjad_container, complex_event_to_abjad_container_name, pre_process_abjad_container_routine_sequence, post_process_abjad_container_routine_sequence)[source]§

Public Methods:

__init__(abjad_container_class, ...)

convert(complex_event_to_convert)

Inherited from Converter

convert(complex_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


Parameters:
  • abjad_container_class (Type[Container]) –

  • lilypond_type_of_abjad_container (str) –

  • complex_event_to_abjad_container_name (Callable[[ComplexEvent], str]) –

  • pre_process_abjad_container_routine_sequence (Sequence[ProcessAbjadContainerRoutine]) –

  • post_process_abjad_container_routine_sequence (Sequence[ProcessAbjadContainerRoutine]) –

convert(complex_event_to_convert)[source]§
Parameters:

complex_event_to_convert (ComplexEvent) –

Return type:

Container

class SequentialEventToAbjadVoice(sequential_event_to_quantized_abjad_container=<mutwo.abjad_converters.events.quantization.NauertSequentialEventToQuantizedAbjadContainer object>, simple_event_to_pitch_list=<mutwo.music_converters.parsers.SimpleEventToPitchList object>, simple_event_to_volume=<mutwo.music_converters.parsers.SimpleEventToVolume object>, simple_event_to_grace_note_sequential_event=<mutwo.music_converters.parsers.SimpleEventToGraceNoteSequentialEvent object>, simple_event_to_after_grace_note_sequential_event=<mutwo.music_converters.parsers.SimpleEventToAfterGraceNoteSequentialEvent object>, simple_event_to_playing_indicator_collection=<mutwo.music_converters.parsers.SimpleEventToPlayingIndicatorCollection object>, simple_event_to_notation_indicator_collection=<mutwo.music_converters.parsers.SimpleEventToNotationIndicatorCollection object>, simple_event_to_lyric=<mutwo.music_converters.parsers.SimpleEventToLyric object>, is_simple_event_rest=None, mutwo_pitch_to_abjad_pitch=<mutwo.abjad_converters.parameters.pitches.MutwoPitchToAbjadPitch object>, mutwo_volume_to_abjad_attachment_dynamic=<mutwo.abjad_converters.parameters.volumes.MutwoVolumeToAbjadAttachmentDynamic object>, tempo_envelope_to_abjad_attachment_tempo=<mutwo.abjad_converters.parameters.tempos.ComplexTempoEnvelopeToAbjadAttachmentTempo object>, mutwo_lyric_to_abjad_string=<mutwo.abjad_converters.parameters.lyrics.MutwoLyricToAbjadString object>, abjad_attachment_class_sequence=None, write_multimeasure_rests=True, abjad_container_class=<class 'abjad.score.Voice'>, lilypond_type_of_abjad_container='Voice', complex_event_to_abjad_container_name=<function SequentialEventToAbjadVoice.<lambda>>, pre_process_abjad_container_routine_sequence=(), post_process_abjad_container_routine_sequence=())[source]§

Convert SequentialEvent to abjad.Voice.

Parameters:

Public Methods:

__init__([...])

convert(sequential_event_to_convert)

Convert passed SequentialEvent.

Inherited from ComplexEventToAbjadContainer

__init__([...])

convert(sequential_event_to_convert)

Convert passed SequentialEvent.

Inherited from Converter

convert(sequential_event_to_convert)

Convert passed SequentialEvent.

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from ComplexEventToAbjadContainer

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


ExtractedData§

alias of tuple[list[Pitch], Volume, SequentialEvent[SimpleEvent], SequentialEvent[SimpleEvent], PlayingIndicatorCollection, NotationIndicatorCollection, Lyric]

ExtractedDataPerSimpleEvent§

alias of tuple[tuple[list[Pitch], Volume, SequentialEvent[SimpleEvent], SequentialEvent[SimpleEvent], PlayingIndicatorCollection, NotationIndicatorCollection, Lyric], …]

convert(sequential_event_to_convert)[source]§

Convert passed SequentialEvent.

Parameters:

sequential_event_to_convert (mutwo.core_events.SequentialEvent) – The SequentialEvent which shall be converted to the abjad.Voice object.

Return type:

Voice

Example:

>>> import abjad
>>> from mutwo.events import basic, music
>>> from mutwo.converters.frontends import abjad as mutwo_abjad
>>> mutwo_melody = basic.SequentialEvent(
>>>     [
>>>         music.NoteLike(pitch, duration)
>>>         for pitch, duration in zip("c a g e".split(" "), (1, 1 / 6, 1 / 6, 1 / 6))
>>>     ]
>>> )
>>> converter = mutwo_abjad.SequentialEventToAbjadVoice()
>>> abjad_melody = converter.convert(mutwo_melody)
>>> abjad.lilypond(abjad_melody)
\new Voice
{
    {
        \tempo 4=120
        %%% \time 4/4 %%%
        c'1
        \mf
    }
    {
        \times 2/3 {
            a'4
            g'4
            e'4
        }
        r2
    }
}
class NestedComplexEventToAbjadContainer(nested_complex_event_to_complex_event_to_abjad_container_converters_converter, abjad_container_class, lilypond_type_of_abjad_container, complex_event_to_abjad_container_name=<function NestedComplexEventToAbjadContainer.<lambda>>, pre_process_abjad_container_routine_sequence=(), post_process_abjad_container_routine_sequence=())[source]§

Public Methods:

__init__(...[, ...])

Inherited from ComplexEventToAbjadContainer

__init__(...[, ...])

convert(complex_event_to_convert)

Inherited from Converter

convert(complex_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from ComplexEventToAbjadContainer

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


Parameters:
convert(complex_event_to_convert)§
Parameters:

complex_event_to_convert (ComplexEvent) –

Return type:

Container

class NestedComplexEventToComplexEventToAbjadContainers[source]§

Public Methods:

convert(nested_complex_event_to_convert)

Inherited from Converter

convert(nested_complex_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


abstract convert(nested_complex_event_to_convert)[source]§
Parameters:

nested_complex_event_to_convert (ComplexEvent) –

Return type:

tuple[mutwo.abjad_converters.events.building.ComplexEventToAbjadContainer, …]

class CycleBasedNestedComplexEventToComplexEventToAbjadContainers(complex_event_to_abjad_container_converter_sequence)[source]§

Public Methods:

__init__(...)

convert(nested_complex_event_to_convert)

Inherited from NestedComplexEventToComplexEventToAbjadContainers

convert(nested_complex_event_to_convert)

Inherited from Converter

convert(nested_complex_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from NestedComplexEventToComplexEventToAbjadContainers

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


Parameters:

complex_event_to_abjad_container_converter_sequence (Sequence[ComplexEventToAbjadContainer]) –

convert(nested_complex_event_to_convert)[source]§
Parameters:

nested_complex_event_to_convert (ComplexEvent) –

Return type:

tuple[mutwo.abjad_converters.events.building.ComplexEventToAbjadContainer, …]

class TagBasedNestedComplexEventToComplexEventToAbjadContainers(tag_to_abjad_converter_dict, complex_event_to_tag=<function TagBasedNestedComplexEventToComplexEventToAbjadContainers.<lambda>>)[source]§

Public Methods:

__init__(tag_to_abjad_converter_dict[, ...])

convert(nested_complex_event_to_convert)

Inherited from NestedComplexEventToComplexEventToAbjadContainers

convert(nested_complex_event_to_convert)

Inherited from Converter

convert(nested_complex_event_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from NestedComplexEventToComplexEventToAbjadContainers

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


Parameters:
convert(nested_complex_event_to_convert)[source]§
Parameters:

nested_complex_event_to_convert (ComplexEvent) –

Return type:

tuple[mutwo.abjad_converters.events.building.ComplexEventToAbjadContainer, …]

class MutwoLyricToAbjadString[source]§

Public Methods:

convert(mutwo_lyric_to_convert)

Inherited from Converter

convert(mutwo_lyric_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(mutwo_lyric_to_convert)[source]§
Parameters:

mutwo_lyric_to_convert (Lyric) –

Return type:

str

class MutwoPitchToAbjadPitch[source]§

Convert Mutwo Pitch objects to Abjad Pitch objects.

This default class simply checks if the passed Mutwo object belongs to mutwo.ext.parameters.pitches.WesternPitch. If it does, Mutwo will initialise the Abjad Pitch from the name attribute. Otherwise Mutwo will simply initialise the Abjad Pitch from the objects frequency attribute.

If users desire to make more complex conversions (for instance due to scordatura or transpositions of instruments), one can simply inherit from this class to define more complex cases.

Public Methods:

convert(pitch_to_convert)

Inherited from Converter

convert(pitch_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(pitch_to_convert)[source]§
Parameters:

pitch_to_convert (Pitch) –

Return type:

Pitch

class TempoEnvelopeToAbjadAttachmentTempo[source]§

Convert tempo envelope to Tempo.

Abstract base class for tempo envelope conversion. See ComplexTempoEnvelopeToAbjadAttachmentTempo for a concrete class.

Public Methods:

convert(tempo_envelope_to_convert)

Inherited from Converter

convert(tempo_envelope_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


abstract convert(tempo_envelope_to_convert)[source]§
Parameters:

tempo_envelope_to_convert (TempoEnvelope) –

Return type:

tuple[tuple[Union[float, fractions.Fraction, int], mutwo.abjad_parameters.attachments.Tempo], …]

class ComplexTempoEnvelopeToAbjadAttachmentTempo[source]§

Convert tempo envelope to Tempo.

This object tries to intelligently set correct tempo abjad_parameters to an abjad.Voice object, appropriate to Western notation standards. Therefore it will not repeat tempo indications if they are merely repetitions of previous tempo indications and it will write ‘a tempo’ when returning to the same tempo after ritardandi or accelerandi.

Public Methods:

convert(tempo_envelope_to_convert)

Inherited from TempoEnvelopeToAbjadAttachmentTempo

convert(tempo_envelope_to_convert)

Inherited from Converter

convert(tempo_envelope_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from TempoEnvelopeToAbjadAttachmentTempo

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(tempo_envelope_to_convert)[source]§
Parameters:

tempo_envelope_to_convert (TempoEnvelope) –

Return type:

tuple[tuple[Union[float, fractions.Fraction, int], mutwo.abjad_parameters.attachments.Tempo], …]

class MutwoVolumeToAbjadAttachmentDynamic[source]§

Convert Mutwo Volume objects to Dynamic.

This default class simply checks if the passed Mutwo object belongs to mutwo.ext.parameters.volumes.WesternVolume. If it does, Mutwo will initialise the Tempo object from the name attribute. Otherwise Mutwo will first initialise a WesternVolume object via its py:method:mutwo.ext.parameters.volumes.WesternVolume.from_amplitude method.

Hairpins aren’t notated with the aid of mutwo.ext.parameters.abc.Volume objects, but with mutwo.ext.parameters.playing_indicators.Hairpin.

Public Methods:

convert(volume_to_convert)

Inherited from Converter

convert(volume_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(volume_to_convert)[source]§
Parameters:

volume_to_convert (Volume) –

Return type:

Optional[Dynamic]

class MutwoPitchToHEJIAbjadPitch(reference_pitch='a', prime_to_heji_accidental_name=None, otonality_indicator=None, utonality_indicator=None, exponent_to_exponent_indicator=None, tempered_pitch_indicator=None)[source]§

Convert Mutwo JustIntonationPitch objects to Abjad Pitch objects.

Parameters:

The resulting Abjad pitches are expected to be used in combination with tuning files that are generated by HEJIEkmelilyTuningFileConverter and with the Lilypond extension Ekmelily. You can find pre-generated tuning files here.

Example:

>>> from mutwo.ext.parameters import pitches
>>> from mutwo.converters.frontends import abjad
>>> my_ji_pitch = pitches.JustIntonationPitch('5/4')
>>> converter_on_a = abjad.MutwoPitchToHEJIAbjadPitch(reference_pitch='a')
>>> converter_on_c = abjad.MutwoPitchToHEJIAbjadPitch(reference_pitch='c')
>>> converter_on_a.convert(my_ji_pitch)
NamedPitch("csoaa''")
>>> converter_on_c.convert(my_ji_pitch)
NamedPitch("eoaa'")

Public Methods:

__init__([reference_pitch, ...])

convert(pitch_to_convert)

Inherited from MutwoPitchToAbjadPitch

convert(pitch_to_convert)

Inherited from Converter

convert(pitch_to_convert)

__call__(*args, **kwargs)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from MutwoPitchToAbjadPitch

_abc_impl

Inherited from Converter

_abc_impl

Inherited from ABC

_abc_impl


convert(pitch_to_convert)[source]§
Parameters:

pitch_to_convert (Pitch) –

Return type:

Pitch

class ProcessAbjadContainerRoutine[source]§

Public Methods:

__call__(complex_event_to_convert, ...)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from ABC

_abc_impl


class AddDurationLineEngraver[source]§

Public Methods:

__call__(complex_event_to_convert, ...)

Call self as a function.

Inherited from ProcessAbjadContainerRoutine

__call__(complex_event_to_convert, ...)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from ProcessAbjadContainerRoutine

_abc_impl

Inherited from ABC

_abc_impl


class PrepareForDurationLineBasedNotation[source]§

Public Methods:

__call__(_, container_to_process)

Call self as a function.

Inherited from ProcessAbjadContainerRoutine

__call__(_, container_to_process)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from ProcessAbjadContainerRoutine

_abc_impl

Inherited from ABC

_abc_impl


class AddInstrumentName(complex_event_to_instrument_name=<function AddInstrumentName.<lambda>>, complex_event_to_short_instrument_name=<function AddInstrumentName.<lambda>>, instrument_name_font_size='teeny', short_instrument_name_font_size='teeny')[source]§

Public Methods:

__init__([complex_event_to_instrument_name, ...])

__call__(complex_event_to_convert, ...)

Call self as a function.

Inherited from ProcessAbjadContainerRoutine

__call__(complex_event_to_convert, ...)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from ProcessAbjadContainerRoutine

_abc_impl

Inherited from ABC

_abc_impl


Parameters:
  • complex_event_to_instrument_name (Callable[[ComplexEvent], str]) –

  • complex_event_to_short_instrument_name (Callable[[ComplexEvent], str]) –

  • instrument_name_font_size (str) –

  • short_instrument_name_font_size (str) –

class AddAccidentalStyle(accidental_style)[source]§

Public Methods:

__init__(accidental_style)

__call__(complex_event_to_convert, ...)

Call self as a function.

Inherited from ProcessAbjadContainerRoutine

__call__(complex_event_to_convert, ...)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from ProcessAbjadContainerRoutine

_abc_impl

Inherited from ABC

_abc_impl


Parameters:

accidental_style (str) –

class SetStaffSize(difference_of_size)[source]§

Public Methods:

__init__(difference_of_size)

__call__(complex_event_to_convert, ...)

Call self as a function.

Inherited from ProcessAbjadContainerRoutine

__call__(complex_event_to_convert, ...)

Call self as a function.

Private Data Attributes:

_abc_impl

Inherited from ProcessAbjadContainerRoutine

_abc_impl

Inherited from ABC

_abc_impl


Parameters:

difference_of_size (int) –

mutwo.abjad_converters.configurations§

Configure mutwo.abjad_converters.

DEFAULT_ABJAD_ATTACHMENT_CLASS_TUPLE = (<class 'mutwo.abjad_parameters.attachments.AfterGraceNoteSequentialEvent'>, <class 'mutwo.abjad_parameters.attachments.Arpeggio'>, <class 'mutwo.abjad_parameters.attachments.Articulation'>, <class 'mutwo.abjad_parameters.attachments.ArtificalHarmonic'>, <class 'mutwo.abjad_parameters.attachments.BarLine'>, <class 'mutwo.abjad_parameters.attachments.BartokPizzicato'>, <class 'mutwo.abjad_parameters.attachments.BendAfter'>, <class 'mutwo.abjad_parameters.attachments.BreathMark'>, <class 'mutwo.abjad_parameters.attachments.Clef'>, <class 'mutwo.abjad_parameters.attachments.Cue'>, <class 'mutwo.abjad_parameters.attachments.DurationLineDashed'>, <class 'mutwo.abjad_parameters.attachments.DurationLineTriller'>, <class 'mutwo.abjad_parameters.attachments.Dynamic'>, <class 'mutwo.abjad_parameters.attachments.DynamicChangeIndicationStop'>, <class 'mutwo.abjad_parameters.attachments.Fermata'>, <class 'mutwo.abjad_parameters.attachments.Glissando'>, <class 'mutwo.abjad_parameters.attachments.GraceNoteSequentialEvent'>, <class 'mutwo.abjad_parameters.attachments.Hairpin'>, <class 'mutwo.abjad_parameters.attachments.LaissezVibrer'>, <class 'mutwo.abjad_parameters.attachments.MarginMarkup'>, <class 'mutwo.abjad_parameters.attachments.Markup'>, <class 'mutwo.abjad_parameters.attachments.NaturalHarmonic'>, <class 'mutwo.abjad_parameters.attachments.Ornamentation'>, <class 'mutwo.abjad_parameters.attachments.Ottava'>, <class 'mutwo.abjad_parameters.attachments.Pedal'>, <class 'mutwo.abjad_parameters.attachments.Prall'>, <class 'mutwo.abjad_parameters.attachments.PreciseNaturalHarmonic'>, <class 'mutwo.abjad_parameters.attachments.RehearsalMark'>, <class 'mutwo.abjad_parameters.attachments.StringContactPoint'>, <class 'mutwo.abjad_parameters.attachments.Tempo'>, <class 'mutwo.abjad_parameters.attachments.Tie'>, <class 'mutwo.abjad_parameters.attachments.Tremolo'>, <class 'mutwo.abjad_parameters.attachments.Trill'>, <class 'mutwo.abjad_parameters.attachments.WoodwindFingering'>)§

Default value for argument abjad_attachment_classes in SequentialEventToAbjadVoiceConverter.