I was trying to get a basic sine wave of 440Hz out from the Maximillian Library. I was going alone with The Audio Programmer’s guide(Juce #23) and by 8:50 in, I was not getting a sine wave output, but some distorted sound. However, it worked in the video, and I am not sure why.
I have included the for loop of the jucer file in question(located in SynthVoice.h). I talked to the people in the Discord, and it appears to be something I am overlooking/don’t know about.
Since the startSample is an argument by value, it is in the function’s context a copy, so you can use it. But your actual problem is, that the generated Sine is not a continuous wave, but keeps starting over with each new generated audio block.
You need a member variable instead, that keeps the position in your sine wave, since the buffer size is most likely not a multiple of your sine waves period.
EDIT: sorry, just see now, that you are pulling the wave from the osc1, so the continuity is taken care of…
Well, how does the resulting waveform look like? Does it look like a signal discontinuity issue or a level clipping issue? Or both? Did you try making the oscillator a bit quieter? (Multiply the output by 0.9 or something…)
To make it simple: a Debug build is big and slow, a Release build is small and fast.
In a Debug build, there are a lot of sanity checks (for instance jassert in JUCE code) and the compiler is not optimizing the code at all.
In a Release build, the sanity checks are skipped and the compiler (and sometimes the linker) optimizes the code.
I guess what you meant is that in your Projucer project you have one configuration which has “Debug Mode” set to “Enabled” (that’s the “Debug” configuration) and one configuration which has “Debug Mode” set to “Disabled” (that’s the “Release” configuration).
This is perfectly normal, but it only tells us that your project has 2 different configurations. It doesn’t tell us which one you use when building your project.
Since you mentioned Live (technically you mentioned Ableton, but that’s the name of the company, not of the DAW), I guess you are either on macOS or Windows, so you’re most likely using Xcode or Visual Studio to build your project.
To build the Release configuration:
in Xcode, you need to navigate the Product menu, then Build For, and then Profiling
in Visual Studio, you need to change the “Solution Configuration” first