«Spectral Cross-Synthesis» by zecraum

on 26 Jun'23 00:54 in fftspectral crosssynthesisspectralphase vocoder

By Nathaniel Virgo. See https://listarc.cal.bham.ac.uk/lists/sc-users-2009/msg55766.html

This comes from the mailing list as an attempt to simulate the vst Shapee.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// By Nathaniel Virgo
// https://listarc.cal.bham.ac.uk/lists/sc-users-2009/msg55766.html

// This comes from the mailing list as an attempt to simulate the vst Shapee

(
s.boot.doWhenBooted {
c = Buffer.read(s,"sounds/a11wlk01.wav");
}
)

(
x = {
    // parameters to play with - width should be an integer - I think 4 is the theoretical optimum
    var fftsize = 512, width=4;

    var in, chain, in2, chain2, out;

    // timbre source - vocal sample
    in = PlayBuf.ar(1, c, BufRateScale.kr(c), loop: 1);

    // pitch source - random polyphonic line
    in2 = Saw.ar(LFNoise0.ar(1!3).exprange(100,5000)).mean;

    chain = FFT(LocalBuf(fftsize), in, wintype:1);       
    chain2 = FFT(LocalBuf(fftsize), in2, wintype:1);
   
    chain = chain.pvcalc2(chain2, fftsize, {|e_mags, e_phases, f_mags, f_phases|

        var fbins = e_mags.clump(width).collect(_.sum) / f_mags.clump(width).collect(_.sum);
       
        [f_mags*fbins.stutter(width), f_phases];
        //[e_mags, f_phases];
    });
       

    out = IFFT(chain);
    Out.ar(0, 0.5 * out.dup);
}.play(s);
)
raw 1115 chars (focus & ctrl+a+c to copy)
reception
comments