Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
libpd-rs
Safe rust abstractions over libpd-sys.
Pure Data (Pd) is a visual programming language developed by Miller Puckette in the 1990s for creating interactive computer music and multimedia works. While Puckette is the main author of the program, Pd is an open-source project with a large developer base working on new extensions. It is released under BSD-3-Clause.
Though pd is designed as a desktop application, libpd is an open source project which exposes it as a C library opening the possibility to embed the functionality of pd to any platform which C can compile to.
libpd-rs aims to bring libpd to the Rust ecosystem. It aims to expose the full functionality of libpd with some extra additions such as bundling commonly used externals and addition of extra functionality for increased ease of use.
It is thoroughly documented, well tested and enriched with various examples to get you started right away.
Now let's make some sound! 🔔
Build dependencies
To be able to buid libpd
install cmake
and llvm
if you don't have them already.
See building libpd for more details and options.
Linux
sudo apt install cmake
Follow the llvm installation instructions
windows
With chocolatey
choco install cmake
choco install llvm
With winget
winget install -e --id Kitware.CMake
winget install -e --id LLVM.LLVM
macOS
brew install cmake
brew install llvm
Cargo dependencies
Add the following dependencies to your Cargo.toml
:
[]
= "0.3"
= "0.15"
Example code
Paste the code into your main.rs
:
⚠️ Warning ⚠️: This example will produce audio, so please keep your volume at a reasonable level for safety.
use ;
use PdGlobal;
This is just the tip of the iceberg about what you can do with libpd.
The patch we had just evaluated would look like this in pd desktop application:
Running the examples and tests
After cloning the repository, in the repository root run:
e.g.
Please check the README on examples for more information.
For the tests, you may run cargo test
directly.
Next steps
Please check the examples and tests directories if you learn better when reading code.
Or if you would like to dive in to documentation please go ahead.
Resources
- Pure Data
- https://puredata.info/
- https://forum.pdpatchrepo.info/
- http://www.pd-tutorial.com/
- https://www.worldscientific.com/worldscibooks/10.1142/6277
- https://mitpress.mit.edu/books/designing-sound
- https://www.soundonsound.com/techniques/pure-data-introduction
- collection of resources in modwiggler
- collection of resources in reddit
- a guide to writing pd externals in C
- libpd
- Audio in Rust
Road map
- Support for Android and IOS
- Enrich examples with nice patches and add also examples with bevy and nannou.
Support
-
Desktop
- macOS:
x86_64
✅aarch64
✅
- linux:
x86_64
✅aarch64
✅
- windows:
- msvc
x86_64
✅aarch64
✅
- gnu
x86_64
(not tested but should work)aarch64
(not tested but should work)
- msvc
- macOS:
-
Mobile
- iOS (not yet but will be addressed)
- Android (not yet but will be addressed)
-
Web (not yet but will be addressed)
List of bundled externals
The way to add externals to libpd is to compile and statically link them.
libpd-rs will be bundling some of the essential and commonly used externals in pure data. This list will be growing as we add more externals.
If you have ideas please consider writing an answer to this post.
moog~
freeverb~
Contributing
- Be friendly and productive
- Follow common practice open source contribution culture
- Rust code of conduct applies
Thank you 🙏
Similar projects
- https://github.com/x37v/puredata-rust
- https://github.com/wavejumper/pd-external-rs
- https://github.com/x37v/puredata-rust/tree/HEAD/pd-sys
Last words
Generative or algorithmic music is a powerful tool for exploration, pumps up creativity and goes very well together with traditional music making approaches also.
Making apps which produce meaningful sound is difficult, I wish that this crate would ease your way on doing that and make complicated audio ideas in apps accessible to more people.