cross2
Prev | Orchestra Opcodes and Operators | Next

## cross2

cross2 — Cross synthesis using FFT's.

## Description

This is an implementation of cross synthesis using FFT's.

## Syntax

    ares cross2 ain1, 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.

Example 189. Example of the cross2 opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

    <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 Conder
    sr = 44100
    ksmps = 32
    nchnls = 2
    0dbfs = 1

    instr 1	;play audio file

    aout soundin "fox.wav"
         outs aout, aout
    endin

    instr 2	;cross-synthesize

    icps = p4
    ifn  = p5		; Use the "ahhc.aiff" sound and "eeec.aiff"
    ain1 oscil 0.6, p4, ifn
    ain2 soundin "fox.wav"	; Use the "fox.wav" as modulator

      isize = 4096
      ioverlap = 2
      iwin = 3
      kbias init 1

    aout cross2 ain1, ain2, isize, ioverlap, iwin, kbias
         outs aout, aout
    endin

    </CsInstruments>
    <CsScore>
    ;audio files
    f 1 0 128 1 "ahhc.aiff" 0 4 0
    f 2 0 128 1 "eeec.aiff" 0 4 0

    f 3 0 2048 20 2	;windowing function

    i 1 0 3

    i 2 3 3  50	1 ;"eeec.aiff"
    i 2 + 3  50	2 ;"ahhc.aiff"
    i 2 + 3  100	1 ;"eeec.aiff"
    i 2 + 3  100	2 ;"ahhc.aiff"
    i 2 + 3  250	1 ;"eeec.aiff"
    i 2 + 3  250	2 ;"ahhc.aiff"
    i 2 + 3  20	1 ;"eeec.aiff"
    i 2 + 3  20	2 ;"ahhc.aiff"
    e

    </CsScore>
    </CsoundSynthesizer>

## Credits

Author: Paris Smaragdis
MIT, Cambridge
1997

Prev | Up | Next
cpuprc | Home | crossfm