Skip to main content

Twelve-tone matrix to generate dodecaphonic melodies

Project description

Twelve-tone matrix to generate dodecaphonic melodies.

https://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Schoenberg_-_Piano_Piece_op.33a_tone_row.png/640px-Schoenberg_-_Piano_Piece_op.33a_tone_row.png

Following a process created by the composer Arnold Schoenberg, this library computes a matrix to create twelve-tone serialism melodies which compose each of the 12 semitones of the chromatic scale with equal importance.

  • Save your compositions to MIDI

  • Free software: BSD license

Installation

pip install twelve-tone

Quick Start

You can quickly generate a random twelve-tone melody with the CLI

$ twelve-tone
['C# / Db', 'A# / Bb', 'F', 'D', 'G# / Ab', 'D# / Eb', 'F# / Gb',
    'A', 'C', 'G', 'B', 'E']

Or you can use the following methods in a script:

>>> from twelve_tone.composer import Composer
>>> c = Composer()
>>> c.compose()
>>> c.get_melody()
['C# / Db', 'A# / Bb', 'F', 'D', 'G# / Ab', 'D# / Eb', 'F# / Gb',
    'A', 'C', 'G', 'B', 'E']

After you have composed a matrix of tone rows, you can save the composition to MIDI:

>>> c.compose()
>>> c.save_to_midi(filename='TWELVE_TONE.mid')

The new MIDI file will be created in your current working directory. If you do not specify a filename for your file, it will default to example.mid.

Documentation

https://python-twelve-tone.readthedocs.io/

Development

To run the all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox

Changelog

0.3.0 (2018-7-04)

  • cli: added random melody generator command

0.2.1 (2016-8-27)

  • build: added miditime to setup install requirements

0.2.0 (2016-8-27)

  • composer: Added save to MIDI capability

0.1.0 (2016-8-20)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twelve-tone-0.3.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twelve_tone-0.3.0-py2.py3-none-any.whl (7.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file twelve-tone-0.3.0.tar.gz.

File metadata

  • Download URL: twelve-tone-0.3.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for twelve-tone-0.3.0.tar.gz
Algorithm Hash digest
SHA256 27753d0dcb300be8babf02b1226dda2eb466bd8ac7f3b5cf71665b5c7703d8ae
MD5 ebfb92f9a511a0844d094e919e8e3190
BLAKE2b-256 e7fa3666d86cc231b436bcc541c184f9bc1237c0aab6d09fddbe09e0312d15b7

See more details on using hashes here.

File details

Details for the file twelve_tone-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for twelve_tone-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8f035c5c619ab55cdee113bfd6d9e5f55db0428a06e7caaf76c66b6f02cdb7f4
MD5 f45f20ba98c4716d85040a50c522718b
BLAKE2b-256 a305e5494d4cd4a39fc4c7ce85e1ad649f14603b63b106ce80e63d0c4cca057b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page