Integrate PureData audio processing and synthesis patches into your NAP project. Built on libpd.
Important
Currently under active development. Tested on Linux x86_64, with source build context. Other platforms and build environments coming soon - pull requests welcome!
Simply git clone this repo into {NAP_ROOT}/modules, then in
{NAP_ROOT}/tools run the script $ ./setup_module.sh napPd.
-
Add
"napPd"to the list of required modules inapp.json. -
In
napkin:- Create an entity name
AudioEntityand add it to the Scene. - Add a
nap::audio::PdComponentto theAudioEntity. - In the Properties panel of the
PdComponent, set the patch and, if you want to process audio input, add the input component to the Input field (e.g. anap::audio::PlaybackComponent). If you don't plan to process audio input, setNum Inputsto 0. - To output audio to the speakers, add a
nap::audio::OutputComponentto theAudioEntity, set Input to thePdComponent, and configure the output routing by right clicking and adding integers 0 and 1. (You may need to include"napportaudio"toapp.jsonto actually hear this output)
- Create an entity name
-
In your app's
myApp::init()function:// Get the Pd instance: auto pdComponent = mAudioEntity->findComponent<audio::PdComponentInstance>(); // Load the Pd patch: pdComponent->load(); // Start processing audio: pdComponent->setDSP(true);
Check out demo/pd_demo_basics for an explanation of how to interact with the
Pd patch through sending and receiving messages.
For more advanced usage (e.g. MIDI, integration into the NAP ecosystem), see the
other demos.
Important
Currently, only one instance of Pd can be created in a single App.
You can still use multiple PdComponents to load multiple patches, however
only 1 can be attached to an audio output node!
The channel count (in, out) must also be the same in all PdComponents.
Better to only use one with a single patch.
This may change in the future if the need arises.
- Platforms:
- Windows
- RaspberryPi (arm64)
- Build contexts
- Add demos
- messages
- MIDI
- nap sequencer
- dashboard
- externals
- Add documentation
