Simple sound-synthesis library for very basic music creation, intended for beginner programmers.
Project description
wavesynth
A simple sound-synthesis library that provides a simplified stateful API
for generating music. The API is intentionally analogous to the turtle
API to assist in the creation of music-based assignments that duplicate
lessons from graphics-based assignments for more accessible course
design.
The library has fairly unsophisticated synthesis resulting in pretty basic sounds, and is also not super performant, although both of these things could be improved.
A log of notes is printed to assist with debugging and/or for matching desired output.
Designed by Peter Mawhorter. Contributions from Lyn & Ohana Turbak.
Dependencies
Writing audio to .wav files can be accomplished using just the built-in
Python modules, but if you want to play audio directly from Python,
you'll need either pyglet or simpleaudio.
Installing
To install from PyPI, run the following command on the command-line:
python -m pip install wavesynth
Once it's installed, you can run a built-in example using:
python -m wavesynth
Documentation
See the documentation for more details on how to use it and what each function does.
Changelog
- Version 2.3.0 allows the use of
pygletinstead ofsimpleaudioforplayTracksupport as well as adding an open-in-browser fallback. - Version 2.2.0 adds support for playing audio directly via
IPythonwhen running in a Jupyter notebook, without needing to usesimpleaudio. This also creates an audio widget in the page via which the sound can be replayed without re-running the code if desired. - Version 2.1.0 changes volume handling so that
loudercan cause volume values to go above 1.0, but internally loudness does not increase beyond 1.0. This means that symmetric calls tolouderand thenquieterwill always cancel each other out, even if theloudercalls would take the volume above 1.0. - Version 2.0.0 replaces
stepUpandstepDownwithclimbUpandclimbDownand removesleapUpandleapDown. New functions likesetFundamentalandsetScaleTypemanage an internal notion of key signature which controls howclimbUpandclimbDownchange pitches. To emulate the oldleapfunctionality, set the scale type to a pentatonic scale and use theclimbfunctions.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wavesynth-2.3.0.tar.gz.
File metadata
- Download URL: wavesynth-2.3.0.tar.gz
- Upload date:
- Size: 23.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53cabc36249b3099f3b42203f84006a1d9f578af9fd705b4461663034464fb27
|
|
| MD5 |
2f9701b496ad4542c9c2ee8e43869d1a
|
|
| BLAKE2b-256 |
4dc48a9f6f2be0882401e386b15bb83465a53b529c82501bca18cbd47af96f78
|
File details
Details for the file wavesynth-2.3.0-py3-none-any.whl.
File metadata
- Download URL: wavesynth-2.3.0-py3-none-any.whl
- Upload date:
- Size: 24.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6005514d80fac22b6f70ac48861e2869b452bcd0692868b25eaf1677a0e7a70
|
|
| MD5 |
8e30131e32c24279f3f9446449a774a5
|
|
| BLAKE2b-256 |
55c6abcc50e92c04b0d5f811b6118f48c59c30dfcc2c066a1ec6301f11248a8e
|