Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.mgsx-dev:gdx-pd:0.7.0'
}
dependencies {
implementation("com.github.mgsx-dev:gdx-pd:0.7.0")
}
<dependency>
<groupId>com.github.mgsx-dev</groupId>
<artifactId>gdx-pd</artifactId>
<version>0.7.0</version>
</dependency>
libraryDependencies += "com.github.mgsx-dev" % "gdx-pd" % "0.7.0"
:dependencies [[com.github.mgsx-dev/gdx-pd "0.7.0"]]
Pure Data extension for LibGDX.
LibGDX is a cross platform game framework. If you don't know, please visit : http://www.badlogicgames.com/
Puredata (Pd) is an audio synthesis application coded in C providing graphical programming. gdx-pd is based on LibPd java bindings. If you don't know, please visit : https://github.com/libpd/libpd
This extension enables audio synthesis in games with pd patches and provides some usefull tools for audio design.
| Platform | Supported | |------------|-----------| | Linux 64 | yes | | Linux 32 | yes | | Android | yes | | Windows 64 | yes | | Windows 32 | yes | | MacOSX 64 | yes | | MacOSX 32 | yes | | iOS | not yet | | Web | not yet |
Full documentation is available in this repository :
Just add gradle dependencies as usual :
Jars are not available on Maven Central yet. Please read the "Build from sources" section.
project(":core") {
apply plugin: "java"
dependencies {
...
compile "net.mgsx.gdx:gdx-pd:$pdVersion"
...
}
}
project(":desktop") {
apply plugin: "java"
dependencies {
compile project(":core")
...
compile "net.mgsx.gdx:gdx-pd-platform:$pdVersion:desktop"
compile "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-desktop"
...
}
}
project(":android") {
apply plugin: "android"
configurations { natives }
dependencies {
compile project(":core")
...
compile "net.mgsx.gdx:gdx-pd-backend-android:$pdVersion"
natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-armeabi"
natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-armeabi-v7a"
natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-arm64-v8a"
natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-x86"
natives "net.mgsx.gdx:gdx-pd-platform:$pdVersion:natives-x86_64"
...
}
}
Note that pre-built native binaries are already tracked in this repository and doesn't need to be built exept changes in C sources.
First setup your local git clone :
$ git clone https://github.com/mgsx-dev/gdx-pd.git
$ cd gdx-pd
$ git submodule init
$ git submodule update
You have to tell gradle about your Android sdk location by creating a local.properties file :
$ echo 'sdk.dir=[absolute path to Android SDK location]' > local.properties
Optionnaly you may want to publish locally in order to use it in your local projects (including gdx-pd-tests projects) :
$ ./gradlew publishToMavenLocal
First fetch pd sources :
$ cd gdx-pd/libpd
$ git submodule init
$ git submodule update
$ cd ..
Linux, Android and Windows binaries can be built on any platform supporting Docker (Linux, Windows and OSX). It only requires Docker installed (see https://docs.docker.com/engine/installation/), NDK and other cross compiler tools are already included in the docker image.
To rebuild binaries, just run command below :
$ docker run --rm -v $(pwd):/work -w /work/native -it mgsx/gdx-docker ../gradlew buildNative
$ sudo chown -R $USER:$USER .
Only OSX bianries require a Mac development environnement :
brew install ant
To rebuild binaries, just run command below :
$ cd native
$ ../gradlew generateBuildScripts
$ ant -f jni/build-macosx32.xml -v -Dhas-compiler=true clean postcompile
$ ant -f jni/build-macosx64.xml -v -Dhas-compiler=true clean postcompile
A bunch of examples are provided in desktop test project. Just import gradle project from "tests" folder and run java classes. You don't need to build gdx-pd in order to run these tests.
An example illustrates sound baking during a gradle build. (you have to replace pdVersion variable with latest gdx-pd version) :
$ cd tests/example-offline
$ ../gradlew -PpdVersion=0.6.0-SNAPSHOT bake
Pure Data and LibPD (git submodules and native binaries) are licenced under the Standard Improved BSD License
Gdx-pd is licensed under the Apache 2 License
Thanks to Miller Puckette for Pure Data.
Thanks to Peter Brinkmann & the libpd team for their Pure Data wrappers
Thanks to b2renger for his contribution in all gdx-pd related projects.