p5.sound.js extends the musical and sonic capabilities of p5.js. It is designed to be a minimal abstraction of the Tone.js library with a feature set that is inspired by p5.js's approach to accessible and poetic creative coding. Key functionalities include audio input, sound file playback and manipulation, effects, synthesis and analysis.
- A set of p5.sound examples are in this repo at examples/
- The original examples can be found on the p5.js web editor here. Note that these may differ from the above set.
- Legacy p5.js Sound Tutorial by Dan Shiffman on YouTube
Interactive documentation can be found at beta.p5js.org/reference/p5.sound
- Find the latest official release of p5.sound.js here, and the latest p5.js version 2 here. p5.sound work with both p5.sj version 2 and version 1.
- The p5.sound.js library here is updated more frequently, and we occasionally offer new releases before the release cycle of p5.js.
If you would like to contribute to this project, visit https://github.com/processing/p5.js/tree/main/contributor_docs to get started.
If you have any questions or concerns regarding the project, you can reach out to our Discord and Gitter communities. The p5.js team closely monitors all pull requests and issues on GitHub, so there's no need to also post them on Discord. Additionally, conversations about specific pull requests and issues should take place on GitHub, to ensure that people following along can see and take part in the discussion.
p5.sound is built using Tone.js, an interactive music framework developed by Yotam Mann.
This repository is an update of the original p5.sound library (initially authored by Jason Sigal) made with the following goals in mind:
- Code stability and readability
- Updated and fewer dependencies
- Deprecating the least used features
- Greater consistency between classes and methods
The project was started by aarón montoya-moraga (montoyamoraga) during the 2023 p5.js sound fellowship (read the announcement for more details) and was completed by Tommy Martinez in September, 2024.
A changeleog of new and deprecated features in the new library can be viewed (here)
Core contributors:
- Tommy Martinez (ogbabydiesal)
- aarón montoya-moraga (montoyamoraga)
Project mentors and advisors:
- Kristin Galvin (blechdom)
- Kenneth Lim (limzykenneth)
- Rachel Lim (raclim)
- Yotam Mann (tambien)
- Dave Pagurek (davepagurek)
- Luisa Peirera (luisaph)
- Jason Sigal (therewasaguy)
- Cassie Tarakajian (catarak)
- Qianqian Ye (Qianqianye)
To use this library, make sure you have p5.js installed. Visit the p5.js website for more information and installation instructions.
Please let us know if you find any bugs or issues by creating a new issue in this repo!
installing the dependencies
npm install
building the library
npm run build
building reference pages (optional)
npx yuidoc .
The library is configured to use Playwright to automatically test the local and web-editor-hosted sets of p5.sound.js examples by automatically controlling a browser (firefox or chromium).
If you haven't used Playwright on your system before, you'll have to run the following command once to allow it to download the browsers it uses:
npx playwright install- Launch playwright's test-runner UI:
npm run test:integration:ui-
Choose example set(s) and browser(s) From the GUI, click "projects" and choose which examples ("web-" and/or "local-") and which browsers ("chromium" and/or "firefox") you wish to test.
-
Run the tests! click the green play button at the top of the list of tests.
If a test fails, you can inspect its console log, the test actions, and even screenshots of what it looked like while it was running.
There are also various other ways to run the tests automatically without any interaction.
For more information, read tests/integration/about-these-tests.md