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])
Metadata
Release files for midi-abstraction 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| midi-abstraction-2.0.2.tar.gz | 17.3 kB | Without provenance | Details for midi-abstraction-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| midi_abstraction-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for midi_abstraction-2.0.2-py3-none-any.whl |
Total release size: 35.0 kB
Release files / midi-abstraction-2.0.2.tar.gz
| Download URL | midi-abstraction-2.0.2.tar.gz |
|---|---|
| Size | 17.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b1f5b8eca2b05867af82503e8e2ffb5faa88f45ec99fddcf535092b4d2459be
|
|
BLAKE2b-256 checksum How to use checksums |
c4f1106e8000f9ec1de623d7ab2354e1df349de07b552cc4e5cc5ac4f108ca8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / midi_abstraction-2.0.2-py3-none-any.whl
| Download URL | midi_abstraction-2.0.2-py3-none-any.whl |
|---|---|
| Size | 17.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f64e7e3d36d91b7007f2aad3429579f8a01a204535df669233d51a46dabe8307
|
|
BLAKE2b-256 checksum How to use checksums |
404743e39defd4ed22ca11b4f82e6dd01ca496bc827a22eb5f4ef935cccae73c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Security for midi-abstraction 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.