m-onz


getting started with netpd

20.04.24

netpd is a CRNMME (Collaborative Realtime Networked Music Making Environment) built in Pure Data. It allows many users to have a realtime jam sessions with each other, connected over the internet. Users might contribute their own netpd-ized patches a.k.a. instruments or use pre-existing ones. The set of instruments, as well as the state of each instrument is synchronized between clients in order to provide identical experience for every connected user.

netpd was designed with music in mind, but it might serve well also other purposes, where realtime state synchronization is a requirement.

netpd should work on any platform that supports pure data including windows and OSX. However in this guide I'm going to focus on debian linux and its derivitives.

about netpd

netpd is over ten years old and now and has been tried and tested as one of the rare examples of music making that works over the internet without a browser. Its built entirely using pure data and some externals which makes it unique. Its possible to add your own instruments and I personally want to explore netpd as the basis for a networked audio visual patching and live coding tool for my own work. You can join the netpd discord and join the weekly jam session that happens every thursday evening at 9PM GMT.

Installing netpd

You might want to follow my previous guide on installing pure data and GEM on debian linux because the Pd version provided by most package managers is too low to support netpd.

sudo apt-get install git
git clone --recursive https://github.com/reduzent/netpd.git

In order to run netpd, you need to have Pd >= 0.52 and some externals installed.

The following externals are required:

iemlib
iemnet
osc
slip

Externals are installed through Pd’s menu Help → Find Externals. Search for a library name and click on the result to install it.

Making music

If everything is installed correctly you should be able to open the "main.pd" patch from within the netpd folder. You will notice chat functionality to send messages to connected peers. You will need to enable DSP and click "unpatch" to launch the music making environment.

You will probably want to create a master instrument first before exploring other instruments. The best way to learn netpd is to play around with it and try to get help from an existing netpd user via discord or connected peers may have already set up a jam.

netpd syncronises the music between connected peers and when you change piano roll notes or parameters all the connected peers will get real time changes. In theory each person should be hearing the same jam... pretty cool hey? If you want to read more about the work behind it I recommend reading the original paper.

Instruments

There is a wide range of existing instruments to try out and I also want to build my own netpd instruments too. You can feed in live input and connect MIDI controllers. I've only really played around with the piano rolls and drum machine/ step sequencer but there is a lot of potential.

Netiquette

If pure data needs to re-compute its signal processing graph you may hear glitches and in extreme cases pops & clicks. If you create or delete a number of instruments quickly within netpd whilst jamming you may encounter it. The following paragraph is taken directly from the netpd website which is an excellent resource that you should read first.

"When joining an already running session, make yourself familiar with what is going on (maybe your peers are in the middle of a recording). Say hi and ask what people are working on. Feel free to contribute. It’s common practice that people work on instruments that they loaded themselves. But it is normally OK for anyone to tweak any instruments. Do not close instruments without notice. Learn to appreciate how things emerge. But then, sessions often profit from novel input of a fresh mind that shakes things up a bit."

A note on security

netpd is an experimental collaborative music making system that can work over the internet. You should be aware of the risks of using it. You can connect to people you know and trust over a local network (and even run netpd offline as a single performer).

I would recommend you take the advice and run an unprivileged user. I have experimented with firejail as a way to run netpd in an isolated context:

Install firejail

sudo apt-get install firejail

Run pd within firejail

firejail --read-only=./netpd --read-write=./netpd/instruments pd

This will open pure data but it won't automatically open netpd so you will need to open netpd via the menu and look for the netpd/main.pd file.



pure data
firejail
netpd