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, the simpleaudio
package
will be needed.
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.2.0 adds support for playing audio directly via
IPython
when 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
louder
can cause volume values to go above 1.0, but internally loudness does not increase beyond 1.0. This means that symmetric calls tolouder
and thenquieter
will always cancel each other out, even if thelouder
calls would take the volume above 1.0. - Version 2.0.0 replaces
stepUp
andstepDown
withclimbUp
andclimbDown
and removesleapUp
andleapDown
. New functions likesetFundamental
andsetScaleType
manage an internal notion of key signature which controls howclimbUp
andclimbDown
change pitches. To emulate the oldleap
functionality, set the scale type to a pentatonic scale and use theclimb
functions.
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
File details
Details for the file wavesynth-2.2.0.tar.gz
.
File metadata
- Download URL: wavesynth-2.2.0.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 946498a64efaf296056947ce9a52379a61bf39aa2114ddd48f75557d2c40f4a4 |
|
MD5 | cf20cde2102db31fe29277bb2f6bb169 |
|
BLAKE2b-256 | dc8dcba3cac31cd927fe67049cea6b0c3016030f87bf5fe3364c94618ff4293d |
File details
Details for the file wavesynth-2.2.0-py3-none-any.whl
.
File metadata
- Download URL: wavesynth-2.2.0-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9fff43877322c4c0ceed309bda6af706b55cc669c2ba9cd25012006975e042e |
|
MD5 | 5338ab1d1a50236fef48ef59a3243e94 |
|
BLAKE2b-256 | 9f7f3482979dd2baedda55c54c482ce4353e783baec6c58abf0fe7e93821ffb4 |