Skip to main content

Python library for MIDI music creation

Project description

Documentation Status Tests Status

Melodia is a Python library for MIDI music creation.

It provides four core concepts – tone, time signature, note and track and various abstractions built on them, such as chords and chord progressions. Library contains MIDI writer which allows to output tracks to MIDI files in order to export them to any DAW.

Installation

Melodia is fully typed and requires Python 3.7 or greater.

pip install melodia

Documentation

Documentation is available at melodia.readthedocs.io.

Example

from melodia.core.track import Track
from melodia.music import chord
from melodia.io import midi

track = Track(signature=(4, 4))

track.add(chord.maj('C3', (1, 1)))
track.add(chord.maj('D3', (1, 1)))
track.add(chord.min('A3', (1, 1)))
track.add(chord.maj7('G3', (1, 1)))

with open('chords.mid', 'wb') as f:
    midi.dump(track, f)
Ableton Live 10 with imported chords

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

melodia-1.1.tar.gz (14.9 kB view hashes)

Uploaded Source

Built Distribution

melodia-1.1-py3-none-any.whl (18.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page