Open Source C++ Library for Audio Apps & Plug-ins
Free C++ API That for Audio Apps and Plug-ins. Learn How to Build Cross-platform desktop, Mobile, and Audio Plugin Apps with Our Guide to Key Features and Code Examples.
Modern audio software such as synthesizers, digital audio workstations (DAWs), and sound processing tools require efficient frameworks that simplify complex audio programming tasks. One of the most widely used frameworks in the audio development industry is JUCE, an open-source C++ library designed for building cross-platform audio applications and plugins. It provides developers with a complete toolkit for audio processing, plugin development, GUI creation, and hardware integration. It enables developers to write code once and deploy applications across multiple platforms including Windows, macOS, Linux, iOS, and Android.
JUCE (Jules’ Utility Class Extensions) is an open-source C++ application framework used to build desktop and mobile applications, particularly audio software and plugins. It provides reusable modules that simplify tasks such as audio processing, MIDI communication, GUI creation, plugin development, file handling and networking and so on. JUCE is widely used by developers and audio software companies to build VST, VST3, AU, AUv3, AAX, and LV2 plugins, as well as standalone applications. It significantly reduces the complexity of building audio applications. Instead of writing platform-specific code for each operating system, developers can use JUCE’s unified API to build cross-platform software.
Getting Started with JUCE
The easiest way to install JUCE is using GitHub. Please use the following command for complete installation.
Install JUCE from NuGet
git clone https://github.com/juce-framework/JUCE.git Install JUCE via CMake
cd JUCE
cmake . -B build
cmake --build build
Audio Processing and DSP Support
The open source JUCE provides built-in modules for digital signal processing (DSP), allowing developers to build audio effects, synthesizers, and sound processors. The framework includes tools for filters, oscillators, FFT analysis, and real-time audio processing. This makes JUCE ideal for creating music production tools and audio effects plugins. Here is a code processing example for an audio buffer and reduces the amplitude of each sample. Such operations are commonly used to implement gain control or audio effects.
How to Processes an Audio Buffer and Reduces the Amplitude via C++ API?
void processBlock(juce::AudioBuffer& buffer)
{
for (int channel = 0; channel < buffer.getNumChannels(); ++channel)
{
auto* samples = buffer.getWritePointer(channel);
for (int i = 0; i < buffer.getNumSamples(); ++i)
samples[i] *= 0.5f; // reduce volume
}
}
Audio Plugin Development via C++ API
The JUCE library simplifies the creation of professional audio plugins. Developers can build plugins compatible with major audio standards like VST, VST3, AU, AUv3, AAX, and LV2 using a single framework. This feature allows developers to distribute their plugins across many DAWs without rewriting the code. The code shows a simple audio plugin reduces the signal gain by 20%. In real projects, developers can add parameters, automation, and complex DSP algorithms.
How to Create a Simple Audio Plugin via C++ API?
class GainProcessor : public juce::AudioProcessor
{
public:
void processBlock(juce::AudioBuffer& buffer,
juce::MidiBuffer&) override
{
buffer.applyGain(0.8f);
}
};
Cross-Platform Development
One of the most powerful features of JUCE is its ability to build applications for multiple platforms using a single C++ codebase. Developers can create software that runs on Windows, macOS, Linux, iOS, and Android without rewriting platform-specific code. This dramatically reduces development time and ensures consistent behavior across operating systems. The following example creates a simple JUCE application that shows a dialog window. Because JUCE handles the platform abstraction, the same code works across multiple operating systems.
How to Create Cross-Platform JUCE Apps via C++?
#include
class HelloWorld : public juce::JUCEApplication
{
public:
const juce::String getApplicationName() override { return "JUCE Demo"; }
const juce::String getApplicationVersion() override { return "1.0"; }
void initialise (const juce::String&) override
{
juce::AlertWindow::showMessageBoxAsync(
juce::AlertWindow::InfoIcon,
"JUCE App",
"Hello from a cross-platform JUCE application!");
}
void shutdown() override {}
};
START_JUCE_APPLICATION (HelloWorld)
MIDI and Audio Device Integration
JUCE also includes APIs for interacting with audio devices and MIDI controllers. Developers can access microphones, speakers, MIDI keyboards, and other hardware directly through the framework. This is critical for applications such as synthesizers, DAWs, and live performance software. This following code listens for incoming MIDI messages and prints the note number whenever a MIDI key is pressed.
How to Listens for Incoming MIDI Messages via C++ API?
void handleIncomingMidiMessage(juce::MidiInput*,
const juce::MidiMessage& message)
{
if (message.isNoteOn())
{
int note = message.getNoteNumber();
juce::Logger::writeToLog("Note On: " + juce::String(note));
}
}