24
Aug
mingus: Music Theory for Python
Last time I posted a rather chaotic and not-very-to-the-point journal of some of the things that are wrong with the use of naive algorithms to represent the ideas in music theory. I couldn't get this thing out of my head and decided to start working on a fundamental music theory and notation package for Python to make writing open source music applications easier.

Today I'm happy to announce that mingus, as the package was dubbed, is currently at version 0.1.7.5 and encapsulates most of the things I set out to make (and much more). The features, so far:

  • Work with notes, intervals, chords, progressions, scales, keys and meters in a simple and theoretically sound way.
  • Generate natural diatonic intervals (seconds, thirds, fourths, etc) and absolute intervals (minor seconds, perfect fifths, etc.)
  • Generate natural diatonic triads and seventh chords, and absolute chords (min7, m/M7, etc). mingus also knows about inverted chords.
  • Refer to chords by their diatonic function (tonic, subtonic, etc. or I, ii, iii, IV, etc).
  • Work with diatonic scales and their modes (ionian, mixolydian, etc.),
  • generate the minor (natural, harmonic and melodic) and chromatic or whole note scales.
  • Recognize intervals and chords from lists of notes.

Here are some simple examples:

>>> from mingus.core import *
>>> chords.minor_seventh("C")
['C', 'Eb', 'G', 'Bb']
>>> progressions.to_chords(["I", "IV", "V"], "C")
[['C', 'E', 'G'], ['F', 'A', 'C'], ['G', 'B', 'D']]
>>> intervals.minor_fifth("C")
'Gb'


You can download mingus, follow its development and learn more about the package at mingus project's page on
googlecode
. To give you a preview of what's to come, here is what a simple bar currently looks like:



The representation is still missing a couple of things as you can see, but work continues.

More mingus here

UPDATE: Version 0.3 of mingus has been released.



No Comments

Be the first to leave a comment for this article ;)


Leave a comment
Name*
E-mail
Website
Title*
Comment*
Notify me when somebody else comments on this article