This is an implementation of cross synthesis using FFT's.
Syntax
ares=cross2(ain1,ain2,isize,ioverlap,iwin,kbias)
arescross2ain1,ain2,isize,ioverlap,iwin,kbias
Initialization
isize -- This is the size of the FFT to be performed. The larger the size the better the frequency response but a sloppy time response.
ioverlap -- This is the overlap factor of the FFT's, must be a power of two. The best settings are 2 and 4. A big overlap takes a long time to compile.
iwin -- This is the function table that contains the window to be used in the analysis. One can use the GEN20 routine to create this window.
Performance
ain1 -- The stimulus sound. Must have high frequencies for best results.
ain2 -- The modulating sound. Must have a moving frequency response (like speech) for best results.
kbias -- The amount of cross synthesis. 1 is the normal, 0 is no cross synthesis.
Examples
Here is an example of the cross2 opcode. It uses the file cross2.csd and fox.wav.
<CsoundSynthesizer><CsOptions>; Select audio/midi flags here according to platform-odac ;;;RT audio out;-iadc ;;;uncomment -iadc if RT audio input is needed too; For Non-realtime ouput leave only the line below:; -o cross2.wav -W ;;; for file output any platform</CsOptions><CsInstruments>; after example from Kevin Condersr=44100ksmps=32nchnls=20dbfs=1instr1;play audio fileaoutsoundin"fox.wav"outsaout,aoutendininstr2;cross-synthesizeicps=p4ifn=p5; Use the "ahhc.aiff" sound and "eeec.aiff"ain1oscil0.6,p4,ifnain2soundin"fox.wav"; Use the "fox.wav" as modulatorisize=4096ioverlap=2iwin=3kbiasinit1aoutcross2ain1,ain2,isize,ioverlap,iwin,kbiasoutsaout,aoutendin</CsInstruments><CsScore>;audio filesf101281"ahhc.aiff"040f201281"eeec.aiff"040f302048202;windowing functioni103i233501;"eeec.aiff"i2+3502;"ahhc.aiff"i2+31001;"eeec.aiff"i2+31002;"ahhc.aiff"i2+32501;"eeec.aiff"i2+32502;"ahhc.aiff"i2+3201;"eeec.aiff"i2+3202;"ahhc.aiff"e</CsScore></CsoundSynthesizer>