Abstract MIDI pitches into keys, chords, modes, scales, and notes.
Project description
midi_abstraction
Abstract midi pitches into keys, chords, modes, scales, and notes.
Installation
# From pip
pip install midi_abstraction
# From source
pip3 install --user --break-system-packages .
- requires python 3.10 or newer
Usage
#!/usr/bin/env python3
import midi_abstraction as mab
# Get a midi note from a letter
octave = 4
middle_c = mab.NOTES["c"][octave]
# Get a letter note from a midi pitch
some_note = None
for k, v in mab.NOTES.items():
if 48 in v:
some_note = k
break
# Get a pitch for a drum
side_stick = mab.Drum.SIDE_STICK.value
# Get a drum from a pitch
some_drum = mab.Drum(35)
# List all drums
list(mab.Drum)
# List all chord names
list(mab.Chord)
# Get the note names that a chord is made of
c_major_notes = mab.CHORDS['c_major']
# Get the notes and chords from any mode/key.
# These are a list of sets due to enharmonic equivalence.
c_major_chords = mab.MAJOR.chords('c')
eb_phrygian_notes = mab.PHRYGIAN.notes('eb')
# Get chords from scale degrees
third_degree_chord = next(iter(mab.MAJOR.chords('c')[2]))
# Get the notes for a chord in a particular octave
octave = 4
middle_c_major_notes = []
for note in mab.CHORDS['c_major']:
middle_c_major_notes.append(mab.NOTES[note][octave])
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-2.0.1.tar.gz
(17.3 kB
view hashes)
Built Distribution
Close
Hashes for midi_abstraction-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6eecae6d8daa5e27d304b7d868983ae6d79055683b81289842b32cc300942aee |
|
MD5 | 7f402b8cce3df2785fd6df3e643cd2e6 |
|
BLAKE2b-256 | f17c82281e29a69c886269deec0e8da9c4e9e78d842d919c30888b169cf479a1 |