Getting libpd

The preferred method to download libpd is to use git.

Do not download libpd as a zip or tar.gz file from GitHub.

The "Download zip" button may look like a good idea, but currently Github does not include submodule files when compiling zip files. This means the zip file is missing the main pd source files and you will not be able to build libpd, with errors such as: No rule to make target `pure-data/src/d_arithmetic.o' or No such file or directory: pure-data/extra/bonk~/bonk~.c.

To download libpd & checkout the pure-data submodule do the following:

If you need to add custom search paths to the CFLAGS, you can specify them when building via:

make CFLAGS="-I/usr/local/lib"

java, csharp, objc, cpp, python

Glue for using libpd with Java, C#, Objective C, C++ and Python. Feel free to improve or add support for other languages such as Lua.

samples

Contains small sample programs and tests in the various supported langauges.

Xcode Project

libpd.xcodeproj provides an Xcode project to build libpd + the Obj-C wrapper as a static library for iOS & Mac OSX. Drag the libpd project into your existing Xcode project, then add libpd-ios (or libpd-osx) to the Linked Frameworks and Libraries in the General tab of your project target.

C#

Installation from NuGet

LibPD is available as a NuGet package. If your platform's native dll is not included, you have to build it yourself with make csharplib and copy the resulting file to the output directory. Batch scripts for compilations on Windows with MinGW64 are included.

Building yourself

The C# library expects a file libpdcsharp.dll in its folder. Before using the project, you need to compile it.

Include csharp/LibPdBinding.csproj in your solution and reference the project in your application.

Windows

You need to install msys2, preferably the version for i686, because that version can build the 64bit versions as well.

Install msys2 using the instructions on the download page.

Install make and gcc by running pacman -S msys/make mingw32/mingw-w64-i686-gcc mingw64/mingw-w64-x86_64-gcc from the msys2 console. You can search for packages in msys2 with pacman -S -s <searchterm>.

For the 64 bit version of msys2 you also need to install winpthread by running pacman -S msys/mingw-w64-cross-winpthreads-git.

Edit mingw32_build_csharp.bat or mingw64_build_csharp.bat and execute it to create the native dll. You probably only need to change the variable for %MSYS2%. Usually you want the 32 bit version, as it will work on 64 bit Windows as well, but Unity 5 needs the 64 bit version.

For the 64 bit version, you also must use libs/mingw64/libwinptread-1.dll instead of libs/mingw32/libwinpthread-1.dll.

For a current version of libwinpthread-1.dll search in your msys2 installation folders.

Linux

If you want to use the library on Linux with Mono, you need the following changes to the LibPdBinding project: