Skip to main content

Play music notes in your Python scripts with ease.

Project description

musicnotes

Play music notes in your Python scripts with ease.

Installation

Install with pip:

pip install musicnotes

You can also install manually from the GitHub repository linked here.

Issues

Anyone wishing to contribute to this project can focus on the following issues.

Instruments

We need to add more instruments, and more keys to the piano, as well as more notes to the guitar as well. This would be a good first PR for anyone willing to contribute to this project.

Asynchronous Audio

The current solution I've developed for playing the notes has trouble playing them more smoothly, and anyone who tests this software will notice how the notes sound when trying to play a song.

Sound Quality

Anyone with access to higher quality sounds for notes can contribute to this project by adding these sounds. Please be sure that these sounds do not violate anyone else's copyright.

General

If you find a bug while using this software, feel free to create an issue on this repository. More on how to create an issue here.

Documentation

Currently, this project only supports a limited number of piano keys, and up to the 5th fret on an acoustic guitar. This project is open-source, so anyone who wants to add more instruments, more keys, or higher quality audio can make a pull request and do so. You can learn more about pull requests here.

This module contains one function, "note". This function contains several arguments in order to clearly define the sound of the note.

note(note, pitch, sharp, flat, instrument)

Arguments:

note: Takes in a letter, from A-G, and plays the corresponding note.

pitch: Currently, three 'pitches' are supported. low, mid, and high. This is due to the fact that the only instrument supported is a 36-key piano, as well as about 36 notes on a guitar. Set to mid by default.

sharp: Set to False by default. Set to True if you want to sharp the note. Remember that B# and E# do not exist.

flat: Set to False by default. Set to True if you want to flat the note.

instrument: Set to piano by default. Currently only supports piano and guitar, with plans to add more instruments in the future.

soundPlayer

This portion of the project is heavily inspired by Taylor S. Marks' project, playsound.

The main thing any contributors need to focus on is the block argument in soundPlayer. This is set to true by default. However, setting this to False will allow sounds to run asynchronously. This will be something that needs to be updated later on, as currently, the notes play very separately, and make it difficult to play smooth-flowing music.

You can also contribute by updating soundPlayer, possibly making it better for our use case.

Copyright

This software is Copyright (c) 2025 Mustaeen Ahmed

See LICENSE for more information.

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

musicnotes-1.14.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

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

musicnotes-1.14-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file musicnotes-1.14.tar.gz.

File metadata

  • Download URL: musicnotes-1.14.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for musicnotes-1.14.tar.gz
Algorithm Hash digest
SHA256 0b64dec175c5e183e25ba4134ba4ade19006659563c15c8322587edff28df35a
MD5 5de3e0a7de853f9c515afb90fdcc2ab9
BLAKE2b-256 723f6cb8ada0a5d625e3c241d76041b555f2f360fde8e008f0d4add442cc49f2

See more details on using hashes here.

File details

Details for the file musicnotes-1.14-py3-none-any.whl.

File metadata

  • Download URL: musicnotes-1.14-py3-none-any.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for musicnotes-1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 8051080785e1370ce1c02ae9c5ce9d12d1823adeece07a8a1635402651216dcb
MD5 6fe0c35296e9726600fda83ce376040f
BLAKE2b-256 da7c3635fa34e3ff08fd1ffb09d84fcb8cc9fd7cd316199ffb094be40b3c76a3

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