BelaPlatform / Bela

Bela: core code, IDE and lots of fun!
Other
483 stars 138 forks source link

pd externals #621

Open giuliomoro opened 4 years ago

giuliomoro commented 4 years ago

Over time I built several pd externals libraries for Bela, and I lost track of them. I will upload them here from now on, so that I don't have to build them again every time.

Installation

You can either uncompress these zip archives into your project, or place them in a dummy-project called pd-externals, so that they can be accessed by all projects on the board. To do so you can abuse the IDE:

Usage

When you install an external library, it is placed in its own subfolder. Then you have to access each object by prepending the library name, e.g.: [libraryName/objectName~]. If you want not to have to type the libraryName/ part, you can create this object in your patch: [declare -path libraryName]. This is largely analogous to the behaviour of Pd Vanilla when installing externals from Deken, except that Pd vanilla enables to set paths globally in the Preference->Path menu, which we do not currently support on Bela.

Pre-built externals:

pd-else

From https://github.com/porres/pd-else

How to build (uses pd-lib-builder):

make PDINCLUDEDIR=/usr/local/include/libpd/

it errors for pic.c as IHEIGHT cannot be found. Fixed it by -D'ing a dummy value, as this is a GUI external, so wouldn't work on Bela anyhow:

cc -DPD -I "/usr/local/include/libpd/" -DUNIX  -fPIC -Ishared -DHAVE_STRUCT_TIMESPEC -Wall -Wextra -Wshadow -Winline -Wstrict-aliasing -O3 -ffast-math -funroll-loops -fomit-frame-pointer -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -o Classes/Source/pic.o -c Classes/Source/pic.c -DIHEIGHT=20

Then to install:

make PDINCLUDEDIR=/usr/local/include/libpd/ PDLIBDIR=/root/Bela/projects/pd-externals/ install

to create the zip archive:

REV=$(git describe --tags HEAD);  pushd /root/Bela/projects/pd-externals; zip -r ${OLDPWD}/else-$REV.zip else; popd

Built against:

ii  libpd-xenomai-3-dev                          0.11.0-Bela-1                     armhf        libpd for arm and xenomai-3. [for v1.0-beta27]
ii  libpd-xenomai-3-dev                    0.11.0-77-g6028dae-dirty-1     armhf        libpd for arm and xenomai-3. [for v1.0-rc4-93-g0c64c285]

Download: else-v1.0-beta27.zip else-v1.0-rc4-93-g0c64c285.zip

pd-zexy v2.3.0

Source: https://github.com/iem-projects/pd-zexy@a8a0257bba09b714b9cc22cc8b7d50b89531dff5 (v2.3.0)

How to build (uses pd-lib-builder):

make PDINCLUDEDIR=/usr/local/include/libpd/

Then to install:

make PDINCLUDEDIR=/usr/local/include/libpd/ PDLIBDIR=/root/Bela/projects/pd-externals/ install

to create the zip archive:

 pushd /root/Bela/projects/pd-externals; zip -r ${OLDPWD}/zexy-v2.3.0.zip zexy; popd

Built against:

ii  libpd-xenomai-3-dev                          0.11.0-Bela-1                     armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download: zexy-v2.3.0

cyclone v0.3, RC-1

Source: https://github.com/porres/pd-cyclone@cf1621ffd84eb4bceb4d551137d220bf54651b57 (cyclone0.3rc1)

(latest version supported by Pd 0.48-2, see here) How to build (uses pd-lib-builder):

make PDINCLUDEDIR=/usr/local/include/libpd/

Then to install:

make PDINCLUDEDIR=/usr/local/include/libpd/ PDLIBDIR=/root/Bela/projects/pd-externals/ install

to create the zip archive:

 pushd /root/Bela/projects/pd-externals; zip -r ${OLDPWD}/cyclone-0.3rc1.zip cyclone; popd

Built against:

ii  libpd-xenomai-3-dev                          0.11.0-Bela-1                     armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download:

cyclone-0.3rc1.zip

csound~ v1.01.0

Source: https://github.com/csound/csound_pd@ebd95fbed206d1bd89a3f4dd6ccabb644846e7e2 (v1.01.0-dirty)

mkdir -p build
cd build
cmake ..
make

Then to install:

cp csound6~.pd_linux /root/Bela/projects/pd-externals/ 

to create the zip archive:

zip csound~-1.01.0.zip csound6~.pd_linux

Built against:

ii  libpd-xenomai-3-dev                          0.11.0-Bela-1                     armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download:

csound~-1.01.0.zip

limiter~

A custom limiter made in FAUST. Includes FAUST .dsp file, _main.pd demo file and MacOS 64bit binary. Instructions to build here.

Built against:

ii  libpd-xenomai-3-dev                          0.11.0-Bela-1                     armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download: limiter~.zip

manta

Source: https://github.com/ssfrr/libmanta

This was hard to build and required a few changes to the source code and build system, too many to document here in detail. At least:

 apt-get install libhidapi-dev

At link time it will fail. Add -L/usr/lib/arm-linux-gnueabihf and -lhidapi-hidraw and remove -lusb1-0.

Built against:

ii  libpd-xenomai-3-dev                          0.11.0-Bela-1                     armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download: manta.pd_linux.zip

pd-tof

How to build (uses pd-lib-builder):

make PDINCLUDEDIR=/usr/local/include/libpd/

Then to install:

make PDINCLUDEDIR=/usr/local/include/libpd/ PDLIBDIR=/root/Bela/projects/pd-externals/ install

to create the zip archive:

pushd /root/Bela/projects/pd-externals; zip -r ${OLDPWD}/tof.zip tof; popd

Built from d9294292f919507df3484a051ac059b7f500dde2 Built against:

ii  libpd-xenomai-3-dev                          0.11.0-Bela-1                     armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download: tof.zip

Mi4Pd

Source: https://github.com/TheTechnobear/Mi4Pd@f4aa6e936347a3952c928b925a03731331d1a627

How to build (uses cmake):

mkdir build
cd buld
cmake ..
make

Then to install:

cp -r release/lib ~/Bela/projects/pd-externals/Mi4Pd

to create the zip archive:

pushd /root/Bela/projects/pd-externals; zip -r ${OLDPWD}/Mi4Pd.zip Mi4Pd; popd

Built against:

ii  libpd-xenomai-3-dev                          0.11.0-Bela-1                     armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download:

Mi4Pd.zip

hid

Source: http://puredata.info/Members/albert/software/hid/0.7.3/hid%5Bv0.7.3%5D(Darwin-amd64-32)(Sources).dek

How to build:

cd src
make CFLAGS='-I/usr/local/include/libpd -Wall -W -g -mfpu=neon -O3'

Then to install:

make install pkglibdir=/root/Bela/projects/pd-externals/

to create the zip archive:

pushd /root/Bela/projects/pd-externals; zip -r ${OLDPWD}/hid.zip hid; popd

Built against:

ii  libpd-xenomai-3-dev                    0.11.0-77-g6028dae-dirty-1        armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download: hid.zip

pdogg

Source: https://sourceforge.net/projects/pure-data/files/libraries/pdogg/pdogg-0.25.1.tar.gz/download

How to build: apply

diff --git a/Makefile b/Makefile
index 80856cc..ffcac3a 100644
--- a/Makefile
+++ b/Makefile
@@ -39,8 +39,8 @@ EXTRA_DIST = pdogg.c makefile.msvc HISTORY
 #------------------------------------------------------------------------------#

 # -I"$(PD_INCLUDE)/pd" supports the header location for 0.43
-ALL_CFLAGS = -I"$(PD_INCLUDE)"
-ALL_LDFLAGS =
+ALL_CFLAGS = -I"$(PD_INCLUDE)" $(shell  /usr/xenomai/bin/xeno-config --skin posix --cflags)
+ALL_LDFLAGS :=  $(shell /usr/xenomai/bin/xeno-config --skin posix --no-mode-check  --no-auto-init --ldflags)
 ALL_LIBS = $(shell pkg-config --libs vorbis vorbisenc vorbisfile)

 #------------------------------------------------------------------------------#
diff --git a/oggamp~.c b/oggamp~.c
index a9ff78b..3d136b5 100644
--- a/oggamp~.c
+++ b/oggamp~.c
@@ -31,7 +31,7 @@

        /* Pd includes */
 #include "m_pd.h"
-#include "g_canvas.h"
+//#include "g_canvas.h"^M
        /* Vorbis includes */
 #include <vorbis/codec.h>

diff --git a/oggcast~.c b/oggcast~.c
index ebd21a1..3bf4e69 100644
--- a/oggcast~.c
+++ b/oggcast~.c
@@ -27,7 +27,7 @@

        /* Pd includes */
 #include "m_pd.h"
-#include "g_canvas.h"
+//#include "g_canvas.h"^M
        /* Vorbis includes */
 #include <vorbis/codec.h>
 #include <vorbis/vorbisenc.h>

then

 make PD_INCLUDE=/usr/local/include/libpd/

Then to install:

mkdir -p /root/Bela/projects/pd-externals/pdogg
cp *pd_linux /root/Bela/projects/pd-externals/pdogg

to create the zip archive:

pushd /root/Bela/projects/pd-externals; zip -r ${OLDPWD}/pdogg.zip pdogg; popd

Built against:

ii  libpd-xenomai-3-dev                    0.11.0-77-g6028dae-dirty-1        armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download: pdogg.zip

https://sourceforge.net/projects/pure-data/files/libraries/freeverb~/freeverb~-1.2.tar.gz/download

freeverb 1.2

Source: https://sourceforge.net/projects/pure-data/files/libraries/freeverb~/freeverb~-1.2.tar.gz/download

How to build: optionally add -march=armv7 -mtune=cortex-a8 to CFLAGS in the Makefile, then

make PD_INCLUDE="/usr/local/include/libpd"

Then to install:

mkdir -p /root/Bela/projects/pd-externals/
cp *pd_linux /root/Bela/projects/pd-externals/

to create the zip archive:

 zip freeverb-bela.zip freeverb~*.*pd*

Built against:

ii  libpd-xenomai-3-dev                          0.11.0-77-g6028dae-dirty-1     armhf        libpd for arm and xenomai-3. Has Pd 0.48

Download: freeverb-bela.zip

Also macos arm64 download if you need it for your host computer (don't use on Bela): freeverb~-macos-arm64.zip

csounder commented 4 years ago

YES! csound6~ works on the Bela!!! Thanks for these instructions and for this build. It would be great for you to share it and include it with the next release. And maybe include a few csound~ examples in the examples "lightbulb" section.

NOTE: Your installation instructions above are not correct in that they tell the installer to say "no" - and there is no "no". There is "cancel". In the fine print of the dialog box that appears when you try to install an external, one is advised to "upload" the .zip into a project and follow the steps from there - and this works perfectly. You might want to update the installation instructions. AND.... THANKS!!!!

giuliomoro commented 4 years ago

thanks for your feedback, I fixed the documentation above.

csounder commented 4 years ago

You might want to include/modify/embellish a few of these csound6~ examples by Victor Lazzarini to the Bela IDE

csound6~_examples.zip https://www.dropbox.com/s/7bekl5xfw8xn738/csound6~_examples.zip?dl=0

tommyecho commented 3 years ago

Hi Giulio! Thank you so much for building the manta external. I have a project that uses [comport] and [list-abs] (particularly the [list-l2s] abstraction). I'm wondering if you might be willing to build these for the bela? I can use them to wirelessly communicate between an augmented guitar device I built and my modular, so it would be incredibly helpful! Thanks for considering:)

giuliomoro commented 3 years ago

list-abs is just abstractions, so it should work out of the box. comport is not real-time safe, so I'd recommend using an OSC to serial bridge or something similar.