Skip to main content

A Python library that gives musical theory contend.

Project description

PySongTool

🎵 Music Theory with Python

Version: beta 0.10

PySongTool is a Python library designed to help provide information involving music theory

This project follows SOLID principles and uses the Facade design pattern to organize and simplify the management of classes and functions.


📚 Requirements

  • Python >= 3.7

🔧 Installation

You can install PySongTool directly from PyPI (when available) or locally:

pip install pysongtool

Or clone the repository and install it manually:

git clone https://github.com/your-username/pysongtool.git
cd pysongtool
pip install .

🗂 Features

  • Generate chords from a root note and chord name.
  • Get all available scales or chords.
  • Explore musical intervals based on a root note.
  • Retrieve detailed scale information, including notes and associated chords.

🚀 How to Use

Creating an Instance

from pysongtool import PySongTool

tool = PySongTool()

Generating a Chord

result = tool.chord('C', 'maj')
print(result)
# {'chord': 'Cmaj', 'notes': ['C', 'E', 'G']}

Listing All Chords

all_chords = tool.all_chords('C')
print(all_chords)
# [{'maj': {'chord': 'Cmaj', 'notes': ['C', 'E', 'G']}}, ...]

Generating a Scale

scale = tool.scale('C', 'major')
print(scale)
# {'notes': ['C', 'D', 'E', 'F', 'G', 'A', 'B'], 'chords': ['Cmaj', 'Dmin', ...]}

Getting Intervals

intervals = tool.intervals('C')
print(intervals)
# [{'name': 'Unison', 'semitones': 0, 'note': 'C'}, ...]

Calculating Intervals Between Notes

intervals = tool.get_interval('C', 'E', 'G')
print(intervals)
# [{'note': 'E', 'interval': {'name': 'Major Third', 'semitones': 4}}, ...]

🛠 Contributing

Contributions are welcome! To collaborate:

  1. Fork the repository.
  2. Create a branch for your feature/bugfix:
    git checkout -b my-feature
    
  3. Commit your changes:
    git commit -m "Description of my feature"
    
  4. Push to your fork:
    git push origin my-feature
    
  5. Open a Pull Request in the main repository.

📝 License

This project is licensed under the MIT License.


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

pysongtool-0.10.5.tar.gz (8.0 kB view details)

Uploaded Source

File details

Details for the file pysongtool-0.10.5.tar.gz.

File metadata

  • Download URL: pysongtool-0.10.5.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for pysongtool-0.10.5.tar.gz
Algorithm Hash digest
SHA256 aca5658888204ba8b249c86dc7fa27f5362705c854a01f7046946dec4706470f
MD5 c433d38844ee83abb14426878273da1e
BLAKE2b-256 7c2f48e305e0ff860cacc85ff7dc443c50da75a6229c5fff97b7653b66fd1e5d

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