Abstract MIDI pitches into keys, chords, modes, notes, and octaves.
Project description
midi_abstraction
Abstract midi pitches into keys, chords, modes, scales, 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_keys()
# get a list of available notes
available_notes = midi_abstraction.list_notes()
# get a list of available modes
available_modes = midi_abstraction.list_modes()
# create a musical key object
songkey = midi_abstraction.Key('a_major')
# list chords in the key
songkey.list_chords()
# list note names in mode
songkey.list_notes_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
# access pentatonic major and minor scales
pentatonic_major = songkey.list_notes_in_pentatonic_major()
pentatonic_minor = songkey.list_notes_in_pentatonic_minor()
# 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))
# turn any named note into a midi pitch
notes = Notes()
c_sharp_pitch = notes.all['cs']
# get any chord from any key, or pitches of any note outside of the key
songkey.universal_chords
songkey.universal_notes
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.4.tar.gz
(4.5 kB
view hashes)
Built Distribution
Close
Hashes for midi_abstraction-0.9.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54d762053960b533cc8406147a30dd77e6be204e38c73a47c6b43fac6a7e81f9 |
|
MD5 | cad5b9716efef7455f9271ebfa65a9c9 |
|
BLAKE2b-256 | 79b9725840b23162dbf53c081f8bc1b618c97e927f432c19948bf0d9835503a0 |