• Stars
    star
    111
  • Rank 308,161 (Top 7 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 6 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of templates for creating Audio Unit V3 in Xcode

Audio-Unit-V3-Templates

A collection of templates for creating Audio Unit V3 in Xcode

About

This repository aims to collect together templates for creating Audio Unit v3 Plug-ins. Apple's API, though powerful, is nebulous at best and for the novice DSP engineer it is a bit much to take on. Apple's sample code and tutorial left me wanting, so here are a couple of complete Xcode projects to help you get started.

Each template listed will gradually include greater and greater complexity. A README can be found in each template folder but here is a rough guide to get you started.

Apple Sample Code

To save time traipsing around the Apple Sample Code Archive, here are the links too available sample code for AUv2 and AUv3 code.

Contributing

See Contributing documentation

Templates

AudioUnit V3 Template Basic

A bare bones template: Audio comes in, Audio Goes out. The DSP kernel is where you will want to focus your attention. The process method of the DSPKernel class is where the sample by sample processing takes place (DSPKernel.hpp line 54). You can ignore everything else for now

AudioUnitV3TemplateWithParameters

Exactly as it says, this is a template that includes a GUI slider object and a gain parameter. Adding in more should be a simple case of replicating the process of initiating and single parameter. There are some extra classes to pay attention to in this template

templateAUfxWithParametersAudioUnit.mm

This objective C class is what communicates with the DAW environment. The initWithComponentDescription method is where the pointers to parameter values are set. Line 80 is a good place to start. There are a lot of pointers flying around which does not help in comprehending the logic.

AudioUnitViewController.swift

This file is where you should head for any GUI work. GUI Elements (or "Views" in Apple parlance) can be added via the AudioUnitViewController.xib file. It is highly recommended you start off with a simple Swift based GUI project before delving into this. There are enough headaches to be had in Xcode and Swift without adding in a whole audio processing framework on top.

Troubleshooting

Common issues I have come across when building audio units. Sanity check with the auval terminal command

Audio Unit is not visible after building

Take a look at the info.plist file, an XML file of info about your Audio Unit Try changing the 4 letter code. Try altering the manufacturer code as well.

info.plist

Build Errors

  • 'vector' file not found
  • ""_OBJC_CLASS_$_AVAudioFormat", referenced from:"
  • "_OBJC_CLASS_$_AVAudioPCMBuffer", referenced from:
  • linker command failed with exit code 1 (use -v to see invocation)

Any of the above? Sounds like you have forgotten to link a library, most probably AVFoundation.

LinkLibrary

or your AudioUnit ObjectiveC++ file has the wrong extension. Change it to .mm

ObjectiveC++ naming

How do I install once I have built the AUv3?

AUv3s are a part of the PluginKit Eco system and information about it is pretty thin on the ground. Basically you will need to run your .app with the embedded .appex before it is registered by PluginKit. You can check your app is registered by

  • Running auval -a in Terminal and looking for your plugin. auval -a | grep FOUR_CHARACTER_MANU_CODE can also help for big lists
  • Running pluginkit -m in Terminal and looking for your .appex's bundle identifier

Is there a nicer way to install it?

Not really, run the .app and your done. PluginKit applies to any embedded .appex so this method of installation makes sense for those, but is perhaps a little unusual to what audio plug-in users expect.

What can I do with my appex file?

Not much, your app needs something to embed in the first place. You can always import it into another xcode project. By itself, the appex is useless and you need to embed it in an app.

Building AUv3s with JUCE

Using JUCE to make an AUv3? See my post on Troubleshooting AUv3s on the Juce forums.


Links

References

Here are a couple of links to check out along your AUv3 travels

Suggestions are welcome for other helpful articles.

Github Repositories

Here is a selection of GitHub Repos that I found useful when making these templates.

You can also search GitHub by tag, so have a look at #auv3, #audio-units, #audio-unit, #audiounit for more examples.

More Repositories

1

macos-ble-examples

Examples for Managing Client connections and creating a peripheral on macOS
Objective-C
20
star
2

max-hardware-library

Library of utility objects for MaxMSP aimed at interacting with electronics hardware like Arduino
Max
15
star
3

AudioEffectsSuite

A Suite of C++ Audio Effects Classes
C++
15
star
4

maxmsp-ble

A BLE Object for Max
Max
11
star
5

CoupledFDPlateAndString

Finite difference modelling of Kirchhoff thin plate coupled with stiff string(s)
MATLAB
10
star
6

absolute-roasters

A data set of UK Coffee Roasters
7
star
7

cppwinrt-ble-examples

So you've decided to ruin your life and work with Bluetooth on windows
C++
6
star
8

Automatic-Music-Box

Automating score generation and playback for paper score 30 note chromatic music boxes
Processing
5
star
9

FDPlateClass

A finite difference plate scheme wrapped in a class
C++
3
star
10

processing-tone-matrix

Andre Michel's ToneMatrix recreated in processing with some extra frills on top
JavaScript
2
star
11

max-byte-cast

MaxMSP Object for casting lists of bytes to other data formats
Max
2
star
12

Wiggle-Scope

VST and Audio Unit Oscilloscope for plug-in testing
C++
2
star
13

Swift-Metal-Plate

A finite difference thin plate visualisation using Metal shaders
C++
1
star
14

iphone-ble-sensors

Sending iPhone sensor data over Bluetooth Low Energy
Swift
1
star
15

1D-Wave-in-5-minutes

Reveal.js presentation and notes around the 1D wave equation and its modal frequencies
JavaScript
1
star
16

FDPlate

C++ Finite difference plate
C++
1
star
17

p5_audio_vis

Audio Visualisation Examples with P5
JavaScript
1
star
18

cpp-cli-audio-tools

Command Line Tools for Audio Playback in C++
C++
1
star
19

completely-smashed

A data set of Scottish Whisky Distilleries
1
star
20

Finite-Difference-Method-for-Differential-Equations-Markdown

TeX
1
star
21

Juce-on-Pi

Code, scripts and documentation relating to getting Juce up and running on a Raspberry Pi
C++
1
star
22

macos-lux

MaxMSP object for retrieving the lux value from the Facetime camera
1
star
23

italian-conjugator

A little web tool for finding out and practicing conjugating italian verbs
HTML
1
star