Skip to main content

A package with functionality for atonal music theory

Project description

pctheory

pctheory is a Python library for using atonal music theory. It is useful for both computer-assisted composition in Python and analysis. Some of the many useful features include:

  • Set-classes
    • Generate all abstract subsets of a set-class
    • Get Forte and Carter names for a set-class
    • Work with microtonal sets
    • Generate set-class-complexes
  • Rows
    • Generate a twelve-tone matrix
    • Generate a rotational array
    • Generate an invariance matrix
    • Load a random all-interval, all-trichord, ten-trichord, or Babbit ten-trichord row

pctheory is much more specialized than music21, and offers substantially more functionality in atonal theory. Additionally, it does not use music21 objects, so there is less computational overhead when using pctheory. It is not difficult to create music21 objects from pctheory objects, which allows pctheory to be used along with music21.

Installation

pctheory is a Python package and can be installed with the command pip install pctheory from the terminal on your computer (Command Prompt or PowerShell on Windows, Terminal on Linux or macOS). Note that you need Python 3.10 or newer.

If the pip install command fails, you will need to build the wheel yourself. Create a virtual environment with the packages build, setuptools, and wheel installed. Then run the command python -m build from the root of this repository. The wheel will be found in the dist/ directory.

Quick start

There are three Jupyter notebooks in this repository that you can consult to get started with pctheory.

Stability

pctheory is currently in alpha status. This means that some functionality might not be stable yet. In particular, there isn't unit test coverage for the whole package at this point. However, the core functionality (such as pitch class operations, set-classes, and row functionality) does have test coverage and should be stable. To see current testing coverage, you can take a look at the tests in the tests directory.

System Requirements

pctheory requires Python 3.10 or newer.

Documentation

Documentation can be found at https://pctheory.readthedocs.io/en/latest/.

Copyright and license

pctheory is copyright © 2024 by Jeffrey Martin. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. To view the GNU General Public License v.3.0, visit https://www.gnu.org/licenses/gpl-3.0.en.html.

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

pctheory-0.0.44.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

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

pctheory-0.0.44-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file pctheory-0.0.44.tar.gz.

File metadata

  • Download URL: pctheory-0.0.44.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pctheory-0.0.44.tar.gz
Algorithm Hash digest
SHA256 c793e48a8ba86302aa0c6221df4164b2fa7597cc1997615e7fa9eede55f96d5a
MD5 2c11d9ffe33ba819f848244ede9afa4c
BLAKE2b-256 09a9d5ea4824e3a93c07a9c9f9f0ce8fc4e31c805b66474101591583ffc65664

See more details on using hashes here.

File details

Details for the file pctheory-0.0.44-py3-none-any.whl.

File metadata

  • Download URL: pctheory-0.0.44-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pctheory-0.0.44-py3-none-any.whl
Algorithm Hash digest
SHA256 fadff7cd08412567e23c6e2b0af4c1edab47d3383e354cca1f55d5a0eb2cc387
MD5 9b9bb126b2c09fdc9de2ee92d7f108cb
BLAKE2b-256 702ec0124a93ec6e0195f9f00b59b4bd2d5b7e5a0de293b181ec11174cc03a37

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