In this assignment, we welcome you to the world of JUCE.
You will need:
cd
to wherever you like to collect git
repos
and say
git clone https://github.com/juce-framework/JUCE.git
You should now have a new JUCE
subdirectory.JUCE
is not in your home directory, please make a symlink to it there:
ln -s /path/to/JUCE ~/JUCE
With this symlink,
you will not need to modify JUCE module paths when they come up in the
320c starter code.
The
Projucer is a convenient application that allows you to create and
manage JUCE projects in conjuction with your preferred IDE, such as Xcode on the Mac.
Most people start out with the Projucer and graduate later to CMake
(which is well supported by JUCE).
Following ~/JUCE/README.md
, the Projucer can be built as follows:
cd ~/JUCE
cmake . -B cmake-build -DJUCE_BUILD_EXAMPLES=ON -DJUCE_BUILD_EXTRAS=ON
cmake --build cmake-build --target Projucer
The app can then be found as ~/JUCE/cmake-build/extras/Projucer/Projucer_artefacts/Projucer.app
on the Mac, and on Linux, there is no .app
extension, as it's a plain executable file in that case.
Alternatively to using CMake, find the IDE project file you need
in ~/JUCE/extras/Projucer/Builds/
. These IDE projects
were generated by Projucer itself. You should see subdirectories for
MacOSX, VisualStudio2017* (Windows), and
LinuxMakefile. cd
to the folder for your operating
system, open the IDE project file in your C++ IDE, and do a build.
For Mac OS using Xcode, e.g., the app is created as
~/JUCE/extras/Projucer/Builds/MacOSX/build/Debug/Projucer.app
.
However you build the Projucer, it is convenient to link to it as
~/JUCE/Projucer.app
and launch it via the link, such as
in a shell alias.
A symbolic link ("symlink") can be created at the command line like this:
ln -s ~/JUCE/.../Projucer.app ~/JUCE/Projucer.app
and it works as desired when the JUCE symlink changes.
A shell alias for launching Projucer from the command line on a Mac, using the shell csh
or the like
can be defined like this (normally in your ~/.cshrc
or ~/.tcshrc
file):
alias opj open -a '~/JUCE/Projucer.app \!:*'
Then, typing opj
at the shell command line opens the
desired Projucer. That way, if you switch to using another JUCE
distribution by modifying the ~/JUCE
symlink, the
associated Projucer version will be switched along with it.
As discussed in the 320C starter-code
README.md,
Projucer project files (extension .jucer
) will contain
paths to modules provided by the JUCE
distribution (and next week the PGM distribution). As described
there, the starter code will have .jucer
files that
expect JUCE and PGM modules under
~/JUCE
and ~/PGM
, respectively.
As a test of Projucer and your ~/JUCE
symlink, let's see if Projucer can regenerate its own IDE project files:
~/JUCE/extras/Projucer/Builds/
.As another symlink test and code cleaning:
~/JUCE/extras/Projucer/Projucer.jucer
and
change ../../modules
to ~/JUCE/modules
everywhere it occurs.jucer
file has been changed externally.
Confirm that you accept.
Launch Projucer and create a new Basic Plug-In project. Give your project a fun name like HW0HelloWorld
.
Note that Path to Modules
is set
to ~/JUCE/modules
already by default. If
your ~/JUCE
symlink is in place, you shouldn't
encounter any errors regarding your JUCE modules now. However, for
the foleys_gui_magic
module (also in the JUCE module
format, but distributed separately, as we'll encounter next week),
it is nice to add ~/PGM/modules
to your User
Modules
path, by selecting the menu item Projucer /
Global Paths ...
, and setting User Modules
as
shown below:
(If you later need more modules, such as your own modules [highly
recommended for all finished and reusable code], you can
set User Modules
to ~/modules
and
populate ~/modules
with symlinks
to foleys_gui_magic
and any other modules you ever use.)
Selected exporter
is what you really want. This should
generate your IDE-format project files and launch your IDE. Set the
active IDE scheme to build a Standalone Plugin
and hit
(Build and) Run in your IDE. This should automatically launch a
standalone version of the demo "Hello World" plugin:
Standalone Plugins are great for debugging and testing, but the whole
point of a plug-in is that it plugs into other applications
such as your favorite DAW. Change your active IDE scheme to be
either VST3
(for most DAWs) or AU
(for Apple
DAWs such as Logic Pro). After building, launch your DAW and you
should be able to load your "Hello World" plugin inside your DAW.
The JUCE platform is great for allowing you to build applications for
many different platforms.
Right now your plugin doesn't do much,
but we'll soon change that!
Visual Studio Code ("VS Code") is a cross-platform IDE written in Electron that is quite different from the Visual Studio IDE app which runs only on Windows and Mac. VS Code therefore does not open any of the "Visual Studio 20xx" exports generated by Projucer. However, there are many paths to VS Code from Projucer. Here are two:
process
function
that defines the block diagram and compiles to a single C++
class.