Pyquist documentation¶
pyquist provides basic utilities for low-level computer music programming
in Python and NumPy. It is designed for learning and is the teaching library
for CMU’s 15-322 Intro to Computer Music.
Source code: https://github.com/gclef-cmu/pyquist
Hands-on walkthrough: HelloPyquist notebook (or run it in Colab without installing anything)
This site is the auto-generated API reference.
Installation¶
Requires Python 3.10 or later and git (used by pip to fetch the
package).
macOS¶
brew install git [email protected] # or 3.11, 3.12, 3.13
python3.10 -m venv .venv
source .venv/bin/activate
pip install --upgrade git+https://github.com/gclef-cmu/pyquist.git
If pq.play(...) is silent, give Terminal (or your IDE) microphone/audio
access in System Settings → Privacy & Security → Microphone.
Linux¶
Install Python, git, and the PortAudio system library that sounddevice
wraps:
# Debian / Ubuntu
sudo apt install python3 python3-venv git libportaudio2
# Fedora
sudo dnf install python3 python3-virtualenv git portaudio
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade git+https://github.com/gclef-cmu/pyquist.git
Windows¶
Install Python (3.10 or later, with “Add Python to PATH” checked) and Git for Windows, then in Command Prompt:
python -m venv .venv
.venv\Scripts\activate.bat
pip install --upgrade git+https://github.com/gclef-cmu/pyquist.git
Key API¶
Most users only need a handful of symbols. Click through for details.
pyquist.Audio— wrap a numpy array of samples as audiopyquist.play()— playback (auto-detects notebook vs. sounddevice)pyquist.plot(),pyquist.plot_freq(),pyquist.plot_spec()— visualizationpyquist.score.Score,pyquist.score.Event,pyquist.score.BasicMetronome— onset-based scores and rendering