<commit_before># Introduction
This plugin is meant to unite the libpd and cordova frameworks so app developers can 
also have the power of Pure Data for audio and music synthesis.  

I assume the following:
1) You already know how to use Pure Data.
2) You are familiar with the Cordova framework and how to use and install plugins.
3) You have at least some basic knowledge of programming in different languages like Obj-C, Java and web languages.
 
## Installing the library

To clone the repository to the root plugins folder try:
```
cordova plugin add https://github.com/robertesler/cordova-pd.git
```
## Instructions for iOS
1) Make sure to add the plugin to your config.xml in your root folder by adding:
```
<plugin name="PdPlugin" value="PdPlugin" />
```
2) Then either add the iOS platform or try:
```
cordova prepare ios
```

3) Open the Xcode project in Xcode. Under the "Build Phases" add a new "Headers Phase"
 You can do this by pressing the '+' icon.

4) Add all the .h files in the plugin root folder ../org.urbanstew.cordova.pd/src/ios/headers/
  to the "Project" headers phase.

5) Build your application using Xcode.  The cordova build option does not currently work when
  linking the static library.

#NOTE:

 This project uses dependencies that are maintained by other developers.  These include:

libpd 
```
git clone https://github.com/libpd/libpd.git
```
pure data (source)
```
git clone git://git.code.sf.net/p/pure-data/pure-data
```
I have updated the libpd Objective-C wrapper to include Automatic Reference Counting (ARC) with 
this plugin. 

You can of course build your project manually cloning libpd yourself.  You would just need the 
PdPlugin.m, PdPlugin.h files and cordova-pd.js file that comes with this distribution.

## Using Custom Externals
To add any custom externals you need to follow the libpd protocol here:
[libpd iOS wiki](https://github.com/libpd/pd-for-ios/wiki/ios) 

## Using your patches in iOS
Your main patch needs to be called cordova.pd and located in the root /www folder.  You can use
other abstractions or folders, look at the [declare] object.

## Instructions for Android 

The Android version is still in development.  It will run as of now but still in a testing phase. 
Check in regularly for any updates.

1) Make sure to add the plugin to your config.xml in your root folder by adding:
```
<plugin name="PdPlugin" value="PdPlugin" />
```
2) Then either add the android platform or try:
```
cordova prepare android<commit_msg>Added audio setting information to README.md.<commit_after># Introduction
This plugin is meant to unite the libpd and cordova frameworks so app developers can 
also have the power of Pure Data for audio and music synthesis.  

I assume the following:
1) You already know how to use Pure Data.
2) You are familiar with the Cordova framework and how to use and install plugins.
3) You have at least some basic knowledge of programming in different languages like Obj-C, Java and web languages.
 
## Installing the library

To clone the repository to the root plugins folder try:
```
cordova plugin add https://github.com/robertesler/cordova-pd.git
```
## Instructions for iOS
1) Make sure to add the plugin to your config.xml in your root folder by adding:
```
<plugin name="PdPlugin" value="PdPlugin" />
```
2) Then either add the iOS platform or try:
```
cordova prepare ios
```

3) Open the Xcode project in Xcode. Under the "Build Phases" add a new "Headers Phase"
 You can do this by pressing the '+' icon.

4) Add all the .h files in the plugin root folder ../org.urbanstew.cordova.pd/src/ios/headers/
  to the "Project" headers phase.

5) Build your application using Xcode.  The cordova build option does not currently work when
  linking the static library.

#NOTE:

 This project uses dependencies that are maintained by other developers.  These include:

libpd 
```
git clone https://github.com/libpd/libpd.git
```
pure data (source)
```
git clone git://git.code.sf.net/p/pure-data/pure-data
```
I have updated the libpd Objective-C wrapper to include Automatic Reference Counting (ARC) with 
this plugin. 

You can of course build your project manually cloning libpd yourself.  You would just need the 
PdPlugin.m, PdPlugin.h files and cordova-pd.js file that comes with this distribution.

## Using Custom Externals
To add any custom externals you need to follow the libpd protocol here:
[libpd iOS wiki](https://github.com/libpd/pd-for-ios/wiki/ios) 

## Using your patches in iOS
Your main patch needs to be called cordova.pd and located in the root /www folder.  You can use
other abstractions or folders, look at the [declare] object.

## Changing Audio Settings
To change things like sample rate, input channels, etc. look at the PdPlugin.m 
or PdPlugin.java code in the plugin's intitialize method.  You will see 
how the plugin sets these at compile.  Right now there is no interface 
to change these any other way.

## Instructions for Android 

The Android version is still in development.  It will run as of now but still in a testing phase. 
Check in regularly for any updates.

1) Make sure to add the plugin to your config.xml in your root folder by adding:
```
<plugin name="PdPlugin" value="PdPlugin" />
```
2) Then either add the android platform or try:
```
cordova prepare android
{'fraction_non_alphanumeric': 0.07336854017351943, 'fraction_numerical': 0.003772161448509996, 'mean_word_length': 4.036087369420703, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '845851', 'n_tokens_mistral': 1536, 'n_tokens_neox': 1455, 'n_words': 776}