float sample = std::sin(currentPhase); currentPhase += phaseIncrement; Use code with caution. Copied to clipboard
For months, Leo had been a "preset tweaker"—someone who used other people’s sounds. But tonight was different. Tonight, he was building his own instrument from scratch using . The First Waveform Code Your Own Synth Plug-Ins With C and JUCE
At 3:00 AM, something strange happened. While messing with the feedback loop of his delay effect, Leo accidentally multiplied a variable by a value that was slightly too high. float sample = std::sin(currentPhase)
"If the signal goes above 0.8, force it to stay at 0.8," he decided. He was essentially "squaring" the wave, adding harmonic distortion. Then, he added a Resonant Low-Pass Filter—a complex piece of trigonometry that would let him sweep through frequencies like a 1970s sci-fi soundtrack. currentPhase += phaseIncrement