Convert Figma logo to code with AI

juce-framework logoJUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.

6,487
1,714
6,487
388

Top Related Projects

1,592

VST 3 Plug-In SDK

10,676

Audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

1,098

Pure Data embeddable audio synthesis library

1,015

The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language.

Quick Overview

JUCE is a cross-platform C++ application framework, used for the development of desktop and mobile applications. It is particularly popular for audio applications and plugins, offering a wide range of UI elements and audio processing capabilities.

Pros

  • Cross-platform compatibility (Windows, macOS, Linux, iOS, Android)
  • Extensive audio processing and UI components
  • Active community and regular updates
  • Well-documented with comprehensive examples

Cons

  • Steep learning curve for beginners
  • Large framework size, which may be overkill for smaller projects
  • Licensing costs for commercial use
  • Some users report performance issues in complex projects

Code Examples

  1. Creating a simple audio plugin:
class SimplePlugin : public juce::AudioProcessor
{
public:
    void processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages) override
    {
        for (int channel = 0; channel < buffer.getNumChannels(); ++channel)
        {
            float* channelData = buffer.getWritePointer (channel);
            
            for (int sample = 0; sample < buffer.getNumSamples(); ++sample)
            {
                channelData[sample] *= 0.5f; // Reduce volume by half
            }
        }
    }

    // Other necessary overrides...
};
  1. Creating a basic GUI component:
class SimpleComponent : public juce::Component
{
public:
    SimpleComponent()
    {
        addAndMakeVisible(button);
        button.setButtonText("Click me!");
        button.onClick = [this] { handleButtonClick(); };
    }

    void paint(juce::Graphics& g) override
    {
        g.fillAll(juce::Colours::lightblue);
    }

    void resized() override
    {
        button.setBounds(getLocalBounds().reduced(20));
    }

private:
    void handleButtonClick()
    {
        juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::InfoIcon,
                                               "Button Clicked",
                                               "You clicked the button!");
    }

    juce::TextButton button;
};
  1. Playing an audio file:
class AudioPlayer : public juce::AudioAppComponent
{
public:
    AudioPlayer()
    {
        setAudioChannels(0, 2);
    }

    void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
    {
        transportSource.prepareToPlay(samplesPerBlockExpected, sampleRate);
    }

    void getNextAudioBlock(const juce::AudioSourceChannelInfo& bufferToFill) override
    {
        transportSource.getNextAudioBlock(bufferToFill);
    }

    void releaseResources() override
    {
        transportSource.releaseResources();
    }

    void loadAndPlayFile(const juce::File& file)
    {
        auto* reader = formatManager.createReaderFor(file);
        if (reader != nullptr)
        {
            std::unique_ptr<juce::AudioFormatReaderSource> newSource(new juce::AudioFormatReaderSource(reader, true));
            transportSource.setSource(newSource.get(), 0, nullptr, reader->sampleRate);
            readerSource.reset(newSource.release());
            transportSource.start();
        }
    }

private:
    juce::AudioFormatManager formatManager;
    std::unique_ptr<juce::AudioFormatReaderSource> readerSource;
    juce::AudioTransportSource transportSource;
};

Getting Started

  1. Download JUCE from the official website or clone the GitHub repository.
  2. Set up your development environment (e.g., Visual Studio, Xcode, or CMake).
  3. Create a new JUCE project using the Projucer application.
  4. Choose your project type (e.g., GUI Application, Audio Plugin).
  5. Configure your project settings and modules.
  6. Generate the project files and open in your preferred IDE.
  7. Start coding your application using

Competitor Comparisons

1,592

VST 3 Plug-In SDK

Pros of VST3 SDK

  • Directly supported by Steinberg, ensuring compatibility with their DAWs
  • Focused specifically on audio plugin development
  • Provides low-level access to audio processing capabilities

Cons of VST3 SDK

  • Steeper learning curve compared to JUCE's more user-friendly API
  • Limited cross-platform GUI development tools
  • Lacks the extensive feature set and utilities provided by JUCE

Code Comparison

VST3 SDK (C++):

#include "public.sdk/source/vst/vstaudioeffect.h"

class MyPlugin : public Steinberg::Vst::AudioEffect {
    tresult PLUGIN_API process(Steinberg::Vst::ProcessData& data) override {
        // Audio processing code here
    }
};

JUCE (C++):

#include <JuceHeader.h>

class MyPlugin : public juce::AudioProcessor {
    void processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages) override {
        // Audio processing code here
    }
};

The VST3 SDK provides a more low-level approach to plugin development, while JUCE offers a higher-level abstraction with additional utilities and cross-platform support. JUCE simplifies many aspects of audio plugin development, including GUI creation and parameter handling, making it more accessible for beginners and faster for prototyping. However, the VST3 SDK offers more direct control over the plugin architecture and may be preferred for highly optimized or specialized audio applications.

10,676

Audio synthesis, processing, & analysis platform for iOS, macOS and tvOS

Pros of AudioKit

  • Focused specifically on iOS and macOS audio development
  • Extensive documentation and tutorials for beginners
  • Simpler API for common audio tasks

Cons of AudioKit

  • Limited cross-platform support compared to JUCE
  • Smaller community and ecosystem
  • Less flexibility for advanced audio processing

Code Comparison

AudioKit:

let oscillator = AKOscillator()
AudioKit.output = oscillator
try AudioKit.start()
oscillator.start()

JUCE:

SineWaveSound::SineWaveSound() {}
SineWaveSound::~SineWaveSound() {}
SineWaveVoice::SineWaveVoice() {}
void SineWaveVoice::startNote(int midiNoteNumber, float velocity, SynthesiserSound*, int) {
    currentAngle = 0.0;
    level = velocity * 0.15;
    tailOff = 0.0;
    auto cyclesPerSecond = MidiMessage::getMidiNoteInHertz(midiNoteNumber);
    auto cyclesPerSample = cyclesPerSecond / getSampleRate();
    angleDelta = cyclesPerSample * 2.0 * MathConstants<double>::pi;
}

AudioKit offers a more straightforward API for common audio tasks, making it easier for beginners to get started with iOS and macOS audio development. However, JUCE provides greater flexibility and cross-platform support, making it more suitable for complex audio applications and professional development across multiple platforms.

1,098

Pure Data embeddable audio synthesis library

Pros of libpd

  • Lightweight and focused on Pure Data integration
  • Easy to embed in mobile and desktop applications
  • Supports real-time audio processing and synthesis

Cons of libpd

  • Limited to Pure Data functionality
  • Lacks comprehensive GUI tools and cross-platform application development features
  • Smaller community and ecosystem compared to JUCE

Code Comparison

JUCE example (audio processing):

void processBlock(AudioBuffer<float>& buffer, MidiBuffer& midiMessages)
{
    for (int channel = 0; channel < buffer.getNumChannels(); ++channel)
    {
        float* channelData = buffer.getWritePointer(channel);
        for (int sample = 0; sample < buffer.getNumSamples(); ++sample)
        {
            channelData[sample] *= gain;
        }
    }
}

libpd example (audio processing):

static void process(float *inBuffer, float *outBuffer)
{
    libpd_process_float(1, inBuffer, outBuffer);
}

JUCE offers a more comprehensive API for audio processing, while libpd provides a simpler interface for integrating Pure Data patches into applications. JUCE is better suited for developing full-fledged audio applications, while libpd excels in scenarios where Pure Data integration is the primary focus.

1,015

The Synthesis ToolKit in C++ (STK) is a set of open source audio signal processing and algorithmic synthesis classes written in the C++ programming language.

Pros of STK

  • Lightweight and focused specifically on audio synthesis and processing
  • Extensive collection of physical modeling algorithms and instruments
  • Cross-platform support with minimal dependencies

Cons of STK

  • Limited GUI capabilities compared to JUCE's comprehensive toolkit
  • Smaller community and less frequent updates
  • Narrower scope, primarily focused on audio processing rather than full application development

Code Comparison

STK example (simple sine wave synthesis):

SineWave sine;
sine.setFrequency(440.0);
for (int i = 0; i < bufferSize; i++) {
    output[i] = sine.tick();
}

JUCE example (simple sine wave synthesis):

dsp::Oscillator<float> oscillator;
oscillator.initialise([](float x) { return std::sin(x); }, 128);
oscillator.setFrequency(440.0f);
oscillator.process(context);

Both libraries offer straightforward ways to generate audio, but JUCE provides a more comprehensive framework for building complete audio applications with GUI support, while STK focuses on low-level audio processing and synthesis algorithms.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

alt text

JUCE is an open-source cross-platform C++ application framework for creating desktop and mobile applications, including VST, VST3, AU, AUv3, AAX and LV2 audio plug-ins and plug-in hosts. JUCE can be easily integrated with existing projects via CMake, or can be used as a project generation tool via the Projucer, which supports exporting projects for Xcode (macOS and iOS), Visual Studio, Android Studio, and Linux Makefiles as well as containing a source code editor.

Getting Started

The JUCE repository contains a master and develop branch. The develop branch contains the latest bug fixes and features and is periodically merged into the master branch in stable tagged releases (the latest release containing pre-built binaries can be also downloaded from the JUCE website).

JUCE projects can be managed with either the Projucer (JUCE's own project-configuration tool) or with CMake.

The Projucer

The repository doesn't contain a pre-built Projucer so you will need to build it for your platform - Xcode, Visual Studio and Linux Makefile projects are located in extras/Projucer/Builds (the minimum system requirements are listed in the minimum system requirements section below). The Projucer can then be used to create new JUCE projects, view tutorials and run examples. It is also possible to include the JUCE modules source code in an existing project directly, or build them into a static or dynamic library which can be linked into a project.

For further help getting started, please refer to the JUCE documentation and tutorials.

CMake

Version 3.22 or higher is required. To use CMake, you will need to install it, either from your system package manager or from the official download page. For comprehensive documentation on JUCE's CMake API, see the JUCE CMake documentation. For examples which may be useful as starting points for new CMake projects, see the CMake examples directory.

Building Examples

To use CMake to build the examples and extras bundled with JUCE, simply clone JUCE and then run the following commands, replacing "DemoRunner" with the name of the target you wish to build.

cd /path/to/JUCE
cmake . -B cmake-build -DJUCE_BUILD_EXAMPLES=ON -DJUCE_BUILD_EXTRAS=ON
cmake --build cmake-build --target DemoRunner

Minimum System Requirements

Building JUCE Projects

  • C++ Standard: 17
  • macOS/iOS: Xcode 12.4 (Intel macOS 10.15.4, Apple Silicon macOS 11.0)
  • Windows: Visual Studio 2019 (Windows 10)
  • Linux: g++ 7.0 or Clang 6.0 (for a full list of dependencies, see here).
  • Android: Android Studio (NDK 26) on Windows, macOS or Linux

Deployment Targets

  • macOS: macOS 10.11
  • Windows: Windows 10
  • Linux: Mainstream Linux distributions
  • iOS: iOS 12
  • Android: Android 5 - Lollipop (API Level 21)

Contributing

Please see our contribution guidelines.

Licensing

See LICENSE.md for licensing and dependency information.

AAX Plug-Ins

AAX plug-ins need to be digitally signed using PACE Anti-Piracy's signing tools before they will run in commercially available versions of Pro Tools. These tools are provided free of charge by Avid. Before obtaining the signing tools, you will need to use a special build of Pro Tools, called Pro Tools Developer, to test your unsigned plug-ins. The steps to obtain Pro Tools Developer are:

  1. Sign up as an AAX Developer here.
  2. Request a Pro Tools Developer Bundle activation code by sending an email to devauth@avid.com.
  3. Download the latest Pro Tools Developer build from your Avid Developer account.

When your plug-ins have been tested and debugged in Pro Tools Developer, and you are ready to digitally sign them, please send an email to audiosdk@avid.com with the subject "PACE Eden Signing Tools Request". You need to include an overview of each plug-in along with a screen recording showing the plug-in running in Pro Tools Developer, with audio if possible.

Please also include the following information:

  • Company name
  • Admin full name
  • Telephone number

Once the request is submitted, PACE Anti-Piracy will contact you directly with information about signing your plug-ins. When the plug-ins have been signed, you are free to sell and distribute them. If you are interested in selling your plug-ins on the Avid Marketplace, please send an email to audiosdk@avid.com.