Welcome to mutwo’s documentation!§

Mutwo is a flexible, event based framework for composing music or other time-based arts in Python. It aims to help composers to build musical structures in a meaningful way and translate those structures to different third party objects (e.g. midi files, csound scores, musical notation with Lilypond via Abjad). The general design philosophy stresses out the independence and freedom of the user with the help of generic data structures and an easily extensible and tweakable software design.

The following example generates a short midi file:

from mutwo import core_events
from mutwo import music_events
from mutwo import midi_converters
simple_melody = core_events.SequentialEvent(
    [
        music_events.NoteLike(pitch_name, duration=duration, volume="mf")
        for pitch_name, duration in (
            ("c", 0.75),
            ("a", 0.25),
            ("g", 1 / 6),
            ("es", 1 / 12),
        )
    ]
)
event_to_midi_file = midi_converters.EventToMidiFile()
event_to_midi_file.convert(simple_melody, "my_simple_melody.mid")

Indices and tables§