Cabbage Logo
Back to Cabbage Site

Need advice about detune

Hello,

I want to add a detuned osc playing at pitch Fd, lets call it OD(Fd) , to a main osci at pitch F, called OM(F) . I see 2 options.

  1. Detune using

Fd = F+ delta

for every note, delta being a small quantity
giving then :

aout = 1/2 * [ OM(F)+ OD(F +delta) ]

  1. Or use a multiplying factor of the initial frequence
    Fd =  (1 +delta ) *  Freq

giving then :

aout = 1/2 * [ OM(F)+ OD( (1 +delta ) * F) ]

Of course both works, but the results is definitely not the same. The first solution is giving a fixed detune tone in Hz (which is providing a different acoustic feeling depending on the pitch of the main osc), whilst the second one is creating a fixed interval.

So please , which solution is the best (or the most used in synthesisers)?
Or is there any other way to reach this goal ?

Any advice is welcome.
Thank you.

In case you haven’t already encountered them, the Csound functions cent(x), semitone(x) and octave(x) should make these sorts of procedures much easier.
Referring to your question, your second solution is more typical and the above mentioned functions can be used for this.

Oh no, I’ve been doing it wrong for years! To be honest the only time I use something like this is in class. And for simplicity sake we simply detune oscillators by hertz values. But good to hear your take on it.

Hello, Thank a a lot to both of you.
I upload my very first synth ever based on your lessons except the use of cent() because I wanted to get a very small detune #2 -3 Hz
unfortunately, it only works with cabbage 2 because of groupbox.
I also attached one snapshot to show how it can sound. (Other will come when combobox can be updated)
Comments and advice to improve it are more than welcome

.JM_sub_1.snaps (3.0 KB)
JM_sub.csd (61.6 KB)

Wow this is a massive synth, good work!
Looking at your detune approach you seem to have adopted the first approach: adding or subtracting a frequency value to the oscillator frequency. This approach will provide you with a constant beat frequency across the keyboard. This disadvantage is that the musical interval between the two tones varies across the keyboard. Specifically if the detune value is large, the lower note clusters will sound quite discordant but higher notes less so. Considering a real-world example such as a piano, wherein individual notes can be served by 1 - 3 strings that are inevitably detuned with respect to one another, this state is better reflected by multiplying a frequency by a constant value rather than adding a constant value. Obviously in a synth you are not obliged to follow this convention but I still think it is more useful and interesting, at least in a conventional synth.
You can still set tiny interval changes with cent(). A change of 1 cent will not be perceivable by humans.

Thank you, Iain… I am flattered :blush:
Should you have little time to play with it and making nice sound… please, could you share the snapshots ?

Indeed, I just wanted the detune to be of very few hertz in order to get a beat, I was not aiming at making a chord.

However, I would still need some advice to improve it. For instance, I am not very happy with the ADSR applied to the filters, you can barely hear its effect…How should/could it be better implemented ?
Also, loading presets is still a pain, the GEN tables do not seem to be updated after loading a preset ( except if it is a user Oscil)> I suppose Rory will explain how to do this in a proper way…

Many thank again for your great help and advices.

Great synth! Can you post this to the recipes section so it’s easy to find for others?

They seem to be working fine for me here with my current build. I’ve just a few other things to look into first, and then I’ll run off a new version for you.