<commit_before>
[![Build Status](https://travis-ci.org/mgsx-dev/gdx-pd.svg?branch=master)](https://travis-ci.org/mgsx-dev/gdx-pd)

Pure Data extension for LibGDX.

Work in progress :

| Platform   | Scheduled | implemented | Tested |
|------------|-----------|-------------|--------|
| Linux 64   |     y     |      y      |   y    |
| Linux 32   |     y     |      y      |        |
| Android    |     y     |      y      |   y    |
| Windows 64 |     y     |      y      |        |
| Windows 32 |     y     |      y      |        |
| MacOSX 64  |     -     |      -      |        |
| MacOSX 32  |     -     |      -      |        |
| iOS        |     -     |      -      |        |
| Web        |     -     |      -      |        |

# What is it ?

LibGDX is a cross platform game framework. If you don't know, please visit them : 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 them : https://github.com/libpd/libpd

This extension enable audio synthesis in games with pd patches and provides some usefull tools  :
* new Music type : PdMusic which play midi files and route midi message to Pd.
* Asset loaders for both Patch and Midi files.
* Message dispatcher.

# Documentation

Full documentation is available in this repository :

* [Assets organization](doc/AssetsOrganization.md)
* [Pd patch libraries](doc/PatchLibraries.md)
* [Remote live patching](doc/LivePatching.md)


# How to use

## Configure your LibGDX project

Just add gradle dependencies as usual :

```
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"
		 ...        
    }
}

```

## Initialize in your launchers


```
// Choose implementation :
Pd.audio = new PdAudioOpenAL(); // Desktop using LibGDX desktop audio implementation (OpenAL)<commit_msg>documentation : temporarily use jitpack #3<commit_after>
[![Build Status](https://travis-ci.org/mgsx-dev/gdx-pd.svg?branch=master)](https://travis-ci.org/mgsx-dev/gdx-pd)

Pure Data extension for LibGDX.

Work in progress :

| Platform   | Scheduled | implemented | Tested |
|------------|-----------|-------------|--------|
| Linux 64   |     y     |      y      |   y    |
| Linux 32   |     y     |      y      |        |
| Android    |     y     |      y      |   y    |
| Windows 64 |     y     |      y      |        |
| Windows 32 |     y     |      y      |        |
| MacOSX 64  |     -     |      -      |        |
| MacOSX 32  |     -     |      -      |        |
| iOS        |     -     |      -      |        |
| Web        |     -     |      -      |        |

# What is it ?

LibGDX is a cross platform game framework. If you don't know, please visit them : 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 them : https://github.com/libpd/libpd

This extension enable audio synthesis in games with pd patches and provides some usefull tools  :
* new Music type : PdMusic which play midi files and route midi message to Pd.
* Asset loaders for both Patch and Midi files.
* Message dispatcher.

# Documentation

Full documentation is available in this repository :

* [Assets organization](doc/AssetsOrganization.md)
* [Pd patch libraries](doc/PatchLibraries.md)
* [Remote live patching](doc/LivePatching.md)


# How to use

## Configure your LibGDX project

Just add gradle dependencies as usual :

```
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** : because of [#3](https://github.com/mgsx-dev/gdx-pd/issues/3), you need to add jitpack as repository 
(this workaround is necessary while OSC release 0.4 is not in Maven Central) :

```
allprojects {
	repositories {
		maven { url "https://jitpack.io" }
	}
}
```

## Initialize in your launchers


```
// Choose implementation :
Pd.audio = new PdAudioOpenAL(); // Desktop using LibGDX desktop audio implementation (OpenAL)
{'fraction_non_alphanumeric': 0.13816896667788622, 'fraction_numerical': 0.008246381689666779, 'mean_word_length': 2.113148245154531, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3151938', 'n_tokens_mistral': 2055, 'n_tokens_neox': 1940, 'n_words': 454}