Skip to main content

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.

Metadata

Release files for pctheory 0.0.45

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pctheory 0.0.45
File Size Uploaded
pctheory-0.0.45.tar.gz 1.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pctheory 0.0.45
File Interpreter ABI Platform
pctheory-0.0.45-py3-none-any.whl Python 3 none any Details

Total release size: 2.4 MB

Release files / pctheory-0.0.45.tar.gz

Download URL pctheory-0.0.45.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
bb377680b6e66e93660719c4088705cc126b712f5af06e5a2a08398da86ffe5f
BLAKE2b-256 checksum
How to use checksums
90901b1517df00dfbb8698ca124f1c381ea01400eeae6cd68504aeb5303efa90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / pctheory-0.0.45-py3-none-any.whl

Download URL pctheory-0.0.45-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
834518a20d86fec9f30871c900787acf5578a518e14dc66304fb3552d10cb19a
BLAKE2b-256 checksum
How to use checksums
bc83bb50c45cf5a8eba1444531225e2f0b74aaf72b6962a034a372a8ed11f193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page