The function below composes a saw wave using additive synthesis.
I’m very interested in the synthesis of unique saw waveforms.
Is this method standard?
How does it compare to Saw.ar?
Are there other methods or techniques?
Could one adjust the interval ratio in an interesting way? Perhaps matching it to a certain interval or scale?
I was under the impression that each harmonic runs at half the amplitude, double the rate of each one previous.
The formula is slightly different, and so regarding the possibility of generating unique saw waveforms by adjusting the interval ratio for each harmonic, I’d like to ask if anyone can share their knowledge of it here… this function to demonstrate:
~saw =
{
|rate 432 lvl 0.2 n 25|
var sig =
(
0 ! 2
)
;
(
1..n // number of harmonics
)
.do
{
|n| sig = sig +
(
SinOsc.ar
(
freq:
(
rate * n
),
mul:
(
lvl / n
)
)
)
}
;
// Pan2 ar: sig
sig ! 2
}
im normally going for this basic formula with the inharmonic parameter for spreading the individual partials to get an inharmonic spectrum and some random phases. The spectrum is multiplied by an 3dB per oct tilt instead of the static division formula. This could then be adjusted by different additive filters like formant, comb, bpf, lpf etc.
thanks to @nathan
(
{
var numPartials = 64;
var spectrum = (1..numPartials);
var tension = (1 + (spectrum * spectrum * \inharmonic.kr(0.005))).sqrt;
var tilt = (log2(spectrum) * \tilt.kr(-3)).dbamp;
var freqs = \freq.kr(110) * spectrum * tension;
var sig = SinOsc.ar(freqs, { Rand(0, 2pi) } ! numPartials);
sig = (sig * tilt).sum;
sig ! 2 * 0.05;
}.play;
)
With additive synthesis, you get the truly awesome power to modulate each partial independently. Here, starting with a basic sawtooth, by modulating frequency and amplitude with different parameters for each partial, you can get a huge variety of interesting sounds: