Introduction
Welcome to the documentation for the libpd-ios framework!
What is libpd-ios?
Libpd-ios is a native iOS and macOS wrapper for the Pure Data (Pd) audio synthesis and processing library. It allows developers to integrate Pd into their iOS and macOS applications, enabling powerful audio synthesis and processing capabilities.
Key Features
- Seamless Integration: Easily integrate the power of Pure Data into your iOS or macOS projects.
- Flexible Audio Processing: Benefit from a wide range of audio synthesis and processing capabilities provided by the Pure Data library.
- Interactive User Interfaces: Design custom user interfaces with real-time interaction to control your audio processing.
- Customizable: Adapt the Pure Data engine to your specific project requirements through extensive customization options.
- Open Source: libpd-ios is an open-source project, allowing you to contribute and benefit from continuous community support.
Installation
Follow the steps below to install the libpd-ios framework in your iOS or macOS project:
- Download the latest version of libpd-ios from the official GitHub repository: [insert download link].
- Extract the downloaded files to your preferred location.
- In Xcode, select your project target.
- Navigate to the “General” tab and scroll down to the “Frameworks, Libraries, and Embedded Content” section.
- Click the “+” button.
- Select “Add Other…” and navigate to the folder where you extracted the libpd-ios files.
- Select the “libpd-ios.xcodeproj” file and click “Open” to add it to your project.
- In the project navigator, select your project target.
- Navigate to the “Build Phases” tab.
- In the “Link Binary With Libraries” section, click the “+” button.
- Add “libpd-ios.framework” to your project.
Usage
To start using libpd-ios in your project, follow the steps outlined below:
Step 1: Import libpd-ios
In your source file, import the libpd-ios framework:
import libpd
Step 2: Initialization
Initialize the Pure Data audio engine:
let pd = PdAudioController.sharedInstance()
Optionally, set the sample rate and number of input/output channels:
pd.configurePlayback(withSampleRate: 44100, numberChannels: 2, inputEnabled: true, mixingEnabled: true)
Step 3: Patch Loading
Load the Pure Data patch into the engine:
let patch = PdFile.open([pathToPatchFile], path: [patchDirectory])
Check if the patch was loaded successfully:
if patch == -1 { /* handle loading error */ }
Step 4: Audio Control
Control audio playback and processing:
- Start audio engine:
pd.isActive = true
- Pause audio engine:
pd.isActive = false
- Send messages to the Pure Data patch:
PdBase.sendMessage("message", withArguments: nil)
- Receive messages from the Pure Data patch:
pd.delegate = self
Step 5: Audio Cleanup
Properly clean up the Pure Data audio engine:
pd.closeFile(patch)
pd.configurePlayback(withSampleRate: 0, numberChannels: 0, inputEnabled: false, mixingEnabled: false)
Examples
Here are a few simple examples to get you started:
- Example 1: Basic audio synthesis
- Example 2: Real-time effects processing
- Example 3: Interactive user interface design
Support
If you encounter any issues or have questions regarding the libpd-ios framework, you can seek help from the official community resources:
- GitHub Repository: [insert GitHub repository URL]
- Community Forums: [insert community forum URL]
- Developer Documentation: [insert Pd (Pure Data) documentation URL]
Conclusion
Congratulations! You are now equipped with the knowledge to integrate the libpd-ios framework into your iOS and macOS projects. Enjoy exploring the audio synthesis and processing possibilities with Pure Data!