binit
Prev | Orchestra Opcodes and Operators | Next

## binit

binit — PVS tracks to amplitude+frequency conversion.

## Description

The binit opcode takes an input containg a TRACKS pv streaming signal (as generated, for instance by partials) and converts it into a equal-bandwidth bin-frame containing amplitude and frequency pairs (PVS_AMP_FREQ), suitable for overlap-add resynthesis (such as performed by pvsynth) or further PVS streaming phase vocoder signal transformations. For each frequency bin, it will look for a suitable track signal to fill it; if not found, the bin will be empty (0 amplitude). If more than one track fits a certain bin, the one with highest amplitude will be chosen. This means that not all of the input signal is actually 'binned', the operation is lossy. However, in many situations this loss is not perceptually relevant.

## Syntax

    fsig binit fin, isize

## Performance

fsig -- output pv stream in PVS_AMP_FREQ format

fin -- input pv stream in TRACKS format

isize -- FFT size of output (N).

## Examples

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

Example 89. Example of the binit 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 binit.wav -W ;;; for file output any platform
    </CsOptions>
    <CsInstruments>

    sr = 44100
    ksmps = 32
    nchnls = 2

    instr 1
    ;ain inch 1				; for live input
    ain	diskin	 "beats.wav", 1		; input signal
    fs1,fsi2 pvsifd	 ain, 2048, 512, 1		; ifd analysis
    fst	partials fs1, fsi2, .003, 1, 3, 500	; partial tracking
    fbins	binit	 fst, 2048		; convert it back to bins
    aout	pvsynth	 fbins			; overlap-add resynthesis
    	outs	 aout, aout

    endin

    </CsInstruments>
    <CsScore>

    i 1 0 2
    e

    </CsScore>
    </CsoundSynthesizer>

The example above shows partial tracking of an ifd-analysis signal, conversion to bin frames and overlap-add resynthesis.

## Credits

Author: Victor Lazzarini
February 2006

New in Csound5.01

Prev | Up | Next
bformdec1 | Home | biquad