A two-part talk by Nick Thompson, founder of Creative Intent, LLC, presented at the Game Audio Boston meetup on September 25, 2018. This talk introduces the fundamentals of digital signal processing at a high level just enough to intuitively evaluate a first order lowpass filter. Then, in the second part of the talk, we introduced JUCE and it's new Unity export target, and applied our intuitive understanding of this filter to build a simple plugin and load it into a Unity project.
2. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
CREATIVEINTENT
INTRODUCTION / BACKGROUND
▸ Electronic musician and programming
hobbyist since a young age.
▸ Studied computer science at Cornell
University.
▸ Started Creative Intent in 2017,
transitioning to audio programming
after 5 years in web.
▸ Shipped two distortion plugins,
Temper and Tantrum, and a third on
the way
3. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
GOALS
‣ Share with you a high level understanding of the
fundamentals of digital signal processing to enable further
exploration.
‣ Break down an intuitive example of a simple digital filter
to apply our fundamentals.
‣ Walk through and build together a fully functional
implementation of our simple filter.
4. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
AGENDA / PRESENTATION
▸ From the top: what is sound?
▸ The Fourier Theorem
▸ Fundamentals of digital sampling
and the Nyquist Theorem
▸ Introduction to the architecture of
a digital signal processing unit
▸ Intuitive exploration of a first order
lowpass filter
"Waveform" by Scott Middler is licensed under CC by-nc-nd 3.0
5. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
AGENDA / WORKSHOP
▸ Introduction to JUCE and creating
the project template.
▸ Walkthrough of the project
template and configuring our
build.
▸ Exposing a parameter and (time
permitting) simple gain example.
▸ Implement our lowpass filter and
load it into Unity.
6. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
WHAT IS SOUND?
SOUND| SOUND |
noun
vibrations that travel through the air or another medium and
can be heard when they reach a person's or animal's ear:
light travels faster than sound.
7. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
WHAT IS SOUND?
VIBRATION | VĪˈBRĀSH(Ə)N |
noun
an instance of vibrating: powerful vibrations from an
earthquake | the big-capacity engine generated less
vibration.
‣ (Physics) an oscillation of the parts of a fluid or an elastic
solid whose equilibrium has been disturbed, or of an
electromagnetic wave.
8. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
WHAT IS SOUND?
9. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
THE FOURIER THEOREM
A mathematical theorem stating that a continuous periodic
function may be expressed as the sum of a series of sine or
cosine terms.
10. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
THE FOURIER THEOREM
11. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
THE FOURIER THEOREM
12. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
THE FOURIER THEOREM
13. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DIGITAL SAMPLING & THE NYQUIST THEOREM
▸ Through the Fourier Theorem, we’ve gone from a complex
physical sound to a single continuous sine wave.
▸ Computational processing cannot truly represent a
continuous function (we don’t have true infinity on a
computer), so we work with discrete values.
▸ Digital sampling (Analog to Digital Conversion) is the
process of translating a continuous signal to a discrete set
of sample points.
14. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DIGITAL SAMPLING & THE NYQUIST THEOREM
15. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DIGITAL SAMPLING & THE NYQUIST THEOREM
16. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DIGITAL SAMPLING & THE NYQUIST THEOREM
▸ The Nyquist-Shannon Theorem states that we can perfectly
reconstruct a continuous signal, s(t), which contains
frequencies no higher than N hertz, by a series of samples
spaced 1/2N apart.
▸ In the musical context, this often accounts for the choice of
a sample rate of 44.1kHz– we can perfectly represent a
signal, in discrete time, whose highest frequency
component is at the top end of the human hearing range.
17. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DIGITAL SAMPLING & THE NYQUIST THEOREM
18. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DIGITAL SAMPLING & THE NYQUIST THEOREM
19. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DIGITAL SAMPLING & THE NYQUIST THEOREM
20. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DSP ARCHITECTURE
Source: Apple Developer Documentation
21. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DSP ARCHITECTURE
Source: https://www.mathworks.com/help/audio/gs/export-matlab-plugin-to-a-daw.html
22. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
DSP ARCHITECTURE
void processBlock (float* inputData, float* outputData, int len)
{
for (int i = 0; i < len; ++i)
{
// This is where the magic happens
outputData[i] = f(inputData[i]);
}
}
So from a practical standpoint, this effectively means that our
job is to prepare a function that receives a large block of input
sample data and prepares the corresponding output data:
23. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
AN INTUITIVE LOWPASS FILTER
▸ A lowpass filter is a filter that allows components of a
signal below a given cutoff frequency to pass through
unaffected while attenuating components of a signal
higher than the cutoff.
▸ We’re going to look at a first-order lowpass filter (a one-
pole filter) that in practice has limited applicability but
provides for a great intuitive exercise.
24. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
AN INTUITIVE LOWPASS FILTER
void processBlock (float* inputData, float* outputData, int len)
{
float lastOut = 0.;
for (int i = 0; i < len; ++i)
{
outputData[i] = lastOut + inputData[i];
lastOut = outputData[i];
}
}
25. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
AN INTUITIVE LOWPASS FILTER
26. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
AN INTUITIVE LOWPASS FILTER
http://www.micromodeler.com/dsp/
https://dsp.audio/editor/DPRVKDSZZLF6RTNnDp7A/1
27. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
AGENDA / PRESENTATION
▸ What is sound? & The Fourier
Theorem
▸ Fundamentals of digital sampling
and the Nyquist Theorem
▸ Introduction to the architecture of
a digital signal processing unit
▸ Intuitive exploration of a first order
lowpass filter
▸ Questions?
"Waveform" by Scott Middler is licensed under CC by-nc-nd 3.0
28. UNDER THE HOOD: NATIVE AUDIO PLUGINS FOR UNITY
AGENDA / WORKSHOP
▸ Introduction to JUCE and creating
the project template.
▸ Walkthrough of the project
template and configuring our
build.
▸ Exposing a parameter and (time
permitting) simple gain example.
▸ Implement our lowpass filter and
load it into Unity.