trcross
Prev | Orchestra Opcodes and Operators | Next

## trcross

trcross — Streaming partial track cross-synthesis.

## Description

The trcross opcode takes two inputs containg TRACKS pv streaming signals (as generated, for instance by partials) and cross-synthesises them into a single TRACKS stream. Two different modes of operation are used: mode 0, cross-synthesis by multiplication of the amplitudes of the two inputs and mode 1, cross-synthesis by the substititution of the amplitudes of input 1 by the input 2. Frequencies and phases of input 1 are preserved in the output. The cross-synthesis is done by matching tracks between the two inputs using a 'search interval'. The matching algorithm will look for tracks in the second input that are within the search interval around each track in the first input. This interval can be changed at the control rate. Wider search intervals will find more matches.

## Syntax

    fsig trcross fin1, fin2, ksearch, kdepth [, kmode]

## Performance

fsig -- output pv stream in TRACKS format

fin1 -- first input pv stream in TRACKS format.

fin2 -- second input pv stream in TRACKS format

ksearch -- search interval ratio, defining a 'search area' around each track of 1st input for matching purposes.

kdepth -- depth of effect (0-1).

kmode -- mode of cross-synthesis. 0, multiplication of amplitudes (filtering), 1, subsitution of amplitudes of input 1 by input 2 (akin to vocoding). Defaults to 0.

## Examples

Here is an example of the trcross opcode. It uses the file trcross.csd.

Example 1043. Example of the trcross 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     ;;;realtime audio out
    ;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
    ; For Non-realtime ouput leave only the line below:
    ; -o trcross.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    sr = 44100
    ksmps = 32
    nchnls = 2
    0dbfs  = 1

    instr 1

    ain1 diskin2 "beats.wav", 1, 0, 1
    ain2 diskin2 "fox.wav", 1

    imode = p4
    fs1,fsi2 pvsifd ain1, 2048, 512, 1		; ifd analysis
    fst      partials fs1, fsi2, .01, 1, 3, 500	; partial tracking

    fs11,fsi12 pvsifd ain2, 2048, 512, 1		; ifd analysis (second input)
    fst1     partials fs11, fsi12, .01, 1, 3, 500	; partial tracking (second input

    fcr  trcross fst, fst1, 1.05, 1, imode		; cross-synthesis (mode 0 and mode 1)
    aout tradsyn fcr, 1, 1, 500, 1			; resynthesis of tracks
         outs aout*3, aout*3

    endin
    </CsInstruments>
    <CsScore>
    f1 0 8192 10 1

    i 1 0 3 0
    i 1 5 3 1

    e
    </CsScore>
    </CsoundSynthesizer>

The example above shows partial tracking of two ifd-analysis signals, cross-synthesis, followed by the remix of the two parts of the spectrum and resynthesis.

## Credits

Author: Victor Lazzarini
February 2006

New in Csound 5.01

Prev | Up | Next
transegr | Home | trfilter