Detune L/R Channels

Hello! I am a beginner in juce and I started a plugin as my computing science bachelor thesis but the documentation is pretty vague for me so I will use your help :). I have a few questions:

Setup: For a mono input I have two channel chains based on the same processspec.

How do I detune them (separately)?
How do I set their panning? (-63, +63)
How do I set a delay? (making the left one start a few ms after the initial start)

Don’t be afraid to consider me completely dumb in your explainations:)

Aight, so first let’s sort these things by how hard it is:

Easiest: Panning
Then: Delay
Hardest: Detune / Resample


that’s basically just having different gain values for each channel and then multiplying every sample of that channel with it. there are a lot of tutorials on how to make simple gain plugins with JUCE, like in the official JUCE tutorials, but also in the juce6 videos of the youtube channel from the audio programmer. Finish some of these tutorials and you’ll probably immediatly have an idea about panning.


JUCE has a class called DelayLine for popping and pushing values into a so-called ring buffer, which is needed to delay signals. Kinda hard to explain in short words, but other people can go into detail if they want to. This is just an overview. That being said: Delays in general are not that hard to figure out, but when you want to modulate them, they need to be really good.

Resampling / Tuning: This requires a delay, which is why I consider it the hardest of these. So after you ahve figured out how a delay works you can basically take a delay and change its playback speed to create a granular pitchshifter. with a bit of tweaking, like windowing and parallel processing, you can get them to sound decent, if you are not going for a super natural sound.

1 Like

About panning yes, that was my initial opinion on how to proceed but I did not know how to handle the left right parts because I did not know that the two channels are the stereo left and right as monos.

About the delayline: I was thinking of highering the sample rate so I can insert empty samples before the left channel and after the right one (so that they can also start relooping in the same initial time point). The number of empty samples from the start and end of each channel controlling the delay time. Is what you explained basically the same thing but in a more juce way? About modulations, other than detuning, I do not intend to use anything else. Won’t resampling also affect the playback speed (bpm) of the input? Where can I learn more about this? I can’t seem to find a lot of in depth documentation that is not just the code rules for function definitions, but an overall “course” on how to use juce.

i don’t entirely get what oversampling is supposed to do here, but ringbuffer architectures are always needed in delays and juce::DelayLine is just the juce default way to do it.

yes, resampling changes the playback speed. the trick is to do it with buffers so small that its not perceived as a tempochange anymore but yet big enough to be able to represent its original spectral information at the new pitch. as i said: tweaking