Abstract MIDI pitches into keys, chords, modes, notes, and octaves.
Project description
midi_abstraction
Abstract midi pitches into keys, chords, modes and notes.
This, combined with a midi file creation package like 'mido', and maybe a little help from builtin 'random', is all you need to procedurally generate music.
Installation
pip install midi_abstraction
Usage
#!/usr/bin/env python3
import midi_abstraction
# get a list of keys
available_keys = midi_abstraction.list_key_names()
# get a list of available notes
available_notes = midi_abstraction.list_note_names()
# get a list of available modes
available_modes = midi_abstraction.list_mode_names()
# create a musical key object
songkey = midi_abstraction.Key('a_major')
# list chords in the key
songkey.list_chord_names()
# list note names in mode
songkey.list_note_names_in_mode('mixolydian')
# list midi note pitches in specific octave
songkey.list_notes_in_octave(4)
# access a dict of chords in songkey here.
chords = songkey.chords
# you can also access modes like this.
ionian = songkey.ionian
# iterate through the chords to get midi pitches.
for key, value in songkey.chords.items():
print(f'{key}: {value})
# print chord names and midi pitches of the notes in each chord, specifying octave.
print(songkey.chords_in_octave(4))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
midi-abstraction-0.9.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for midi_abstraction-0.9.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 686090a45609ee66dbd141d83f244bb5eebb1055f696ef3e4e63b9fff394eb8e |
|
MD5 | ca63da759fb65402e231162a0a5fe091 |
|
BLAKE2b-256 | 146daf3891c0a4fc199f1a3aaf0c0742ac3b9536d960971ef06ca12420770c76 |