The tutorials are not very good (at all)

Hello,

I am trying to build a simple compressor with JUCE for my Audio Technology MSc course with some coding background in Supercollider and Pure Data.

I am struggling to find a way (or resource for beginners) to learn JUCE code at all. This is further majorly hindered by issues such as confusing tutorials. On the page ‘‘Tutorial: Create a basic Audio/MIDI plugin, Part 1: Setting up’’ I followed it step by step and have found that there is no ‘‘yourcompany’’ vst during the scan proccess of VST3’s. By locating the file however (not described in tutorial) I have found some form of VST3 from the numerous projects (from numerous attempts), this however only has 2 outputs and no inputs even though I have chosen the Midi In and Out characteristics.

This is by far one of the most stressful things to learn when people are saying it is ‘‘simple’’ trying to make a simple compressor, god give me strength. I have tried many different tutorials and courses to encounter similar problems that do not involve a single bit of code the problems lie in some sort of technicality of ‘‘setting up’’. This should not be the difficult part but it is! This along with JUCE and public domain coding software in general is rubbish! - Change my mind!

Matt

see this screen shot this always comes up even though I followed the step by step instructions provided by JUCE, does this also need to solved, and finally when will there be good coding software available to me? after my course finishes? fgs people I am having a horrible time with this software and the likes of it. You would think it if it was you for something people would help or you would have better luck by now if you needed help…

It is actually all good, you are on the right track.

The first warning is just some Apple thing, you can click on that update button or ignore it. AFAIK it won’t make a difference. It’s just which build system is used.

The second warning is the variable channelData, where you start implementing your dsp code. It is only there to give you an idea how to loop through the samples.

Good luck

2 Likes

This is what i am talking about when I say there is no help. I don’t see how I am on the right track? there should be output and input in the audio plug in host? only 2 outputs, I refer back to my first message. I don’t see how how someone like me is supposed to learn this code to make a compressor, I am not one for lack of trying! Are they trying to make it difficult on purpose? rather than as difficult as it needs to be? at least initially?

I don’t think there is a tutorial/learning resource out there at all that is good enough…

Hi and welcome! You’re right - audio development is a challenging pursuit, and it can be difficult to get started. Here are some resources for you…

  1. If you’re looking to build a compressor, have a look at JUCE’s own example using their DSP Module. In the Projucer, go to File → Open Example → Plugins → DSPModulePluginDemo. Isolating just the compressor code on its own can be a challenge if you’re just getting started, but it’s all there

  2. Searching on GitHub, I found these 30 JUCE compressors. Have a dig through these and I’m sure you’ll learn some new tricks.

  3. If you’re just getting started, try @matkatmusic’s new 5 hour tutorial on FreeCodeCamp, or over 100 talks on audio development from the Audio Developer Conference.

  4. @olilarkin has a fantastic list of audio development resources here.

  5. I have over 100 JUCE tutorials on my YouTube channel, starting from when I first started learning to code. If you’re just beginning with JUCE, start here. If you’re just starting with C++, check out the tutorials where I teach my son the language from the start here. We also have a community on Discord where developers of all levels connect and help one another! You can join here.

Hope that helps. Good luck!

11 Likes

Another thought: JUCE is a C++ library, so having some basic C++ know how and some know how about the build tools before starting with JUCE helps you a lot, especially when you are getting build warnings like in your screenshots.

After all, plugin programing is just a niche topic in the big wide general programing world and JUCE gives you great tools to solve those audio plugin specific problems, so if you ever tried to do all this without JUCE you‘ll quickly come to the conclusion that they don’t make it difficult by purpose but that it already does a lot of heavy lifting for you and that it‘s just a really complex topic.

8 Likes

the tutorials could be better at some points but they are ok. do what theaudioprogrammer says and come into his discord. most issues like that can quickly be sorted out by just asking everyone if they’ve encountered that yet, because that’s usually the case, especially with these tutorials

Thank you everyone for the information. Good luck to me :slight_smile:

One other thought from both having done it and helping lots of devs get started with our software. By far the hardest part is the very first compile run cycle. Making a plug-in which compiles shows up in reaper or what not and shows a string you put into paint requires your build pipeline and tools and environment to be set up properly. Problems there can be idiosyncratic sometimes and often require just poking at it a bit. But from my experience once you get there it gets way way easier (and the tutorials are then very useful I find). Hope that helps and good luck

2 Likes

Hello again,

When I try to open other peoples compressors and build them it fails or when i try clone the repository it gets stuck on receiving objects. How do I open peoples github Juce projects?

So far I have completed Matkatmusics 5hr course up to where i run the code and I have sliders and parameters on the Eq the next part is adding DSP (Part 4).

Trying to get to grips with it watching the 5 hour course and Audioprogrammers tutorials for c++, example code in Juce and Github has not been much success yet …

Kind regards,

Matt

Can you post some more details? I have my doubts that it just “gets stuck”, surely there is some kind of error message?

git clone the repository.

If you use the default SSH version (starts with git@github.com:) then you’ll need to have your SSH public key added to your GitHub account, otherwise using the HTTPS version can allow you skip that (which is fine for other peoples project for which you’ll never commit/push to).

1 Like

Good news the git clone worked because i needed to use terminal basically.

Although there was no error and it was stuck on loading objects probably because I did not use terminal. Anyway I am just happy its working now!

One thing I would recommend, if you’re trying to figure out how to build a compressor, is to look through JUCE’s own Compressor class (with the dsp namespace).

If you create an instance of the compressor object in your PluginProcessor.h, you can control (or command on Mac?) click on the class and navigate through its header and cpp files to see how the compressor processes audio.

And you could implement this compressor object to do your compression, or you could just use it as a jumping-off point to understand the signal processing flow.

Another good starting point for understanding the basics of compression in DSP would be this paper.

Hope that’s helpful. And no, it’s not really that simple to get things set up and going. It took me probably a couple weeks just to figure out how to set up a simple static filter, get it processing both channels correctly,

1 Like

I’ve looked through the Compressor class in the dsp namespace already it’s abit confusing there is lots of functions i can see and some I would like to add (like peak and rms made with the enumeration instruction followed by dsp::BallisticsFilter and a setLevelCalculationType?) but I don’t know the right way to put it in yet in to someones example code i have been looking at or starting from my own which i am still obviously struggling on.

I’m not sure how to create an instance of a compressor object. I need to focus on c++ much more I guess.

If there is anything you could add to what you have said or code you could share as to what you mean that would be good.

I am hoping it will get easier soon. Thank you for your efforts.

Yeah, C++ fundamentals are going to help when first getting started. I would definitely recommend checking out The Audio Programmer’s youtube for tutorials on the essential aspects of creating plugins. I don’t know if he’s done any compressors, but there is a lot of general guidance that applies to JUCE as a whole.

As far as creating an instance of the compressor object, or any pre-existing object that your PluginProcessor.h is able to use via header inclusions (i.e. the #include “JuceHeader.h” piece of code at the top of PluginProcessor.h), create a line of code (beneath the “private” secion) like:

juce::dsp::Compressor<float> compressor;

This gives your processor access to an instance of the JUCE compressor.

In your PluginProcessor.cpp, within the PrepareToPlay function, create an instance of ProcessSpec which you’ll need to pass information about the number of channels, sample rate, and buffer size to the compressor.

juce::dsp::ProcessSpec spec;
spec.numChannels = getTotalNumInputChannels();
spec.sampleRate = sampleRate;
spec.maximumBlockSize = samplesPerBlock;

then you’d do:

compressor.prepare(spec);

This passes the above information about this incoming audio to the compressor so it’s ready to process audio.

You could use this space to initialize the compressor’s variables, too, although you’ll probably want to initialize them in the header or in the constructor and then write a function for updating them as they change in real time. But for the sake of just getting something that will compress audio when you turn the plugin on, you can declare its variables like:

compressor.setThreshold(-18.0);

doing so for each aspect of the compressor.

Alright, last thing, in ProcessBlock, create an AudioBlock and a ProcessContextReplacing. This will let you pass the incoming buffer into the compressor and get the resulting audio. Like so:

juce::dsp::AudioBlock<float> block (buffer);
juce::dsp::ProcessContextReplacing<float> context (block);
compressor.process(context);

I could be forgetting something, but I think this is the gist of getting a very basic setup for the JUCE compressor class. Let me know if this works. Eventually you could map the compressor’s parameters to processor parameters so you can actually adjust them in real time. And hang in there, dude. It does get easier! You’ll be surprised how quickly things start making sense if you just keep at it.

1 Like

You can message me directly in the Slack Workspace for my courses if you grab the SimpleEQ course from my website: https://www.programmingformusicians.com

I will help you get through the SimpleEQ plugin project.

2 Likes

Hello,

Thank you for this information. It does not build successfully though it comes up with this (see image)

Kind regards,

Matt

Hello,

Thank you for the offer, thus far I am following along with the SimpleEQ with no problems but I will let you know if I do. I am trying to build a compressor (the best compressor I can hopefully with all the features and inner workings such as thd) that is my main goal.

Kind regards,

Matt

It won’t work with a C++ beginner tutorial.
The JUCE framework is not well suited to start from zero, although some people manage to learn C++ and JUCE at the same time.

You need to know the difference between a function declaration and an implementation. That will tell you where to put what code.

1 Like