Applying all harmonics from one sound to each harmonic of another

Simplifying: I would like to apply the spectral harmony of one sound to another.

template = Mix(SinOsc.ar(400 * [1,1.25,1.5])/3);
source = Mix(SinOsc.ar([1000,1200])/2);

desiredResult = Mix(SinOsc.ar(([1000,1200] *.1 [1,1.25,1.5]).flat)/6);

Here I’m putting sine waves, but in the end I would like to do this with any recorded sound (both as target and source).

My idea would be:

  1. detect template’s fundamental freq f0
  2. calculate CQT for template
  3. shift CQT’s bins so that f0 gets into the first bin
  4. convolution of shifted CQT with source’s CQT: each partial from source becomes the fundamental of template’s “intervallic” spectrum.
  5. inverse CQT

I’m thinking of CQT because I don’t think it’s possible to create an “interval spectrum” with FFT. I would loose all the information when squeezing it down to the lowest bins

Before I dig into how to get a CQT in SuperCollider… does anyone have any easier idea?

1 Like