Best Way to Implement Unison Oscillator From Juce's Oscillator Class

Hello:
I have been working on making a subtractive synthesizer, and everything is working fine; however, I would like to add a unison effect to my oscillators.
My question is this:

  • Is there a way to do this using only the juce::dsp::Oscillator class without any extra 3rd party modules?

Thanks in advance for any help!

If you want to use JUCE oscillator then you could just use a bunch of them at different frequencies and stereo panning. Or derive from oscillator and track a number of internal phasors.

If you haven’t already you may want to sort out aliasing first.

1 Like

I’ll add that you’ll probably want to modify the oscillator class to be able to set the phase manually. And then randomize the phase on creation. Otherwise you can get a nasty lasery sound on the first note that gets played - caused by all oscillators starting on the same phase.

1 Like

idk how juce’ oscillator works exactly, but typically you just need a bunch of unique phasors that all pull from the same waveform and you just add them all up on each other. i agree with evan, looking into concepts of random/continuous/fixed phase is crucial for unison oscillators as well. also look into the difference of freq- and pitch-based unison. that matters for what you feed the phasors with.

1 Like

This ‘nasty’ lasery effect is sometimes quite nice actually - that’s why it’s good to have a unison phase reset control with a randomisation % control :slight_smile:

1 Like