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 ConsecutionToAbjadVoice. If one wants to build complete scores from within mutwo, the module offers the NestedCompoundToAbjadContainer.

Known bugs and limitations:

  1. Indicators attached to rests which follow another rest won’t be translated to abjad. This behaviour happens because LeafMakerConsecutionToQuantizedAbjadContainer and NauertConsecutionToQuantizedAbjadContainer tie rests before converting the data to abjad objects. With a different (maybe user-declared) quantizer this limitation can be fixed. For more details see the comment `here <https://github.com/mutwo-org/mutwo.abjad/blob/58b0044/mutwo/abjad_converters/events/quantization.py#L102-L128>_.

  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.ConsecutionToQuantizedAbjadContainer

Quantize Consecution objects.

mutwo.abjad_converters.NauertConsecutionToQuantizedAbjadContainer

Quantize Consecution objects via abjadext.nauert.

mutwo.abjad_converters.NauertConsecutionToDurationLineBasedQuantizedAbjadContainer

Quantize Consecution objects via abjadext.nauert.

mutwo.abjad_converters.LeafMakerConsecutionToQuantizedAbjadContainer

Quantize Consecution object via abjad.LeafMaker.

mutwo.abjad_converters.LeafMakerConsecutionToDurationLineBasedQuantizedAbjadContainer

Quantize Consecution object via abjad.LeafMaker.

mutwo.abjad_converters.CompoundToAbjadContainer

mutwo.abjad_converters.ConsecutionToAbjadVoice

Convert Consecution to abjad.Voice.

mutwo.abjad_converters.NestedCompoundToAbjadContainer

mutwo.abjad_converters.NestedCompoundToCompoundToAbjadContainers

mutwo.abjad_converters.CycleBasedNestedCompoundToCompoundToAbjadContainers

mutwo.abjad_converters.TagBasedNestedCompoundToCompoundToAbjadContainers

mutwo.abjad_converters.MutwoLyricToAbjadString

mutwo.abjad_converters.MutwoPitchToAbjadPitch

Convert Mutwo Pitch objects to Abjad Pitch objects.

mutwo.abjad_converters.TempoToAbjadAttachmentTempo

Convert tempo envelope to Tempo.

mutwo.abjad_converters.ComplexTempoToAbjadAttachmentTempo

Convert tempo to Tempo.

mutwo.abjad_converters.MutwoVolumeToAbjadAttachmentDynamic

Convert Mutwo Volume objects to Dynamic.

mutwo.abjad_converters.MutwoPitchToHEJIAbjadPitch

Convert JustIntonationPitch to abjad pitches.

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 ConsecutionToQuantizedAbjadContainer(default_time_signature_sequence=(TimeSignature(pair=(4, 4), hide=False, partial=None),), event_to_time_signature_tuple=None, is_chronon_rest=None)[source]

Bases: Converter

Quantize Consecution objects.

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

  • event_to_time_signature_tuple (Optional[Callable[[Event], Optional[tuple[abjad.indicators.TimeSignature, ...]]]]) – Function which extracts a tuple[abjad.TimeSignature, …] from a mutwo.core_events.abc.Event. If set to None mutwo falls back to default_time_signature_sequence. Default to None.

  • is_chronon_rest (Callable[[core_events.Chronon], bool], optional) – Function to detect if the the inspected mutwo.core_events.Chronon is a Rest. By default Mutwo simply checks if ‘pitch_list’ contain any objects. If not, the Event will be interpreted as a rest.

Public Methods:

convert(consecution_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


abstract convert(consecution_to_convert)[source]
Parameters:

consecution_to_convert (Consecution) –

Return type:

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

class NauertConsecutionToQuantizedAbjadContainer(default_time_signature_sequence=(TimeSignature(pair=(4, 4), hide=False, partial=None), ), duration_unit='beats', attack_point_optimizer=<abjadext.nauert.attackpointoptimizers.MeasurewiseAttackPointOptimizer object>, search_tree=None, **kwargs)[source]

Bases: ConsecutionToQuantizedAbjadContainer

Quantize Consecution objects via abjadext.nauert.

Parameters:
  • default_time_signature_sequence (Sequence[abjad.TimeSignature]) – Set time signatures to divide the quantized abjad data in desired bar sizes. If the converted Consecution 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 Consecution (how the duration attribute will be interpreted). Can either be ‘beats’ (default) or ‘miliseconds’. WARNING: ‘miliseconds’ isn’t working properly yet!

  • 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 LeafMakerConsecutionToQuantizedAbjadContainer this converter supports nested tuplets and ties across tuplets. But this converter is much slower than the LeafMakerConsecutionToQuantizedAbjadContainer. 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 Methods:

convert(consecution_to_convert)

Inherited from ConsecutionToQuantizedAbjadContainer

convert(consecution_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


convert(consecution_to_convert)[source]
Parameters:

consecution_to_convert (Consecution) –

Return type:

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

class NauertConsecutionToDurationLineBasedQuantizedAbjadContainer(*args, duration_line_minimum_length=6, duration_line_thickness=3, **kwargs)[source]

Bases: NauertConsecutionToQuantizedAbjadContainer, _DurationLineBasedQuantizedAbjadContainerMixin

Quantize Consecution objects via abjadext.nauert.

Parameters:
  • default_time_signature_sequence (Sequence[abjad.TimeSignature]) – Set time signatures to divide the quantized abjad data in desired bar sizes. If the converted Consecution 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 Consecution (how the duration attribute will be interpreted). Can either be ‘beats’ (default) or ‘miliseconds’. WARNING: ‘miliseconds’ isn’t working properly yet!

  • 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, music_events
>>> converter = abjad_converters.ConsecutionToAbjadVoice(
...     abjad_converters.LeafMakerConsecutionToDurationLineBasedQuantizedAbjadContainer(
...        )
...    )
>>> seq = core_events.Consecution(
...     [
...         music_events.NoteLike("c", 0.25),
...         music_events.NoteLike("d", 1),
...         music_events.NoteLike([], 0.25),
...         music_events.NoteLike("e", 1),
...         music_events.NoteLike("e", 1)
...     ]
... )
>>> voice = converter.convert(seq)
>>> voice.consists_commands.append("Duration_line_engraver")

Public Methods:

convert(consecution_to_convert)

Inherited from NauertConsecutionToQuantizedAbjadContainer

convert(consecution_to_convert)

Inherited from ConsecutionToQuantizedAbjadContainer

convert(consecution_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


convert(consecution_to_convert)[source]
Parameters:

consecution_to_convert (Consecution) –

Return type:

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

class LeafMakerConsecutionToQuantizedAbjadContainer(*args, do_rewrite_meter=True, add_beams=True, concatenate_adjacent_tuplets=True, reduce_multiplier=True, **kwargs)[source]

Bases: ConsecutionToQuantizedAbjadContainer

Quantize Consecution object via abjad.LeafMaker.

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

  • concatenate_adjacent_tuplets (bool) – Set to True if quantizer should concatenate adjacent tuplets via mutwo.abjad_utilities.concatenate_adjacent_tuplets(). Because this function can make processing slower (and may lead to not-yet-fixed bugs) it can be deactivated if not used. Default to True.

  • reduce_multiplier (bool) – Set to True if quantizer should call mutwo.abjad_utilities.reduce_multiplier() after consecution has been quantized. Can be useful if working with tuplets. If no tuplets are used it can be deactivated for faster conversion. Default to True.

  • do_rewrite_meter (bool) –

  • add_beams (bool) –

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

  1. LeafMakerConsecutionToQuantizedAbjadContainer doesn’t support nested tuplets.

  2. LeafMakerConsecutionToQuantizedAbjadContainer 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 Consecution to the converter.

Public Methods:

convert(consecution_to_convert)

Inherited from ConsecutionToQuantizedAbjadContainer

convert(consecution_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


convert(consecution_to_convert)[source]
Parameters:

consecution_to_convert (Consecution) –

Return type:

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

class LeafMakerConsecutionToDurationLineBasedQuantizedAbjadContainer(*args, duration_line_minimum_length=6, duration_line_thickness=3, **kwargs)[source]

Bases: LeafMakerConsecutionToQuantizedAbjadContainer, _DurationLineBasedQuantizedAbjadContainerMixin

Quantize Consecution object via abjad.LeafMaker.

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

  • concatenate_adjacent_tuplets (bool) – Set to True if quantizer should concatenate adjacent tuplets via mutwo.abjad_utilities.concatenate_adjacent_tuplets(). Because this function can make processing slower (and may lead to not-yet-fixed bugs) it can be deactivated if not used. Default to True.

  • reduce_multiplier (bool) – Set to True if quantizer should call mutwo.abjad_utilities.reduce_multiplier() after consecution has been quantized. Can be useful if working with tuplets. If no tuplets are used it can be deactivated for faster conversion. Default to True.

  • 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, music_events
>>> converter = abjad_converters.ConsecutionToAbjadVoice(
...     abjad_converters.LeafMakerConsecutionToDurationLineBasedQuantizedAbjadContainer(
...        )
...    )
>>> seq = core_events.Consecution(
...     [
...         music_events.NoteLike("c", 0.25),
...         music_events.NoteLike("d", 1),
...         music_events.NoteLike([], 0.25),
...         music_events.NoteLike("e", 1),
...         music_events.NoteLike("e", 1)
...     ]
... )
>>> voice = converter.convert(seq)
>>> voice.consists_commands.append("Duration_line_engraver")

Public Methods:

convert(consecution_to_convert)

Inherited from LeafMakerConsecutionToQuantizedAbjadContainer

convert(consecution_to_convert)

Inherited from ConsecutionToQuantizedAbjadContainer

convert(consecution_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


convert(consecution_to_convert)[source]
Parameters:

consecution_to_convert (Consecution) –

Return type:

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

class CompoundToAbjadContainer(abjad_container_class, lilypond_type_of_abjad_container, compound_to_abjad_container_name, pre_process_abjad_container_routine_sequence, post_process_abjad_container_routine_sequence)[source]

Bases: Converter

Public Methods:

convert(compound_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


Parameters:
  • abjad_container_class (Type[Container]) –

  • lilypond_type_of_abjad_container (str) –

  • compound_to_abjad_container_name (Callable[[Compound], str]) –

  • pre_process_abjad_container_routine_sequence (Sequence[ProcessAbjadContainerRoutine]) –

  • post_process_abjad_container_routine_sequence (Sequence[ProcessAbjadContainerRoutine]) –

convert(compound_to_convert)[source]
Parameters:

compound_to_convert (Compound) –

Return type:

Container

class ConsecutionToAbjadVoice(consecution_to_quantized_abjad_container=LeafMakerConsecutionToQuantizedAbjadContainer(), default_tempo=FlexTempo(30.0), chronon_to_pitch_list=ChrononToPitchList(), chronon_to_volume=ChrononToVolume(), chronon_to_grace_note_consecution=ChrononToGraceNoteConsecution(), chronon_to_after_grace_note_consecution=ChrononToAfterGraceNoteConsecution(), chronon_to_playing_indicator_collection=ChrononToPlayingIndicatorCollection(), chronon_to_notation_indicator_collection=ChrononToNotationIndicatorCollection(), chronon_to_lyric=ChrononToLyric(), mutwo_pitch_to_abjad_pitch=MutwoPitchToAbjadPitch(), mutwo_volume_to_abjad_attachment_dynamic=MutwoVolumeToAbjadAttachmentDynamic(), tempo_to_abjad_attachment_tempo=ComplexTempoToAbjadAttachmentTempo(), mutwo_lyric_to_abjad_string=MutwoLyricToAbjadString(), event_to_tempo=None, abjad_attachment_class_sequence=None, write_multimeasure_rests=True, abjad_container_class=<class 'abjad.score.Voice'>, lilypond_type_of_abjad_container='Voice', compound_to_abjad_container_name=<function ConsecutionToAbjadVoice.<lambda>>, pre_process_abjad_container_routine_sequence=(), post_process_abjad_container_routine_sequence=(), duration_line_engraver=True, prepare_for_duration_line_based_notation=True)[source]

Bases: CompoundToAbjadContainer

Convert Consecution to abjad.Voice.

Parameters:

Public Methods:

convert(consecution_to_convert)

Convert passed Consecution.

Inherited from CompoundToAbjadContainer

convert(compound_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


ExtractedData

alias of tuple[list[Pitch], Volume, Consecution[Chronon], Consecution[Chronon], PlayingIndicatorCollection, NotationIndicatorCollection, Lyric]

ExtractedDataPerChronon

alias of tuple[tuple[list[Pitch], Volume, Consecution[Chronon], Consecution[Chronon], PlayingIndicatorCollection, NotationIndicatorCollection, Lyric], …]

convert(consecution_to_convert)[source]

Convert passed Consecution.

Parameters:

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

Return type:

Voice

Example:

>>> import abjad
>>> from mutwo import core_events, music_events
>>> from mutwo import abjad_converters
>>> seq = core_events.Consecution(
...     [
...         music_events.NoteLike(p, d)
...         for p, d in zip("c a g e".split(" "), (1, 1 / 6, 1 / 6, 1 / 6))
...     ]
... )
>>> converter = abjad_converters.ConsecutionToAbjadVoice()
>>> voice = converter.convert(seq)
class NestedCompoundToAbjadContainer(nested_compound_to_compound_to_abjad_container_converters_converter, abjad_container_class, lilypond_type_of_abjad_container, compound_to_abjad_container_name=<function NestedCompoundToAbjadContainer.<lambda>>, pre_process_abjad_container_routine_sequence=(), post_process_abjad_container_routine_sequence=())[source]

Bases: CompoundToAbjadContainer

Public Methods:

Inherited from CompoundToAbjadContainer

convert(compound_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


Parameters:
class NestedCompoundToCompoundToAbjadContainers[source]

Bases: Converter

Public Methods:

convert(nested_compound_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


abstract convert(nested_compound_to_convert)[source]
Parameters:

nested_compound_to_convert (Compound) –

Return type:

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

class CycleBasedNestedCompoundToCompoundToAbjadContainers(compound_to_abjad_container_converter_sequence)[source]

Bases: NestedCompoundToCompoundToAbjadContainers

Public Methods:

convert(nested_compound_to_convert)

Inherited from NestedCompoundToCompoundToAbjadContainers

convert(nested_compound_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


Parameters:

compound_to_abjad_container_converter_sequence (Sequence[CompoundToAbjadContainer]) –

convert(nested_compound_to_convert)[source]
Parameters:

nested_compound_to_convert (Compound) –

Return type:

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

class TagBasedNestedCompoundToCompoundToAbjadContainers(tag_to_abjad_converter_dict, compound_to_tag=<function TagBasedNestedCompoundToCompoundToAbjadContainers.<lambda>>)[source]

Bases: NestedCompoundToCompoundToAbjadContainers

Public Methods:

convert(nested_compound_to_convert)

Inherited from NestedCompoundToCompoundToAbjadContainers

convert(nested_compound_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


Parameters:
convert(nested_compound_to_convert)[source]
Parameters:

nested_compound_to_convert (Compound) –

Return type:

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

class MutwoLyricToAbjadString[source]

Bases: Converter

Public Methods:

convert(mutwo_lyric_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


convert(mutwo_lyric_to_convert)[source]
Parameters:

mutwo_lyric_to_convert (Lyric) –

Return type:

str

class MutwoPitchToAbjadPitch(allowed_division_sequence=(Fraction(1, 2),))[source]

Bases: Converter

Convert Mutwo Pitch objects to Abjad Pitch objects.

Parameters:

allowed_division_sequence (Sequence[fractions.Fraction]) – MutwoPitchToAbjadPitch rounds microtonal music_parameters.WesternPitch in order to make them notatable with Lilypond. By default they are rounded to quarter-tones (because Lilypond support quarter-tones). If you’d like to omit quarter tones you can set this to (fractions.Fraction(1, 1),). See also the documentation of round_to method from music_parameters.WesternPitch for further information.

This default class simply checks if the passed Mutwo object belongs to mutwo.music_parameters.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 hertz 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(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


convert(pitch_to_convert)[source]
Parameters:

pitch_to_convert (Pitch) –

Return type:

Pitch

class TempoToAbjadAttachmentTempo[source]

Bases: Converter

Convert tempo envelope to Tempo.

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

Public Methods:

convert(tempo_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


abstract convert(tempo_to_convert)[source]
Parameters:

tempo_to_convert (Tempo) –

Return type:

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

class ComplexTempoToAbjadAttachmentTempo[source]

Bases: TempoToAbjadAttachmentTempo

Convert tempo 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_to_convert)

Inherited from TempoToAbjadAttachmentTempo

convert(tempo_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


convert(tempo_to_convert)[source]
Parameters:

tempo_to_convert (Tempo) –

Return type:

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

class MutwoVolumeToAbjadAttachmentDynamic[source]

Bases: Converter

Convert Mutwo Volume objects to Dynamic.

This default class simply checks if the passed Mutwo object belongs to mutwo.music_parameters.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.music_parameters.WesternVolume.from_amplitude method.

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

Public Methods:

convert(volume_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


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]

Bases: MutwoPitchToAbjadPitch

Convert JustIntonationPitch to abjad pitches.

Parameters:

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

Example:

>>> from mutwo import music_parameters
>>> from mutwo import abjad_converters
>>> p = music_parameters.JustIntonationPitch('5/4')
>>> converter_on_a = abjad_converters.MutwoPitchToHEJIAbjadPitch(reference_pitch='a')
>>> converter_on_c = abjad_converters.MutwoPitchToHEJIAbjadPitch(reference_pitch='c')
>>> converter_on_a.convert(p)
NamedPitch("csoaa''")
>>> converter_on_c.convert(p)
NamedPitch("eoaa'")

Public Methods:

convert(pitch_to_convert)

Inherited from MutwoPitchToAbjadPitch

convert(pitch_to_convert)

Inherited from Converter

convert(...)

Inherited from MutwoObject

copy()

Return a deep copy of mutwo object.


convert(pitch_to_convert)[source]
Parameters:

pitch_to_convert (Pitch) –

Return type:

Pitch

class ProcessAbjadContainerRoutine[source]

Bases: ABC


class AddDurationLineEngraver[source]

Bases: ProcessAbjadContainerRoutine


class PrepareForDurationLineBasedNotation[source]

Bases: ProcessAbjadContainerRoutine


class AddInstrumentName(compound_to_instrument_name=<function AddInstrumentName.<lambda>>, compound_to_short_instrument_name=<function AddInstrumentName.<lambda>>, instrument_name_font_size='teeny', short_instrument_name_font_size='teeny')[source]

Bases: ProcessAbjadContainerRoutine


Parameters:
  • compound_to_instrument_name (Callable[[Compound], str]) –

  • compound_to_short_instrument_name (Callable[[Compound], str]) –

  • instrument_name_font_size (str) –

  • short_instrument_name_font_size (str) –

class AddAccidentalStyle(accidental_style)[source]

Bases: ProcessAbjadContainerRoutine


Parameters:

accidental_style (str) –

class SetStaffSize(difference_of_size)[source]

Bases: ProcessAbjadContainerRoutine


Parameters:

difference_of_size (int) –

mutwo.abjad_converters.configurations

Configure mutwo.abjad_converters.

DEFAULT_ABJAD_ATTACHMENT_CLASS_TUPLE = (<class 'mutwo.abjad_parameters.attachments.AfterGraceNoteConsecution'>, <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.GraceNoteConsecution'>, <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.NaturalHarmonicNodeList'>, <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.RehearsalMark'>, <class 'mutwo.abjad_parameters.attachments.Slur'>, <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 ConsecutionToAbjadVoiceConverter.

mutwo.abjad_converters.constants

Constants for mutwo.abjad_converters.

INEFFECTIVE_INDICATOR_FOR_MULTIMEASURE_REST_TUPLE = (<class 'abjad.indicators.Fermata'>,)

Define indicators which don’t work with multimeasure rests.

Some indicators aren’t rendered in Lilypond when applied to multimeasure rests. Therefore mutwo.abjad avoids creating multimeasure rests if a to a rest any of the given indicator classes where attached.