PyTuning: A Python Framework for Exploring Musical Scales

Thu 01 December 2016

As discussed in a new musical scale, in the course of exploring alternate tunings and scales I developed a Python-based framework for creating and analyzing such scales. I'm pleased to announce that I have released this software as an open-source project.


Some of the package's features include:

  • Creation of scales in a variety of ways (EDO, Euler-Fokker, Diatonic, Harmonic, from generator intervals, etc.)
  • Ability to represent created scales in ways that are understood by external software (Scala, Timidity, Fluidsynth, Yoshimi, Zynaddsubfx).
  • Some analysis functions (for example, PyTuning provides a framework for searching for scale modes based upon defined metric functions and combinatorial analysis). Also included are some number-theoretic functions, such as prime limits and odd limits.
  • Some scale visualizations.
  • Interactive use.

The package may either be used as a development library or as a console-based application (but this requires some familiarity with Python).

As an example of use, the following session shows the creation of the scale referenced above, as well as the creation of two tuning tables so that it can be used in musical compositions:


The package is registered at the Python Package Index, and can be installed via the normal channels:

pip install pytuning

However, some care must be taken in choosing the dependencies to install, so I'd suggest that you take a look at the project's documentation before installing.


Documentation for the project can be found at The documentation is relatively complete, but as the software has just been released, it's probably somewhat riddled with typos.

Source Code

The source code is available via an MIT-style open-source license, and can be accessed at GitHub.